From: Andre Przywara Subject: [PATCH] x86/amd: fix crash as Xen Dom0 on AMD Trinity systems Date: Wed, 30 May 2012 15:10:02 +0200 Message-ID: <1338383402-3838-1-git-send-email-andre.przywara@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: mingo@elte.hu, hpa@zytor.com, tglx@linutronix.de Cc: Andre Przywara , jeremy@goop.org, xen-devel@lists.xensource.com, stable@vger.kernel.org#3.4+, konrad.wilk@oracle.com, linux-kernel@vger.kernel.org List-Id: xen-devel@lists.xenproject.org Because we are behind a family check before tweaking the topology bit, we can use the standard rd/wrmsr variants for the CPUID feature register. This fixes a crash when using the kernel as a Xen Dom0 on affected Trinity systems. The wrmsrl_amd_safe is not properly paravirtualized yet (this will be fixed in another patch). Signed-off-by: Andre Przywara Cc: stable@vger.kernel.org # 3.4+ --- arch/x86/kernel/cpu/amd.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 146bb62..80ccd99 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -586,9 +586,9 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c) !cpu_has(c, X86_FEATURE_TOPOEXT)) { u64 val; - if (!rdmsrl_amd_safe(0xc0011005, &val)) { + if (!rdmsrl_safe(0xc0011005, &val)) { val |= 1ULL << 54; - wrmsrl_amd_safe(0xc0011005, val); + checking_wrmsrl(0xc0011005, val); rdmsrl(0xc0011005, val); if (val & (1ULL << 54)) { set_cpu_cap(c, X86_FEATURE_TOPOEXT); -- 1.7.4.4