Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/CPU: Fix FPDSS on Zen1

Zen1's hardware divider can leave, under certain circumstances, partial
results from previous operations. Those results can be leaked by
another, attacker thread.

Fix that with a chicken bit.

Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Borislav Petkov (AMD) and committed by
Linus Torvalds
e55d98e7 43cfbdda

+6
+3
arch/x86/include/asm/msr-index.h
··· 674 674 #define MSR_AMD64_DC_CFG 0xc0011022 675 675 #define MSR_AMD64_TW_CFG 0xc0011023 676 676 677 + #define MSR_AMD64_FP_CFG 0xc0011028 678 + #define MSR_AMD64_FP_CFG_ZEN1_DENORM_FIX_BIT 9 679 + 677 680 #define MSR_AMD64_DE_CFG 0xc0011029 678 681 #define MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT 1 679 682 #define MSR_AMD64_DE_CFG_LFENCE_SERIALIZE BIT_ULL(MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT)
+3
arch/x86/kernel/cpu/amd.c
··· 944 944 msr_clear_bit(MSR_K7_HWCR, MSR_K7_HWCR_IRPERF_EN_BIT); 945 945 clear_cpu_cap(c, X86_FEATURE_IRPERF); 946 946 } 947 + 948 + pr_notice_once("AMD Zen1 FPDSS bug detected, enabling mitigation.\n"); 949 + msr_set_bit(MSR_AMD64_FP_CFG, MSR_AMD64_FP_CFG_ZEN1_DENORM_FIX_BIT); 947 950 } 948 951 949 952 static const struct x86_cpu_id amd_zenbleed_microcode[] = {