WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-4.0-testing] svm: use msr safe for erratum 383
From: "Xen patchbot-4.0-testing" <patchbot-4.0-testing@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 11 Jun 2010 07:25:42 -0700
Delivery-date: Fri, 11 Jun 2010 07:28:36 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-4.0-testing] svm: use msr safe for erratum 383, Xen patchbot-4.0-testing <=