[PATCH v2 0/7] x86/alternatives: Adjust all insn-relative fields

Andrew Cooper posted 7 patches 1 month, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20241002152725.1841575-1-andrew.cooper3@citrix.com
tools/tests/Makefile                      |   1 +
tools/tests/x86-decode-lite/.gitignore    |   1 +
tools/tests/x86-decode-lite/Makefile      |  45 ++
tools/tests/x86-decode-lite/insns.S       | 703 ++++++++++++++++++++++
tools/tests/x86-decode-lite/macro-magic.h |  52 ++
tools/tests/x86-decode-lite/main.c        | 111 ++++
tools/tests/x86-decode-lite/x86-emulate.h |  27 +
xen/arch/x86/alternative.c                | 213 +++++--
xen/arch/x86/hvm/vmx/entry.S              |  12 +-
xen/arch/x86/include/asm/spec_ctrl_asm.h  |  43 +-
xen/arch/x86/x86_emulate/Makefile         |   6 +
xen/arch/x86/x86_emulate/decode-lite.c    | 311 ++++++++++
xen/arch/x86/x86_emulate/private.h        |   2 +
xen/arch/x86/x86_emulate/x86_emulate.h    |  14 +
14 files changed, 1456 insertions(+), 85 deletions(-)
create mode 100644 tools/tests/x86-decode-lite/.gitignore
create mode 100644 tools/tests/x86-decode-lite/Makefile
create mode 100644 tools/tests/x86-decode-lite/insns.S
create mode 100644 tools/tests/x86-decode-lite/macro-magic.h
create mode 100644 tools/tests/x86-decode-lite/main.c
create mode 100644 tools/tests/x86-decode-lite/x86-emulate.h
create mode 100644 xen/arch/x86/x86_emulate/decode-lite.c
[PATCH v2 0/7] x86/alternatives: Adjust all insn-relative fields
Posted by Andrew Cooper 1 month, 2 weeks ago
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.

v2:
  Most work is in patch 1 and the new patch 2 (userspace harness).  Other
  patches with minor or no change.

Andrew Cooper (7):
  x86: Introduce x86_decode_lite()
  tests/x86: Introduce a userspace test harness for x86_decode_lite()
  x86/alternative: Walk all replacements during self tests
  x86/alternative: Indent 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

 tools/tests/Makefile                      |   1 +
 tools/tests/x86-decode-lite/.gitignore    |   1 +
 tools/tests/x86-decode-lite/Makefile      |  45 ++
 tools/tests/x86-decode-lite/insns.S       | 703 ++++++++++++++++++++++
 tools/tests/x86-decode-lite/macro-magic.h |  52 ++
 tools/tests/x86-decode-lite/main.c        | 111 ++++
 tools/tests/x86-decode-lite/x86-emulate.h |  27 +
 xen/arch/x86/alternative.c                | 213 +++++--
 xen/arch/x86/hvm/vmx/entry.S              |  12 +-
 xen/arch/x86/include/asm/spec_ctrl_asm.h  |  43 +-
 xen/arch/x86/x86_emulate/Makefile         |   6 +
 xen/arch/x86/x86_emulate/decode-lite.c    | 311 ++++++++++
 xen/arch/x86/x86_emulate/private.h        |   2 +
 xen/arch/x86/x86_emulate/x86_emulate.h    |  14 +
 14 files changed, 1456 insertions(+), 85 deletions(-)
 create mode 100644 tools/tests/x86-decode-lite/.gitignore
 create mode 100644 tools/tests/x86-decode-lite/Makefile
 create mode 100644 tools/tests/x86-decode-lite/insns.S
 create mode 100644 tools/tests/x86-decode-lite/macro-magic.h
 create mode 100644 tools/tests/x86-decode-lite/main.c
 create mode 100644 tools/tests/x86-decode-lite/x86-emulate.h
 create mode 100644 xen/arch/x86/x86_emulate/decode-lite.c

-- 
2.39.5
Re: [PATCH v2 0/7] x86/alternatives: Adjust all insn-relative fields
Posted by Frediano Ziglio 1 month, 2 weeks ago
On Wed, Oct 2, 2024 at 4:27 PM Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>
> 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.
>
> v2:
>   Most work is in patch 1 and the new patch 2 (userspace harness).  Other
>   patches with minor or no change.
>
> Andrew Cooper (7):
>   x86: Introduce x86_decode_lite()
>   tests/x86: Introduce a userspace test harness for x86_decode_lite()
>   x86/alternative: Walk all replacements during self tests
>   x86/alternative: Indent 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
>
>  tools/tests/Makefile                      |   1 +
>  tools/tests/x86-decode-lite/.gitignore    |   1 +
>  tools/tests/x86-decode-lite/Makefile      |  45 ++
>  tools/tests/x86-decode-lite/insns.S       | 703 ++++++++++++++++++++++
>  tools/tests/x86-decode-lite/macro-magic.h |  52 ++
>  tools/tests/x86-decode-lite/main.c        | 111 ++++
>  tools/tests/x86-decode-lite/x86-emulate.h |  27 +
>  xen/arch/x86/alternative.c                | 213 +++++--
>  xen/arch/x86/hvm/vmx/entry.S              |  12 +-
>  xen/arch/x86/include/asm/spec_ctrl_asm.h  |  43 +-
>  xen/arch/x86/x86_emulate/Makefile         |   6 +
>  xen/arch/x86/x86_emulate/decode-lite.c    | 311 ++++++++++
>  xen/arch/x86/x86_emulate/private.h        |   2 +
>  xen/arch/x86/x86_emulate/x86_emulate.h    |  14 +
>  14 files changed, 1456 insertions(+), 85 deletions(-)
>  create mode 100644 tools/tests/x86-decode-lite/.gitignore
>  create mode 100644 tools/tests/x86-decode-lite/Makefile
>  create mode 100644 tools/tests/x86-decode-lite/insns.S
>  create mode 100644 tools/tests/x86-decode-lite/macro-magic.h
>  create mode 100644 tools/tests/x86-decode-lite/main.c
>  create mode 100644 tools/tests/x86-decode-lite/x86-emulate.h
>  create mode 100644 xen/arch/x86/x86_emulate/decode-lite.c
>

For patches 1 to 6

Reviewed-by: Frediano Ziglio <frediano.ziglio@cloud.com>

Frediano