Re: [PATCH 12/14] KVM: x86/mmu: Fold max_mapping_level() into kvm_mmu_hugepage_adjust()

2020-01-21 Thread Paolo Bonzini
On 08/01/20 21:24, Sean Christopherson wrote: > - level = host_pfn_mapping_level(vcpu, gfn, pfn); > + slot = kvm_vcpu_gfn_to_memslot(vcpu, gfn); > + if (!memslot_valid_for_gpte(slot, true)) > + return PT_PAGE_TABLE_LEVEL; Following up on my remark to patch 7, this can also

[PATCH 12/14] KVM: x86/mmu: Fold max_mapping_level() into kvm_mmu_hugepage_adjust()

2020-01-08 Thread Sean Christopherson
Fold max_mapping_level() into kvm_mmu_hugepage_adjust() now that HugeTLB mappings are handled in kvm_mmu_hugepage_adjust(), i.e. there isn't a need to pre-calculate the max mapping level. Co-locating all hugepage checks eliminates a memslot lookup, at the cost of performing the __mmu_gfn_lpage_is_