[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240801173955.1975034-1-ackerleytng@google.com>
Date: Thu, 1 Aug 2024 17:39:55 +0000
From: Ackerley Tng <ackerleytng@...gle.com>
To: michael.roth@....com
Cc: ak@...ux.intel.com, alpergun@...gle.com, ardb@...nel.org,
ashish.kalra@....com, bp@...en8.de, dave.hansen@...ux.intel.com,
dovmurik@...ux.ibm.com, hpa@...or.com, jarkko@...nel.org, jmattson@...gle.com,
vannapurve@...gle.com, erdemaktas@...gle.com, jroedel@...e.de,
kirill@...temov.name, kvm@...r.kernel.org, liam.merwick@...cle.com,
linux-coco@...ts.linux.dev, linux-crypto@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org, luto@...nel.org,
mingo@...hat.com, nikunj.dadhania@....com, pankaj.gupta@....com,
pbonzini@...hat.com, peterz@...radead.org, pgonda@...gle.com,
rientjes@...gle.com, sathyanarayanan.kuppuswamy@...ux.intel.com,
seanjc@...gle.com, slp@...hat.com, srinivas.pandruvada@...ux.intel.com,
tglx@...utronix.de, thomas.lendacky@....com, tobin@....com,
tony.luck@...el.com, vbabka@...e.cz, vkuznets@...hat.com, x86@...nel.org,
Ackerley Tng <ackerleytng@...gle.com>
Subject: [PATCH] Fixes: f32fb32820b1 ("KVM: x86: Add hook for determining max
NPT mapping level")
The `if (req_max_level)` test was meant ignore req_max_level if
PG_LEVEL_NONE was returned. Hence, this function should return
max_level instead of the ignored req_max_level.
Signed-off-by: Ackerley Tng <ackerleytng@...gle.com>
Change-Id: I403898aacc379ed98ba5caa41c9f1c52f277adc2
---
arch/x86/kvm/mmu/mmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
index 901be9e420a4..e6b73774645d 100644
--- a/arch/x86/kvm/mmu/mmu.c
+++ b/arch/x86/kvm/mmu/mmu.c
@@ -4335,7 +4335,7 @@ static u8 kvm_max_private_mapping_level(struct kvm *kvm, kvm_pfn_t pfn,
if (req_max_level)
max_level = min(max_level, req_max_level);
- return req_max_level;
+ return max_level;
}
static int kvm_faultin_pfn_private(struct kvm_vcpu *vcpu,
--
2.46.0.rc2.264.g509ed76dc8-goog
Powered by blists - more mailing lists