[PATCH 1/3] powerpc: Add __hard_irqs_disabled()

Benjamin Herrenschmidt benh at kernel.crashing.org
Tue May 16 21:22:02 AEST 2017


On Tue, 2017-05-16 at 14:56 +0530, Aneesh Kumar K.V wrote:
>  
> +static inline bool __hard_irqs_disabled(void)
> +{
> +       unsigned long flags = mfmsr();
> +       return (flags & MSR_EE) == 0;
> +}
> +

Reading the MSR has a cost. Can't we rely on paca->irq_happened being
non-0 ?

(If you are paranoid, add a test of msr as well and warn if there's
a mismatch ...)

Cheers,
Ben.



More information about the Linuxppc-dev mailing list