diff options
author | Vishal Annapurve <vannapurve@google.com> | 2023-01-11 00:44:44 +0000 |
---|---|---|
committer | Sean Christopherson <seanjc@google.com> | 2023-01-24 10:06:32 -0800 |
commit | e6df2ae3f57c6bfab29e767796ce8d4796a84ebb (patch) | |
tree | 6bf97a5310c00974b37378736d2527399fd4dd32 /tools/testing/selftests/kvm/include/x86_64 | |
parent | e99b0d4cc2b679c5892d0994610b44e7b584d98b (diff) |
KVM: selftests: x86: Cache host CPU vendor (AMD vs. Intel)
Cache the host CPU vendor for userspace and share it with guest code.
All the current callers of this_cpu* actually care about host cpu so
they are updated to check host_cpu_is*.
Suggested-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: David Matlack <dmatlack@google.com>
Signed-off-by: Vishal Annapurve <vannapurve@google.com>
Link: https://lore.kernel.org/r/20230111004445.416840-3-vannapurve@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/testing/selftests/kvm/include/x86_64')
-rw-r--r-- | tools/testing/selftests/kvm/include/x86_64/processor.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/testing/selftests/kvm/include/x86_64/processor.h b/tools/testing/selftests/kvm/include/x86_64/processor.h index b5ea72f79540..53ffa43c90db 100644 --- a/tools/testing/selftests/kvm/include/x86_64/processor.h +++ b/tools/testing/selftests/kvm/include/x86_64/processor.h @@ -19,6 +19,9 @@ #include "../kvm_util.h" +extern bool host_cpu_is_intel; +extern bool host_cpu_is_amd; + #define NMI_VECTOR 0x02 #define X86_EFLAGS_FIXED (1u << 1) |