Skip to content

x86: Merge cpuid and msr policy objects

Andrew Cooper xen-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest15 patches 12 repliesIn review
  2. v1 RFC9 patches 24 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15x86: Rename struct cpu_policy to struct old_cpuid_policytools/libs/guest/xg_cpuid_x86.c tools/tests/cpu-policy/test-cpu-policy.c xen/arch/x86/domctl.c +4 more+14 -140 replies
2/15x86: Rename {domctl,sysctl}.cpu_policy.{cpuid,msr}_policy fieldstools/libs/guest/xg_cpuid_x86.c xen/arch/x86/domctl.c xen/arch/x86/sysctl.c +2 more+20 -200 replies
3/15x86: Rename struct cpuid_policy to struct cpu_policytools/fuzz/cpu-policy/afl-policy-fuzzer.c tools/tests/x86_emulator/Makefile tools/tests/x86_emulator/x86-emulate.h +5 more+467 -4820 replies
4/15x86: Merge struct msr_policy into struct cpu_policytools/fuzz/cpu-policy/afl-policy-fuzzer.c xen/arch/x86/include/asm/msr.h xen/include/xen/lib/x86/cpu-policy.h +2 more+83 -1080 replies
5/15x86: Merge the system {cpuid,msr} policy objectsxen/arch/x86/Makefile xen/arch/x86/cpu-policy.c xen/arch/x86/cpu/common.c +7 more+116 -1260 replies
6/15x86: Merge a domain's {cpuid,msr} policy objectsxen/arch/x86/cpu-policy.c xen/arch/x86/cpuid.c xen/arch/x86/domain.c +7 more+86 -1040 replies
7/15x86: Merge xc_cpu_policy's cpuid and msr objectstools/libs/guest/xg_cpuid_x86.c tools/libs/guest/xg_private.h tools/tests/tsx/test-tsx.c+53 -590 replies
8/15x86: Drop struct old_cpu_policytools/libs/guest/xg_cpuid_x86.c tools/tests/cpu-policy/test-cpu-policy.c xen/arch/x86/domctl.c +2 more+27 -580 replies
9/15x86: Out-of-inline the policy<->featureset convertorstools/libs/guest/xg_cpuid_x86.c xen/arch/x86/cpuid.c xen/arch/x86/sysctl.c +2 more+68 -582 replies
10/15x86/boot: Move MSR policy initialisation logic into cpu-policy.cxen/arch/x86/cpu-policy.c xen/arch/x86/include/asm/cpu-policy.h xen/arch/x86/include/asm/msr.h +2 more+89 -861 reply
11/15x86/boot: Merge CPUID policy initialisation logic into cpu-policy.cxen/arch/x86/cpu-policy.c xen/arch/x86/cpuid.c xen/arch/x86/hvm/hvm.c +4 more+764 -8264 replies
12/15x86/emul: Switch x86_emulate_ctxt to cpu_policytools/fuzz/x86_instruction_emulator/fuzz-emul.c tools/tests/x86_emulator/test_x86_emulator.c tools/tests/x86_emulator/x86-emulate.c +6 more+15 -121 reply
13/15tools/fuzz: Rework afl-policy-fuzzertools/fuzz/cpu-policy/afl-policy-fuzzer.c+20 -371 reply
14/15libx86: Update library API for cpu_policytools/fuzz/cpu-policy/afl-policy-fuzzer.c tools/tests/cpu-policy/test-cpu-policy.c tools/tests/x86_emulator/x86-emulate.c +6 more+46 -424 replies
15/15x86: Remove temporary {cpuid,msr}_policy definesxen/arch/x86/cpu/mcheck/mce_intel.c xen/arch/x86/cpuid.c xen/arch/x86/domain.c +11 more+26 -321 reply

Reviews trailers per patch

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

PatchJan Beulich
1/15R-b
2/15R-b
3/15R-b
4/15R-b
5/15R-b
6/15R-b
7/15R-b
8/15R-b
9/15A-b
10/15A-b
11/15A-b
12/15R-b
13/15R-b
14/15A-b
15/15A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/15] x86: Merge cpuid and msr policy objects

This is in order to be able to put MSR_ARCH_CAPS in a featureset. In hindsight it was a mistake separating CPUID and read-only MSR data into separate structs.

Patches 1-8 were posted previously and have had the feedback addressed. Patches 9-15 are the result of splitting the older RFC patch 9 apart, with the discussed adjustment to aliases accounted for.

Gitlab run showing the series to be buildable at each changeset:

https://gitlab.com/xen-project/people/andyhhp/xen/-/jobs/4053607867

P.S. I'm not sure I believe the net diffstat below. I think the cpuid.c => cpu-policy.c rename is confusing it.

Andrew Cooper (15):
x86: Rename struct cpu_policy to struct old_cpuid_policy
x86: Rename {domctl,sysctl}.cpu_policy.{cpuid,msr}_policy fields
x86: Rename struct cpuid_policy to struct cpu_policy
x86: Merge struct msr_policy into struct cpu_policy
x86: Merge the system {cpuid,msr} policy objects
x86: Merge a domain's {cpuid,msr} policy objects
x86: Merge xc_cpu_policy's cpuid and msr objects
x86: Drop struct old_cpu_policy
x86: Out-of-inline the policy<->featureset convertors x86/boot: Move MSR policy initialisation logic into cpu-policy.c x86/boot: Merge CPUID policy initialisation logic into cpu-policy.c x86/emul: Switch x86_emulate_ctxt to cpu_policy tools/fuzz: Rework afl-policy-fuzzer
libx86: Update library API for cpu_policy
x86: Remove temporary {cpuid,msr}_policy defines

 tools/fuzz/cpu-policy/afl-policy-fuzzer.c     |  64 +-
 .../fuzz/x86_instruction_emulator/fuzz-emul.c |   2 +-
 tools/libs/guest/xg_cpuid_x86.c               |  50 +-
 tools/libs/guest/xg_private.h                 |   5 +-
 tools/tests/cpu-policy/test-cpu-policy.c      |  54 +-
 tools/tests/tsx/test-tsx.c                    |  71 +-
 tools/tests/x86_emulator/Makefile             |   2 +-
 tools/tests/x86_emulator/test_x86_emulator.c  |   2 +-
 tools/tests/x86_emulator/x86-emulate.c        |   4 +-
 tools/tests/x86_emulator/x86-emulate.h        |   2 +-
 xen/arch/x86/Makefile                         |   1 +
 xen/arch/x86/{cpuid.c => cpu-policy.c}        | 692 ++++----------
 xen/arch/x86/cpu/common.c                     |   4 +-
 xen/arch/x86/cpu/mcheck/mce_intel.c           |   2 +-
 xen/arch/x86/cpuid.c                          | 856 +-----------------
 xen/arch/x86/domain.c                         |  17 +-
 xen/arch/x86/domctl.c                         |  51 +-
 xen/arch/x86/hvm/emulate.c                    |   4 +-
 xen/arch/x86/hvm/hvm.c                        |   5 +-
 xen/arch/x86/hvm/svm/svm.c                    |   2 +-
 xen/arch/x86/hvm/vlapic.c                     |   2 +-
 xen/arch/x86/hvm/vmx/vmx.c                    |   8 +-
 xen/arch/x86/include/asm/cpu-policy.h         |  27 +
 xen/arch/x86/include/asm/cpuid.h              |  21 +-
 xen/arch/x86/include/asm/domain.h             |  13 +-
 xen/arch/x86/include/asm/msr.h                |  14 +-
 xen/arch/x86/mm/mem_sharing.c                 |   3 +-
 xen/arch/x86/mm/shadow/hvm.c                  |   2 +-
 xen/arch/x86/msr.c                            | 160 +---
 xen/arch/x86/pv/domain.c                      |   3 +-
 xen/arch/x86/pv/emul-priv-op.c                |   6 +-
 xen/arch/x86/pv/ro-page-fault.c               |   2 +-
 xen/arch/x86/setup.c                          |   5 +-
 xen/arch/x86/sysctl.c                         |  79 +-
 xen/arch/x86/traps.c                          |   2 +-
 xen/arch/x86/x86_emulate/private.h            |   4 +-
 xen/arch/x86/x86_emulate/x86_emulate.c        |   2 +-
 xen/arch/x86/x86_emulate/x86_emulate.h        |   9 +-
 xen/arch/x86/xstate.c                         |   4 +-
 xen/include/public/domctl.h                   |   4 +-
 xen/include/public/sysctl.h                   |   4 +-
 xen/include/xen/lib/x86/cpu-policy.h          | 510 ++++++++++-
 xen/include/xen/lib/x86/cpuid.h               | 475 ----------
 xen/include/xen/lib/x86/msr.h                 | 104 ---
 xen/lib/x86/cpuid.c                           |  68 +-
 xen/lib/x86/msr.c                             |   6 +-
 xen/lib/x86/policy.c                          |   8 +-
 47 files changed, 1005 insertions(+), 2430 deletions(-)
 copy xen/arch/x86/{cpuid.c => cpu-policy.c} (52%)
 create mode 100644 xen/arch/x86/include/asm/cpu-policy.h
 delete mode 100644 xen/include/xen/lib/x86/cpuid.h
 delete mode 100644 xen/include/xen/lib/x86/msr.h
Signature · 1 line
2.30.2