ia64/xen-unstable

changeset 2685:d92269f82bbe

bitkeeper revision 1.1159.1.255 (4177bef1YxrXgVRyVzt2_EdbMj5rDg)

Merge freefall.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk
into freefall.cl.cam.ac.uk:/local/scratch/kaf24/xeno
author kaf24@freefall.cl.cam.ac.uk
date Thu Oct 21 13:51:45 2004 +0000 (2004-10-21)
parents 7bc73b540515 7eb0f01df59a
children ba107a7380bc bd272fb0c28f fa98ee4c6a0c
files xen/arch/x86/dom0_ops.c xen/arch/x86/domain.c xen/include/asm-x86/processor.h xen/include/hypervisor-ifs/dom0_ops.h xen/include/hypervisor-ifs/hypervisor-if.h
line diff
     1.1 --- a/xen/arch/x86/dom0_ops.c	Thu Oct 21 13:47:32 2004 +0000
     1.2 +++ b/xen/arch/x86/dom0_ops.c	Thu Oct 21 13:51:45 2004 +0000
     1.3 @@ -107,8 +107,8 @@ void arch_getdomaininfo_ctxt(struct doma
     1.4  
     1.5      c->flags = 0;
     1.6      memcpy(&c->cpu_ctxt, 
     1.7 -           &d->shared_info->execution_context,
     1.8 -           sizeof(d->shared_info->execution_context));
     1.9 +           &d->thread.user_ctxt,
    1.10 +           sizeof(d->thread.user_ctxt));
    1.11      if ( test_bit(DF_DONEFPUINIT, &d->flags) )
    1.12          c->flags |= ECF_I387_VALID;
    1.13      memcpy(&c->fpu_ctxt,
     2.1 --- a/xen/arch/x86/domain.c	Thu Oct 21 13:47:32 2004 +0000
     2.2 +++ b/xen/arch/x86/domain.c	Thu Oct 21 13:51:45 2004 +0000
     2.3 @@ -240,9 +240,18 @@ int arch_final_setup_guestos(struct doma
     2.4      if ( c->flags & ECF_I387_VALID )
     2.5          set_bit(DF_DONEFPUINIT, &d->flags);
     2.6  
     2.7 -    memcpy(&d->shared_info->execution_context,
     2.8 +    memcpy(&d->thread.user_ctxt,
     2.9             &c->cpu_ctxt,
    2.10 -           sizeof(d->shared_info->execution_context));
    2.11 +           sizeof(d->thread.user_ctxt));
    2.12 +
    2.13 +    /*
    2.14 +     * This is sufficient! If the descriptor DPL differs from CS RPL then we'll
    2.15 +     * #GP. If DS, ES, FS, GS are DPL 0 then they'll be cleared automatically.
    2.16 +     * If SS RPL or DPL differs from CS RPL then we'll #GP.
    2.17 +     */
    2.18 +    if ( ((d->thread.user_ctxt.cs & 3) == 0) ||
    2.19 +         ((d->thread.user_ctxt.ss & 3) == 0) )
    2.20 +        return -EINVAL;
    2.21  
    2.22      memcpy(&d->thread.i387,
    2.23             &c->fpu_ctxt,
    2.24 @@ -295,12 +304,12 @@ int arch_final_setup_guestos(struct doma
    2.25  
    2.26  #if defined(__i386__)
    2.27  
    2.28 -void new_thread(struct domain *p,
    2.29 +void new_thread(struct domain *d,
    2.30                  unsigned long start_pc,
    2.31                  unsigned long start_stack,
    2.32                  unsigned long start_info)
    2.33  {
    2.34 -    execution_context_t *ec = &p->shared_info->execution_context;
    2.35 +    execution_context_t *ec = &d->thread.user_ctxt;
    2.36  
    2.37      /*
    2.38       * Initial register values:
    2.39 @@ -320,7 +329,7 @@ void new_thread(struct domain *p,
    2.40      ec->eflags |= X86_EFLAGS_IF;
    2.41  
    2.42      /* No fast trap at start of day. */
    2.43 -    SET_DEFAULT_FAST_TRAP(&p->thread);
    2.44 +    SET_DEFAULT_FAST_TRAP(&d->thread);
    2.45  }
    2.46  
    2.47  
    2.48 @@ -345,7 +354,7 @@ void switch_to(struct domain *prev_p, st
    2.49      /* Switch guest general-register state. */
    2.50      if ( !is_idle_task(prev_p) )
    2.51      {
    2.52 -        memcpy(&prev_p->shared_info->execution_context, 
    2.53 +        memcpy(&prev_p->thread.user_ctxt,
    2.54                 stack_ec, 
    2.55                 sizeof(*stack_ec));
    2.56          unlazy_fpu(prev_p);
    2.57 @@ -355,19 +364,9 @@ void switch_to(struct domain *prev_p, st
    2.58      if ( !is_idle_task(next_p) )
    2.59      {
    2.60          memcpy(stack_ec,
    2.61 -               &next_p->shared_info->execution_context,
    2.62 +               &next_p->thread.user_ctxt,
    2.63                 sizeof(*stack_ec));
    2.64  
    2.65 -        /*
    2.66 -         * This is sufficient! If the descriptor DPL differs from CS RPL then 
    2.67 -         * we'll #GP. If DS, ES, FS, GS are DPL 0 then they'll be cleared 
    2.68 -         * automatically. If SS RPL or DPL differs from CS RPL then we'll #GP.
    2.69 -         */
    2.70 -        if ( (stack_ec->cs & 3) == 0 )
    2.71 -            stack_ec->cs = FLAT_RING1_CS;
    2.72 -        if ( (stack_ec->ss & 3) == 0 )
    2.73 -            stack_ec->ss = FLAT_RING1_DS;
    2.74 -
    2.75          SET_FAST_TRAP(&next_p->thread);
    2.76  
    2.77          /* Switch the guest OS ring-1 stack. */
     3.1 --- a/xen/include/asm-x86/processor.h	Thu Oct 21 13:47:32 2004 +0000
     3.2 +++ b/xen/include/asm-x86/processor.h	Thu Oct 21 13:51:45 2004 +0000
     3.3 @@ -291,6 +291,8 @@ struct thread_struct {
     3.4      unsigned long      debugreg[8];  /* %%db0-7 debug registers */
     3.5  /* floating point info */
     3.6      struct i387_state  i387;
     3.7 +/* general user-visible register state */
     3.8 +    execution_context_t user_ctxt;
     3.9  /* Trap info. */
    3.10  #ifdef __i386__
    3.11      int                fast_trap_idx;
    3.12 @@ -331,6 +333,7 @@ long set_fast_trap(struct domain *p, int
    3.13  	0, 0,		      		       			\
    3.14  	{ [0 ... 7] = 0 },	/* debugging registers */	\
    3.15  	{ { 0, }, },		/* 387 state */			\
    3.16 +	{ 0 },							\
    3.17  	0x20, { 0, 0 },		/* DEFAULT_FAST_TRAP */		\
    3.18  	{ {0} }			/* io permissions */		\
    3.19  }
     4.1 --- a/xen/include/hypervisor-ifs/dom0_ops.h	Thu Oct 21 13:47:32 2004 +0000
     4.2 +++ b/xen/include/hypervisor-ifs/dom0_ops.h	Thu Oct 21 13:51:45 2004 +0000
     4.3 @@ -19,7 +19,7 @@
     4.4   * This makes sure that old versions of dom0 tools will stop working in a
     4.5   * well-defined way (rather than crashing the machine, for instance).
     4.6   */
     4.7 -#define DOM0_INTERFACE_VERSION   0xAAAA0016
     4.8 +#define DOM0_INTERFACE_VERSION   0xAAAA0017
     4.9  
    4.10  #define MAX_DOMAIN_NAME    16
    4.11  
     5.1 --- a/xen/include/hypervisor-ifs/hypervisor-if.h	Thu Oct 21 13:47:32 2004 +0000
     5.2 +++ b/xen/include/hypervisor-ifs/hypervisor-if.h	Thu Oct 21 13:51:45 2004 +0000
     5.3 @@ -358,8 +358,6 @@ typedef struct shared_info_st
     5.4      u64                wall_timeout;    /* 312 */
     5.5      u64                domain_timeout;  /* 320 */
     5.6  
     5.7 -    execution_context_t execution_context; /* 328 */
     5.8 -
     5.9      arch_shared_info_t arch;
    5.10  
    5.11  } PACKED shared_info_t;