[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-6b0f43ddfa358dc71ad2a2d57bce5906c1c5dc1a@git.kernel.org>
Date: Mon, 31 Aug 2009 23:37:40 GMT
From: tip-bot for Borislav Petkov <borislav.petkov@....com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
tglx@...utronix.de, borislav.petkov@....com
Subject: [tip:x86/cpu] x86, AMD: Disable wrongly set X86_FEATURE_LAHF_LM CPUID bit
Commit-ID: 6b0f43ddfa358dc71ad2a2d57bce5906c1c5dc1a
Gitweb: http://git.kernel.org/tip/6b0f43ddfa358dc71ad2a2d57bce5906c1c5dc1a
Author: Borislav Petkov <borislav.petkov@....com>
AuthorDate: Mon, 31 Aug 2009 09:50:11 +0200
Committer: H. Peter Anvin <hpa@...or.com>
CommitDate: Mon, 31 Aug 2009 15:14:29 -0700
x86, AMD: Disable wrongly set X86_FEATURE_LAHF_LM CPUID bit
fbd8b1819e80ac5a176d085fdddc3a34d1499318 turns off the bit for
/proc/cpuinfo. However, a proper/full fix would be to additionally
turn off the bit in the CPUID output so that future callers get
correct CPU features info.
Do that by basically reversing what the BIOS wrongfully does at boot.
Signed-off-by: Borislav Petkov <borislav.petkov@....com>
LKML-Reference: <1251705011-18636-3-git-send-email-petkovbb@...il.com>
Signed-off-by: H. Peter Anvin <hpa@...or.com>
---
arch/x86/kernel/cpu/amd.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 63fddcd..0a717fc 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -404,9 +404,18 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
/*
* Some BIOSes incorrectly force this feature, but only K8
* revision D (model = 0x14) and later actually support it.
+ * (AMD Erratum #110, docId: 25759).
*/
- if (c->x86_model < 0x14)
+ if (c->x86_model < 0x14 && cpu_has(c, X86_FEATURE_LAHF_LM)) {
+ u64 val;
+
clear_cpu_cap(c, X86_FEATURE_LAHF_LM);
+ if (!rdmsrl_amd_safe(0xc001100d, &val)) {
+ val &= ~(1ULL << 32);
+ wrmsrl_amd_safe(0xc001100d, val);
+ }
+ }
+
}
if (c->x86 == 0x10 || c->x86 == 0x11)
set_cpu_cap(c, X86_FEATURE_REP_GOOD);
--
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