[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aCrmZnSokvmqfel3@gmail.com>
Date: Mon, 19 May 2025 10:05:58 +0200
From: Ingo Molnar <mingo@...nel.org>
To: Eric Biggers <ebiggers@...nel.org>
Cc: Ard Biesheuvel <ardb@...nel.org>, x86@...nel.org,
linux-kernel@...r.kernel.org, linux-crypto@...r.kernel.org,
linux-pm@...r.kernel.org, Borislav Petkov <bp@...en8.de>,
Thomas Gleixner <tglx@...utronix.de>,
Ayush Jain <Ayush.Jain3@....com>,
Herbert Xu <herbert@...dor.apana.org.au>
Subject: Re: [PATCH 3/3] x86/fpu: Don't support kernel-mode FPU when
irqs_disabled()
* Eric Biggers <ebiggers@...nel.org> wrote:
> > # echo PANIC > /sys/kernel/debug/provoke-crash/DIRECT
> >
> > Another case that likely executes with IRQs disabled (but I haven't
> > double checked) is reset_system(), which may return with an error, or
> > reboot/poweroff the machine and never return.
>
> That makes sense to me. preempt_disable() and preempt_enable() are already
> allowed when IRQs are disabled, and I'm not sure why local_bh_disable() and
> local_bh_enable() are different.
Because local_bh_enable() may run softirq handlers immediately if
there's pending softirqs, which shouldn't be done in hardirq context.
This is a key optimization of the Linux networking code, which uses
BH-off/BH-on sections instead of IRQS-off/IRQS-on critical sections,
for performance reasons.
Thanks,
Ingo
Powered by blists - more mailing lists