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: Enable 1M pages for gmap

While userspace is allowed to have pages of any size, the new gmap
would always use 4k pages to back the guest.

Enable 1M pages for gmap.

This allows 1M pages to be used to back a guest when userspace is using
1M pages for the corresponding addresses (e.g. THP or hugetlbfs).

Remove the limitation that disallowed having nested guests and
hugepages at the same time.

Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>

+5 -6
+1 -1
arch/s390/kvm/gmap.c
··· 620 620 621 621 static inline bool gmap_1m_allowed(struct gmap *gmap, gfn_t gfn) 622 622 { 623 - return false; 623 + return test_bit(GMAP_FLAG_ALLOW_HPAGE_1M, &gmap->flags); 624 624 } 625 625 626 626 int gmap_link(struct kvm_s390_mmu_cache *mc, struct gmap *gmap, struct guest_fault *f)
+1 -5
arch/s390/kvm/kvm-s390.c
··· 851 851 r = -EINVAL; 852 852 else { 853 853 r = 0; 854 + set_bit(GMAP_FLAG_ALLOW_HPAGE_1M, &kvm->arch.gmap->flags); 854 855 /* 855 856 * We might have to create fake 4k page 856 857 * tables. To avoid that the hardware works on ··· 5728 5727 if (!sclp.has_sief2) { 5729 5728 pr_info("SIE is not available\n"); 5730 5729 return -ENODEV; 5731 - } 5732 - 5733 - if (nested && hpage) { 5734 - pr_info("A KVM host that supports nesting cannot back its KVM guests with huge pages\n"); 5735 - return -EINVAL; 5736 5730 } 5737 5731 5738 5732 for (i = 0; i < 16; i++)
+3
arch/s390/kvm/pv.c
··· 721 721 uvcb.flags.ap_allow_instr = kvm->arch.model.uv_feat_guest.ap; 722 722 uvcb.flags.ap_instr_intr = kvm->arch.model.uv_feat_guest.ap_intr; 723 723 724 + clear_bit(GMAP_FLAG_ALLOW_HPAGE_1M, &kvm->arch.gmap->flags); 725 + gmap_split_huge_pages(kvm->arch.gmap); 726 + 724 727 cc = uv_call_sched(0, (u64)&uvcb); 725 728 *rc = uvcb.header.rc; 726 729 *rrc = uvcb.header.rrc;