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

[Xen-changelog] Save per cpu IDT information into the VMCS host area.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 07884fe7c5ce0efe7605a3dcbf8a026be9552145
# Parent  dd3dbd7c82e01724e563f9262f85dfccbc306046

Save per cpu IDT information into the VMCS host area.

Without this, we may be saving the IDT info from the wrong cpu into the
vmcs.
This makes domU work in the presence of VMX domains on SMP/HT enabled
machines.

Signed-off-by: Chengyuan Li <chengyuan.li@xxxxxxxxx>
Signed-off-by: Xiaofeng Ling <xiaofeng.ling@xxxxxxxxx>=20
Signed-off-by: Arun Sharma <arun.sharma@xxxxxxxxx>

diff -r dd3dbd7c82e0 -r 07884fe7c5ce xen/arch/x86/vmx_vmcs.c
--- a/xen/arch/x86/vmx_vmcs.c   Thu Jul 21 13:59:08 2005
+++ b/xen/arch/x86/vmx_vmcs.c   Thu Jul 21 13:59:49 2005
@@ -190,10 +190,14 @@
 
     vmx_setup_platform(v, regs);
 
+    __asm__ __volatile__ ("sidt  (%0) \n" :: "a"(&desc) : "memory");
+    host_env.idtr_limit = desc.size;
+    host_env.idtr_base = desc.address;
+    error |= __vmwrite(HOST_IDTR_BASE, host_env.idtr_base);
+ 
     __asm__ __volatile__ ("sgdt  (%0) \n" :: "a"(&desc) : "memory");
     host_env.gdtr_limit = desc.size;
     host_env.gdtr_base = desc.address;
-
     error |= __vmwrite(HOST_GDTR_BASE, host_env.gdtr_base);
 
     error |= __vmwrite(GUEST_LDTR_SELECTOR, 0);
@@ -351,7 +355,6 @@
 {
     int error = 0;
     unsigned long crn;
-    struct Xgt_desc_struct desc;
 
     /* Host Selectors */
     host_env->ds_selector = __HYPERVISOR_DS;
@@ -377,14 +380,7 @@
     host_env->ds_base = 0;
     host_env->cs_base = 0;
 
-/* Debug */
-    __asm__ __volatile__ ("sidt  (%0) \n" :: "a"(&desc) : "memory");
-    host_env->idtr_limit = desc.size;
-    host_env->idtr_base = desc.address;
-    error |= __vmwrite(HOST_IDTR_BASE, host_env->idtr_base);
-
     __asm__ __volatile__ ("mov %%cr0,%0" : "=r" (crn) : );
-
     host_env->cr0 = crn;
     error |= __vmwrite(HOST_CR0, crn); /* same CR0 */
 
@@ -392,6 +388,7 @@
     __asm__ __volatile__ ("mov %%cr4,%0" : "=r" (crn) : ); 
     host_env->cr4 = crn;
     error |= __vmwrite(HOST_CR4, crn);
+
     error |= __vmwrite(HOST_RIP, (unsigned long) vmx_asm_vmexit_handler);
 #ifdef __x86_64__ 
     /* TBD: support cr8 for 64-bit guest */ 

_______________________________________________
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®.