summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm
diff options
context:
space:
mode:
authorSean Christopherson <sean.j.christopherson@intel.com>2020-01-08 12:24:45 -0800
committerPaolo Bonzini <pbonzini@redhat.com>2020-01-27 20:00:07 +0100
commitd32ec81bab670e599e645e1d1d5231d62de7d0d6 (patch)
treea621e66d3e27177ebb2d039a7e7b6740ab37cb93 /arch/x86/kvm
parent09c4453ee8e63a710774ae10da7909289aa6a58e (diff)
downloadlinux-d32ec81bab670e599e645e1d1d5231d62de7d0d6.tar.bz2
KVM: x86/mmu: Zap any compound page when collapsing sptes
Zap any compound page, e.g. THP or HugeTLB pages, when zapping sptes that can potentially be converted to huge sptes after disabling dirty logging on the associated memslot. Note, this approach could result in false positives, e.g. if a random compound page is mapped into the guest, but mapping non-huge compound pages into the guest is far from the norm, and toggling dirty logging is not a frequent operation. Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r--arch/x86/kvm/mmu/mmu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
index 6be0239dcfbf..9090842ccd10 100644
--- a/arch/x86/kvm/mmu/mmu.c
+++ b/arch/x86/kvm/mmu/mmu.c
@@ -5951,7 +5951,7 @@ restart:
*/
if (sp->role.direct && !kvm_is_reserved_pfn(pfn) &&
!kvm_is_zone_device_pfn(pfn) &&
- kvm_is_transparent_hugepage(pfn)) {
+ PageCompound(pfn_to_page(pfn))) {
pte_list_remove(rmap_head, sptep);
if (kvm_available_flush_tlb_with_range())