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] SVM patch for 64bit hv, to reset the ss, es, ds host sel

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] SVM patch for 64bit hv, to reset the ss, es, ds host selectors to NULL
From: Xen staging patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 08 May 2006 13:58:18 +0000
Delivery-date: Mon, 08 May 2006 07:05:01 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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 kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 8761333499ae2874647eb5d67d8cb091fbc5b14b
# Parent  ad5b833122a8d88be39629751e1ee5c1d8629f96
SVM patch for 64bit hv, to reset the ss, es, ds host selectors to NULL
during a context switch to the SVM domain's vcpu. This patch also
initializes the tlb_control to 1 for the initial do_launch().
Signed-off-by: Tom Woller <thomas.woller@xxxxxxx>
---
 xen/arch/x86/hvm/svm/svm.c  |   14 ++++++++++++++
 xen/arch/x86/hvm/svm/vmcb.c |    2 ++
 2 files changed, 16 insertions(+)

diff -r ad5b833122a8 -r 8761333499ae xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c        Thu May 04 17:44:14 2006 +0100
+++ b/xen/arch/x86/hvm/svm/svm.c        Thu May 04 21:24:39 2006 +0100
@@ -61,6 +61,9 @@ static unsigned long trace_values[NR_CPU
 /* Useful define */
 #define MAX_INST_SIZE  15
 
+#define set_segment_register(name, value)  \
+       __asm__ __volatile__ ( "movw %%ax ,%%" STR(name) "" : : "a" (value) )
+
 /* 
  * External functions, etc. We should move these to some suitable header 
file(s) */
 
@@ -681,6 +684,17 @@ static void svm_ctxt_switch_from(struct 
 
 static void svm_ctxt_switch_to(struct vcpu *v)
 {
+#if __x86_64__
+    /* 
+     * This is required, because VMRUN does consistency check
+     * and some of the DOM0 selectors are pointing to 
+     * invalid GDT locations, and cause AMD processors
+     * to shutdown.
+     */
+    set_segment_register(ds, 0);
+    set_segment_register(es, 0);
+    set_segment_register(ss, 0);
+#endif
 }
 
 void svm_final_setup_guest(struct vcpu *v)
diff -r ad5b833122a8 -r 8761333499ae xen/arch/x86/hvm/svm/vmcb.c
--- a/xen/arch/x86/hvm/svm/vmcb.c       Thu May 04 17:44:14 2006 +0100
+++ b/xen/arch/x86/hvm/svm/vmcb.c       Thu May 04 21:24:39 2006 +0100
@@ -428,6 +428,8 @@ void svm_do_launch(struct vcpu *v)
        
     if (svm_dbg_on)
         svm_dump_vmcb(__func__, vmcb);
+
+    vmcb->tlb_control = 1;
 }
 
 

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

<Prev in Thread] Current Thread [Next in Thread>