Skip to content

x86: Support for CET Supervisor Shadow Stacks

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 Latest14 patches 41 repliesIn review
  2. v116 patches 49 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14x86/traps: Clean up printing in {do_reserved, fatal}_trap()xen/arch/x86/traps.c xen/include/asm-x86/processor.h xen/include/asm-x86/x86-defns.h+56 -101 reply
2/14x86/traps: Factor out extable_fixup() and make printing consistentxen/arch/x86/traps.c+35 -422 replies
3/14x86/shstk: Introduce Supervisor Shadow Stack supportdocs/misc/xen-command-line.pandoc xen/arch/x86/Kconfig xen/arch/x86/setup.c +3 more+71 -012 replies
4/14x86/traps: Implement #CP handler and extend #PF for shadow stacksxen/arch/x86/traps.c xen/arch/x86/x86_64/entry.S xen/include/asm-x86/processor.h+52 -34 replies
5/14x86/shstk: Re-layout the stack block for shadow stacksxen/arch/x86/cpu/common.c xen/arch/x86/mm.c xen/arch/x86/smpboot.c +5 more+30 -472 replies
6/14x86/shstk: Create shadow stacksxen/arch/x86/cpu/common.c xen/arch/x86/mm.c xen/include/asm-x86/config.h +3 more+53 -35 replies
7/14x86/cpu: Adjust enable_nmis() to be shadow stack compatiblexen/include/asm-x86/processor.h+33 -100 replies
8/14x86/cpu: Adjust reset_stack_and_jump() to be shadow stack compatiblexen/include/asm-x86/asm_defns.h xen/include/asm-x86/current.h+49 -71 reply
9/14x86/spec-ctrl: Adjust DO_OVERWRITE_RSB to be shadow stack compatiblexen/include/asm-x86/spec_ctrl_asm.h+13 -30 replies
10/14x86/extable: Adjust extable handling to be shadow stack compatiblexen/arch/x86/traps.c xen/arch/x86/x86_64/entry.S+76 -25 replies
11/14x86/alt: Adjust _alternative_instructions() to not create shadow stacksxen/arch/x86/alternative.c xen/arch/x86/mm.c+17 -32 replies
12/14x86/entry: Adjust guest paths to be shadow stack compatiblexen/arch/x86/x86_64/compat/entry.S xen/arch/x86/x86_64/entry.S+32 -12 replies
13/14x86/S3: Save and restore Shadow Stack configurationxen/arch/x86/acpi/wakeup_prot.S xen/include/asm-x86/msr-index.h xen/include/asm-x86/x86-defns.h+62 -02 replies
14/14x86/shstk: Activate Supervisor Shadow Stacksdocs/misc/xen-command-line.pandoc xen/arch/x86/boot/x86_64.S xen/arch/x86/cpu/common.c +3 more+87 -22 replies

Reviews trailers per patch

11 of 14 patches have a Reviewed-by or Acked-by.

PatchJan Beulich
1/14A-b
2/14R-b
3/14R-b
4/14R-b
5/14
6/14
7/14R-b
8/14R-b
9/14R-b
10/14
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.

Read the v2 thread

Cover letter [PATCH v2 00/14] x86: Support for CET Supervisor Shadow Stacks

This series implements Shadow Stack support for Xen to use.

You'll need a CET-capable toolchain (Binutils >= 2.29 or LLVM >= 7), but no specific compiler support required.

CET-SS makes PV32 unusable, so using shadow stacks prevents the use of 32bit PV guests. Compatibilty can be obtained using PV Shim.

See patches for individual changes.

Andrew Cooper (14):
x86/traps: Clean up printing in {do_reserved,fatal}_trap() x86/traps: Factor out extable_fixup() and make printing consistent x86/shstk: Introduce Supervisor Shadow Stack support x86/traps: Implement #CP handler and extend #PF for shadow stacks x86/shstk: Re-layout the stack block for shadow stacks x86/shstk: Create shadow stacks
x86/cpu: Adjust enable_nmis() to be shadow stack compatible x86/cpu: Adjust reset_stack_and_jump() to be shadow stack compatible x86/spec-ctrl: Adjust DO_OVERWRITE_RSB to be shadow stack compatible x86/extable: Adjust extable handling to be shadow stack compatible x86/alt: Adjust _alternative_instructions() to not create shadow stacks x86/entry: Adjust guest paths to be shadow stack compatible x86/S3: Save and restore Shadow Stack configuration x86/shstk: Activate Supervisor Shadow Stacks

 docs/misc/xen-command-line.pandoc   |  25 ++++
 xen/arch/x86/Kconfig                |  18 +++
 xen/arch/x86/acpi/wakeup_prot.S     |  58 +++++++++
 xen/arch/x86/alternative.c          |  14 +++
 xen/arch/x86/boot/x86_64.S          |  35 +++++-
 xen/arch/x86/cpu/common.c           |  39 +++++-
 xen/arch/x86/crash.c                |   7 ++
 xen/arch/x86/mm.c                   |  46 ++++---
 xen/arch/x86/setup.c                |  56 +++++++++
 xen/arch/x86/smpboot.c              |   3 +-
 xen/arch/x86/spec_ctrl.c            |   8 ++
 xen/arch/x86/traps.c                | 239 ++++++++++++++++++++++++++----------
 xen/arch/x86/x86_64/compat/entry.S  |   1 +
 xen/arch/x86/x86_64/entry.S         |  50 +++++++-
 xen/include/asm-x86/asm_defns.h     |   8 +-
 xen/include/asm-x86/config.h        |   5 +
 xen/include/asm-x86/cpufeature.h    |   1 +
 xen/include/asm-x86/cpufeatures.h   |   1 +
 xen/include/asm-x86/current.h       |  60 +++++++--
 xen/include/asm-x86/mm.h            |   1 -
 xen/include/asm-x86/msr-index.h     |   3 +
 xen/include/asm-x86/page.h          |   1 +
 xen/include/asm-x86/processor.h     |  60 ++++++---
 xen/include/asm-x86/spec_ctrl_asm.h |  16 ++-
 xen/include/asm-x86/x86-defns.h     |  35 ++++++
 xen/include/asm-x86/x86_64/page.h   |   1 +
 xen/scripts/Kconfig.include         |   4 +
 27 files changed, 664 insertions(+), 131 deletions(-)
Signature · 1 line
2.11.0