Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dd2887e7 authored by Nick Wang's avatar Nick Wang Committed by Gleb Natapov
Browse files

KVM: s390: Remove the sanity checks for kvm memory slot



To model the standby memory with memory_region_add_subregion
and friends, the guest would have one or more regions of ram.
Remove the check allowing only one memory slot and the check
requiring the real address of memory slot starts at zero.

Signed-off-by: default avatarNick Wang <jfwang@us.ibm.com>
Signed-off-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: default avatarGleb Natapov <gleb@redhat.com>
parent 3188bf6b
Loading
Loading
Loading
Loading
+4 −12
Original line number Original line Diff line number Diff line
@@ -977,18 +977,10 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,
				   struct kvm_userspace_memory_region *mem,
				   struct kvm_userspace_memory_region *mem,
				   enum kvm_mr_change change)
				   enum kvm_mr_change change)
{
{
	/* A few sanity checks. We can have exactly one memory slot which has
	/* A few sanity checks. We can have memory slots which have to be
	   to start at guest virtual zero and which has to be located at a
	   located/ended at a segment boundary (1MB). The memory in userland is
	   page boundary in userland and which has to end at a page boundary.
	   ok to be fragmented into various different vmas. It is okay to mmap()
	   The memory in userland is ok to be fragmented into various different
	   and munmap() stuff in this slot after doing this call at any time */
	   vmas. It is okay to mmap() and munmap() stuff in this slot after
	   doing this call at any time */

	if (mem->slot)
		return -EINVAL;

	if (mem->guest_phys_addr)
		return -EINVAL;


	if (mem->userspace_addr & 0xffffful)
	if (mem->userspace_addr & 0xffffful)
		return -EINVAL;
		return -EINVAL;