Skip to content

Commit

Permalink
KVM: x86/mmu: Zap any compound page when collapsing sptes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sean Christopherson authored and Paolo Bonzini committed Jan 27, 2020
1 parent 09c4453 commit d32ec81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kvm/mmu/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -5951,7 +5951,7 @@ static bool kvm_mmu_zap_collapsible_spte(struct kvm *kvm,
*/
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())
Expand Down

0 comments on commit d32ec81

Please sign in to comment.