ia64/xen-unstable

changeset 2916:5974d9d97d89

bitkeeper revision 1.1159.170.1 (418fbcfftbJRf270n_KReJDuXIouGg)

Rejig the layout of saved activations on Xen's stack. Touches a bunch
of stuff but things are generally a bit cleaner now. Should be easier
to integrate vm86 support, and I'm now ready to do bigger changes to
the Xen->guest exit code.
author kaf24@freefall.cl.cam.ac.uk
date Mon Nov 08 18:37:51 2004 +0000 (2004-11-08)
parents 2a69594a92dc
children 4a610e420c0d
files .rootkeys xen/arch/x86/traps.c xen/arch/x86/x86_32/entry.S xen/include/asm-x86/irq.h xen/include/asm-x86/x86_32/asm_defns.h xen/include/asm-x86/x86_32/current.h xen/include/asm-x86/x86_32/regs.h xen/include/public/arch-x86_32.h xen/include/public/dom0_ops.h xen/include/xen/sched.h
line diff
     1.1 --- a/.rootkeys	Mon Nov 08 13:44:07 2004 +0000
     1.2 +++ b/.rootkeys	Mon Nov 08 18:37:51 2004 +0000
     1.3 @@ -731,6 +731,7 @@ 40e1966akOHWvvunCED7x3HPv35QvQ xen/inclu
     1.4  3ddb79c3ezddh34MdelJpa5tNR00Dw xen/include/asm-x86/system.h
     1.5  3ddb79c4HugMq7IYGxcQKFBpKwKhzA xen/include/asm-x86/types.h
     1.6  40cf1596saFaHD5DC5zvrSn7CDCWGQ xen/include/asm-x86/uaccess.h
     1.7 +418fbcfe_WliJPToeVM-9VStvym-hw xen/include/asm-x86/x86_32/asm_defns.h
     1.8  3ddb79c2ADvRmdexd9y3AYK9_NTx-Q xen/include/asm-x86/x86_32/current.h
     1.9  3ddb79c3mbqEM7QQr3zVq7NiBNhouA xen/include/asm-x86/x86_32/regs.h
    1.10  3e7f358aG11EvMI9VJ4_9hD4LUO7rQ xen/include/asm-x86/x86_32/string.h
     2.1 --- a/xen/arch/x86/traps.c	Mon Nov 08 13:44:07 2004 +0000
     2.2 +++ b/xen/arch/x86/traps.c	Mon Nov 08 18:37:51 2004 +0000
     2.3 @@ -166,14 +166,25 @@ void show_stack(unsigned long *esp)
     2.4  void show_registers(struct xen_regs *regs)
     2.5  {
     2.6      unsigned long esp;
     2.7 -    unsigned short ss;
     2.8 +    unsigned short ss, ds, es, fs, gs;
     2.9  
    2.10 -    esp = (unsigned long)(&regs->esp);
    2.11 -    ss  = __HYPERVISOR_DS;
    2.12      if ( regs->xcs & 3 )
    2.13      {
    2.14          esp = regs->esp;
    2.15          ss  = regs->xss & 0xffff;
    2.16 +        ds  = regs->xds & 0xffff;
    2.17 +        es  = regs->xes & 0xffff;
    2.18 +        fs  = regs->xfs & 0xffff;
    2.19 +        gs  = regs->xgs & 0xffff;
    2.20 +    }
    2.21 +    else
    2.22 +    {
    2.23 +        esp = (unsigned long)(&regs->esp);
    2.24 +        ss  = __HYPERVISOR_DS;
    2.25 +        ds  = __HYPERVISOR_DS;
    2.26 +        es  = __HYPERVISOR_DS;
    2.27 +        fs  = __HYPERVISOR_DS;
    2.28 +        gs  = __HYPERVISOR_DS;
    2.29      }
    2.30  
    2.31      printk("CPU:    %d\nEIP:    %04x:[<%08lx>]      \nEFLAGS: %08lx\n",
    2.32 @@ -183,8 +194,7 @@ void show_registers(struct xen_regs *reg
    2.33      printk("esi: %08lx   edi: %08lx   ebp: %08lx   esp: %08lx\n",
    2.34             regs->esi, regs->edi, regs->ebp, esp);
    2.35      printk("ds: %04x   es: %04x   fs: %04x   gs: %04x   ss: %04x\n",
    2.36 -           regs->xds & 0xffff, regs->xes & 0xffff, 
    2.37 -           regs->xfs & 0xffff, regs->xgs & 0xffff, ss);
    2.38 +           ds, es, fs, gs, ss);
    2.39  
    2.40      show_stack(&regs->esp);
    2.41  } 
    2.42 @@ -230,7 +240,6 @@ static inline void do_trap(int trapnr, c
    2.43      {
    2.44          DPRINTK("Trap %d: %08lx -> %08lx\n", trapnr, regs->eip, fixup);
    2.45          regs->eip = fixup;
    2.46 -        regs->xds = regs->xes = regs->xfs = regs->xgs = __HYPERVISOR_DS;
    2.47          return;
    2.48      }
    2.49  
    2.50 @@ -394,7 +403,6 @@ asmlinkage void do_page_fault(struct xen
    2.51          if ( !d->mm.shadow_mode )
    2.52              DPRINTK("Page fault: %08lx -> %08lx\n", regs->eip, fixup);
    2.53          regs->eip = fixup;
    2.54 -        regs->xds = regs->xes = regs->xfs = regs->xgs = __HYPERVISOR_DS;
    2.55          return;
    2.56      }
    2.57  
    2.58 @@ -509,7 +517,6 @@ asmlinkage void do_general_protection(st
    2.59      {
    2.60          DPRINTK("GPF (%04lx): %08lx -> %08lx\n", error_code, regs->eip, fixup);
    2.61          regs->eip = fixup;
    2.62 -        regs->xds = regs->xes = regs->xfs = regs->xgs = __HYPERVISOR_DS;
    2.63          return;
    2.64      }
    2.65  
     3.1 --- a/xen/arch/x86/x86_32/entry.S	Mon Nov 08 13:44:07 2004 +0000
     3.2 +++ b/xen/arch/x86/x86_32/entry.S	Mon Nov 08 18:37:51 2004 +0000
     3.3 @@ -59,76 +59,9 @@
     3.4  #include <xen/config.h>
     3.5  #include <xen/errno.h>
     3.6  #include <xen/softirq.h>
     3.7 +#include <asm/x86_32/asm_defns.h>
     3.8  #include <public/xen.h>
     3.9  
    3.10 -EBX		= 0x00
    3.11 -ECX		= 0x04
    3.12 -EDX		= 0x08
    3.13 -ESI		= 0x0C
    3.14 -EDI		= 0x10
    3.15 -EBP		= 0x14
    3.16 -EAX		= 0x18
    3.17 -DS		= 0x1C
    3.18 -ES		= 0x20
    3.19 -FS              = 0x24
    3.20 -GS              = 0x28
    3.21 -ORIG_EAX	= 0x2C
    3.22 -EIP		= 0x30
    3.23 -CS		= 0x34
    3.24 -EFLAGS		= 0x38
    3.25 -OLDESP		= 0x3C
    3.26 -OLDSS		= 0x40
    3.27 -
    3.28 -/* Offsets in domain structure */
    3.29 -PROCESSOR       =  0
    3.30 -SHARED_INFO     =  4
    3.31 -EVENT_SEL       =  8
    3.32 -EVENT_ADDR      = 12
    3.33 -FAILSAFE_BUFFER = 16
    3.34 -FAILSAFE_SEL    = 32
    3.35 -FAILSAFE_ADDR   = 36
    3.36 -
    3.37 -/* Offsets in shared_info_t */
    3.38 -#define UPCALL_PENDING /* 0 */
    3.39 -#define UPCALL_MASK       1
    3.40 -
    3.41 -/* Offsets in guest_trap_bounce */
    3.42 -GTB_ERROR_CODE   =  0
    3.43 -GTB_CR2          =  4
    3.44 -GTB_FLAGS        =  8
    3.45 -GTB_CS           = 10
    3.46 -GTB_EIP          = 12
    3.47 -GTBF_TRAP        =  1
    3.48 -GTBF_TRAP_NOCODE =  2
    3.49 -GTBF_TRAP_CR2    =  4
    3.50 -                        
    3.51 -CF_MASK		= 0x00000001
    3.52 -IF_MASK		= 0x00000200
    3.53 -NT_MASK		= 0x00004000
    3.54 -        
    3.55 -#define SAVE_ALL_NOSEGREGS \
    3.56 -        cld; \
    3.57 -        pushl %gs; \
    3.58 -        pushl %fs; \
    3.59 -        pushl %es; \
    3.60 -        pushl %ds; \
    3.61 -        pushl %eax; \
    3.62 -        pushl %ebp; \
    3.63 -        pushl %edi; \
    3.64 -        pushl %esi; \
    3.65 -        pushl %edx; \
    3.66 -        pushl %ecx; \
    3.67 -        pushl %ebx; \
    3.68 -
    3.69 -#define SAVE_ALL \
    3.70 -        SAVE_ALL_NOSEGREGS \
    3.71 -        movl $(__HYPERVISOR_DS),%edx; \
    3.72 -        movl %edx,%ds; \
    3.73 -        movl %edx,%es; \
    3.74 -        movl %edx,%fs; \
    3.75 -        movl %edx,%gs; \
    3.76 -        sti;
    3.77 -
    3.78  #define GET_CURRENT(reg)   \
    3.79          movl $4096-4, reg; \
    3.80          orl  %esp, reg;    \
    3.81 @@ -226,17 +159,10 @@ multicall_fixup1:
    3.82                  
    3.83          ALIGN
    3.84  restore_all_guest:
    3.85 -        # First, may need to restore %ds if clobbered by create_bounce_frame
    3.86 -        pushl %ss
    3.87 -        popl  %ds
    3.88 -        # Second, create a failsafe copy of DS,ES,FS,GS in case any are bad
    3.89 -        leal  DS(%esp),%esi
    3.90 -        leal  FAILSAFE_BUFFER(%ebx),%edi
    3.91 -        movsl
    3.92 -        movsl
    3.93 -        movsl
    3.94 -        movsl
    3.95 -        # Finally, restore guest registers -- faults will cause failsafe
    3.96 +1:	movl XREGS_ds(%esp),%ds
    3.97 +2:	movl XREGS_es(%esp),%es
    3.98 +3:	movl XREGS_fs(%esp),%fs
    3.99 +4:	movl XREGS_gs(%esp),%gs
   3.100          popl %ebx
   3.101  	popl %ecx
   3.102  	popl %edx
   3.103 @@ -244,62 +170,50 @@ restore_all_guest:
   3.104  	popl %edi
   3.105  	popl %ebp
   3.106  	popl %eax
   3.107 -1:	popl %ds
   3.108 -2:	popl %es
   3.109 -3:	popl %fs
   3.110 -4:	popl %gs
   3.111          addl $4,%esp
   3.112  5:      iret
   3.113  .section .fixup,"ax"
   3.114 -10:     subl $4,%esp
   3.115 -        pushl %gs
   3.116 -9:      pushl %fs
   3.117 -8:      pushl %es
   3.118 -7:      pushl %ds
   3.119 -6:      pushl %eax
   3.120 +6:      subl $4,%esp
   3.121 +        pushl %eax
   3.122  	pushl %ebp
   3.123  	pushl %edi
   3.124  	pushl %esi
   3.125  	pushl %edx
   3.126  	pushl %ecx
   3.127  	pushl %ebx
   3.128 -	pushl %ss
   3.129 -	popl  %ds
   3.130 -	pushl %ss
   3.131 -	popl  %es
   3.132 -	jmp  failsafe_callback
   3.133 +7:      SET_XEN_SEGMENTS
   3.134 +        jmp failsafe_callback
   3.135  .previous
   3.136  .section __ex_table,"a"
   3.137  	.align 4
   3.138 -	.long 1b,6b
   3.139 +	.long 1b,7b
   3.140  	.long 2b,7b
   3.141 -	.long 3b,8b
   3.142 -	.long 4b,9b
   3.143 -	.long 5b,10b
   3.144 +	.long 3b,7b
   3.145 +	.long 4b,7b
   3.146 +	.long 5b,6b
   3.147  .previous
   3.148  
   3.149  /* No special register assumptions */
   3.150  failsafe_callback:
   3.151          GET_CURRENT(%ebx)
   3.152 -        movl PROCESSOR(%ebx),%eax
   3.153 +        movl DOMAIN_processor(%ebx),%eax
   3.154          shl  $4,%eax
   3.155          lea  guest_trap_bounce(%eax),%edx
   3.156 -        movl FAILSAFE_ADDR(%ebx),%eax
   3.157 -        movl %eax,GTB_EIP(%edx)
   3.158 -        movl FAILSAFE_SEL(%ebx),%eax
   3.159 -        movw %ax,GTB_CS(%edx)
   3.160 +        movl DOMAIN_failsafe_addr(%ebx),%eax
   3.161 +        movl %eax,GTB_eip(%edx)
   3.162 +        movl DOMAIN_failsafe_sel(%ebx),%eax
   3.163 +        movw %ax,GTB_cs(%edx)
   3.164          call create_bounce_frame
   3.165          subl $16,%esi                # add DS/ES/FS/GS to failsafe stack frame
   3.166 -        leal FAILSAFE_BUFFER(%ebx),%ebp
   3.167 -        movl  0(%ebp),%eax           # DS
   3.168 -FAULT1: movl %eax,(%esi) 
   3.169 -        movl  4(%ebp),%eax           # ES
   3.170 -FAULT2: movl %eax,4(%esi)
   3.171 -        movl  8(%ebp),%eax           # FS
   3.172 -FAULT3: movl %eax,8(%esi) 
   3.173 -        movl 12(%ebp),%eax           # GS
   3.174 -FAULT4: movl %eax,12(%esi)
   3.175 -        movl %esi,OLDESP(%esp)
   3.176 +        movl XREGS_ds(%esp),%eax
   3.177 +FAULT1: movl %eax,%gs:(%esi) 
   3.178 +        movl XREGS_es(%esp),%eax
   3.179 +FAULT2: movl %eax,%gs:4(%esi)
   3.180 +        movl XREGS_fs(%esp),%eax
   3.181 +FAULT3: movl %eax,%gs:8(%esi) 
   3.182 +        movl XREGS_gs(%esp),%eax
   3.183 +FAULT4: movl %eax,%gs:12(%esi)
   3.184 +        movl %esi,XREGS_esp(%esp)
   3.185          popl %ebx
   3.186          popl %ecx
   3.187          popl %edx
   3.188 @@ -307,15 +221,10 @@ FAULT4: movl %eax,12(%esi)
   3.189          popl %edi
   3.190          popl %ebp
   3.191          popl %eax
   3.192 -        addl $20,%esp                # skip DS/ES/FS/GS/ORIG_EAX
   3.193 +        addl $4,%esp
   3.194  FAULT5: iret 
   3.195  
   3.196 -
   3.197          ALIGN
   3.198 -# Simple restore -- we should never fault as we we will only interrupt ring 0
   3.199 -# when sane values have been placed in all registers. The only exception is
   3.200 -# NMI, which may interrupt before good values have been placed in DS-GS.
   3.201 -# The NMI return code deals with this problem itself.
   3.202  restore_all_xen:
   3.203  	popl %ebx
   3.204  	popl %ecx
   3.205 @@ -324,10 +233,6 @@ restore_all_xen:
   3.206  	popl %edi
   3.207  	popl %ebp
   3.208  	popl %eax
   3.209 -	popl %ds
   3.210 -	popl %es
   3.211 -	popl %fs
   3.212 -	popl %gs
   3.213          addl $4,%esp
   3.214          iret
   3.215  
   3.216 @@ -335,37 +240,38 @@ restore_all_xen:
   3.217  ENTRY(hypercall)
   3.218          pushl %eax			# save orig_eax
   3.219  	SAVE_ALL
   3.220 -	GET_CURRENT(%ebx)
   3.221 +        sti
   3.222 +        GET_CURRENT(%ebx)
   3.223  	andl $(NR_hypercalls-1),%eax
   3.224  	call *SYMBOL_NAME(hypercall_table)(,%eax,4)
   3.225  
   3.226  ret_from_hypercall:
   3.227 -        movl %eax,EAX(%esp)		# save the return value
   3.228 +        movl %eax,XREGS_eax(%esp)		# save the return value
   3.229  
   3.230  test_all_events:
   3.231          xorl %ecx,%ecx
   3.232          notl %ecx
   3.233          cli                             # tests must not race interrupts
   3.234  /*test_softirqs:*/  
   3.235 -        movl PROCESSOR(%ebx),%eax
   3.236 +        movl DOMAIN_processor(%ebx),%eax
   3.237          shl  $6,%eax                    # sizeof(irq_cpustat) == 64
   3.238          test %ecx,SYMBOL_NAME(irq_stat)(%eax,1)
   3.239          jnz  process_softirqs
   3.240  /*test_guest_events:*/
   3.241 -        movl SHARED_INFO(%ebx),%eax
   3.242 -        testb $0xFF,UPCALL_MASK(%eax)
   3.243 +        movl DOMAIN_shared_info(%ebx),%eax
   3.244 +        testb $0xFF,SHINFO_upcall_mask(%eax)
   3.245          jnz  restore_all_guest
   3.246 -        testb $0xFF,UPCALL_PENDING(%eax)
   3.247 +        testb $0xFF,SHINFO_upcall_pending(%eax)
   3.248          jz   restore_all_guest
   3.249 -        movb $1,UPCALL_MASK(%eax)       # Upcalls are masked during delivery
   3.250 +        movb $1,SHINFO_upcall_mask(%eax) # Upcalls are masked during delivery
   3.251  /*process_guest_events:*/
   3.252 -        movl PROCESSOR(%ebx),%edx
   3.253 -        shl  $4,%edx                    # sizeof(guest_trap_bounce) == 16
   3.254 +        movl DOMAIN_processor(%ebx),%edx
   3.255 +        shl  $4,%edx                     # sizeof(guest_trap_bounce) == 16
   3.256          lea  guest_trap_bounce(%edx),%edx
   3.257 -        movl EVENT_ADDR(%ebx),%eax
   3.258 -        movl %eax,GTB_EIP(%edx)
   3.259 -        movl EVENT_SEL(%ebx),%eax
   3.260 -        movw %ax,GTB_CS(%edx)
   3.261 +        movl DOMAIN_event_addr(%ebx),%eax
   3.262 +        movl %eax,GTB_eip(%edx)
   3.263 +        movl DOMAIN_event_sel(%ebx),%eax
   3.264 +        movw %ax,GTB_cs(%edx)
   3.265          call create_bounce_frame
   3.266          jmp  restore_all_guest
   3.267  
   3.268 @@ -375,16 +281,16 @@ process_softirqs:
   3.269          call SYMBOL_NAME(do_softirq)
   3.270          jmp  test_all_events
   3.271                  
   3.272 -/* CREATE A BASIC EXCEPTION FRAME ON GUEST OS (RING-1) STACK:         */
   3.273 -/*   {EIP, CS, EFLAGS, [ESP, SS]}                                     */
   3.274 -/* %edx == guest_trap_bounce, %ebx == task_struct                     */
   3.275 -/* %eax,%ecx are clobbered. %ds:%esi contain new OLDSS/OLDESP.        */
   3.276 +/* CREATE A BASIC EXCEPTION FRAME ON GUEST OS (RING-1) STACK:            */
   3.277 +/*   {EIP, CS, EFLAGS, [ESP, SS]}                                        */
   3.278 +/* %edx == guest_trap_bounce, %ebx == task_struct                        */
   3.279 +/* %eax,%ecx are clobbered. %gs:%esi contain new XREGS_ss/XREGS_esp. */
   3.280  create_bounce_frame:        
   3.281 -        mov  CS+4(%esp),%cl
   3.282 +        mov  XREGS_cs+4(%esp),%cl
   3.283          test $2,%cl
   3.284          jz   1f /* jump if returning to an existing ring-1 activation */
   3.285          /* obtain ss/esp from TSS -- no current ring-1 activations */
   3.286 -        movl PROCESSOR(%ebx),%eax
   3.287 +        movl DOMAIN_processor(%ebx),%eax
   3.288          /* next 4 lines multiply %eax by 8320, which is sizeof(tss_struct) */
   3.289          movl %eax, %ecx
   3.290          shll $7, %ecx
   3.291 @@ -392,38 +298,37 @@ create_bounce_frame:
   3.292          addl %ecx,%eax
   3.293          addl $init_tss + 12,%eax
   3.294          movl (%eax),%esi /* tss->esp1 */
   3.295 -FAULT6: movl 4(%eax),%ds /* tss->ss1  */
   3.296 +FAULT6: movl 4(%eax),%gs /* tss->ss1  */
   3.297          /* base of stack frame must contain ss/esp (inter-priv iret) */
   3.298          subl $8,%esi
   3.299 -        movl OLDESP+4(%esp),%eax
   3.300 -FAULT7: movl %eax,(%esi) 
   3.301 -        movl OLDSS+4(%esp),%eax
   3.302 -FAULT8: movl %eax,4(%esi) 
   3.303 +        movl XREGS_esp+4(%esp),%eax
   3.304 +FAULT7: movl %eax,%gs:(%esi) 
   3.305 +        movl XREGS_ss+4(%esp),%eax
   3.306 +FAULT8: movl %eax,%gs:4(%esi) 
   3.307          jmp 2f
   3.308  1:      /* obtain ss/esp from oldss/oldesp -- a ring-1 activation exists */
   3.309 -        movl OLDESP+4(%esp),%esi
   3.310 -FAULT9: movl OLDSS+4(%esp),%ds 
   3.311 +        movl XREGS_esp+4(%esp),%esi
   3.312 +FAULT9: movl XREGS_ss+4(%esp),%gs 
   3.313  2:      /* Construct a stack frame: EFLAGS, CS/EIP */
   3.314          subl $12,%esi
   3.315 -        movl EIP+4(%esp),%eax
   3.316 -FAULT10:movl %eax,(%esi) 
   3.317 -        movl CS+4(%esp),%eax
   3.318 -FAULT11:movl %eax,4(%esi) 
   3.319 -        movl EFLAGS+4(%esp),%eax
   3.320 -FAULT12:movl %eax,8(%esi)
   3.321 +        movl XREGS_eip+4(%esp),%eax
   3.322 +FAULT10:movl %eax,%gs:(%esi) 
   3.323 +        movl XREGS_cs+4(%esp),%eax
   3.324 +FAULT11:movl %eax,%gs:4(%esi) 
   3.325 +        movl XREGS_eflags+4(%esp),%eax
   3.326 +FAULT12:movl %eax,%gs:8(%esi)
   3.327          /* Rewrite our stack frame and return to ring 1. */
   3.328          /* IA32 Ref. Vol. 3: TF, VM, RF and NT flags are cleared on trap. */
   3.329          andl $0xfffcbeff,%eax
   3.330 -        movl %eax,EFLAGS+4(%esp)
   3.331 -        movl %ds,OLDSS+4(%esp)
   3.332 -        movl %esi,OLDESP+4(%esp)
   3.333 -        movzwl %es:GTB_CS(%edx),%eax
   3.334 -        movl %eax,CS+4(%esp)
   3.335 -        movl %es:GTB_EIP(%edx),%eax
   3.336 -        movl %eax,EIP+4(%esp)
   3.337 +        movl %eax,XREGS_eflags+4(%esp)
   3.338 +        movl %gs,XREGS_ss+4(%esp)
   3.339 +        movl %esi,XREGS_esp+4(%esp)
   3.340 +        movzwl GTB_cs(%edx),%eax
   3.341 +        movl %eax,XREGS_cs+4(%esp)
   3.342 +        movl GTB_eip(%edx),%eax
   3.343 +        movl %eax,XREGS_eip+4(%esp)
   3.344          ret
   3.345 -        
   3.346 -                              
   3.347 +
   3.348  .section __ex_table,"a"
   3.349          .align 4
   3.350          .long FAULT1, crash_domain_fixup3 # Fault writing to ring-1 stack
   3.351 @@ -447,44 +352,41 @@ FAULT12:movl %eax,8(%esi)
   3.352  crash_domain_fixup1:
   3.353          subl  $4,%esp
   3.354          SAVE_ALL
   3.355 +        sti
   3.356          jmp   domain_crash
   3.357  crash_domain_fixup2:
   3.358          addl  $4,%esp                     
   3.359  crash_domain_fixup3:
   3.360 -        pushl %ss
   3.361 -        popl  %ds
   3.362          jmp   domain_crash
   3.363  .previous
   3.364  
   3.365          ALIGN
   3.366  process_guest_exception_and_events:        
   3.367 -        movl PROCESSOR(%ebx),%eax
   3.368 +        movl DOMAIN_processor(%ebx),%eax
   3.369          shl  $4,%eax
   3.370          lea  guest_trap_bounce(%eax),%edx
   3.371 -        testb $~0,GTB_FLAGS(%edx)
   3.372 +        testb $~0,GTB_flags(%edx)
   3.373          jz   test_all_events
   3.374          call create_bounce_frame        # just the basic frame
   3.375 -        mov  %es:GTB_FLAGS(%edx),%cl
   3.376 +        mov  GTB_flags(%edx),%cl
   3.377          test $GTBF_TRAP_NOCODE,%cl
   3.378          jnz  2f
   3.379          subl $4,%esi                    # push error_code onto guest frame
   3.380 -        movl %es:GTB_ERROR_CODE(%edx),%eax
   3.381 -FAULT13:movl %eax,(%esi)
   3.382 +        movl GTB_error_code(%edx),%eax
   3.383 +FAULT13:movl %eax,%gs:(%esi)
   3.384          test $GTBF_TRAP_CR2,%cl
   3.385          jz   1f
   3.386          subl $4,%esi                    # push %cr2 onto guest frame
   3.387 -        movl %es:GTB_CR2(%edx),%eax
   3.388 -FAULT14:movl %eax,(%esi)
   3.389 -1:      movl %esi,OLDESP(%esp)        
   3.390 -2:      push %es                        # unclobber %ds
   3.391 -        pop  %ds 
   3.392 -        movb $0,GTB_FLAGS(%edx)
   3.393 +        movl GTB_cr2(%edx),%eax
   3.394 +FAULT14:movl %eax,%gs:(%esi)
   3.395 +1:      movl %esi,XREGS_esp(%esp)        
   3.396 +2:      movb $0,GTB_flags(%edx)
   3.397          jmp  test_all_events
   3.398  
   3.399          ALIGN
   3.400  ENTRY(ret_from_intr)
   3.401  	GET_CURRENT(%ebx)
   3.402 -        movb CS(%esp),%al
   3.403 +        movb XREGS_cs(%esp),%al
   3.404  	testb $3,%al	# return to non-supervisor?
   3.405  	jne test_all_events
   3.406  	jmp restore_all_xen
   3.407 @@ -494,36 +396,31 @@ ENTRY(divide_error)
   3.408  	pushl $ SYMBOL_NAME(do_divide_error)
   3.409  	ALIGN
   3.410  error_code:
   3.411 -	pushl %fs
   3.412 -	pushl %es
   3.413 -	pushl %ds
   3.414 -	pushl %eax
   3.415 -	xorl  %eax,%eax
   3.416 -	pushl %ebp
   3.417 +	cld
   3.418 +      	pushl %ebp
   3.419  	pushl %edi
   3.420  	pushl %esi
   3.421  	pushl %edx
   3.422 -	decl  %eax			# eax = -1
   3.423  	pushl %ecx
   3.424  	pushl %ebx
   3.425 -	cld
   3.426 -	movl  %gs,%ecx
   3.427 -	movl  ORIG_EAX(%esp), %esi	# get the error code
   3.428 -	movl  GS(%esp), %edi		# get the function address
   3.429 -	movl  %eax, ORIG_EAX(%esp)
   3.430 -	movl  %ecx, GS(%esp)
   3.431 -	movl  $(__HYPERVISOR_DS),%edx
   3.432 -	movl  %edx,%ds
   3.433 -	movl  %edx,%es
   3.434 -	movl  %edx,%fs
   3.435 -	movl  %edx,%gs
   3.436 +        movb XREGS_cs(%esp),%bl
   3.437 +        testb $3,%bl
   3.438 +        je   1f
   3.439 +        movl %ds,XREGS_ds(%esp)
   3.440 +        movl %es,XREGS_es(%esp)
   3.441 +        movl %fs,XREGS_fs(%esp)
   3.442 +        movl %gs,XREGS_gs(%esp)
   3.443 +1:      SET_XEN_SEGMENTS
   3.444 +	movl  XREGS_orig_eax(%esp),%esi		# get the error code
   3.445 +	movl  XREGS_eax(%esp),%edi		# get the function address
   3.446 +	movl  %eax,XREGS_eax(%esp)
   3.447  	movl  %esp,%edx
   3.448  	pushl %esi			# push the error code
   3.449  	pushl %edx			# push the xen_regs pointer
   3.450  	GET_CURRENT(%ebx)
   3.451 -	call  *%edi
   3.452 +        call  *%edi
   3.453          addl  $8,%esp
   3.454 -        movb  CS(%esp),%al
   3.455 +        movb  XREGS_cs(%esp),%al
   3.456  	testb $3,%al
   3.457  	je    restore_all_xen
   3.458          jmp   process_guest_exception_and_events
   3.459 @@ -628,21 +525,21 @@ ENTRY(nmi)
   3.460          # In all other cases we bail without touching DS-GS, as we have
   3.461          # interrupted an enclosing Xen activation in tricky prologue or
   3.462          # epilogue code.
   3.463 -        movb  CS(%esp),%al
   3.464 +        movb  XREGS_cs(%esp),%al
   3.465  	testb $3,%al
   3.466          jne   do_watchdog_tick
   3.467 -        movl  DS(%esp),%eax
   3.468 +        movl  XREGS_ds(%esp),%eax
   3.469          cmpw  $(__HYPERVISOR_DS),%ax
   3.470 -        jne   nmi_badseg
   3.471 -        movl  ES(%esp),%eax
   3.472 +        jne   restore_all_xen
   3.473 +        movl  XREGS_es(%esp),%eax
   3.474          cmpw  $(__HYPERVISOR_DS),%ax
   3.475 -        jne   nmi_badseg
   3.476 -        movl  FS(%esp),%eax
   3.477 +        jne   restore_all_xen
   3.478 +        movl  XREGS_fs(%esp),%eax
   3.479          cmpw  $(__HYPERVISOR_DS),%ax
   3.480 -        jne   nmi_badseg
   3.481 -        movl  GS(%esp),%eax
   3.482 +        jne   restore_all_xen
   3.483 +        movl  XREGS_gs(%esp),%eax
   3.484          cmpw  $(__HYPERVISOR_DS),%ax
   3.485 -        jne   nmi_badseg
   3.486 +        jne   restore_all_xen
   3.487  
   3.488  do_watchdog_tick:
   3.489          movl  $(__HYPERVISOR_DS),%edx
   3.490 @@ -653,34 +550,23 @@ do_watchdog_tick:
   3.491  	pushl %edx   # regs
   3.492          call  SYMBOL_NAME(do_nmi)
   3.493  	addl  $8,%esp
   3.494 -        movb  CS(%esp),%al
   3.495 +        movb  XREGS_cs(%esp),%al
   3.496  	testb $3,%al
   3.497  	je    restore_all_xen
   3.498          GET_CURRENT(%ebx)
   3.499          jmp   restore_all_guest
   3.500  
   3.501 -nmi_badseg:
   3.502 -	popl %ebx
   3.503 -	popl %ecx
   3.504 -	popl %edx
   3.505 -	popl %esi
   3.506 -	popl %edi
   3.507 -	popl %ebp
   3.508 -	popl %eax
   3.509 -        addl $20,%esp
   3.510 -        iret
   3.511 -
   3.512  nmi_parity_err:
   3.513          # Clear and disable the parity-error line
   3.514          andb $0xf,%al
   3.515          orb  $0x4,%al
   3.516          outb %al,$0x61
   3.517          cmpb $'i',%ss:SYMBOL_NAME(opt_nmi) # nmi=ignore
   3.518 -        je   nmi_badseg
   3.519 +        je   restore_all_xen
   3.520          bts  $0,%ss:SYMBOL_NAME(nmi_softirq_reason)
   3.521          bts  $NMI_SOFTIRQ,%ss:SYMBOL_NAME(irq_stat)
   3.522          cmpb $'d',%ss:SYMBOL_NAME(opt_nmi) # nmi=dom0
   3.523 -        je   nmi_badseg
   3.524 +        je   restore_all_xen
   3.525          movl $(__HYPERVISOR_DS),%edx       # nmi=fatal
   3.526          movl %edx,%ds
   3.527          movl %edx,%es
   3.528 @@ -696,11 +582,11 @@ nmi_io_err:
   3.529          orb  $0x8,%al
   3.530          outb %al,$0x61
   3.531          cmpb $'i',%ss:SYMBOL_NAME(opt_nmi) # nmi=ignore
   3.532 -        je   nmi_badseg
   3.533 +        je   restore_all_xen
   3.534          bts  $1,%ss:SYMBOL_NAME(nmi_softirq_reason)
   3.535          bts  $NMI_SOFTIRQ,%ss:SYMBOL_NAME(irq_stat)
   3.536          cmpb $'d',%ss:SYMBOL_NAME(opt_nmi) # nmi=dom0
   3.537 -        je   nmi_badseg
   3.538 +        je   restore_all_xen
   3.539          movl $(__HYPERVISOR_DS),%edx       # nmi=fatal
   3.540          movl %edx,%ds
   3.541          movl %edx,%es
     4.1 --- a/xen/include/asm-x86/irq.h	Mon Nov 08 13:44:07 2004 +0000
     4.2 +++ b/xen/include/asm-x86/irq.h	Mon Nov 08 18:37:51 2004 +0000
     4.3 @@ -5,6 +5,7 @@
     4.4  
     4.5  #include <xen/config.h>
     4.6  #include <asm/atomic.h>
     4.7 +#include <asm/x86_32/asm_defns.h>
     4.8  
     4.9  extern void disable_irq(unsigned int);
    4.10  extern void disable_irq_nosync(unsigned int);
    4.11 @@ -83,36 +84,6 @@ extern char _stext, _etext;
    4.12  
    4.13  #define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs))
    4.14  
    4.15 -#define __STR(x) #x
    4.16 -#define STR(x) __STR(x)
    4.17 -
    4.18 -#if defined(__i386__)
    4.19 -
    4.20 -#define SAVE_ALL \
    4.21 -	"cld\n\t" \
    4.22 -	"pushl %gs\n\t" \
    4.23 -	"pushl %fs\n\t" \
    4.24 -	"pushl %es\n\t" \
    4.25 -	"pushl %ds\n\t" \
    4.26 -	"pushl %eax\n\t" \
    4.27 -	"pushl %ebp\n\t" \
    4.28 -	"pushl %edi\n\t" \
    4.29 -	"pushl %esi\n\t" \
    4.30 -	"pushl %edx\n\t" \
    4.31 -	"pushl %ecx\n\t" \
    4.32 -	"pushl %ebx\n\t" \
    4.33 -	"movl $" STR(__HYPERVISOR_DS) ",%edx\n\t" \
    4.34 -	"movl %edx,%ds\n\t" \
    4.35 -	"movl %edx,%es\n\t" \
    4.36 -	"movl %edx,%fs\n\t" \
    4.37 -	"movl %edx,%gs\n\t"
    4.38 -
    4.39 -#else
    4.40 -
    4.41 -#define SAVE_ALL
    4.42 -
    4.43 -#endif
    4.44 -
    4.45  #define BUILD_SMP_INTERRUPT(x,v) XBUILD_SMP_INTERRUPT(x,v)
    4.46  #define XBUILD_SMP_INTERRUPT(x,v)\
    4.47  asmlinkage void x(void); \
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/xen/include/asm-x86/x86_32/asm_defns.h	Mon Nov 08 18:37:51 2004 +0000
     5.3 @@ -0,0 +1,122 @@
     5.4 +#ifndef __ASM_DEFNS_H__
     5.5 +#define __ASM_DEFNS_H__
     5.6 +
     5.7 +/* Offsets in 'struct xen_regs' --- AUTO-GENERATE ME! */
     5.8 +#define XREGS_ebx      0x00
     5.9 +#define XREGS_ecx      0x04
    5.10 +#define XREGS_edx      0x08
    5.11 +#define XREGS_esi      0x0C
    5.12 +#define XREGS_edi      0x10
    5.13 +#define XREGS_ebp      0x14
    5.14 +#define XREGS_eax      0x18
    5.15 +#define XREGS_orig_eax 0x1C
    5.16 +#define XREGS_eip      0x20
    5.17 +#define XREGS_cs       0x24
    5.18 +#define XREGS_eflags   0x28
    5.19 +#define XREGS_esp      0x2C
    5.20 +#define XREGS_ss       0x30
    5.21 +#define XREGS_es       0x34
    5.22 +#define XREGS_ds       0x38
    5.23 +#define XREGS_fs       0x3C
    5.24 +#define XREGS_gs       0x40
    5.25 +
    5.26 +/* Offsets in 'struct domain' --- AUTO-GENERATE ME! */
    5.27 +#define DOMAIN_processor       0
    5.28 +#define DOMAIN_shared_info     4
    5.29 +#define DOMAIN_event_sel       8
    5.30 +#define DOMAIN_event_addr     12
    5.31 +#define DOMAIN_failsafe_sel   16
    5.32 +#define DOMAIN_failsafe_addr  20
    5.33 +
    5.34 +/* Offsets in shared_info_t --- AUTO-GENERATE ME! */
    5.35 +#define SHINFO_upcall_pending /* 0 */
    5.36 +#define SHINFO_upcall_mask       1
    5.37 +
    5.38 +/* Offsets in 'struct guest_trap_bounce' --- AUTO-GENERATE ME! */
    5.39 +#define GTB_error_code    0
    5.40 +#define GTB_cr2           4
    5.41 +#define GTB_flags         8
    5.42 +#define GTB_cs           10
    5.43 +#define GTB_eip          12
    5.44 +#define GTBF_TRAP         1
    5.45 +#define GTBF_TRAP_NOCODE  2
    5.46 +#define GTBF_TRAP_CR2     4
    5.47 +
    5.48 +/* EFLAGS masks. */
    5.49 +#define CF_MASK 0x00000001
    5.50 +#define IF_MASK 0x00000200
    5.51 +#define NT_MASK 0x00004000
    5.52 +
    5.53 +#define __STR(x) #x
    5.54 +#define STR(x) __STR(x)
    5.55 +
    5.56 +/* AUTO-GENERATE the following two cases (quoted vs. unquoted). */
    5.57 +#ifndef __ASSEMBLY__
    5.58 +
    5.59 +#define __SAVE_ALL_PRE \
    5.60 +        "cld;" \
    5.61 +        "pushl %eax;" \
    5.62 +        "pushl %ebp;" \
    5.63 +        "pushl %edi;" \
    5.64 +        "pushl %esi;" \
    5.65 +        "pushl %edx;" \
    5.66 +        "pushl %ecx;" \
    5.67 +        "pushl %ebx;" \
    5.68 +        "movb "STR(XREGS_cs)"(%esp),%al;" \
    5.69 +        "testb $3,%al;" \
    5.70 +        "je 1f;" \
    5.71 +        "movl %ds,"STR(XREGS_ds)"(%esp);" \
    5.72 +        "movl %es,"STR(XREGS_es)"(%esp);" \
    5.73 +        "movl %fs,"STR(XREGS_fs)"(%esp);" \
    5.74 +        "movl %gs,"STR(XREGS_gs)"(%esp);"
    5.75 +
    5.76 +#define SAVE_ALL_NOSEGREGS \
    5.77 +        __SAVE_ALL_PRE \
    5.78 +        "1:"
    5.79 +
    5.80 +#define SET_XEN_SEGMENTS \
    5.81 +        "movl $("STR(__HYPERVISOR_DS)"),%edx;" \
    5.82 +        "movl %edx,%ds;" \
    5.83 +        "movl %edx,%es;"
    5.84 +
    5.85 +#define SAVE_ALL \
    5.86 +        __SAVE_ALL_PRE \
    5.87 +        SET_XEN_SEGMENTS \
    5.88 +        "1:"
    5.89 +
    5.90 +#else
    5.91 +
    5.92 +#define __SAVE_ALL_PRE \
    5.93 +        cld; \
    5.94 +        pushl %eax; \
    5.95 +        pushl %ebp; \
    5.96 +        pushl %edi; \
    5.97 +        pushl %esi; \
    5.98 +        pushl %edx; \
    5.99 +        pushl %ecx; \
   5.100 +        pushl %ebx; \
   5.101 +        movb XREGS_cs(%esp),%dl; \
   5.102 +        testb $3,%dl; \
   5.103 +        je 1f; \
   5.104 +        movl %ds,XREGS_ds(%esp); \
   5.105 +        movl %es,XREGS_es(%esp); \
   5.106 +        movl %fs,XREGS_fs(%esp); \
   5.107 +        movl %gs,XREGS_gs(%esp);
   5.108 +
   5.109 +#define SAVE_ALL_NOSEGREGS \
   5.110 +        __SAVE_ALL_PRE \
   5.111 +        1:
   5.112 +
   5.113 +#define SET_XEN_SEGMENTS \
   5.114 +        movl $(__HYPERVISOR_DS),%edx; \
   5.115 +        movl %edx,%ds; \
   5.116 +        movl %edx,%es;
   5.117 +
   5.118 +#define SAVE_ALL \
   5.119 +        __SAVE_ALL_PRE \
   5.120 +        SET_XEN_SEGMENTS \
   5.121 +        1:
   5.122 +
   5.123 +#endif
   5.124 +
   5.125 +#endif /* __ASM_DEFNS_H__ */
     6.1 --- a/xen/include/asm-x86/x86_32/current.h	Mon Nov 08 13:44:07 2004 +0000
     6.2 +++ b/xen/include/asm-x86/x86_32/current.h	Mon Nov 08 18:37:51 2004 +0000
     6.3 @@ -31,11 +31,17 @@ static inline execution_context_t *get_e
     6.4      return execution_context;
     6.5  }
     6.6  
     6.7 +/*
     6.8 + * Get the top-of-stack, as stored in the per-CPU TSS. This is actually
     6.9 + * 20 bytes below the real top of the stack to allow space for:
    6.10 + *  domain pointer, DS, ES, FS, GS.
    6.11 + */
    6.12  static inline unsigned long get_stack_top(void)
    6.13  {
    6.14      unsigned long p;
    6.15 -    __asm__ ( "orl %%esp,%0; andl $~3,%0" 
    6.16 -              : "=r" (p) : "0" (STACK_SIZE-4) );
    6.17 +    __asm__ ( "andl %%esp,%0; addl %2,%0" 
    6.18 +              : "=r" (p)
    6.19 +              : "0" (~(STACK_SIZE-1)), "i" (STACK_SIZE-20) );
    6.20      return p;
    6.21  }
    6.22  
     7.1 --- a/xen/include/asm-x86/x86_32/regs.h	Mon Nov 08 13:44:07 2004 +0000
     7.2 +++ b/xen/include/asm-x86/x86_32/regs.h	Mon Nov 08 18:37:51 2004 +0000
     7.3 @@ -1,47 +1,51 @@
     7.4  #ifndef _I386_REGS_H
     7.5  #define _I386_REGS_H
     7.6  
     7.7 -struct xen_regs {
     7.8 -	long ebx;
     7.9 -	long ecx;
    7.10 -	long edx;
    7.11 -	long esi;
    7.12 -	long edi;
    7.13 -	long ebp;
    7.14 -	long eax;
    7.15 -	int  xds;
    7.16 -	int  xes;
    7.17 -	int  xfs;
    7.18 -	int  xgs;
    7.19 -	long orig_eax;
    7.20 -	long eip;
    7.21 -	int  xcs;
    7.22 -	long eflags;
    7.23 -	long esp;
    7.24 -	int  xss;
    7.25 +struct xen_regs
    7.26 +{
    7.27 +    /* All saved activations contain the following fields. */
    7.28 +    long ebx;
    7.29 +    long ecx;
    7.30 +    long edx;
    7.31 +    long esi;
    7.32 +    long edi;
    7.33 +    long ebp;
    7.34 +    long eax;
    7.35 +    long orig_eax;
    7.36 +    long eip;
    7.37 +    int  xcs;
    7.38 +    long eflags;
    7.39 +
    7.40 +    /* Only saved guest activations contain the following fields. */
    7.41 +    long esp;
    7.42 +    int  xss;
    7.43 +    int  xes;
    7.44 +    int  xds;
    7.45 +    int  xfs;
    7.46 +    int  xgs;
    7.47  };
    7.48  
    7.49  enum EFLAGS {
    7.50 -        EF_CF   = 0x00000001,
    7.51 -        EF_PF   = 0x00000004,
    7.52 -        EF_AF   = 0x00000010,
    7.53 -        EF_ZF   = 0x00000040,
    7.54 -        EF_SF   = 0x00000080,
    7.55 -        EF_TF   = 0x00000100,
    7.56 -        EF_IE   = 0x00000200,
    7.57 -        EF_DF   = 0x00000400,
    7.58 -        EF_OF   = 0x00000800,
    7.59 -        EF_IOPL = 0x00003000,
    7.60 -        EF_IOPL_RING0 = 0x00000000,
    7.61 -        EF_IOPL_RING1 = 0x00001000,
    7.62 -        EF_IOPL_RING2 = 0x00002000,
    7.63 -        EF_NT   = 0x00004000,   /* nested task */
    7.64 -        EF_RF   = 0x00010000,   /* resume */
    7.65 -        EF_VM   = 0x00020000,   /* virtual mode */
    7.66 -        EF_AC   = 0x00040000,   /* alignment */
    7.67 -        EF_VIF  = 0x00080000,   /* virtual interrupt */
    7.68 -        EF_VIP  = 0x00100000,   /* virtual interrupt pending */
    7.69 -        EF_ID   = 0x00200000,   /* id */
    7.70 +    EF_CF   = 0x00000001,
    7.71 +    EF_PF   = 0x00000004,
    7.72 +    EF_AF   = 0x00000010,
    7.73 +    EF_ZF   = 0x00000040,
    7.74 +    EF_SF   = 0x00000080,
    7.75 +    EF_TF   = 0x00000100,
    7.76 +    EF_IE   = 0x00000200,
    7.77 +    EF_DF   = 0x00000400,
    7.78 +    EF_OF   = 0x00000800,
    7.79 +    EF_IOPL = 0x00003000,
    7.80 +    EF_IOPL_RING0 = 0x00000000,
    7.81 +    EF_IOPL_RING1 = 0x00001000,
    7.82 +    EF_IOPL_RING2 = 0x00002000,
    7.83 +    EF_NT   = 0x00004000,   /* nested task */
    7.84 +    EF_RF   = 0x00010000,   /* resume */
    7.85 +    EF_VM   = 0x00020000,   /* virtual mode */
    7.86 +    EF_AC   = 0x00040000,   /* alignment */
    7.87 +    EF_VIF  = 0x00080000,   /* virtual interrupt */
    7.88 +    EF_VIP  = 0x00100000,   /* virtual interrupt pending */
    7.89 +    EF_ID   = 0x00200000,   /* id */
    7.90  };
    7.91  
    7.92  #endif
     8.1 --- a/xen/include/public/arch-x86_32.h	Mon Nov 08 13:44:07 2004 +0000
     8.2 +++ b/xen/include/public/arch-x86_32.h	Mon Nov 08 18:37:51 2004 +0000
     8.3 @@ -92,16 +92,16 @@ typedef struct
     8.4      unsigned long edi;
     8.5      unsigned long ebp;
     8.6      unsigned long eax;
     8.7 -    unsigned long ds;
     8.8 -    unsigned long es;
     8.9 -    unsigned long fs;
    8.10 -    unsigned long gs;
    8.11      unsigned long _unused;
    8.12      unsigned long eip;
    8.13      unsigned long cs;
    8.14      unsigned long eflags;
    8.15      unsigned long esp;
    8.16      unsigned long ss;
    8.17 +    unsigned long es;
    8.18 +    unsigned long ds;
    8.19 +    unsigned long fs;
    8.20 +    unsigned long gs;
    8.21  } PACKED execution_context_t;
    8.22  
    8.23  typedef u64 tsc_timestamp_t; /* RDTSC timestamp */
     9.1 --- a/xen/include/public/dom0_ops.h	Mon Nov 08 13:44:07 2004 +0000
     9.2 +++ b/xen/include/public/dom0_ops.h	Mon Nov 08 18:37:51 2004 +0000
     9.3 @@ -19,7 +19,7 @@
     9.4   * This makes sure that old versions of dom0 tools will stop working in a
     9.5   * well-defined way (rather than crashing the machine, for instance).
     9.6   */
     9.7 -#define DOM0_INTERFACE_VERSION   0xAAAA0019
     9.8 +#define DOM0_INTERFACE_VERSION   0xAAAA001A
     9.9  
    9.10  /************************************************************************/
    9.11  
    10.1 --- a/xen/include/xen/sched.h	Mon Nov 08 13:44:07 2004 +0000
    10.2 +++ b/xen/include/xen/sched.h	Mon Nov 08 18:37:51 2004 +0000
    10.3 @@ -75,15 +75,8 @@ struct domain
    10.4      unsigned long event_selector;    /* 08: entry CS  */
    10.5      unsigned long event_address;     /* 12: entry EIP */
    10.6  
    10.7 -    /* Saved DS,ES,FS,GS immediately before return to guest OS. */
    10.8 -    unsigned long failsafe_selectors[4]; /* 16-32 */ 
    10.9 -
   10.10 -    /*
   10.11 -     * END OF FIRST CACHELINE. Stuff above is touched a lot!
   10.12 -     */
   10.13 -
   10.14 -    unsigned long failsafe_selector; /* 32: entry CS  */
   10.15 -    unsigned long failsafe_address;  /* 36: entry EIP */
   10.16 +    unsigned long failsafe_selector; /* 16: entry CS  */
   10.17 +    unsigned long failsafe_address;  /* 20: entry EIP */
   10.18  
   10.19      /*
   10.20       * From here on things can be added and shuffled without special attention