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] Save per cpu IDT information into the VMCS host area.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Save per cpu IDT information into the VMCS host area.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 21 Jul 2005 10:00:10 -0400
Delivery-date: Thu, 21 Jul 2005 14:00:36 +0000
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/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 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Save per cpu IDT information into the VMCS host area., Xen patchbot -unstable <=