Skip to content

x86: Add CPUID properties, clean up related code

Sean Christopherson kvm 2 versions – Applied

Status from this message: Applied to kvm-x86 next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest14 patches 11 repliesApplied
  2. v116 patches 17 repliesSuperseded

Changes in v2 from the cover letter

- Avoid tabs immediatedly after #defines. [Dapeng]
- Sqaush the arch events vs. GP counters fixes into one patch. [Dapeng]
- Mask available arch events based on enumerate bit vector width. [Dapeng]
- Add a missing space in a printf argument. [Liam]
- Collect reviews. [Dapeng, Liam]

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/14x86: Encode X86_FEATURE_* definitions using a structurelib/x86/processor.h+95 -760 replies
2/14x86: Add X86_PROPERTY_* framework to retrieve CPUID valueslib/x86/processor.h+102 -70 replies
3/14x86: Use X86_PROPERTY_MAX_VIRT_ADDR in is_canonical()lib/x86/processor.h+7 -20 replies
4/14x86: Implement get_supported_xcr0() using X86_PROPERTY_SUPPORTED_XCR0_{LO,HI}lib/x86/processor.h x86/xsave.c+10 -100 replies
5/14x86: Add and use X86_PROPERTY_INTEL_PT_NR_RANGESlib/x86/processor.h x86/la57.c+4 -10 replies
6/14x86/pmu: Mark all arch events as available on AMD, and rename fieldslib/x86/pmu.c lib/x86/pmu.h x86/pmu.c+13 -133 replies
7/14x86/pmu: Mark Intel architectural event available iff X <= CPUID.0xA.EAX[31:24]lib/x86/pmu.c x86/pmu.c+3 -12 replies
8/14x86/pmu: Use X86_PROPERTY_PMU_* macros to retrieve PMU informationlib/x86/pmu.c+8 -101 reply
9/14x86/sev: Use VC_VECTOR from processor.hlib/x86/amd_sev.c lib/x86/amd_sev.h+2 -80 replies
10/14x86/sev: Skip the AMD SEV test if SEV is unsupported/disabledx86/amd_sev.c+7 -441 reply
11/14x86/sev: Define and use X86_FEATURE_* flags for CPUID 0x8000001Flib/x86/amd_sev.c lib/x86/amd_sev.h lib/x86/processor.h+14 -301 reply
12/14x86/sev: Use X86_PROPERTY_SEV_C_BIT to get the AMD SEV C-bit locationlib/x86/amd_sev.c lib/x86/amd_sev.h+1 -151 reply
13/14x86/sev: Use amd_sev_es_enabled() to detect if SEV-ES is enabledx86/amd_sev.c+2 -100 replies
14/14x86: Move SEV MSR definitions to msr.hlib/x86/amd_sev.c lib/x86/amd_sev.h lib/x86/msr.h+9 -171 reply

Reviews trailers per patch

All 14 patches have a Reviewed-by or Acked-by.

PatchDapeng MiLiam MerwickSandipan Das
1/14R-b
2/14R-b
3/14R-b
4/14R-b
5/14R-b
6/14R-b T-b R-b T-b
7/14R-b R-b
8/14R-b T-b
9/14R-b
10/14R-b
11/14R-b
12/14R-b
13/14R-b
14/14R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [kvm-unit-tests PATCH v2 00/14] x86: Add CPUID properties, clean up related code

Copy KVM selftests' X86_PROPERTY_* infrastructure (multi-bit CPUID fields), and use the properties to clean up various warts. The SEV code is particular makes things much harder than they need to be.

Note, this applies on kvm-x86 next.

v2:
- Avoid tabs immediatedly after #defines. [Dapeng]
- Sqaush the arch events vs. GP counters fixes into one patch. [Dapeng]
- Mask available arch events based on enumerate bit vector width. [Dapeng]
- Add a missing space in a printf argument. [Liam]
- Collect reviews. [Dapeng, Liam]

v1: https://lore.kernel.org/all/[email protected]

Sean Christopherson (14):
x86: Encode X86_FEATURE_* definitions using a structure
x86: Add X86_PROPERTY_* framework to retrieve CPUID values
x86: Use X86_PROPERTY_MAX_VIRT_ADDR in is_canonical()
x86: Implement get_supported_xcr0() using

    X86_PROPERTY_SUPPORTED_XCR0_{LO,HI}
  x86: Add and use X86_PROPERTY_INTEL_PT_NR_RANGES
  x86/pmu: Mark all arch events as available on AMD, and rename fields
  x86/pmu: Mark Intel architectural event available iff X <=
    CPUID.0xA.EAX[31:24]

x86/pmu: Use X86_PROPERTY_PMU_* macros to retrieve PMU information x86/sev: Use VC_VECTOR from processor.h
x86/sev: Skip the AMD SEV test if SEV is unsupported/disabled x86/sev: Define and use X86_FEATURE_* flags for CPUID 0x8000001F x86/sev: Use X86_PROPERTY_SEV_C_BIT to get the AMD SEV C-bit location x86/sev: Use amd_sev_es_enabled() to detect if SEV-ES is enabled
x86: Move SEV MSR definitions to msr.h

 lib/x86/amd_sev.c   |  48 ++-----
 lib/x86/amd_sev.h   |  29 ----
 lib/x86/msr.h       |   6 +
 lib/x86/pmu.c       |  25 ++--
 lib/x86/pmu.h       |   8 +-
 lib/x86/processor.h | 312 ++++++++++++++++++++++++++++++++------------
 x86/amd_sev.c       |  63 ++-------
 x86/la57.c          |   2 +-
 x86/pmu.c           |   9 +-
 x86/xsave.c         |  11 +-
 10 files changed, 273 insertions(+), 240 deletions(-)

base-commit: 0293b912a7e7c019ed0144ad9ee62c09b0b61de2

Signature · 1 line
2.50.0.rc0.642.g800a2b2222-goog