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/AMD: Apply erratum 665 on machines without a BIOS fix

AMD F12h machines have an erratum which can cause DIV/IDIV to behave
unpredictably. The workaround is to set MSRC001_1029[31] but sometimes
there is no BIOS update containing that workaround so let's do it
ourselves unconditionally. It is simple enough.

[ Borislav: Wrote commit message. ]

Signed-off-by: Emanuel Czirai <icanrealizeum@gmail.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Yaowu Xu <yaowu@google.com>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/20160902053550.18097-1-bp@alien8.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

authored by

Emanuel Czirai and committed by
Thomas Gleixner
d1992996 3eab887a

+12
+12
arch/x86/kernel/cpu/amd.c
··· 669 set_cpu_bug(c, X86_BUG_AMD_TLB_MMATCH); 670 } 671 672 static void init_amd_bd(struct cpuinfo_x86 *c) 673 { 674 u64 value; ··· 737 case 6: init_amd_k7(c); break; 738 case 0xf: init_amd_k8(c); break; 739 case 0x10: init_amd_gh(c); break; 740 case 0x15: init_amd_bd(c); break; 741 } 742
··· 669 set_cpu_bug(c, X86_BUG_AMD_TLB_MMATCH); 670 } 671 672 + #define MSR_AMD64_DE_CFG 0xC0011029 673 + 674 + static void init_amd_ln(struct cpuinfo_x86 *c) 675 + { 676 + /* 677 + * Apply erratum 665 fix unconditionally so machines without a BIOS 678 + * fix work. 679 + */ 680 + msr_set_bit(MSR_AMD64_DE_CFG, 31); 681 + } 682 + 683 static void init_amd_bd(struct cpuinfo_x86 *c) 684 { 685 u64 value; ··· 726 case 6: init_amd_k7(c); break; 727 case 0xf: init_amd_k8(c); break; 728 case 0x10: init_amd_gh(c); break; 729 + case 0x12: init_amd_ln(c); break; 730 case 0x15: init_amd_bd(c); break; 731 } 732