Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

KVM: s390: Allow 4k granularity for memslots

Until now memslots on s390 needed to have 1M granularity and be 1M
aligned. Since the new gmap code can handle memslots with 4k
granularity and alignment, remove the restrictions.

Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>

+6 -14
+6 -14
arch/s390/kvm/kvm-s390.c
··· 5642 5642 struct kvm_memory_slot *new, 5643 5643 enum kvm_mr_change change) 5644 5644 { 5645 - gpa_t size; 5646 - 5647 5645 if (kvm_is_ucontrol(kvm) && new->id < KVM_USER_MEM_SLOTS) 5648 5646 return -EINVAL; 5649 5647 ··· 5651 5653 5652 5654 if (change != KVM_MR_DELETE && change != KVM_MR_FLAGS_ONLY) { 5653 5655 /* 5654 - * A few sanity checks. We can have memory slots which have to be 5655 - * located/ended at a segment boundary (1MB). The memory in userland is 5656 - * ok to be fragmented into various different vmas. It is okay to mmap() 5657 - * and munmap() stuff in this slot after doing this call at any time 5656 + * A few sanity checks. The memory in userland is ok to be 5657 + * fragmented into various different vmas. It is okay to mmap() 5658 + * and munmap() stuff in this slot after doing this call at any 5659 + * time. 5658 5660 */ 5659 - 5660 - if (new->userspace_addr & 0xffffful) 5661 + if (new->userspace_addr & ~PAGE_MASK) 5661 5662 return -EINVAL; 5662 - 5663 - size = new->npages * PAGE_SIZE; 5664 - if (size & 0xffffful) 5665 - return -EINVAL; 5666 - 5667 - if ((new->base_gfn * PAGE_SIZE) + size > kvm->arch.mem_limit) 5663 + if ((new->base_gfn + new->npages) * PAGE_SIZE > kvm->arch.mem_limit) 5668 5664 return -EINVAL; 5669 5665 } 5670 5666