[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 0/5] x86/alternatives: Adjust all insn-relative fields


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: ODIN Thomas <thomas.odin@xxxxxxxxxx>
  • Date: Mon, 2 Nov 2026 10:15:51 +0100
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>
  • Delivery-date: Mon, 02 Nov 2026 09:16:04 +0000
  • Feedback-id: default:8631fc262581453bbf619ec5b2062170:Sweego
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 10/15/26 23:07, Andrew Cooper 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.
> 
> https://gitlab.com/xen-project/hardware/xen-staging/-/pipelines/2952556080
> 
> Andrew Cooper (5):
>    x86/emul: 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: 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      |  56 ++
>   tools/tests/x86-decode-lite/insns.S       | 711 ++++++++++++++++++++++
>   tools/tests/x86-decode-lite/macro-magic.h |  62 ++
>   tools/tests/x86-decode-lite/main.c        | 113 ++++
>   tools/tests/x86-decode-lite/x86-emulate.h |  29 +
>   xen/arch/x86/alternative.c                | 102 +++-
>   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    | 331 ++++++++++
>   xen/arch/x86/x86_emulate/x86_emulate.h    |  14 +
>   13 files changed, 1447 insertions(+), 34 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
> 

I tested this series on top of staging/unstable.

Hardware: Intel Core Ultra 5 226V
Config:   CONFIG_SELF_TESTS=y, spec-ctrl=bhb-entry,bhb-seq=short
            (BHB-entry shown for both HVM and PV in the boot log)
Dom0:     PVH

Result:
    * x86-decode-lite userspace test: passed
    * Boot with the alternatives self-test: no decode failures or
      disp8 escapes reported.
    * dom0 and an HVM guest ran normally with the BHB sequence
      active, including a guest cpuid loop to generate VM exits.
    * PV guest not tested

Note: the CPU doesn't select the BHB sequence by default, so I forced
it on the command line.

Tested-by: ODIN Thomas <thomas.odin@xxxxxxxxxx>

~Thomas


--
Thomas Odin | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.