aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2013-02-19 13:33:12 -0500
committerH. Peter Anvin <hpa@linux.intel.com>2013-02-19 13:44:00 -0500
commit52d3d06e706bdde3d6c5c386deb065c3b4c51618 (patch)
treebc9ef29b1ea13a0a7f601379e9041715e9637cd2
parentf0322bd341fd63261527bf84afd3272bcc2e8dd3 (diff)
x86, cpu, amd: Fix WC+ workaround for older virtual hosts
The WC+ workaround for F10h introduces a new MSR and kvm host #GPs on accesses to unknown MSRs if paravirt is not compiled in. Use the exception-handling MSR accessors so as not to break 3.8 and later guests booting on older hosts. Remove a redundant family check while at it. Cc: Gleb Natapov <gleb@redhat.com> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com> Signed-off-by: Borislav Petkov <bp@suse.de> Link: http://lkml.kernel.org/r/1361298793-31834-1-git-send-email-bp@alien8.de Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--arch/x86/kernel/cpu/amd.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 721ef3208eb5..163af4a91d09 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -723,12 +723,14 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
723 * performance degradation for certain nested-paging guests. 723 * performance degradation for certain nested-paging guests.
724 * Prevent this conversion by clearing bit 24 in 724 * Prevent this conversion by clearing bit 24 in
725 * MSR_AMD64_BU_CFG2. 725 * MSR_AMD64_BU_CFG2.
726 *
727 * NOTE: we want to use the _safe accessors so as not to #GP kvm
728 * guests on older kvm hosts.
726 */ 729 */
727 if (c->x86 == 0x10) { 730
728 rdmsrl(MSR_AMD64_BU_CFG2, value); 731 rdmsrl_safe(MSR_AMD64_BU_CFG2, &value);
729 value &= ~(1ULL << 24); 732 value &= ~(1ULL << 24);
730 wrmsrl(MSR_AMD64_BU_CFG2, value); 733 wrmsrl_safe(MSR_AMD64_BU_CFG2, value);
731 }
732 } 734 }
733 735
734 rdmsr_safe(MSR_AMD64_PATCH_LEVEL, &c->microcode, &dummy); 736 rdmsr_safe(MSR_AMD64_PATCH_LEVEL, &c->microcode, &dummy);