[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-4.0-testing] svm: use msr safe for erratum 383



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1276261476 -3600
# Node ID 3903d95733f702d23b92dbaeec515cf31db860d3
# Parent  351daae7d22555c6b981919774e9762511474187
svm: use msr safe for erratum 383

Make erratum 383 use msr safe variants to work on top of KVM.

Signed-off-by: Christoph Egger <Christoph.Egger@xxxxxxx>
xen-unstable changeset:   21602:f086edac7f92
xen-unstable date:        Fri Jun 11 13:57:52 2010 +0100
---
 xen/arch/x86/hvm/svm/svm.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff -r 351daae7d225 -r 3903d95733f7 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c        Fri Jun 11 14:01:23 2010 +0100
+++ b/xen/arch/x86/hvm/svm/svm.c        Fri Jun 11 14:04:36 2010 +0100
@@ -823,16 +823,20 @@ static int svm_cpu_prepare(unsigned int 
 
 static void svm_init_erratum_383(struct cpuinfo_x86 *c)
 {
-    uint64_t msr_content;
+    uint32_t l, h;
 
     /* only family 10h is affected */
     if ( c->x86 != 0x10 )
         return;
 
-    rdmsrl(MSR_AMD64_DC_CFG, msr_content);
-    wrmsrl(MSR_AMD64_DC_CFG, msr_content | (1ULL << 47));
-
-    amd_erratum383_found = 1;
+    /* use safe methods to be compatible with nested virtualization */
+    if (rdmsr_safe(MSR_AMD64_DC_CFG, l, h) == 0 &&
+        wrmsr_safe(MSR_AMD64_DC_CFG, l, h | (1UL << 15)) == 0)
+    {
+        amd_erratum383_found = 1;
+    } else {
+        printk("Failed to enable erratum 383\n");
+    }
 }
 
 static int svm_cpu_up(struct cpuinfo_x86 *c)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.