|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH 2/2] x86/irq: Improve local_irq_restore() code generation and performance
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
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |