[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140114162722.GF29865@pd.tnic>
Date: Tue, 14 Jan 2014 17:27:23 +0100
From: Borislav Petkov <bp@...en8.de>
To: "H. Peter Anvin" <hpa@...or.com>
Cc: Henrique de Moraes Holschuh <hmh@....eng.br>,
X86 ML <x86@...nel.org>, LKML <linux-kernel@...r.kernel.org>,
Kim Naru <kim.naru@....com>,
Aravind Gopalakrishnan <aravind.gopalakrishnan@....com>,
Sherry Hurwitz <sherry.hurwitz@....com>
Subject: [PATCH] x86, CPU, AMD: Add workaround for family 16h, erratum 793
From: Borislav Petkov <bp@...e.de>
This adds the workaround for erratum 793 as a precaution in case not
every BIOS implements it. This addresses CVE-2013-6885.
Signed-off-by: Borislav Petkov <bp@...e.de>
---
arch/x86/kernel/cpu/amd.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 4a48e8bbd857..e4d6f8c91f51 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -507,6 +507,17 @@ static void early_init_amd(struct cpuinfo_x86 *c)
set_cpu_cap(c, X86_FEATURE_EXTD_APICID);
}
#endif
+
+#define MSR_AMD_LS_CFG 0xc0011020
+ /* F16h, models 00h-0fh, erratum 793 */
+ if (c->x86 == 0x16 && c->x86_model <= 0xf) {
+ u64 val;
+
+ rdmsrl(MSR_AMD_LS_CFG, val);
+ if (!(val & BIT(15)))
+ wrmsrl(MSR_AMD_LS_CFG, val | BIT(15));
+ }
+
}
static const int amd_erratum_383[];
--
1.8.5.2.192.g7794a68
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists