On 08/08/2025 9:23 pm, Andrew Cooper wrote:
> diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
> index a45ce106e210..90cbad13a7c7 100644
> --- a/xen/arch/x86/Kconfig
> +++ b/xen/arch/x86/Kconfig
> @@ -57,6 +57,10 @@ config HAS_CC_CET_IBT
>       # Retpoline check to work around 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93654
>       def_bool $(cc-option,-fcf-protection=branch -mmanual-endbr 
> -mindirect-branch=thunk-extern) && $(as-instr,endbr64)
>  
> +config HAS_AS_FRED
> +     # binutils >= 2.41 or LLVM >= 19
> +     def_bool $(as-instr,eretu;lkgs %ax)
> +
>  menu "Architecture Features"
>  
>  source "arch/x86/Kconfig.cpu"
> diff --git a/xen/arch/x86/include/asm/asm-defns.h 
> b/xen/arch/x86/include/asm/asm-defns.h
> index 61a5faf90446..2e5200b94b82 100644
> --- a/xen/arch/x86/include/asm/asm-defns.h
> +++ b/xen/arch/x86/include/asm/asm-defns.h
> @@ -4,6 +4,15 @@
>      .byte 0x0f, 0x01, 0xfc
>  .endm
>  
> +#ifndef CONFIG_HAS_AS_FRED
> +.macro eretu
> +    .byte 0xf3, 0x0f, 0x01, 0xca
> +.endm
> +.macro erets
> +    .byte 0xf2, 0x0f, 0x01, 0xca
> +.endm
> +#endif

Seeing as I know you are going to be unhappy with the Kconfig...

I think I'm dev complete on the PV support now, and there's not an LKGS
in sight.

We don't strictly need the conditional in asm-defns.h, and if we don't
need it in C either then we can drop the Kconfig entirely.

~Andrew

Reply via email to