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

Re: [Xen-devel] [PATCH 2/4] xen/arch: Switch local_save_flags() to being a static inline helper



>>> On 23.11.18 at 17:52, <andrew.cooper3@xxxxxxxxxx> wrote:
> --- a/xen/include/asm-x86/system.h
> +++ b/xen/include/asm-x86/system.h
> @@ -253,14 +253,18 @@ static inline unsigned long 
> array_index_mask_nospec(unsigned long index,
>  /* used when interrupts are already enabled or to shutdown the processor */
>  #define halt()          asm volatile ( "hlt" : : : "memory" )
>  
> -#define local_save_flags(x)                                      \
> -({                                                               \
> -    BUILD_BUG_ON(sizeof(x) != sizeof(long));                     \
> -    asm volatile ( "pushf" __OS " ; pop" __OS " %0" : "=g" (x)); \
> -})
> +static inline unsigned long local_save_flags(void)
> +{
> +    unsigned long flags;
> +
> +    asm volatile ( "pushf; pop %0;" : "=g" (flags) );
> +
> +    return flags;
> +}

Provided this doesn't defeat the current possibility of the compiler
POP-ing directly into a stack variable
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Apart from this I'm a little puzzled by the uppercasing of SAVE in
the Arm asm() comments, but I'll leave that to the Arm maintainers.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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