ia64/xen-unstable

changeset 5836:07884fe7c5ce

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@intel.com>
Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>=20
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Jul 21 13:59:49 2005 +0000 (2005-07-21)
parents dd3dbd7c82e0
children 6e11af443eb1
files xen/arch/x86/vmx_vmcs.c
line diff
     1.1 --- a/xen/arch/x86/vmx_vmcs.c	Thu Jul 21 13:59:08 2005 +0000
     1.2 +++ b/xen/arch/x86/vmx_vmcs.c	Thu Jul 21 13:59:49 2005 +0000
     1.3 @@ -190,10 +190,14 @@ void vmx_do_launch(struct vcpu *v)
     1.4  
     1.5      vmx_setup_platform(v, regs);
     1.6  
     1.7 +    __asm__ __volatile__ ("sidt  (%0) \n" :: "a"(&desc) : "memory");
     1.8 +    host_env.idtr_limit = desc.size;
     1.9 +    host_env.idtr_base = desc.address;
    1.10 +    error |= __vmwrite(HOST_IDTR_BASE, host_env.idtr_base);
    1.11 + 
    1.12      __asm__ __volatile__ ("sgdt  (%0) \n" :: "a"(&desc) : "memory");
    1.13      host_env.gdtr_limit = desc.size;
    1.14      host_env.gdtr_base = desc.address;
    1.15 -
    1.16      error |= __vmwrite(HOST_GDTR_BASE, host_env.gdtr_base);
    1.17  
    1.18      error |= __vmwrite(GUEST_LDTR_SELECTOR, 0);
    1.19 @@ -351,7 +355,6 @@ static inline int construct_vmcs_host(st
    1.20  {
    1.21      int error = 0;
    1.22      unsigned long crn;
    1.23 -    struct Xgt_desc_struct desc;
    1.24  
    1.25      /* Host Selectors */
    1.26      host_env->ds_selector = __HYPERVISOR_DS;
    1.27 @@ -377,14 +380,7 @@ static inline int construct_vmcs_host(st
    1.28      host_env->ds_base = 0;
    1.29      host_env->cs_base = 0;
    1.30  
    1.31 -/* Debug */
    1.32 -    __asm__ __volatile__ ("sidt  (%0) \n" :: "a"(&desc) : "memory");
    1.33 -    host_env->idtr_limit = desc.size;
    1.34 -    host_env->idtr_base = desc.address;
    1.35 -    error |= __vmwrite(HOST_IDTR_BASE, host_env->idtr_base);
    1.36 -
    1.37      __asm__ __volatile__ ("mov %%cr0,%0" : "=r" (crn) : );
    1.38 -
    1.39      host_env->cr0 = crn;
    1.40      error |= __vmwrite(HOST_CR0, crn); /* same CR0 */
    1.41  
    1.42 @@ -392,6 +388,7 @@ static inline int construct_vmcs_host(st
    1.43      __asm__ __volatile__ ("mov %%cr4,%0" : "=r" (crn) : ); 
    1.44      host_env->cr4 = crn;
    1.45      error |= __vmwrite(HOST_CR4, crn);
    1.46 +
    1.47      error |= __vmwrite(HOST_RIP, (unsigned long) vmx_asm_vmexit_handler);
    1.48  #ifdef __x86_64__ 
    1.49      /* TBD: support cr8 for 64-bit guest */