Re: [RFC PATCH v2] x86/fpu: make kernel-mode FPU reliably usable in softirqs

From: Dave Hansen
Date: Wed Mar 05 2025 - 11:57:01 EST


On 3/5/25 01:07, Ingo Molnar wrote:>> Alternatives considered:
>> - Make kernel-mode FPU sections fully preemptible. This would require
>> growing task_struct by another struct fpstate which is more than 2K.
>
> So that's something that will probably happen once the kernel is built
> using APX anyway?

I was expecting that building the kernel with APX would be very
different than a kernel_fpu_begin(). We don't just need *one* more save
area for APX registers: we need a stack, just like normal GPRs.

We'd effectively need to enlarge pt_regs and fix up things like
PUSH_AND_CLEAR_REGS to save the APX registers in addition to the good
old GPRs before calling C code.

That's what I was thinking at least. Did folks have more clever ideas?