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 patchbot -3.0-testing <patchbot-3.0-testing@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 04 May 2006 23:24:22 +0000
Delivery-date: Thu, 04 May 2006 16:25:33 -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 6d0a2702bd6deb65c78173d2674c9125546aa960
# Parent  e1db72ac19292f2b79d5f4c2b09feb13e29e4194
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-unstable changeset:   9935:8761333499ae2874647eb5d67d8cb091fbc5b14b
xen-unstable date:        Thu May  4 21:24:39 2006 +0100

diff -r e1db72ac1929 -r 6d0a2702bd6d xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c        Thu May 04 17:08:19 2006 +0100
+++ b/xen/arch/x86/hvm/svm/svm.c        Thu May 04 21:26:02 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) */
 
@@ -680,6 +683,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 e1db72ac1929 -r 6d0a2702bd6d xen/arch/x86/hvm/svm/vmcb.c
--- a/xen/arch/x86/hvm/svm/vmcb.c       Thu May 04 17:08:19 2006 +0100
+++ b/xen/arch/x86/hvm/svm/vmcb.c       Thu May 04 21:26:02 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>