ia64/xen-unstable

changeset 4276:5c8a42bc39b3

bitkeeper revision 1.1236.1.118 (42417279HPSjyqvMU1nR51tWeAILpw)

Fix x86/64 build.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Mar 23 13:43:21 2005 +0000 (2005-03-23)
parents 989b998fd8ca
children 9f302fdb83a9
files xen/arch/x86/domain.c xen/arch/x86/traps.c
line diff
     1.1 --- a/xen/arch/x86/domain.c	Wed Mar 23 13:35:24 2005 +0000
     1.2 +++ b/xen/arch/x86/domain.c	Wed Mar 23 13:43:21 2005 +0000
     1.3 @@ -733,7 +733,9 @@ long do_switch_to_user(void)
     1.4  
     1.5  void context_switch(struct exec_domain *prev_p, struct exec_domain *next_p)
     1.6  {
     1.7 +#ifdef __i386__
     1.8      struct tss_struct *tss = init_tss + smp_processor_id();
     1.9 +#endif
    1.10      execution_context_t *stack_ec = get_execution_context();
    1.11  
    1.12      __cli();
     2.1 --- a/xen/arch/x86/traps.c	Wed Mar 23 13:35:24 2005 +0000
     2.2 +++ b/xen/arch/x86/traps.c	Wed Mar 23 13:43:21 2005 +0000
     2.3 @@ -385,12 +385,27 @@ static inline int guest_io_okay(
     2.4      struct exec_domain *ed, struct xen_regs *regs)
     2.5  {
     2.6      u16 x;
     2.7 +#if defined(__x86_64__)
     2.8 +    /* If in user mode, switch to kernel mode just to read I/O bitmap. */
     2.9 +    extern void toggle_guest_mode(struct exec_domain *);
    2.10 +    int user_mode = !(ed->arch.flags & TF_kernel_mode);
    2.11 +#define TOGGLE_MODE() if ( user_mode ) toggle_guest_mode(ed)
    2.12 +#elif defined(__i386__)
    2.13 +#define TOGGLE_MODE() ((void)0)
    2.14 +#endif
    2.15 +
    2.16      if ( ed->arch.iopl >= (KERNEL_MODE(ed, regs) ? 1 : 3) )
    2.17          return 1;
    2.18 -    if ( (ed->arch.iobmp_limit > (port + bytes)) &&
    2.19 -         (__get_user(x, (u16 *)(ed->arch.iobmp+(port>>3))) == 0) &&
    2.20 -         ((x & (((1<<bytes)-1) << (port&7))) == 0) )
    2.21 -        return 1;
    2.22 +
    2.23 +    if ( ed->arch.iobmp_limit > (port + bytes) )
    2.24 +    {
    2.25 +        TOGGLE_MODE();
    2.26 +        __get_user(x, (u16 *)(ed->arch.iobmp+(port>>3)));
    2.27 +        TOGGLE_MODE();
    2.28 +        if ( (x & (((1<<bytes)-1) << (port&7))) == 0 )
    2.29 +            return 1;
    2.30 +    }
    2.31 +
    2.32      return 0;
    2.33  }
    2.34  
    2.35 @@ -401,14 +416,17 @@ static inline int admin_io_okay(
    2.36  {
    2.37      struct domain *d = ed->domain;
    2.38      u16 x;
    2.39 +
    2.40      if ( IS_PRIV(d) || (d->arch.max_iopl >= (KERNEL_MODE(ed, regs) ? 1 : 3)) )
    2.41          return 1;
    2.42 +
    2.43      if ( d->arch.iobmp_mask != NULL )
    2.44      {
    2.45          x = *(u16 *)(d->arch.iobmp_mask + (port >> 3));
    2.46          if ( (x & (((1<<bytes)-1) << (port&7))) == 0 )
    2.47              return 1;
    2.48      }
    2.49 +
    2.50      return 0;
    2.51  }
    2.52