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
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_