x86: Don't support kernel-mode FPU with hardirqs disabled
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 11 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | x86/fpu: Add fpu_save_state() for __save_processor_state()arch/ arch/ | +37 | 0 replies | |
| 2/3 | x86/pm: Use fpu_save_state() in __save_processor_state()arch/ | +7 | 0 replies | |
| 3/3 | x86/fpu: Don't support kernel-mode FPU when irqs_disabled()arch/ | +18 | 10 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] x86: Don't support kernel-mode FPU with hardirqs disabled
This series returns to my earlier suggestion to make x86 not support kernel-mode FPU when hardirqs are disabled, aligning it with arm64
(https://lore.kernel.org/r/[email protected]).
To make this possible despite the use of the kernel-mode FPU functions by __save_processor_state() (which I mentioned at
https://lore.kernel.org/r/[email protected]), I've changed __save_processor_state() to use a new function instead of (mis)using the kernel-mode FPU functions.
This slightly reduces the overhead of kernel-mode FPU (since the result is fewer checks), and it fixes the issue reported at
https://lore.kernel.org/r/20250516112217.GBaCcf6Yoc6LkIIryP@fat_crate.local/
where irq_fpu_usable() incorrectly returned false during CPU initialization, causing a crash in the SHA-256 library code.
Eric Biggers (3):
x86/fpu: Add fpu_save_state() for __save_processor_state() x86/pm: Use fpu_save_state() in __save_processor_state() x86/fpu: Don't support kernel-mode FPU when irqs_disabled()
arch/x86/include/asm/fpu/api.h | 1 + arch/x86/kernel/fpu/core.c | 92 ++++++++++++++++++++-------------- arch/x86/power/cpu.c | 18 +++---- 3 files changed, 62 insertions(+), 49 deletions(-)
base-commit: 8566fc3b96539e3235909d6bdda198e1282beaed
Signature · 1 line
2.49.0