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

From: Benjamin Herrenschmidt <[email-masked]>
Date: Tue, 16 May 2017 21:22:02 +1000

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.