Skip to content

Commit 1d92d2e

Browse files
Sean Christophersonbonzini
authored andcommitted
KVM: x86/mmu: Rename max_page_level to max_huge_page_level
Rename max_page_level to explicitly call out that it tracks the max huge page level so as to avoid confusion when a future patch moves the max TDP level, i.e. max root level, into the MMU and kvm_configure_mmu(). Signed-off-by: Sean Christopherson <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent d468d94 commit 1d92d2e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

arch/x86/kvm/mmu/mmu.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ module_param_named(flush_on_reuse, force_flush_and_sync_on_reuse, bool, 0644);
9292
*/
9393
bool tdp_enabled = false;
9494

95-
static int max_page_level __read_mostly;
95+
static int max_huge_page_level __read_mostly;
9696

9797
enum {
9898
AUDIT_PRE_PAGE_FAULT,
@@ -3256,7 +3256,7 @@ static int kvm_mmu_hugepage_adjust(struct kvm_vcpu *vcpu, gfn_t gfn,
32563256
if (!slot)
32573257
return PG_LEVEL_4K;
32583258

3259-
max_level = min(max_level, max_page_level);
3259+
max_level = min(max_level, max_huge_page_level);
32603260
for ( ; max_level > PG_LEVEL_4K; max_level--) {
32613261
linfo = lpage_info_slot(gfn, slot, max_level);
32623262
if (!linfo->disallow_lpage)
@@ -5580,23 +5580,23 @@ void kvm_mmu_invpcid_gva(struct kvm_vcpu *vcpu, gva_t gva, unsigned long pcid)
55805580
}
55815581
EXPORT_SYMBOL_GPL(kvm_mmu_invpcid_gva);
55825582

5583-
void kvm_configure_mmu(bool enable_tdp, int tdp_page_level)
5583+
void kvm_configure_mmu(bool enable_tdp, int tdp_huge_page_level)
55845584
{
55855585
tdp_enabled = enable_tdp;
55865586

55875587
/*
5588-
* max_page_level reflects the capabilities of KVM's MMU irrespective
5588+
* max_huge_page_level reflects KVM's MMU capabilities irrespective
55895589
* of kernel support, e.g. KVM may be capable of using 1GB pages when
55905590
* the kernel is not. But, KVM never creates a page size greater than
55915591
* what is used by the kernel for any given HVA, i.e. the kernel's
55925592
* capabilities are ultimately consulted by kvm_mmu_hugepage_adjust().
55935593
*/
55945594
if (tdp_enabled)
5595-
max_page_level = tdp_page_level;
5595+
max_huge_page_level = tdp_huge_page_level;
55965596
else if (boot_cpu_has(X86_FEATURE_GBPAGES))
5597-
max_page_level = PG_LEVEL_1G;
5597+
max_huge_page_level = PG_LEVEL_1G;
55985598
else
5599-
max_page_level = PG_LEVEL_2M;
5599+
max_huge_page_level = PG_LEVEL_2M;
56005600
}
56015601
EXPORT_SYMBOL_GPL(kvm_configure_mmu);
56025602

0 commit comments

Comments
 (0)