diff options
author | Sean Christopherson <seanjc@google.com> | 2024-11-28 04:33:56 +0300 |
---|---|---|
committer | Sean Christopherson <seanjc@google.com> | 2024-12-19 01:19:52 +0300 |
commit | 5c8de4b3a5bc4dc6a1a8afd46ff5d58beebb6356 (patch) | |
tree | c80c50d54764c87f72cda053f5f3d8c557ad9df4 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 3d142340d717f5e246f65769bc1d211b62d03677 (diff) | |
download | linux-5c8de4b3a5bc4dc6a1a8afd46ff5d58beebb6356.tar.xz |
KVM: x86: Add a macro to init CPUID features that ignore host kernel support
Add a macro for use in kvm_set_cpu_caps() to automagically initialize
features that KVM wants to support based solely on the CPU's capabilities,
e.g. KVM advertises LA57 support if it's available in hardware, even if
the host kernel isn't utilizing 57-bit virtual addresses.
Track a features that are passed through to userspace (from hardware) in
a local variable, and simply OR them in *after* adjusting the capabilities
that came from boot_cpu_data.
Note, eliminating the open-coded call to cpuid_ecx() also fixes a largely
benign bug where KVM could incorrectly report LA57 support on Intel CPUs
whose max supported CPUID is less than 7, i.e. if the max supported leaf
(<7) happened to have bit 16 set. In practice, barring a funky virtual
machine setup, the bug is benign as all known CPUs that support VMX also
support leaf 7.
Link: https://lore.kernel.org/r/20241128013424.4096668-30-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions