WSL2-Linux-Kernel/arch
Uros Bizjak 8607d7ccbf x86/fpu: Fix AMD X86_BUG_FXSAVE_LEAK fixup
[ Upstream commit 5d31174f3c8c465d9dbe88f6b9d1fe5716f44981 ]

The assembly snippet in restore_fpregs_from_fpstate() that implements
X86_BUG_FXSAVE_LEAK fixup loads the value from a random variable,
preferably the one that is already in the L1 cache.

However, the access to fpinit_state via *fpstate pointer is not
implemented correctly. The "m" asm constraint requires dereferenced
pointer variable, otherwise the compiler just reloads the value
via temporary stack slot. The current asm code reflects this:

     mov    %rdi,(%rsp)
     ...
     fildl  (%rsp)

With dereferenced pointer variable, the code does what the
comment above the asm snippet says:

     fildl  (%rdi)

Also, remove the pointless %P operand modifier. The modifier is
ineffective on non-symbolic references - it was used to prevent
%rip-relative addresses in .altinstr sections, but FILDL in the
.text section can use %rip-relative addresses without problems.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/20240315081849.5187-1-ubizjak@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-07-05 09:14:43 +02:00
..
alpha
arc ARC: [plat-hsdk]: Remove misplaced interrupt-cells property 2024-05-02 16:24:44 +02:00
arm ARM: dts: samsung: smdk4412: fix keypad no-autorepeat 2024-07-05 09:14:36 +02:00
arm64 arm64: dts: imx8qm-mek: fix gpio number for reg_usdhc2_vmmc 2024-07-05 09:14:35 +02:00
csky arch: consolidate arch_irq_work_raise prototypes 2024-02-23 08:54:39 +01:00
h8300
hexagon hexagon: vmlinux.lds.S: handle attributes section 2024-04-10 16:19:31 +02:00
ia64 arch: Introduce CONFIG_FUNCTION_ALIGNMENT 2024-04-10 16:18:49 +02:00
m68k m68k: mac: Fix reboot hang on Mac IIci 2024-06-16 13:39:25 +02:00
microblaze microblaze: Remove early printk call from cpuinfo-static.c 2024-06-16 13:39:38 +02:00
mips mips: bmips: BCM6358: make sure CBR is correctly set 2024-07-05 09:14:29 +02:00
nds32
nios2
openrisc openrisc: Fix pagewalk usage in arch_dma_{clear, set}_uncached 2024-04-10 16:19:42 +02:00
parisc parisc: use correct compat recv/recvfrom syscalls 2024-07-05 09:14:42 +02:00
powerpc powerpc/io: Avoid clang null pointer arithmetic warnings 2024-07-05 09:14:27 +02:00
riscv riscv: fix overlap of allocated page and PTR_ERR 2024-07-05 09:14:38 +02:00
s390 s390/cpacf: Make use of invalid opcode produce a link error 2024-06-16 13:40:00 +02:00
sh Revert "sh: Handle calling csum_partial with misaligned data" 2024-06-16 13:39:23 +02:00
sparc sparc: fix compat recv/recvfrom syscalls 2024-07-05 09:14:41 +02:00
um um: Fix the -Wmissing-prototypes warning for __switch_mm 2024-06-16 13:39:44 +02:00
x86 x86/fpu: Fix AMD X86_BUG_FXSAVE_LEAK fixup 2024-07-05 09:14:43 +02:00
xtensa
.gitignore
Kconfig cpu: Re-enable CPU mitigations by default for !X86 architectures 2024-05-02 16:24:48 +02:00