On 20.02.2023 20:47, Andrew Cooper wrote:
> --- a/xen/arch/x86/include/asm/system.h
> +++ b/xen/arch/x86/include/asm/system.h
> @@ -267,13 +267,8 @@ static inline unsigned long 
> array_index_mask_nospec(unsigned long index,
>  })
>  #define local_irq_restore(x)                                     \
>  ({                                                               \
> -    BUILD_BUG_ON(sizeof(x) != sizeof(long));                     \
> -    asm volatile ( "pushfq\n\t"                                  \
> -                   "andq %0, (%%rsp)\n\t"                        \
> -                   "orq  %1, (%%rsp)\n\t"                        \
> -                   "popfq"                                       \
> -                   : : "i?r" ( ~X86_EFLAGS_IF ),                 \
> -                       "ri" ( (x) & X86_EFLAGS_IF ) );           \
> +    if ( (x) & X86_EFLAGS_IF )                                   \
> +        local_irq_enable();                                      \
>  })

Without it being written down anywhere that IRQs cannot be turned off
this way, and without there being a reference to that documentation
in the description, this is introducing a plain bug; I'm sorry to say
it that way. With both of the above fulfilled I'd of course be happy
to see the improvement take effect.

Jan

Reply via email to