Skip to content

x86: Protection Key Supervisor support

Andrew Cooper xen-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest8 patches 18 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8x86/boot: Sanitise PKRU on bootxen/arch/x86/cpu/common.c xen/arch/x86/include/asm/cpufeature.h xen/arch/x86/setup.c+5 -13 replies
2/8x86/prot-key: Enumeration for Protection Key Supervisortools/libs/light/libxl_cpuid.c tools/misc/xen-cpuid.c xen/arch/x86/include/asm/cpufeature.h +3 more+7 -10 replies
3/8x86/prot-key: Split PKRU infrastructure out of asm/processor.hxen/arch/x86/cpu/common.c xen/arch/x86/include/asm/processor.h xen/arch/x86/include/asm/prot-key.h +2 more+40 -410 replies
4/8x86: Initial support for WRMSRNStools/libs/light/libxl_cpuid.c tools/misc/xen-cpuid.c xen/arch/x86/include/asm/msr.h +1 more+15 -04 replies
5/8x86/hvm: Context switch MSR_PKRSxen/arch/x86/cpu/common.c xen/arch/x86/hvm/vmx/vmx.c xen/arch/x86/include/asm/msr.h +3 more+82 -07 replies
6/8x86/hvm: Enable guest access to MSR_PKRSxen/arch/x86/hvm/hvm.c xen/arch/x86/hvm/vmx/vmx.c xen/arch/x86/msr.c+28 -04 replies
7/8x86/pagewalk: Support PKSxen/arch/x86/include/asm/guest_pt.h xen/arch/x86/include/asm/hvm/hvm.h xen/arch/x86/mm/guest_walk.c+13 -40 replies
8/8x86/hvm: Support PKS for HAP guestsxen/arch/x86/cpuid.c xen/arch/x86/hvm/hvm.c xen/include/public/arch-x86/cpufeatureset.h+13 -20 replies

Reviews trailers per patch

7 of 8 patches have a Reviewed-by or Acked-by.

PatchJan Beulich
1/8R-b
2/8R-b
3/8R-b
4/8R-b
5/8
6/8R-b
7/8R-b
8/8R-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 0/8] x86: Protection Key Supervisor support

Only 14 months after v1... This time with testing on real hardware (not that any bugs were found) and against an updated XTF comprehensive pagewalk test.

  # time ./xtf-runner hvm64 pagetable-emulation~hap
  --- Xen Test Framework ---
  Environment: HVM 64bit (Long mode 4 levels)
  Test pagetable-emulation
    Info: Intel, Fam 6, Model 143, Stepping 3, paddr 46, vaddr 48
    Features: PSE PAE PGE PAT PSE36 PCID NX PAGE1G SMEP SMAP PKU PKS
    Paging mode heuristic: Hap
    Using physical addresses 0000000040000000 and 0000200000000000
  Test L1e
  Test L2e
  Test L2e Superpage
  Test L3e
  Test L3e Superpage
  Test L4e
  Test L4e Superpage
  Completed 28835840 tests
  Test result: SUCCESS

Combined test results:
test-hvm64-pagetable-emulation~hap SUCCESS

  real                                     1m26.315s
  user                                     0m0.039s
  sys                                      0m0.086s

This test is going to get even more silly when CET-SS becomes supported.

Andrew Cooper (8):
x86/boot: Sanitise PKRU on boot
x86/prot-key: Enumeration for Protection Key Supervisor x86/prot-key: Split PKRU infrastructure out of asm/processor.h
x86: Initial support for WRMSRNS
x86/hvm: Context switch MSR_PKRS
x86/hvm: Enable guest access to MSR_PKRS x86/pagewalk: Support PKS
x86/hvm: Support PKS for HAP guests

 tools/libs/light/libxl_cpuid.c              |  2 +
 tools/misc/xen-cpuid.c                      |  3 +-
 xen/arch/x86/cpu/common.c                   |  6 ++
 xen/arch/x86/cpuid.c                        |  9 +++
 xen/arch/x86/hvm/hvm.c                      |  5 +-
 xen/arch/x86/hvm/vmx/vmx.c                  | 26 +++++++++
 xen/arch/x86/include/asm/cpufeature.h       |  2 +
 xen/arch/x86/include/asm/guest_pt.h         |  5 ++
 xen/arch/x86/include/asm/hvm/hvm.h          |  3 +
 xen/arch/x86/include/asm/msr-index.h        |  2 +
 xen/arch/x86/include/asm/msr.h              | 21 +++++++
 xen/arch/x86/include/asm/processor.h        | 38 -------------
 xen/arch/x86/include/asm/prot-key.h         | 85 +++++++++++++++++++++++++++++
 xen/arch/x86/include/asm/x86-defns.h        |  1 +
 xen/arch/x86/mm/guest_walk.c                | 16 ++++--
 xen/arch/x86/msr.c                          | 10 ++++
 xen/arch/x86/setup.c                        |  6 +-
 xen/arch/x86/smpboot.c                      |  4 ++
 xen/arch/x86/x86_emulate.c                  |  2 +
 xen/include/public/arch-x86/cpufeatureset.h |  2 +
 20 files changed, 201 insertions(+), 47 deletions(-)
 create mode 100644 xen/arch/x86/include/asm/prot-key.h
Signature · 1 line
2.11.0