Re: [PATCH 05/14] KVM: x86/mmu: Consult max mapping level when zapping collapsible SPTEs

2021-02-18 Thread Sean Christopherson
On Thu, Feb 18, 2021, Mike Kravetz wrote: > On 2/18/21 8:23 AM, Sean Christopherson wrote: > > On Thu, Feb 18, 2021, Paolo Bonzini wrote: > >> On 13/02/21 01:50, Sean Christopherson wrote: > >>> > >>> pfn = spte_to_pfn(iter.old_spte); > >>> if (kvm_is_reserved_pfn(pfn) || > >>>

Re: [PATCH 05/14] KVM: x86/mmu: Consult max mapping level when zapping collapsible SPTEs

2021-02-18 Thread Mike Kravetz
On 2/18/21 8:23 AM, Sean Christopherson wrote: > On Thu, Feb 18, 2021, Paolo Bonzini wrote: >> On 13/02/21 01:50, Sean Christopherson wrote: >>> >>> pfn = spte_to_pfn(iter.old_spte); >>> if (kvm_is_reserved_pfn(pfn) || >>> - (!PageTransCompoundMap(pfn_to_page(p

Re: [PATCH 05/14] KVM: x86/mmu: Consult max mapping level when zapping collapsible SPTEs

2021-02-18 Thread Sean Christopherson
On Thu, Feb 18, 2021, Paolo Bonzini wrote: > On 13/02/21 01:50, Sean Christopherson wrote: > > > > pfn = spte_to_pfn(iter.old_spte); > > if (kvm_is_reserved_pfn(pfn) || > > - (!PageTransCompoundMap(pfn_to_page(pfn)) && > > -!kvm_is_zone_device_

Re: [PATCH 05/14] KVM: x86/mmu: Consult max mapping level when zapping collapsible SPTEs

2021-02-18 Thread Paolo Bonzini
On 13/02/21 01:50, Sean Christopherson wrote: pfn = spte_to_pfn(iter.old_spte); if (kvm_is_reserved_pfn(pfn) || - (!PageTransCompoundMap(pfn_to_page(pfn)) && -!kvm_is_zone_device_pfn(pfn))) + iter.level >= kv

[PATCH 05/14] KVM: x86/mmu: Consult max mapping level when zapping collapsible SPTEs

2021-02-12 Thread Sean Christopherson
When zapping SPTEs in order to rebuild them as huge pages, use the new helper that computes the max mapping level to detect whether or not a SPTE should be zapped. Doing so avoids zapping SPTEs that can't possibly be rebuilt as huge pages, e.g. due to hardware constraints, memslot alignment, etc..