]> www.infradead.org Git - users/dwmw2/linux.git/commit
KVM: e500: perform hugepage check after looking up the PFN
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 8 Jan 2025 15:49:50 +0000 (16:49 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Sun, 12 Jan 2025 09:53:00 +0000 (10:53 +0100)
commit55f4db79c4d94d4bb757f7a31a7f14de22fe517d
treedfe7198be8b44ce7c9cdd909ae60a70c284bb678
parent03b755b2aa48d242440cbfbd365e153b4b20fe54
KVM: e500: perform hugepage check after looking up the PFN

e500 KVM tries to bypass __kvm_faultin_pfn() in order to map VM_PFNMAP
VMAs as huge pages.  This is a Bad Idea because VM_PFNMAP VMAs could
become noncontiguous as a result of callsto remap_pfn_range().

Instead, use the already existing host PTE lookup to retrieve a
valid host-side mapping level after __kvm_faultin_pfn() has
returned.  Then find the largest size that will satisfy the
guest's request while staying within a single host PTE.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/powerpc/kvm/e500_mmu_host.c