On 13.09.2023 22:27, Andrew Cooper wrote:
> These have grown more complex over time, with some already having been
> converted.
> 
> Provide full Requires/Clobbers comments, otherwise missing at this level of
> indirection.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>

Reviewed-by: Jan Beulich <jbeul...@suse.com>

>  /* Use when exiting to PV guest context. */
> -#define SPEC_CTRL_EXIT_TO_PV                                            \
> -    ALTERNATIVE "",                                                     \
> -        DO_SPEC_CTRL_EXIT_TO_GUEST, X86_FEATURE_SC_MSR_PV;              \
> +.macro SPEC_CTRL_EXIT_TO_PV
> +/*
> + * Requires %rax=spec_ctrl, %rsp=regs/info
> + * Clobbers %rcx, %rdx
> + */
> +    ALTERNATIVE "", DO_SPEC_CTRL_EXIT_TO_GUEST, X86_FEATURE_SC_MSR_PV
> +
>      DO_SPEC_CTRL_COND_VERW
> +.endm
>  
>  /*
>   * Use in IST interrupt/exception context.  May interrupt Xen or PV context.

I'll need to carefully rebase "x86/spec-ctrl: add logic to issue IBPB on
exit to guest" over this change. In particular the use of __LINE__ there
(which probably you didn't really like anyway) won't work anymore. Yet
with just a single use of the macro per source file we ought to be able
to get away without this extra label disambiguation ...

Jan

Reply via email to