diff options
| author | Sean Christopherson <seanjc@google.com> | 2026-09-02 16:09:30 -0700 |
|---|---|---|
| committer | Sean Christopherson <seanjc@google.com> | 2026-09-11 15:41:58 -0700 |
| commit | 7ed619909773d1cc2d026b63b003010693ef0c5f (patch) | |
| tree | 46c80254d128560b00922405a9294d6e84d92b07 /tools/perf/scripts/python/bin | |
| parent | 926a9ea9bdf0b09c1cd8e896b251152d892f2566 (diff) | |
KVM: x86/mmu: Use KVM's max TDP level to determine need for 32-bit TDP root
When checking to see if KVM needs to allocate a TDP PAE root that's 32-bit
addressable, query KVM's overall max TDP level, not the vCPU-specific TDP
level, as the logic is specific to using NPT on 32-bit hosts. Querying the
vCPU's alleged TDP level is flawed and confusing, as KVM selects between
4-level vs. 5-level based on the guest's MAXPHYADDR, and MAXPHYADDR isn't
yet configured (via CPUID) when the vCPU is being created.
I.e. as is, it would *appear* that KVM is violating its own rules with
respect to changing guest CPUID (see kvm_mmu_after_set_cpuid()). In
practice, the flaw is benign as the goal is purely to see if KVM needs to
use PAE-paging; whether KVM will use 4-level vs. 5-level is irrelevant.
More importantly, avoiding kvm_mmu_get_tdp_level() during vCPU creation
will allow hardening KVM's handling of S-EPT mirror root level.
For all intents and purposes, no functional change intended.
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Link: https://patch.msgid.link/20260902230932.2760127-2-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions
