mbox series

[0/6] x86/alternatives: Adjust all insn-relative fields

Message ID 20240422181434.3463252-1-andrew.cooper3@citrix.com (mailing list archive)
Headers show
Series x86/alternatives: Adjust all insn-relative fields | expand

Message

Andrew Cooper April 22, 2024, 6:14 p.m. UTC
Alternatives have had a reasonably severe restriction since their
introduction.  This has been the source of several bugs, and several
inefficiencies particularly in the speculative safety paths, and I've finally
gotten bored enough to fixing it.

Introduce the new infrastructure, and adjust the BHB scrubbing logic to use
it.

Andrew Cooper (6):
  x86: Introduce x86_decode_lite()
  x86/alternative: Walk all replacements in debug builds
  x86/alternative: Intend the relocation logic
  x86/alternative: Replace a continue with a goto
  x86/alternative: Relocate all insn-relative fields
  x86/spec-ctrl: Introduce and use DO_COND_BHB_SEQ

 xen/arch/x86/alternative.c               | 210 +++++++++++++------
 xen/arch/x86/hvm/vmx/entry.S             |  12 +-
 xen/arch/x86/include/asm/spec_ctrl_asm.h |  43 ++--
 xen/arch/x86/x86_emulate/Makefile        |   1 +
 xen/arch/x86/x86_emulate/decode-lite.c   | 245 +++++++++++++++++++++++
 xen/arch/x86/x86_emulate/private.h       |   2 +
 xen/arch/x86/x86_emulate/x86_emulate.h   |  17 ++
 7 files changed, 445 insertions(+), 85 deletions(-)
 create mode 100644 xen/arch/x86/x86_emulate/decode-lite.c