[PATCH v5 08/12] powerpc: Add support to mask perf interrupts and replay them

Madhavan Srinivasan maddy at linux.vnet.ibm.com
Thu Jan 5 03:51:05 AEDT 2017



On Wednesday 04 January 2017 06:08 PM, Nicholas Piggin wrote:
> On Wed,  4 Jan 2017 17:19:46 +0530
> Madhavan Srinivasan <maddy at linux.vnet.ibm.com> wrote:
>
>> @@ -134,7 +137,7 @@ static inline bool arch_irqs_disabled(void)
>>   	_was_enabled = local_paca->soft_enabled;	\
>>   	local_paca->soft_enabled = IRQ_DISABLE_MASK_LINUX;\
>>   	local_paca->irq_happened |= PACA_IRQ_HARD_DIS;	\
>> -	if (!(_was_enabled & IRQ_DISABLE_MASK_LINUX))	\
>> +	if (!(_was_enabled & IRQ_DISABLE_MASK_ALL))	\
>>   		trace_hardirqs_off();			\
>>   } while(0)
> Hang on, maybe there's some confusion about this. trace_hardirqs_off() is
> for Linux irqs (i.e., local_irq_disable()), so that should continue to
> test just the LINUX mask I think. Otherwise this
>
>      powerpc_local_pmu_disable();
>      hard_irq_disable();

Currently we set both bits for pmu soft disable

                 flags = 
soft_disabled_mask_or_return(IRQ_DISABLE_MASK_LINUX | \
IRQ_DISABLE_MASK_PMU);                  \

So yes in the above seq, we will miss the pmu bit. But since 
trace_hardirqs_off()
is for _LINUX, instead will it not be safer to OR it?

         local_paca->soft_disabled_mask |= IRQ_DISABLE_MASK_LINUX;\

Maddy

> Will miss calling trace_hardirqs_off(). You don't have a function that
> disables PMU irqs without Linux irqs, but one might exist.
>
> What I was concerned about is actually setting the disable mask to ALL
>
>    	local_paca->soft_enabled = IRQ_DISABLE_MASK_ALL;
>
> No? Otherwise if you did
>
>      powerpc_local_irq_pmu_disable();
>      hard_irq_disable();
>
> Then you would lose the PMU bit out of the mask.
>
> Thanks,
> Nick
>



More information about the Linuxppc-dev mailing list