All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] KVM: x86: Use kernel x86 cpuid utilities in KVM selftests
@ 2021-04-22  0:56 Ricardo Koller
  2021-04-22  0:56 ` [PATCH 1/5] KVM: x86: Move reverse CPUID helpers to separate header file Ricardo Koller
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Ricardo Koller @ 2021-04-22  0:56 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: kvm, Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	H. Peter Anvin, Sean Christopherson, Vitaly Kuznetsov,
	Wanpeng Li, Jim Mattson, Joerg Roedel, Nathan Chancellor,
	Nick Desaulniers, linux-kernel, clang-built-linux,
	Ricardo Koller

The kernel has a set of utilities and definitions to deal with x86 cpu
features.  The x86 KVM selftests don't use them, and instead have
evolved to use differing and ad-hoc methods for checking features. The
advantage of the kernel feature definitions is that they use a format
that embeds the info needed to extract them from cpuid (function, index,
and register to use).

The first 3 patches massage the related cpuid header files in the kernel
side, then copy them into tools/ so they can be included by selftests.
The last 2 patches replace the tests checking for cpu features to use
the definitions and utilities introduced from the kernel.

Thanks,
Ricardo

Ricardo Koller (5):
  KVM: x86: Move reverse CPUID helpers to separate header file
  x86/cpu: Expose CPUID regs, leaf and index definitions to tools
  tools headers x86: Copy cpuid helpers from the kernel
  KVM: selftests: Introduce utilities for checking x86 features
  KVM: selftests: Use kernel x86 cpuid features format

 arch/x86/events/intel/pt.c                    |   1 +
 arch/x86/include/asm/cpufeature.h             |  23 +-
 arch/x86/include/asm/processor.h              |  11 -
 arch/x86/kernel/cpu/scattered.c               |   2 +-
 arch/x86/kernel/cpuid.c                       |   2 +-
 arch/x86/kvm/cpuid.h                          | 177 +-----------
 arch/x86/kvm/reverse_cpuid.h                  | 185 +++++++++++++
 tools/arch/x86/include/asm/cpufeature.h       | 257 ++++++++++++++++++
 tools/arch/x86/include/asm/cpufeatures.h      |   3 +
 .../selftests/kvm/include/x86_64/cpuid.h      |  61 +++++
 .../selftests/kvm/include/x86_64/processor.h  |  16 --
 .../kvm/include/x86_64/reverse_cpuid.h        | 185 +++++++++++++
 .../selftests/kvm/include/x86_64/svm_util.h   |  11 +-
 tools/testing/selftests/kvm/lib/x86_64/svm.c  |   6 +-
 tools/testing/selftests/kvm/lib/x86_64/vmx.c  |   5 +-
 tools/testing/selftests/kvm/steal_time.c      |   5 +-
 .../kvm/x86_64/cr4_cpuid_sync_test.c          |  23 +-
 .../selftests/kvm/x86_64/set_sregs_test.c     |  25 +-
 .../selftests/kvm/x86_64/vmx_pmu_msrs_test.c  |   8 +-
 .../kvm/x86_64/vmx_set_nested_state_test.c    |   5 +-
 .../selftests/kvm/x86_64/xss_msr_test.c       |  10 +-
 21 files changed, 749 insertions(+), 272 deletions(-)
 create mode 100644 arch/x86/kvm/reverse_cpuid.h
 create mode 100644 tools/arch/x86/include/asm/cpufeature.h
 create mode 100644 tools/testing/selftests/kvm/include/x86_64/cpuid.h
 create mode 100644 tools/testing/selftests/kvm/include/x86_64/reverse_cpuid.h

-- 
2.31.1.368.gbe11c130af-goog


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-07-08 19:46 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-22  0:56 [PATCH 0/5] KVM: x86: Use kernel x86 cpuid utilities in KVM selftests Ricardo Koller
2021-04-22  0:56 ` [PATCH 1/5] KVM: x86: Move reverse CPUID helpers to separate header file Ricardo Koller
2021-04-22  0:56 ` [PATCH 2/5] x86/cpu: Expose CPUID regs, leaf and index definitions to tools Ricardo Koller
2021-04-22  0:56 ` [PATCH 3/5] tools headers x86: Copy cpuid helpers from the kernel Ricardo Koller
2021-04-22  6:59   ` Paolo Bonzini
2021-04-23  0:08     ` Ricardo Koller
2021-04-22  0:56 ` [PATCH 4/5] KVM: selftests: Introduce utilities for checking x86 features Ricardo Koller
2021-04-22  0:56 ` [PATCH 5/5] KVM: selftests: Use kernel x86 cpuid features format Ricardo Koller
2021-04-22  7:02 ` [PATCH 0/5] KVM: x86: Use kernel x86 cpuid utilities in KVM selftests Paolo Bonzini
2021-04-28 19:46   ` Ricardo Koller
2021-06-29 17:28     ` Jim Mattson
2021-07-08 16:50       ` Paolo Bonzini
2021-07-08 17:21         ` Ricardo Koller
2021-07-08 17:57           ` Paolo Bonzini
2021-07-08 19:46             ` Ricardo Koller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.