Re: Perf: WARNING: arch/x86/entry/common.c:624 idtentry_exit_cond_rcu+0x92/0xc0

From: Thomas Gleixner
Date: Fri Jun 12 2020 - 06:34:39 EST


Andy Lutomirski <luto@xxxxxxxxxxxxxx> writes:
>> On Jun 12, 2020, at 2:01 AM, Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
>> There is no IST on 32bit, never was. We do software stack switching for
>> device interrupts, but that's a different story.
>>
>
> DEFINE_IDTENTRY does the idtentry_enter_cond_rcu() dance, which isnât
> intended to be safe from NMI context. It should probably map to
> DEFINE_IDTENTRY_RAW() instead. The specific issue is that NMI ends up
> there, and at least DEFINE_IDTENTRY_NMI should be raw.

Yes, you are right. That's clearly broken.

> I havenât tried this at all, nor have I dug through all the users of
> these macros to check what they expect. Perhaps we should not have
> the _IST one defined at all on 32 bit and rename it to
> DEFINE_IDTENTRY_IST_RAW on 64 bit to make it more clear whatâs going
> on when reading the C code.

Let me go over it with a fine comb.

> Or maybe Iâm too sleepy and Iâm nuts. But I donât think I am.

/me politely refrains from commenting