Re: [PATCH 3/3] x86/fpu: Don't support kernel-mode FPU when irqs_disabled()

Ingo Molnar
2025-05-18T06:34:30Z

* Eric Biggers <ebiggers@kernel.org> wrote:

> > Alternatively we could set in_kernel_fpu during CPU bootstrap, and
> > clear it once we know the FPU is usable? This is only a relatively
> > short early boot period, with no scheduling, right?
>
> Yes, if there isn't agreement on this approach we can do that
> instead. Say:
>
> - Replace in_kernel_fpu with kernel_fpu_supported, with the opposite
> meaning (so that the initial value of false means "unsupported")

I'm not against simplifying the x86 FPU model to exclude IRQs-off
context (especially if it also micro-optimizes some of the key runtime
kernel-FPU primitives), but it has to be a full solution and we'll have
to see how complicated the EFI changes get.

Ie. without seeing the full cost-benefit balance it's hard to call this
in advance. Mind sending a full series that addresses the EFI case too?

Thanks,

Ingo