On 26.02.2024 13:54, Andrew Cooper wrote:
> Some retroactive review, for if I'd got to the patch in time.
> 
>  * The new ASM-friendly BUILD_BUG_ON() should be in a header file.
>  * entry_int82() wants the movl->movb treatment too.
> 
> Fixes: c144b9e32427 ("x86: Reduce assembly code size of entry points")
> Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>

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

> Fixes just to link the two patches.

Hmm, I see.

> --- a/xen/arch/x86/include/asm/asm_defns.h
> +++ b/xen/arch/x86/include/asm/asm_defns.h
> @@ -56,6 +56,18 @@ register unsigned long current_stack_pointer asm("rsp");
>  #define ASSERT_INTERRUPTS_DISABLED \
>      ASSERT_INTERRUPT_STATUS(z, "INTERRUPTS DISABLED")
>  
> +#ifdef __ASSEMBLY__
> +
> +.macro BUILD_BUG_ON condstr cond:vararg
> +        .if \cond
> +        .error "Condition \"\condstr\" not satisfied"
> +        .endif
> +.endm
> +/* preprocessor macro to make error message more user friendly */
> +#define BUILD_BUG_ON(cond) BUILD_BUG_ON #cond cond
> +
> +#endif /* __ASSEMBLY__ */
> +
>  #ifdef __ASSEMBLY__

Minor remark: Seeing these back to back is slightly odd. A little
higher up there's an "#ifndef __ASSEMBLY__" (producing e.g.
ASM_CALL_CONSTRAINT) in an #else of which this would imo be a
pretty good fit. Further down where SUBSECTION_LBL() is defined would
also look to be more suitable than adding yet another #ifdef.

Jan

Reply via email to