android_kernel_motorola_sm6375/arch
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Dave Hansen 550e12ef14 x86/fpu: Delay instruction pointer fixup until after warning
[ Upstream commit 1cec9ac2d071cfd2da562241aab0ef701355762a ]

Right now, if XRSTOR fails a console message like this is be printed:

	Bad FPU state detected at restore_fpregs_from_fpstate+0x9a/0x170, reinitializing FPU registers.

However, the text location (...+0x9a in this case) is the instruction
*AFTER* the XRSTOR. The highlighted instruction in the "Code:" dump
also points one instruction late.

The reason is that the "fixup" moves RIP up to pass the bad XRSTOR and
keep on running after returning from the #GP handler. But it does this
fixup before warning.

The resulting warning output is nonsensical because it looks like the
non-FPU-related instruction is #GP'ing.

Do not fix up RIP until after printing the warning. Do this by using
the more generic and standard ex_handler_default().

Fixes: d5c8028b47 ("x86/fpu: Reinitialize FPU registers if restoring FPU state fails")
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Chao Gao <chao.gao@intel.com>
Acked-by: Alison Schofield <alison.schofield@intel.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc:stable@vger.kernel.org
Link: https://lore.kernel.org/all/20250624210148.97126F9E%40davehans-spike.ostc.intel.com
[ adapted ex_handler_default() call ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-08-28 16:21:34 +02:00
..
alpha
arc
arm ARM: 9448/1: Use an absolute path to unified.h in KBUILD_AFLAGS 2025-08-28 16:21:32 +02:00
arm64 arm64: Handle KCOV __init vs inline mismatches 2025-08-28 16:21:24 +02:00
c6x
csky
h8300
hexagon
ia64
m68k m68k: Fix lost column on framebuffer debug console 2025-08-28 16:21:30 +02:00
microblaze
mips mips: Include KBUILD_CPPFLAGS in CHECKFLAGS invocation 2025-08-28 16:21:33 +02:00
nds32
nios2 nios2: force update_mmu_cache on spurious tlb-permission--related pagefaults 2025-06-27 11:02:54 +01:00
openrisc
parisc parisc: Makefile: fix a typo in palo.conf 2025-08-28 16:21:30 +02:00
powerpc (powerpc/512) Fix possible dma_unmap_single() on uninitialized pointer 2025-08-28 16:21:26 +02:00
riscv riscv: Avoid fortify warning in syscall_get_arguments() 2025-05-02 07:39:20 +02:00
s390 s390/stp: Remove udelay from stp_sync_clock() 2025-08-28 16:21:26 +02:00
sh
sparc sparc/mm: disable preemption in lazy mmu mode 2025-05-02 07:39:16 +02:00
um um: ubd: Add missing error check in start_io_thread() 2025-07-17 18:24:53 +02:00
unicore32
x86 x86/fpu: Delay instruction pointer fixup until after warning 2025-08-28 16:21:34 +02:00
xtensa
.gitignore
Kconfig