ia64/xen-unstable

changeset 4930:c02d87b68355

bitkeeper revision 1.1415 (42887ada_Jmkta2rYHnpJBE2EVpy4w)

Remove generic 'fast trap' from the Xen public interfaces. Internally
within Xen, we automatically set up direct trap for int 0x80, which is
the only 'fast trap' vector that we ever supported anyway.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon May 16 10:50:02 2005 +0000 (2005-05-16)
parents 2c0bcfd2a1fc
children ebefebb6acfb
files docs/src/interface.tex extras/mini-os/h/hypervisor.h freebsd-5.3-xen-sparse/i386-xen/i386-xen/machdep.c freebsd-5.3-xen-sparse/i386-xen/i386-xen/mp_machdep.c freebsd-5.3-xen-sparse/i386-xen/include/hypervisor.h linux-2.4.29-xen-sparse/arch/xen/kernel/traps.c linux-2.6.11-xen-sparse/arch/xen/i386/kernel/smpboot.c linux-2.6.11-xen-sparse/arch/xen/i386/kernel/traps.c linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/hypercall.h linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/hypercall.h netbsd-2.0-xen-sparse/sys/arch/xen/include/hypervisor.h tools/libxc/xc_linux_build.c tools/libxc/xc_linux_restore.c tools/libxc/xc_plan9_build.c tools/libxc/xc_vmx_build.c xen/arch/x86/dom0_ops.c xen/arch/x86/domain.c xen/arch/x86/traps.c xen/arch/x86/x86_32/entry.S xen/arch/x86/x86_32/traps.c xen/include/asm-x86/domain.h xen/include/asm-x86/processor.h xen/include/public/arch-x86_32.h xen/include/public/dom0_ops.h xen/include/public/xen.h
line diff
     1.1 --- a/docs/src/interface.tex	Mon May 16 10:36:52 2005 +0000
     1.2 +++ b/docs/src/interface.tex	Mon May 16 10:50:02 2005 +0000
     1.3 @@ -721,24 +721,6 @@ stack-frame layout is used.
     1.4  
     1.5  \end{quote} 
     1.6  
     1.7 -Finally, as an optimization it is possible for each guest OS 
     1.8 -to install one ``fast trap'': this is a trap gate which will 
     1.9 -allow direct transfer of control from ring 3 into ring 1 without
    1.10 -indirecting via Xen. In most cases this is suitable for use by 
    1.11 -the guest OS system call mechanism, although it may be used for
    1.12 -any purpose. 
    1.13 -
    1.14 -
    1.15 -\begin{quote}
    1.16 -\hypercall{set\_fast\_trap(int idx)}
    1.17 -
    1.18 -Install the handler for exception vector {\tt idx} as the ``fast
    1.19 -trap'' for this domain. Note that this installs the current handler 
    1.20 -(i.e. that which has been installed more recently via a call 
    1.21 -to {\tt set\_trap\_table()}). 
    1.22 -
    1.23 -\end{quote}
    1.24 -
    1.25  
    1.26  
    1.27  \section{Scheduling and Timer}
     2.1 --- a/extras/mini-os/h/hypervisor.h	Mon May 16 10:36:52 2005 +0000
     2.2 +++ b/extras/mini-os/h/hypervisor.h	Mon May 16 10:50:02 2005 +0000
     2.3 @@ -257,17 +257,6 @@ static __inline__ int HYPERVISOR_update_
     2.4      return ret;
     2.5  }
     2.6  
     2.7 -static __inline__ int HYPERVISOR_set_fast_trap(int idx)
     2.8 -{
     2.9 -    int ret;
    2.10 -    __asm__ __volatile__ (
    2.11 -        TRAP_INSTR
    2.12 -        : "=a" (ret) : "0" (__HYPERVISOR_set_fast_trap), 
    2.13 -        _a1 (idx) : "memory" );
    2.14 -
    2.15 -    return ret;
    2.16 -}
    2.17 -
    2.18  static __inline__ int HYPERVISOR_dom_mem_op(void *dom_mem_op)
    2.19  {
    2.20      int ret;
     3.1 --- a/freebsd-5.3-xen-sparse/i386-xen/i386-xen/machdep.c	Mon May 16 10:36:52 2005 +0000
     3.2 +++ b/freebsd-5.3-xen-sparse/i386-xen/i386-xen/machdep.c	Mon May 16 10:50:02 2005 +0000
     3.3 @@ -1642,9 +1642,6 @@ init386(void)
     3.4  	if ((error = HYPERVISOR_set_trap_table(trap_table)) != 0) {
     3.5  		panic("set_trap_table failed - error %d\n", error);
     3.6  	}
     3.7 -	if ((error = HYPERVISOR_set_fast_trap(0x80)) != 0) {
     3.8 -	        panic("set_fast_trap failed - error %d\n", error);
     3.9 -	}
    3.10          HYPERVISOR_set_callbacks(GSEL(GCODE_SEL, SEL_KPL), (unsigned long)Xhypervisor_callback,
    3.11  				 GSEL(GCODE_SEL, SEL_KPL), (unsigned long)failsafe_callback);
    3.12  
     4.1 --- a/freebsd-5.3-xen-sparse/i386-xen/i386-xen/mp_machdep.c	Mon May 16 10:36:52 2005 +0000
     4.2 +++ b/freebsd-5.3-xen-sparse/i386-xen/i386-xen/mp_machdep.c	Mon May 16 10:50:02 2005 +0000
     4.3 @@ -885,10 +885,9 @@ install_ap_tramp(void)
     4.4  }
     4.5  #endif
     4.6  
     4.7 -static int 
     4.8 +static void
     4.9  cpu_mp_trap_init(trap_info_t *trap_ctxt)
    4.10  {
    4.11 -
    4.12          trap_info_t *t = trap_table;
    4.13  
    4.14          for (t = trap_table; t->address; t++) {
    4.15 @@ -896,7 +895,6 @@ cpu_mp_trap_init(trap_info_t *trap_ctxt)
    4.16                  trap_ctxt[t->vector].cs = t->cs;
    4.17                  trap_ctxt[t->vector].address = t->address;
    4.18          }
    4.19 -        return 0x80 /*SYSCALL_VECTOR*/;
    4.20  }
    4.21  
    4.22  /*
    4.23 @@ -961,7 +959,7 @@ start_ap(int apic_id)
    4.24  		ctxt.trap_ctxt[i].vector = i;
    4.25  		ctxt.trap_ctxt[i].cs     = FLAT_KERNEL_CS;
    4.26  	}
    4.27 -	ctxt.fast_trap_idx = cpu_mp_trap_init(ctxt.trap_ctxt);
    4.28 +	cpu_mp_trap_init(ctxt.trap_ctxt);
    4.29  
    4.30  	/* No LDT. */
    4.31  	ctxt.ldt_ents = 0;
     5.1 --- a/freebsd-5.3-xen-sparse/i386-xen/include/hypervisor.h	Mon May 16 10:36:52 2005 +0000
     5.2 +++ b/freebsd-5.3-xen-sparse/i386-xen/include/hypervisor.h	Mon May 16 10:50:02 2005 +0000
     5.3 @@ -284,18 +284,6 @@ HYPERVISOR_update_descriptor(
     5.4  }
     5.5  
     5.6  static inline int 
     5.7 -HYPERVISOR_set_fast_trap(int idx)
     5.8 -{
     5.9 -    int ret;
    5.10 -    __asm__ __volatile__ (
    5.11 -        TRAP_INSTR
    5.12 -        : "=a" (ret) : "0" (__HYPERVISOR_set_fast_trap), 
    5.13 -        "b" (idx) : "memory" );
    5.14 -
    5.15 -    return ret;
    5.16 -}
    5.17 -
    5.18 -static inline int 
    5.19  HYPERVISOR_dom_mem_op(unsigned int   op,
    5.20  		      unsigned long *pages,
    5.21  		      unsigned long  nr_pages)
     6.1 --- a/linux-2.4.29-xen-sparse/arch/xen/kernel/traps.c	Mon May 16 10:36:52 2005 +0000
     6.2 +++ b/linux-2.4.29-xen-sparse/arch/xen/kernel/traps.c	Mon May 16 10:50:02 2005 +0000
     6.3 @@ -605,7 +605,6 @@ static trap_info_t trap_table[] = {
     6.4  void __init trap_init(void)
     6.5  {
     6.6      HYPERVISOR_set_trap_table(trap_table);    
     6.7 -    HYPERVISOR_set_fast_trap(SYSCALL_VECTOR);
     6.8  
     6.9      /*
    6.10       * The default LDT is a single-entry callgate to lcall7 for iBCS and a
     7.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/smpboot.c	Mon May 16 10:36:52 2005 +0000
     7.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/smpboot.c	Mon May 16 10:50:02 2005 +0000
     7.3 @@ -821,7 +821,7 @@ static int __init do_boot_cpu(int apicid
     7.4  	extern void startup_32_smp(void);
     7.5  	extern void hypervisor_callback(void);
     7.6  	extern void failsafe_callback(void);
     7.7 -	extern int smp_trap_init(trap_info_t *);
     7.8 +	extern void smp_trap_init(trap_info_t *);
     7.9  	int i;
    7.10  
    7.11  	cpu = ++cpucount;
    7.12 @@ -881,7 +881,7 @@ static int __init do_boot_cpu(int apicid
    7.13  		ctxt.trap_ctxt[i].vector = i;
    7.14  		ctxt.trap_ctxt[i].cs     = FLAT_KERNEL_CS;
    7.15  	}
    7.16 -	ctxt.fast_trap_idx = smp_trap_init(ctxt.trap_ctxt);
    7.17 +	smp_trap_init(ctxt.trap_ctxt);
    7.18  
    7.19  	/* No LDT. */
    7.20  	ctxt.ldt_ents = 0;
     8.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/traps.c	Mon May 16 10:36:52 2005 +0000
     8.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/traps.c	Mon May 16 10:50:02 2005 +0000
     8.3 @@ -957,7 +957,6 @@ static trap_info_t trap_table[] = {
     8.4  void __init trap_init(void)
     8.5  {
     8.6  	HYPERVISOR_set_trap_table(trap_table);
     8.7 -	HYPERVISOR_set_fast_trap(SYSCALL_VECTOR);
     8.8  
     8.9  	/*
    8.10  	 * default LDT is a single-entry callgate to lcall7 for iBCS
    8.11 @@ -971,7 +970,7 @@ void __init trap_init(void)
    8.12  	cpu_init();
    8.13  }
    8.14  
    8.15 -int smp_trap_init(trap_info_t *trap_ctxt)
    8.16 +void smp_trap_init(trap_info_t *trap_ctxt)
    8.17  {
    8.18  	trap_info_t *t = trap_table;
    8.19  
    8.20 @@ -980,5 +979,4 @@ int smp_trap_init(trap_info_t *trap_ctxt
    8.21  		trap_ctxt[t->vector].cs = t->cs;
    8.22  		trap_ctxt[t->vector].address = t->address;
    8.23  	}
    8.24 -	return SYSCALL_VECTOR;
    8.25  }
     9.1 --- a/linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/hypercall.h	Mon May 16 10:36:52 2005 +0000
     9.2 +++ b/linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/hypercall.h	Mon May 16 10:50:02 2005 +0000
     9.3 @@ -332,22 +332,6 @@ HYPERVISOR_update_descriptor(
     9.4  }
     9.5  
     9.6  static inline int
     9.7 -HYPERVISOR_set_fast_trap(
     9.8 -    int idx)
     9.9 -{
    9.10 -    int ret;
    9.11 -    unsigned long ign;
    9.12 -
    9.13 -    __asm__ __volatile__ (
    9.14 -        TRAP_INSTR
    9.15 -        : "=a" (ret), "=b" (ign)
    9.16 -	: "0" (__HYPERVISOR_set_fast_trap), "1" (idx)
    9.17 -	: "memory" );
    9.18 -
    9.19 -    return ret;
    9.20 -}
    9.21 -
    9.22 -static inline int
    9.23  HYPERVISOR_dom_mem_op(
    9.24      unsigned int op, unsigned long *extent_list,
    9.25      unsigned long nr_extents, unsigned int extent_order)
    10.1 --- a/linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/hypercall.h	Mon May 16 10:36:52 2005 +0000
    10.2 +++ b/linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/hypercall.h	Mon May 16 10:50:02 2005 +0000
    10.3 @@ -310,21 +310,6 @@ HYPERVISOR_update_descriptor(
    10.4  }
    10.5  
    10.6  static inline int
    10.7 -HYPERVISOR_set_fast_trap(
    10.8 -    int idx)
    10.9 -{
   10.10 -    int ret;
   10.11 -
   10.12 -    __asm__ __volatile__ (
   10.13 -        TRAP_INSTR
   10.14 -        : "=a" (ret)
   10.15 -	: "0" ((unsigned long)__HYPERVISOR_set_fast_trap), "D" ((unsigned long)idx)
   10.16 -	: __syscall_clobber );
   10.17 -
   10.18 -    return ret;
   10.19 -}
   10.20 -
   10.21 -static inline int
   10.22  HYPERVISOR_dom_mem_op(
   10.23      unsigned int op, unsigned long *extent_list,
   10.24      unsigned long nr_extents, unsigned int extent_order)
    11.1 --- a/netbsd-2.0-xen-sparse/sys/arch/xen/include/hypervisor.h	Mon May 16 10:36:52 2005 +0000
    11.2 +++ b/netbsd-2.0-xen-sparse/sys/arch/xen/include/hypervisor.h	Mon May 16 10:50:02 2005 +0000
    11.3 @@ -354,21 +354,6 @@ HYPERVISOR_update_descriptor(unsigned lo
    11.4  }
    11.5  
    11.6  static inline int
    11.7 -HYPERVISOR_set_fast_trap(int idx)
    11.8 -{
    11.9 -    int ret;
   11.10 -    unsigned long ign1;
   11.11 -
   11.12 -    __asm__ __volatile__ (
   11.13 -        TRAP_INSTR
   11.14 -        : "=a" (ret), "=b" (ign1)
   11.15 -	: "0" (__HYPERVISOR_set_fast_trap), "1" (idx)
   11.16 -	: "memory" );
   11.17 -
   11.18 -    return ret;
   11.19 -}
   11.20 -
   11.21 -static inline int
   11.22  HYPERVISOR_dom_mem_op(unsigned int op, unsigned long *extent_list,
   11.23      unsigned long nr_extents, unsigned int extent_order)
   11.24  {
    12.1 --- a/tools/libxc/xc_linux_build.c	Mon May 16 10:36:52 2005 +0000
    12.2 +++ b/tools/libxc/xc_linux_build.c	Mon May 16 10:50:02 2005 +0000
    12.3 @@ -426,10 +426,6 @@ int xc_linux_build(int xc_handle,
    12.4          ctxt->trap_ctxt[i].cs     = FLAT_KERNEL_CS;
    12.5      }
    12.6  
    12.7 -#if defined(__i386__)
    12.8 -    ctxt->fast_trap_idx = 0;
    12.9 -#endif
   12.10 -
   12.11      /* No LDT. */
   12.12      ctxt->ldt_ents = 0;
   12.13      
    13.1 --- a/tools/libxc/xc_linux_restore.c	Mon May 16 10:36:52 2005 +0000
    13.2 +++ b/tools/libxc/xc_linux_restore.c	Mon May 16 10:50:02 2005 +0000
    13.3 @@ -600,13 +600,12 @@ int xc_linux_restore(int xc_handle, XcIO
    13.4       *  1. user_regs is fine, as Xen checks that on context switch.
    13.5       *  2. fpu_ctxt is fine, as it can't hurt Xen.
    13.6       *  3. trap_ctxt needs the code selectors checked.
    13.7 -     *  4. fast_trap_idx is checked by Xen.
    13.8 -     *  5. ldt base must be page-aligned, no more than 8192 ents, ...
    13.9 -     *  6. gdt already done, and further checking is done by Xen.
   13.10 -     *  7. check that kernel_ss is safe.
   13.11 -     *  8. pt_base is already done.
   13.12 -     *  9. debugregs are checked by Xen.
   13.13 -     *  10. callback code selectors need checking.
   13.14 +     *  4. ldt base must be page-aligned, no more than 8192 ents, ...
   13.15 +     *  5. gdt already done, and further checking is done by Xen.
   13.16 +     *  6. check that kernel_ss is safe.
   13.17 +     *  7. pt_base is already done.
   13.18 +     *  8. debugregs are checked by Xen.
   13.19 +     *  9. callback code selectors need checking.
   13.20       */
   13.21      for ( i = 0; i < 256; i++ )
   13.22      {
    14.1 --- a/tools/libxc/xc_plan9_build.c	Mon May 16 10:36:52 2005 +0000
    14.2 +++ b/tools/libxc/xc_plan9_build.c	Mon May 16 10:50:02 2005 +0000
    14.3 @@ -510,10 +510,6 @@ xc_plan9_build(int xc_handle,
    14.4  		ctxt->trap_ctxt[i].cs = FLAT_KERNEL_CS;
    14.5  	}
    14.6  
    14.7 -#if defined(__i386__)
    14.8 -	ctxt->fast_trap_idx = 0;
    14.9 -#endif
   14.10 -
   14.11  	/* No LDT. */
   14.12  	ctxt->ldt_ents = 0;
   14.13  
    15.1 --- a/tools/libxc/xc_vmx_build.c	Mon May 16 10:36:52 2005 +0000
    15.2 +++ b/tools/libxc/xc_vmx_build.c	Mon May 16 10:50:02 2005 +0000
    15.3 @@ -591,10 +591,6 @@ int xc_vmx_build(int xc_handle,
    15.4          ctxt->trap_ctxt[i].cs     = FLAT_KERNEL_CS;
    15.5      }
    15.6  
    15.7 -#if defined(__i386__)
    15.8 -    ctxt->fast_trap_idx = 0;
    15.9 -#endif
   15.10 -
   15.11      /* No LDT. */
   15.12      ctxt->ldt_ents = 0;
   15.13      
    16.1 --- a/xen/arch/x86/dom0_ops.c	Mon May 16 10:36:52 2005 +0000
    16.2 +++ b/xen/arch/x86/dom0_ops.c	Mon May 16 10:50:02 2005 +0000
    16.3 @@ -406,12 +406,6 @@ void arch_getdomaininfo_ctxt(
    16.4          c->flags |= VGCF_VMX_GUEST;
    16.5  #endif
    16.6  
    16.7 -#ifdef ARCH_HAS_FAST_TRAP
    16.8 -    if ( (ed->arch.fast_trap_desc.a == 0) &&
    16.9 -         (ed->arch.fast_trap_desc.b == 0) )
   16.10 -        c->fast_trap_idx = 0;
   16.11 -#endif
   16.12 -
   16.13      c->gdt_ents = 0;
   16.14      if ( GET_GDT_ADDRESS(ed) == GDT_VIRT_START(ed) )
   16.15      {
    17.1 --- a/xen/arch/x86/domain.c	Mon May 16 10:36:52 2005 +0000
    17.2 +++ b/xen/arch/x86/domain.c	Mon May 16 10:50:02 2005 +0000
    17.3 @@ -242,8 +242,6 @@ void arch_do_createdomain(struct exec_do
    17.4  {
    17.5      struct domain *d = ed->domain;
    17.6  
    17.7 -    SET_DEFAULT_FAST_TRAP(&ed->arch);
    17.8 -
    17.9      ed->arch.flags = TF_kernel_mode;
   17.10  
   17.11      if ( d->domain_id != IDLE_DOMAIN_ID )
   17.12 @@ -422,9 +420,6 @@ int arch_set_info_guest(
   17.13      if ( test_bit(_VCPUF_initialised, &ed->vcpu_flags) )
   17.14          return 0;
   17.15  
   17.16 -    if ( (rc = (int)set_fast_trap(ed, c->fast_trap_idx)) != 0 )
   17.17 -        return rc;
   17.18 -
   17.19      memset(ed->arch.guest_context.debugreg, 0,
   17.20             sizeof(ed->arch.guest_context.debugreg));
   17.21      for ( i = 0; i < 8; i++ )
   17.22 @@ -726,7 +721,6 @@ static void __context_switch(void)
   17.23                 stack_regs, 
   17.24                 CTXT_SWITCH_STACK_BYTES);
   17.25          unlazy_fpu(p);
   17.26 -        CLEAR_FAST_TRAP(&p->arch);
   17.27          save_segments(p);
   17.28      }
   17.29  
   17.30 @@ -750,7 +744,7 @@ static void __context_switch(void)
   17.31  
   17.32          if ( !VMX_DOMAIN(n) )
   17.33          {
   17.34 -            SET_FAST_TRAP(&n->arch);
   17.35 +            set_int80_direct_trap(n);
   17.36              switch_kernel_stack(n, cpu);
   17.37          }
   17.38      }
    18.1 --- a/xen/arch/x86/traps.c	Mon May 16 10:36:52 2005 +0000
    18.2 +++ b/xen/arch/x86/traps.c	Mon May 16 10:50:02 2005 +0000
    18.3 @@ -1176,7 +1176,11 @@ long do_set_trap_table(trap_info_t *trap
    18.4              break;
    18.5          }
    18.6  
    18.7 -        memcpy(dst+cur.vector, &cur, sizeof(cur));
    18.8 +        memcpy(&dst[cur.vector], &cur, sizeof(cur));
    18.9 +
   18.10 +        if ( cur.vector == 0x80 )
   18.11 +            init_int80_direct_trap(current);
   18.12 +
   18.13          traps++;
   18.14      }
   18.15  
    19.1 --- a/xen/arch/x86/x86_32/entry.S	Mon May 16 10:36:52 2005 +0000
    19.2 +++ b/xen/arch/x86/x86_32/entry.S	Mon May 16 10:50:02 2005 +0000
    19.3 @@ -729,7 +729,7 @@ ENTRY(hypercall_table)
    19.4          .long do_set_debugreg
    19.5          .long do_get_debugreg
    19.6          .long do_update_descriptor  /* 10 */
    19.7 -        .long do_set_fast_trap
    19.8 +        .long do_ni_hypercall
    19.9          .long do_dom_mem_op
   19.10          .long do_multicall
   19.11          .long do_update_va_mapping
    20.1 --- a/xen/arch/x86/x86_32/traps.c	Mon May 16 10:36:52 2005 +0000
    20.2 +++ b/xen/arch/x86/x86_32/traps.c	Mon May 16 10:50:02 2005 +0000
    20.3 @@ -12,7 +12,7 @@
    20.4  #include <asm/vmx.h>
    20.5  #endif
    20.6  
    20.7 -/* All CPUs have their own IDT to allow set_fast_trap(). */
    20.8 +/* All CPUs have their own IDT to allow int80 direct trap. */
    20.9  idt_entry_t *idt_tables[NR_CPUS] = { 0 };
   20.10  
   20.11  void show_registers(struct cpu_user_regs *regs)
   20.12 @@ -184,50 +184,23 @@ void __init percpu_traps_init(void)
   20.13      set_task_gate(TRAP_double_fault, __DOUBLEFAULT_TSS_ENTRY<<3);
   20.14  }
   20.15  
   20.16 -long set_fast_trap(struct exec_domain *p, int idx)
   20.17 +void init_int80_direct_trap(struct exec_domain *ed)
   20.18  {
   20.19 -    trap_info_t *ti;
   20.20 -
   20.21 -    /* Index 0 is special: it disables fast traps. */
   20.22 -    if ( idx == 0 )
   20.23 -    {
   20.24 -        if ( p == current )
   20.25 -            CLEAR_FAST_TRAP(&p->arch);
   20.26 -        SET_DEFAULT_FAST_TRAP(&p->arch);
   20.27 -        return 0;
   20.28 -    }
   20.29 -
   20.30 -    /* We only fast-trap vector 0x80 (used by Linux and the BSD variants). */
   20.31 -    if ( idx != 0x80 )
   20.32 -        return -1;
   20.33 -
   20.34 -    ti = &p->arch.guest_context.trap_ctxt[idx];
   20.35 +    trap_info_t *ti = &ed->arch.guest_context.trap_ctxt[0x80];
   20.36  
   20.37      /*
   20.38       * We can't virtualise interrupt gates, as there's no way to get
   20.39       * the CPU to automatically clear the events_mask variable.
   20.40       */
   20.41      if ( TI_GET_IF(ti) )
   20.42 -        return -1;
   20.43 -
   20.44 -    if ( p == current )
   20.45 -        CLEAR_FAST_TRAP(&p->arch);
   20.46 -
   20.47 -    p->arch.guest_context.fast_trap_idx = idx;
   20.48 -    p->arch.fast_trap_desc.a = (ti->cs << 16) | (ti->address & 0xffff);
   20.49 -    p->arch.fast_trap_desc.b = 
   20.50 -        (ti->address & 0xffff0000) | 0x8f00 | (TI_GET_DPL(ti)&3)<<13;
   20.51 +        return;
   20.52  
   20.53 -    if ( p == current )
   20.54 -        SET_FAST_TRAP(&p->arch);
   20.55 +    ed->arch.int80_desc.a = (ti->cs << 16) | (ti->address & 0xffff);
   20.56 +    ed->arch.int80_desc.b =
   20.57 +        (ti->address & 0xffff0000) | 0x8f00 | ((TI_GET_DPL(ti) & 3) << 13);
   20.58  
   20.59 -    return 0;
   20.60 -}
   20.61 -
   20.62 -
   20.63 -long do_set_fast_trap(int idx)
   20.64 -{
   20.65 -    return set_fast_trap(current, idx);
   20.66 +    if ( ed == current )
   20.67 +        set_int80_direct_trap(ed);
   20.68  }
   20.69  
   20.70  long do_set_callbacks(unsigned long event_selector,
    21.1 --- a/xen/include/asm-x86/domain.h	Mon May 16 10:36:52 2005 +0000
    21.2 +++ b/xen/include/asm-x86/domain.h	Mon May 16 10:50:02 2005 +0000
    21.3 @@ -17,7 +17,7 @@ struct trap_bounce {
    21.4  struct arch_domain
    21.5  {
    21.6      l1_pgentry_t *mm_perdomain_pt;
    21.7 -#ifdef __x86_64__
    21.8 +#ifdef CONFIG_X86_64
    21.9      l2_pgentry_t *mm_perdomain_l2;
   21.10      l3_pgentry_t *mm_perdomain_l3;
   21.11  #endif
   21.12 @@ -82,9 +82,8 @@ struct arch_exec_domain
   21.13      int iobmp_limit;  /* Number of ports represented in the bitmap.  */
   21.14      int iopl;         /* Current IOPL for this VCPU. */
   21.15  
   21.16 -    /* Trap info. */
   21.17 -#ifdef ARCH_HAS_FAST_TRAP
   21.18 -    struct desc_struct fast_trap_desc;
   21.19 +#ifdef CONFIG_X86_32
   21.20 +    struct desc_struct int80_desc;
   21.21  #endif
   21.22  
   21.23      /* Virtual Machine Extensions */
   21.24 @@ -106,7 +105,7 @@ struct arch_exec_domain
   21.25      l2_pgentry_t *monitor_vtable;		/* virtual address of monitor_table */
   21.26      l1_pgentry_t *hl2_vtable;			/* virtual address of hl2_table */
   21.27  
   21.28 -#ifdef __x86_64__
   21.29 +#ifdef CONFIG_X86_64
   21.30      l3_pgentry_t *guest_vl3table;
   21.31      l4_pgentry_t *guest_vl4table;
   21.32  #endif
    22.1 --- a/xen/include/asm-x86/processor.h	Mon May 16 10:36:52 2005 +0000
    22.2 +++ b/xen/include/asm-x86/processor.h	Mon May 16 10:50:02 2005 +0000
    22.3 @@ -374,31 +374,17 @@ extern idt_entry_t *idt_tables[];
    22.4  
    22.5  extern struct tss_struct init_tss[NR_CPUS];
    22.6  
    22.7 -#ifdef ARCH_HAS_FAST_TRAP
    22.8 -
    22.9 -#define SET_DEFAULT_FAST_TRAP(_p) \
   22.10 -    (_p)->guest_context.fast_trap_idx = 0x30;   \
   22.11 -    (_p)->fast_trap_desc.a = 0;   \
   22.12 -    (_p)->fast_trap_desc.b = 0;
   22.13 +#ifdef CONFIG_X86_32
   22.14  
   22.15 -#define CLEAR_FAST_TRAP(_p) \
   22.16 -    (memset(idt_tables[smp_processor_id()] + \
   22.17 -            (_p)->guest_context.fast_trap_idx, \
   22.18 -            0, 8))
   22.19 -
   22.20 -#define SET_FAST_TRAP(_p)   \
   22.21 -    (memcpy(idt_tables[smp_processor_id()] + \
   22.22 -            (_p)->guest_context.fast_trap_idx, \
   22.23 -            &((_p)->fast_trap_desc), 8))
   22.24 -
   22.25 -long set_fast_trap(struct exec_domain *p, int idx);
   22.26 +extern void init_int80_direct_trap(struct exec_domain *ed);
   22.27 +#define set_int80_direct_trap(_ed)                  \
   22.28 +    (memcpy(idt_tables[(_ed)->processor] + 0x80,    \
   22.29 +            &((_ed)->arch.int80_desc), 8))
   22.30  
   22.31  #else
   22.32  
   22.33 -#define SET_DEFAULT_FAST_TRAP(_p) ((void)0)
   22.34 -#define CLEAR_FAST_TRAP(_p)       ((void)0)
   22.35 -#define SET_FAST_TRAP(_p)         ((void)0)
   22.36 -#define set_fast_trap(_p, _i)     (0)
   22.37 +#define init_int80_direct_trap(_ed) ((void)0)
   22.38 +#define set_int80_direct_trap(_ed)  ((void)0)
   22.39  
   22.40  #endif
   22.41  
    23.1 --- a/xen/include/public/arch-x86_32.h	Mon May 16 10:36:52 2005 +0000
    23.2 +++ b/xen/include/public/arch-x86_32.h	Mon May 16 10:50:02 2005 +0000
    23.3 @@ -133,7 +133,6 @@ typedef struct vcpu_guest_context {
    23.4      struct { char x[512]; } fpu_ctxt        /* User-level FPU registers     */
    23.5      __attribute__((__aligned__(16)));       /* (needs 16-byte alignment)    */
    23.6      trap_info_t   trap_ctxt[256];           /* Virtual IDT                  */
    23.7 -    unsigned int  fast_trap_idx;            /* "Fast trap" vector offset    */
    23.8      unsigned long ldt_base, ldt_ents;       /* LDT (linear address, # ents) */
    23.9      unsigned long gdt_frames[16], gdt_ents; /* GDT (machine frames, # ents) */
   23.10      unsigned long kernel_ss, kernel_sp;     /* Virtual TSS (only SS1/SP1)   */
   23.11 @@ -154,8 +153,6 @@ typedef struct {
   23.12  typedef struct {
   23.13  } arch_vcpu_info_t;
   23.14  
   23.15 -#define ARCH_HAS_FAST_TRAP
   23.16 -
   23.17  #endif
   23.18  
   23.19  #endif
    24.1 --- a/xen/include/public/dom0_ops.h	Mon May 16 10:36:52 2005 +0000
    24.2 +++ b/xen/include/public/dom0_ops.h	Mon May 16 10:50:02 2005 +0000
    24.3 @@ -19,7 +19,7 @@
    24.4   * This makes sure that old versions of dom0 tools will stop working in a
    24.5   * well-defined way (rather than crashing the machine, for instance).
    24.6   */
    24.7 -#define DOM0_INTERFACE_VERSION   0xAAAA1005
    24.8 +#define DOM0_INTERFACE_VERSION   0xAAAA1006
    24.9  
   24.10  /************************************************************************/
   24.11  
    25.1 --- a/xen/include/public/xen.h	Mon May 16 10:36:52 2005 +0000
    25.2 +++ b/xen/include/public/xen.h	Mon May 16 10:50:02 2005 +0000
    25.3 @@ -42,7 +42,6 @@
    25.4  #define __HYPERVISOR_set_debugreg          8
    25.5  #define __HYPERVISOR_get_debugreg          9
    25.6  #define __HYPERVISOR_update_descriptor    10
    25.7 -#define __HYPERVISOR_set_fast_trap        11 /* x86/32 only */
    25.8  #define __HYPERVISOR_dom_mem_op           12
    25.9  #define __HYPERVISOR_multicall            13
   25.10  #define __HYPERVISOR_update_va_mapping    14