ia64/xen-unstable

changeset 3388:ef529c8bd197

bitkeeper revision 1.1159.212.8 (41ddcdedA_y3YPCIz7quwuaHg2Lhng)

VMX bug fixes.
author iap10@labyrinth.cl.cam.ac.uk
date Thu Jan 06 23:46:53 2005 +0000 (2005-01-06)
parents b0d439448dfe
children 6223f62df1d8
files xen/arch/x86/vmx.c xen/arch/x86/x86_32/entry.S
line diff
     1.1 --- a/xen/arch/x86/vmx.c	Thu Jan 06 20:41:41 2005 +0000
     1.2 +++ b/xen/arch/x86/vmx.c	Thu Jan 06 23:46:53 2005 +0000
     1.3 @@ -75,7 +75,7 @@ int start_vmx()
     1.4  
     1.5  void stop_vmx()
     1.6  {
     1.7 -    if (test_bit(X86_FEATURE_VMXE, &boot_cpu_data.x86_capability))
     1.8 +    if (read_cr4() & X86_CR4_VMXE)
     1.9          __vmxoff();
    1.10  }
    1.11  
     2.1 --- a/xen/arch/x86/x86_32/entry.S	Thu Jan 06 20:41:41 2005 +0000
     2.2 +++ b/xen/arch/x86/x86_32/entry.S	Thu Jan 06 23:46:53 2005 +0000
     2.3 @@ -75,14 +75,24 @@
     2.4   *
     2.5   * We also need the room, especially because orig_eax field is used 
     2.6   * by do_IRQ(). Compared the xen_regs, we skip pushing for the following:
     2.7 - * (1/1)  u16 error_code;
     2.8 - * (2/1)  u16 entry_vector;
     2.9 + *   (10) u32 gs;                 
    2.10 + *   (9)  u32 fs;
    2.11 + *   (8)  u32 ds;
    2.12 + *   (7)  u32 es;
    2.13 + *               <- get_stack_top() (= HOST_ESP)
    2.14 + *   (6)  u32 ss;
    2.15 + *   (5)  u32 esp;
    2.16 + *   (4)  u32 eflags;
    2.17 + *   (3)  u32 cs;
    2.18   *   (2)  u32 eip;
    2.19 - *   (3)  u32 cs;
    2.20 - *   (4)  u32 eflags;
    2.21 + * (2/1)  u16 entry_vector;
    2.22 + * (1/1)  u16 error_code;
    2.23 + * However, get_stack_top() acturally returns 20 bytes below the real
    2.24 + * top of the stack to allow space for:
    2.25 + * domain pointer, DS, ES, FS, GS. Therefore, we effectively skip 6 registers.
    2.26   */
    2.27  #define VMX_MONITOR_EFLAGS	0x202 /* IF on */
    2.28 -#define NR_SKIPPED_REGS	4	/* See the above explanation */
    2.29 +#define NR_SKIPPED_REGS	6	/* See the above explanation */
    2.30  #define VMX_SAVE_ALL_NOSEGREGS \
    2.31          pushl $VMX_MONITOR_EFLAGS; \
    2.32          popf; \