ia64/xen-unstable

changeset 3066:d64da6d97856

bitkeeper revision 1.1159.170.52 (419e281dxhj2vE4hBYI-_Ud4rCMAWg)

Merge scramble.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-unstable.bk
into scramble.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-2.0-testing.bk
author kaf24@scramble.cl.cam.ac.uk
date Fri Nov 19 17:06:37 2004 +0000 (2004-11-19)
parents e16455258e29 3db48d067bde
children 296c38890427
files .rootkeys linux-2.6.9-xen-sparse/arch/xen/i386/kernel/irq.c linux-2.6.9-xen-sparse/arch/xen/kernel/Makefile linux-2.6.9-xen-sparse/arch/xen/kernel/empty.c linux-2.6.9-xen-sparse/arch/xen/kernel/evtchn.c xen/arch/x86/memory.c xen/arch/x86/shadow.c xen/arch/x86/traps.c xen/include/asm-x86/debugger.h xen/include/asm-x86/processor.h
line diff
     1.1 --- a/.rootkeys	Fri Nov 19 09:22:30 2004 +0000
     1.2 +++ b/.rootkeys	Fri Nov 19 17:06:37 2004 +0000
     1.3 @@ -169,7 +169,6 @@ 4107adf1WcCgkhsdLTRGX52cOG1vJg linux-2.6
     1.4  4107adf1s5u6249DNPUViX1YNagbUQ linux-2.6.9-xen-sparse/arch/xen/i386/pci/irq.c
     1.5  40f56239zOksGg_H4XD4ye6iZNtoZA linux-2.6.9-xen-sparse/arch/xen/kernel/Makefile
     1.6  40f56239bvOjuuuViZ0XMlNiREFC0A linux-2.6.9-xen-sparse/arch/xen/kernel/ctrl_if.c
     1.7 -40f56239pYRq5yshPTkv3ujXKc8K6g linux-2.6.9-xen-sparse/arch/xen/kernel/empty.c
     1.8  40f56238xFQe9T7M_U_FItM-bZIpLw linux-2.6.9-xen-sparse/arch/xen/kernel/evtchn.c
     1.9  4110f478aeQWllIN7J4kouAHiAqrPw linux-2.6.9-xen-sparse/arch/xen/kernel/fixup.c
    1.10  412dfae9eA3_6e6bCGUtg1mj8b56fQ linux-2.6.9-xen-sparse/arch/xen/kernel/gnttab.c
     2.1 --- a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/irq.c	Fri Nov 19 09:22:30 2004 +0000
     2.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/irq.c	Fri Nov 19 17:06:37 2004 +0000
     2.3 @@ -695,7 +695,6 @@ void free_irq(unsigned int irq, void *de
     2.4  	p = &desc->action;
     2.5  	for (;;) {
     2.6  		struct irqaction * action = *p;
     2.7 -
     2.8  		if (action) {
     2.9  			struct irqaction **pp = p;
    2.10  			p = &action->next;
    2.11 @@ -757,7 +756,7 @@ unsigned long probe_irq_on(void)
    2.12  	 * something may have generated an irq long ago and we want to
    2.13  	 * flush such a longstanding irq before considering it as spurious. 
    2.14  	 */
    2.15 -	for (i = NR_PIRQS-1; i > 0; i--)  {
    2.16 +	for (i = NR_IRQS-1; i > 0; i--)  {
    2.17  		desc = irq_desc + i;
    2.18  
    2.19  		spin_lock_irq(&desc->lock);
    2.20 @@ -775,7 +774,7 @@ unsigned long probe_irq_on(void)
    2.21  	 * (we must startup again here because if a longstanding irq
    2.22  	 * happened in the previous stage, it may have masked itself)
    2.23  	 */
    2.24 -	for (i = NR_PIRQS-1; i > 0; i--) {
    2.25 +	for (i = NR_IRQS-1; i > 0; i--) {
    2.26  		desc = irq_desc + i;
    2.27  
    2.28  		spin_lock_irq(&desc->lock);
    2.29 @@ -797,7 +796,7 @@ unsigned long probe_irq_on(void)
    2.30  	 * Now filter out any obviously spurious interrupts
    2.31  	 */
    2.32  	val = 0;
    2.33 -	for (i = 0; i < NR_PIRQS; i++) {
    2.34 +	for (i = 0; i < NR_IRQS; i++) {
    2.35  		irq_desc_t *desc = irq_desc + i;
    2.36  		unsigned int status;
    2.37  
    2.38 @@ -844,7 +843,7 @@ unsigned int probe_irq_mask(unsigned lon
    2.39  	unsigned int mask;
    2.40  
    2.41  	mask = 0;
    2.42 -	for (i = 0; i < NR_PIRQS; i++) {
    2.43 +	for (i = 0; i < NR_IRQS; i++) {
    2.44  		irq_desc_t *desc = irq_desc + i;
    2.45  		unsigned int status;
    2.46  
    2.47 @@ -894,7 +893,7 @@ int probe_irq_off(unsigned long val)
    2.48  
    2.49  	nr_irqs = 0;
    2.50  	irq_found = 0;
    2.51 -	for (i = 0; i < NR_PIRQS; i++) {
    2.52 +	for (i = 0; i < NR_IRQS; i++) {
    2.53  		irq_desc_t *desc = irq_desc + i;
    2.54  		unsigned int status;
    2.55  
     3.1 --- a/linux-2.6.9-xen-sparse/arch/xen/kernel/Makefile	Fri Nov 19 09:22:30 2004 +0000
     3.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/kernel/Makefile	Fri Nov 19 17:06:37 2004 +0000
     3.3 @@ -9,5 +9,4 @@ XENARCH	:= $(subst ",,$(CONFIG_XENARCH))
     3.4  
     3.5  extra-y += vmlinux.lds
     3.6  
     3.7 -obj-y	:= ctrl_if.o evtchn.o fixup.o reboot.o xen_proc.o empty.o \
     3.8 -           gnttab.o skbuff.o
     3.9 +obj-y	:= ctrl_if.o evtchn.o fixup.o reboot.o xen_proc.o gnttab.o skbuff.o
     4.1 --- a/linux-2.6.9-xen-sparse/arch/xen/kernel/empty.c	Fri Nov 19 09:22:30 2004 +0000
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,44 +0,0 @@
     4.4 -
     4.5 -#include <linux/string.h>
     4.6 -#include <asm-xen/hypervisor.h>
     4.7 -
     4.8 -#if 0
     4.9 -static __inline__ int HYPERVISOR_console_write(const char *str, int count)
    4.10 -{
    4.11 -	int ret;
    4.12 -	__asm__ __volatile__ (
    4.13 -		TRAP_INSTR
    4.14 -		: "=a" (ret) : "0" (__HYPERVISOR_console_write), 
    4.15 -		"b" (str), "c" (count) : "memory" );
    4.16 -
    4.17 -
    4.18 -	return ret;
    4.19 -}
    4.20 -#endif
    4.21 -
    4.22 -#if 01
    4.23 -void
    4.24 -xen_puts(const char *str)
    4.25 -{
    4.26 -
    4.27 -	(void)HYPERVISOR_console_io(CONSOLEIO_write, strlen(str), (char *)str);
    4.28 -}
    4.29 -
    4.30 -asmlinkage int CLPRINTK(const char *fmt, ...)
    4.31 -{
    4.32 -	va_list args;
    4.33 -	int printk_len;
    4.34 -	static char printk_buf[1024+1];
    4.35 -    
    4.36 -	/* Emit the output into the temporary buffer */
    4.37 -	va_start(args, fmt);
    4.38 -	printk_len = vsnprintf(printk_buf, sizeof(printk_buf)-1, fmt, args);
    4.39 -	va_end(args);
    4.40 -
    4.41 -	printk_buf[printk_len] = 0;
    4.42 -	/* Send the processed output directly to Xen. */
    4.43 -	(void)HYPERVISOR_console_io(CONSOLEIO_write, printk_len, printk_buf);
    4.44 -
    4.45 -	return 0;
    4.46 -}
    4.47 -#endif
     5.1 --- a/linux-2.6.9-xen-sparse/arch/xen/kernel/evtchn.c	Fri Nov 19 09:22:30 2004 +0000
     5.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/kernel/evtchn.c	Fri Nov 19 17:06:37 2004 +0000
     5.3 @@ -70,7 +70,7 @@ static unsigned long pirq_needs_unmask_n
     5.4  /* Upcall to generic IRQ layer. */
     5.5  extern asmlinkage unsigned int do_IRQ(int irq, struct pt_regs *regs);
     5.6  
     5.7 -#define VALID_EVTCHN(_chn) ((_chn) != -1)
     5.8 +#define VALID_EVTCHN(_chn) ((_chn) >= 0)
     5.9  
    5.10  /*
    5.11   * Force a proper event-channel callback from Xen after clearing the
    5.12 @@ -229,35 +229,51 @@ void unbind_evtchn_from_irq(int evtchn)
    5.13  
    5.14  static unsigned int startup_dynirq(unsigned int irq)
    5.15  {
    5.16 -    unmask_evtchn(irq_to_evtchn[irq]);
    5.17 +    int evtchn = irq_to_evtchn[irq];
    5.18 +
    5.19 +    if ( !VALID_EVTCHN(evtchn) )
    5.20 +        return 0;
    5.21 +    unmask_evtchn(evtchn);
    5.22      return 0;
    5.23  }
    5.24  
    5.25  static void shutdown_dynirq(unsigned int irq)
    5.26  {
    5.27 -    mask_evtchn(irq_to_evtchn[irq]);
    5.28 +    int evtchn = irq_to_evtchn[irq];
    5.29 +
    5.30 +    if ( !VALID_EVTCHN(evtchn) )
    5.31 +        return;
    5.32 +    mask_evtchn(evtchn);
    5.33  }
    5.34  
    5.35  static void enable_dynirq(unsigned int irq)
    5.36  {
    5.37 -    unmask_evtchn(irq_to_evtchn[irq]);
    5.38 +    int evtchn = irq_to_evtchn[irq];
    5.39 +
    5.40 +    unmask_evtchn(evtchn);
    5.41  }
    5.42  
    5.43  static void disable_dynirq(unsigned int irq)
    5.44  {
    5.45 -    mask_evtchn(irq_to_evtchn[irq]);
    5.46 +    int evtchn = irq_to_evtchn[irq];
    5.47 +
    5.48 +    mask_evtchn(evtchn);
    5.49  }
    5.50  
    5.51  static void ack_dynirq(unsigned int irq)
    5.52  {
    5.53 -    mask_evtchn(irq_to_evtchn[irq]);
    5.54 -    clear_evtchn(irq_to_evtchn[irq]);
    5.55 +    int evtchn = irq_to_evtchn[irq];
    5.56 +
    5.57 +    mask_evtchn(evtchn);
    5.58 +    clear_evtchn(evtchn);
    5.59  }
    5.60  
    5.61  static void end_dynirq(unsigned int irq)
    5.62  {
    5.63 +    int evtchn = irq_to_evtchn[irq];
    5.64 +
    5.65      if ( !(irq_desc[irq].status & IRQ_DISABLED) )
    5.66 -        unmask_evtchn(irq_to_evtchn[irq]);
    5.67 +        unmask_evtchn(evtchn);
    5.68  }
    5.69  
    5.70  static struct hw_interrupt_type dynirq_type = {
     6.1 --- a/xen/arch/x86/memory.c	Fri Nov 19 09:22:30 2004 +0000
     6.2 +++ b/xen/arch/x86/memory.c	Fri Nov 19 17:06:37 2004 +0000
     6.3 @@ -1809,8 +1809,7 @@ int ptwr_do_page_fault(unsigned long add
     6.4          domain_crash();
     6.5      }
     6.6      
     6.7 -    /* Maybe fall through to shadow mode to propagate writable L1. */
     6.8 -    return !current->mm.shadow_mode;
     6.9 +    return EXCRET_fault_fixed;
    6.10  }
    6.11  
    6.12  static __init int ptwr_init(void)
     7.1 --- a/xen/arch/x86/shadow.c	Fri Nov 19 09:22:30 2004 +0000
     7.2 +++ b/xen/arch/x86/shadow.c	Fri Nov 19 17:06:37 2004 +0000
     7.3 @@ -636,7 +636,7 @@ int shadow_fault(unsigned long va, long 
     7.4      shadow_unlock(m);
     7.5  
     7.6      check_pagetable(m, current->mm.pagetable, "post-sf");
     7.7 -    return 1;
     7.8 +    return EXCRET_fault_fixed;
     7.9  }
    7.10  
    7.11  
     8.1 --- a/xen/arch/x86/traps.c	Fri Nov 19 09:22:30 2004 +0000
     8.2 +++ b/xen/arch/x86/traps.c	Fri Nov 19 17:06:37 2004 +0000
     8.3 @@ -228,7 +228,7 @@ asmlinkage void fatal_trap(int trapnr, s
     8.4          __asm__ __volatile__ ( "hlt" );
     8.5  }
     8.6  
     8.7 -static inline void do_trap(int trapnr, char *str,
     8.8 +static inline int do_trap(int trapnr, char *str,
     8.9                             struct xen_regs *regs, 
    8.10                             long error_code, int use_error_code)
    8.11  {
    8.12 @@ -249,7 +249,7 @@ static inline void do_trap(int trapnr, c
    8.13      tb->eip        = ti->address;
    8.14      if ( TI_GET_IF(ti) )
    8.15          d->shared_info->vcpu_data[0].evtchn_upcall_mask = 1;
    8.16 -    return; 
    8.17 +    return 0;
    8.18  
    8.19   xen_fault:
    8.20  
    8.21 @@ -257,7 +257,7 @@ static inline void do_trap(int trapnr, c
    8.22      {
    8.23          DPRINTK("Trap %d: %08lx -> %08lx\n", trapnr, regs->eip, fixup);
    8.24          regs->eip = fixup;
    8.25 -        return;
    8.26 +        return 0;
    8.27      }
    8.28  
    8.29      DEBUGGER_trap_fatal(trapnr, regs, error_code);
    8.30 @@ -266,18 +266,19 @@ static inline void do_trap(int trapnr, c
    8.31      panic("CPU%d FATAL TRAP: vector = %d (%s)\n"
    8.32            "[error_code=%08x]\n",
    8.33            smp_processor_id(), trapnr, str, error_code);
    8.34 +    return 0;
    8.35  }
    8.36  
    8.37  #define DO_ERROR_NOCODE(trapnr, str, name) \
    8.38 -asmlinkage void do_##name(struct xen_regs * regs, long error_code) \
    8.39 +asmlinkage int do_##name(struct xen_regs * regs, long error_code) \
    8.40  { \
    8.41 -    do_trap(trapnr, str, regs, error_code, 0); \
    8.42 +    return do_trap(trapnr, str, regs, error_code, 0); \
    8.43  }
    8.44  
    8.45  #define DO_ERROR(trapnr, str, name) \
    8.46 -asmlinkage void do_##name(struct xen_regs * regs, long error_code) \
    8.47 +asmlinkage int do_##name(struct xen_regs * regs, long error_code) \
    8.48  { \
    8.49 -    do_trap(trapnr, str, regs, error_code, 1); \
    8.50 +    return do_trap(trapnr, str, regs, error_code, 1); \
    8.51  }
    8.52  
    8.53  DO_ERROR_NOCODE( 0, "divide error", divide_error)
    8.54 @@ -292,7 +293,7 @@ DO_ERROR_NOCODE(16, "fpu error", coproce
    8.55  DO_ERROR(17, "alignment check", alignment_check)
    8.56  DO_ERROR_NOCODE(19, "simd error", simd_coprocessor_error)
    8.57  
    8.58 -asmlinkage void do_int3(struct xen_regs *regs, long error_code)
    8.59 +asmlinkage int do_int3(struct xen_regs *regs, long error_code)
    8.60  {
    8.61      struct domain *d = current;
    8.62      struct trap_bounce *tb = &d->thread.trap_bounce;
    8.63 @@ -316,6 +317,8 @@ asmlinkage void do_int3(struct xen_regs 
    8.64      tb->eip        = ti->address;
    8.65      if ( TI_GET_IF(ti) )
    8.66          d->shared_info->vcpu_data[0].evtchn_upcall_mask = 1;
    8.67 +
    8.68 +    return 0;
    8.69  }
    8.70  
    8.71  asmlinkage void do_double_fault(void)
    8.72 @@ -355,7 +358,7 @@ asmlinkage void do_machine_check(struct 
    8.73      fatal_trap(TRAP_machine_check, regs, error_code);
    8.74  }
    8.75  
    8.76 -asmlinkage void do_page_fault(struct xen_regs *regs, long error_code)
    8.77 +asmlinkage int do_page_fault(struct xen_regs *regs, long error_code)
    8.78  {
    8.79      trap_info_t *ti;
    8.80      unsigned long off, addr, fixup;
    8.81 @@ -377,18 +380,22 @@ asmlinkage void do_page_fault(struct xen
    8.82                        ptwr_info[cpu].ptinfo[PTWR_PT_ACTIVE].l2_idx) )
    8.83          {
    8.84              ptwr_flush(PTWR_PT_ACTIVE);
    8.85 -            return;
    8.86 +            return EXCRET_fault_fixed;
    8.87          }
    8.88  
    8.89          if ( (addr < PAGE_OFFSET) &&
    8.90               ((error_code & 3) == 3) && /* write-protection fault */
    8.91               ptwr_do_page_fault(addr) )
    8.92 -            return;
    8.93 +        {
    8.94 +            if ( unlikely(d->mm.shadow_mode) )
    8.95 +                (void)shadow_fault(addr, error_code);
    8.96 +            return EXCRET_fault_fixed;
    8.97 +        }
    8.98      }
    8.99  
   8.100      if ( unlikely(d->mm.shadow_mode) && 
   8.101           (addr < PAGE_OFFSET) && shadow_fault(addr, error_code) )
   8.102 -        return; /* Returns TRUE if fault was handled. */
   8.103 +        return EXCRET_fault_fixed;
   8.104  
   8.105      if ( unlikely(addr >= LDT_VIRT_START) && 
   8.106           (addr < (LDT_VIRT_START + (d->mm.ldt_ents*LDT_ENTRY_SIZE))) )
   8.107 @@ -400,7 +407,7 @@ asmlinkage void do_page_fault(struct xen
   8.108          off  = addr - LDT_VIRT_START;
   8.109          addr = d->mm.ldt_base + off;
   8.110          if ( likely(map_ldt_shadow_page(off >> PAGE_SHIFT)) )
   8.111 -            return; /* successfully copied the mapping */
   8.112 +            return EXCRET_fault_fixed; /* successfully copied the mapping */
   8.113      }
   8.114  
   8.115      if ( unlikely(!(regs->cs & 3)) )
   8.116 @@ -414,7 +421,7 @@ asmlinkage void do_page_fault(struct xen
   8.117      tb->eip        = ti->address;
   8.118      if ( TI_GET_IF(ti) )
   8.119          d->shared_info->vcpu_data[0].evtchn_upcall_mask = 1;
   8.120 -    return; 
   8.121 +    return 0; 
   8.122  
   8.123   xen_fault:
   8.124  
   8.125 @@ -424,7 +431,7 @@ asmlinkage void do_page_fault(struct xen
   8.126          if ( !d->mm.shadow_mode )
   8.127              DPRINTK("Page fault: %08lx -> %08lx\n", regs->eip, fixup);
   8.128          regs->eip = fixup;
   8.129 -        return;
   8.130 +        return 0;
   8.131      }
   8.132  
   8.133      DEBUGGER_trap_fatal(TRAP_page_fault, regs, error_code);
   8.134 @@ -451,9 +458,10 @@ asmlinkage void do_page_fault(struct xen
   8.135            "[error_code=%08x]\n"
   8.136            "Faulting linear address might be %08lx\n",
   8.137            smp_processor_id(), error_code, addr);
   8.138 +    return 0;
   8.139  }
   8.140  
   8.141 -asmlinkage void do_general_protection(struct xen_regs *regs, long error_code)
   8.142 +asmlinkage int do_general_protection(struct xen_regs *regs, long error_code)
   8.143  {
   8.144      struct domain *d = current;
   8.145      struct trap_bounce *tb = &d->thread.trap_bounce;
   8.146 @@ -502,7 +510,7 @@ asmlinkage void do_general_protection(st
   8.147      if ( VM_ASSIST(d, VMASST_TYPE_4gb_segments) && 
   8.148           (error_code == 0) && 
   8.149           gpf_emulate_4gb(regs) )
   8.150 -        return;
   8.151 +        return 0;
   8.152  #endif
   8.153  
   8.154      /* Pass on GPF as is. */
   8.155 @@ -514,7 +522,7 @@ asmlinkage void do_general_protection(st
   8.156      tb->eip        = ti->address;
   8.157      if ( TI_GET_IF(ti) )
   8.158          d->shared_info->vcpu_data[0].evtchn_upcall_mask = 1;
   8.159 -    return;
   8.160 +    return 0;
   8.161  
   8.162   gp_in_kernel:
   8.163  
   8.164 @@ -522,7 +530,7 @@ asmlinkage void do_general_protection(st
   8.165      {
   8.166          DPRINTK("GPF (%04lx): %08lx -> %08lx\n", error_code, regs->eip, fixup);
   8.167          regs->eip = fixup;
   8.168 -        return;
   8.169 +        return 0;
   8.170      }
   8.171  
   8.172      DEBUGGER_trap_fatal(TRAP_gp_fault, regs, error_code);
   8.173 @@ -530,6 +538,7 @@ asmlinkage void do_general_protection(st
   8.174      show_registers(regs);
   8.175      panic("CPU%d GENERAL PROTECTION FAULT\n"
   8.176            "[error_code=%08x]\n", smp_processor_id(), error_code);
   8.177 +    return 0;
   8.178  }
   8.179  
   8.180  asmlinkage void mem_parity_error(struct xen_regs *regs)
   8.181 @@ -549,8 +558,6 @@ asmlinkage void io_check_error(struct xe
   8.182  
   8.183  static void unknown_nmi_error(unsigned char reason, struct xen_regs * regs)
   8.184  {
   8.185 -    DEBUGGER_trap_entry(TRAP_nmi, regs, 0);
   8.186 -
   8.187      printk("Uhhuh. NMI received for unknown reason %02x.\n", reason);
   8.188      printk("Dazed and confused, but trying to continue\n");
   8.189      printk("Do you have a strange power saving mode enabled?\n");
   8.190 @@ -581,7 +588,7 @@ static void nmi_softirq(void)
   8.191          send_guest_virq(dom0, VIRQ_IO_ERR);
   8.192  }
   8.193  
   8.194 -asmlinkage void math_state_restore(struct xen_regs *regs, long error_code)
   8.195 +asmlinkage int math_state_restore(struct xen_regs *regs, long error_code)
   8.196  {
   8.197      /* Prevent recursion. */
   8.198      clts();
   8.199 @@ -602,9 +609,11 @@ asmlinkage void math_state_restore(struc
   8.200          tb->cs         = current->thread.traps[7].cs;
   8.201          tb->eip        = current->thread.traps[7].address;
   8.202      }
   8.203 +
   8.204 +    return EXCRET_fault_fixed;
   8.205  }
   8.206  
   8.207 -asmlinkage void do_debug(struct xen_regs *regs, long error_code)
   8.208 +asmlinkage int do_debug(struct xen_regs *regs, long error_code)
   8.209  {
   8.210      unsigned int condition;
   8.211      struct domain *d = current;
   8.212 @@ -619,7 +628,7 @@ asmlinkage void do_debug(struct xen_regs
   8.213           (d->thread.debugreg[7] == 0) )
   8.214      {
   8.215          __asm__("movl %0,%%db7" : : "r" (0));
   8.216 -        return;
   8.217 +        goto out;
   8.218      }
   8.219  
   8.220      if ( (regs->cs & 3) == 0 )
   8.221 @@ -632,7 +641,7 @@ asmlinkage void do_debug(struct xen_regs
   8.222           * on it. No need to bump EIP; the only faulting trap is an instruction
   8.223           * breakpoint, which can't happen to us.
   8.224           */
   8.225 -        return;
   8.226 +        goto out;
   8.227      }
   8.228  
   8.229      /* Save debug status register where guest OS can peek at it */
   8.230 @@ -641,13 +650,16 @@ asmlinkage void do_debug(struct xen_regs
   8.231      tb->flags = TBF_TRAP_NOCODE;
   8.232      tb->cs    = d->thread.traps[1].cs;
   8.233      tb->eip   = d->thread.traps[1].address;
   8.234 +
   8.235 + out:
   8.236 +    return EXCRET_not_a_fault;
   8.237  }
   8.238  
   8.239 -
   8.240 -asmlinkage void do_spurious_interrupt_bug(struct xen_regs * regs,
   8.241 -                                          long error_code)
   8.242 -{ /* nothing */ }
   8.243 -
   8.244 +asmlinkage int do_spurious_interrupt_bug(
   8.245 +    struct xen_regs * regs, long error_code)
   8.246 +{
   8.247 +    return EXCRET_not_a_fault;
   8.248 +}
   8.249  
   8.250  #define _set_gate(gate_addr,type,dpl,addr) \
   8.251  do { \
     9.1 --- a/xen/include/asm-x86/debugger.h	Fri Nov 19 09:22:30 2004 +0000
     9.2 +++ b/xen/include/asm-x86/debugger.h	Fri Nov 19 17:06:37 2004 +0000
     9.3 @@ -22,33 +22,13 @@
     9.4  #ifndef __X86_DEBUGGER_H__
     9.5  #define __X86_DEBUGGER_H__
     9.6  
     9.7 -/* Avoid magic vector numbers by using these semi-sensical names. */
     9.8 -#define TRAP_divide_error     0
     9.9 -#define TRAP_debug            1
    9.10 -#define TRAP_nmi              2
    9.11 -#define TRAP_int3             3
    9.12 -#define TRAP_overflow         4
    9.13 -#define TRAP_bounds           5
    9.14 -#define TRAP_invalid_op       6
    9.15 -#define TRAP_no_device        7
    9.16 -#define TRAP_double_fault     8
    9.17 -#define TRAP_copro_seg        9
    9.18 -#define TRAP_invalid_tss     10
    9.19 -#define TRAP_no_segment      11
    9.20 -#define TRAP_stack_error     12
    9.21 -#define TRAP_gp_fault        13
    9.22 -#define TRAP_page_fault      14
    9.23 -#define TRAP_spurious_int    15
    9.24 -#define TRAP_copro_error     16
    9.25 -#define TRAP_alignment_check 17
    9.26 -#define TRAP_machine_check   18
    9.27 -#define TRAP_simd_error      19
    9.28 +#include <asm/processor.h>
    9.29  
    9.30  /* The main trap handlers use these helper macros which include early bail. */
    9.31  #define DEBUGGER_trap_entry(_v, _r, _e) \
    9.32 -    if ( debugger_trap_entry(_v, _r, _e) ) return;
    9.33 +    if ( debugger_trap_entry(_v, _r, _e) ) return EXCRET_fault_fixed;
    9.34  #define DEBUGGER_trap_fatal(_v, _r, _e) \
    9.35 -    if ( debugger_trap_fatal(_v, _r, _e) ) return;
    9.36 +    if ( debugger_trap_fatal(_v, _r, _e) ) return EXCRET_fault_fixed;
    9.37  
    9.38  #ifdef XEN_DEBUGGER
    9.39  
    10.1 --- a/xen/include/asm-x86/processor.h	Fri Nov 19 09:22:30 2004 +0000
    10.2 +++ b/xen/include/asm-x86/processor.h	Fri Nov 19 17:06:37 2004 +0000
    10.3 @@ -85,6 +85,39 @@
    10.4  #define X86_CR4_OSXMMEXCPT	0x0400	/* enable unmasked SSE exceptions */
    10.5  
    10.6  /*
    10.7 + * Trap/fault mnemonics.
    10.8 + */
    10.9 +#define TRAP_divide_error     0
   10.10 +#define TRAP_debug            1
   10.11 +#define TRAP_nmi              2
   10.12 +#define TRAP_int3             3
   10.13 +#define TRAP_overflow         4
   10.14 +#define TRAP_bounds           5
   10.15 +#define TRAP_invalid_op       6
   10.16 +#define TRAP_no_device        7
   10.17 +#define TRAP_double_fault     8
   10.18 +#define TRAP_copro_seg        9
   10.19 +#define TRAP_invalid_tss     10
   10.20 +#define TRAP_no_segment      11
   10.21 +#define TRAP_stack_error     12
   10.22 +#define TRAP_gp_fault        13
   10.23 +#define TRAP_page_fault      14
   10.24 +#define TRAP_spurious_int    15
   10.25 +#define TRAP_copro_error     16
   10.26 +#define TRAP_alignment_check 17
   10.27 +#define TRAP_machine_check   18
   10.28 +#define TRAP_simd_error      19
   10.29 +
   10.30 +/*
   10.31 + * Non-fatal fault/trap handlers return an error code to the caller. If the
   10.32 + * code is non-zero, it means that either the exception was not due to a fault
   10.33 + * (i.e., it was a trap) or that the fault has been fixed up so the instruction
   10.34 + * replay ought to succeed.
   10.35 + */
   10.36 +#define EXCRET_not_a_fault 1 /* It was a trap. No instruction replay needed. */
   10.37 +#define EXCRET_fault_fixed 1 /* It was fault that we fixed: try a replay. */
   10.38 +
   10.39 +/*
   10.40   * 'trap_bounce' flags values.
   10.41   */
   10.42  #define TBF_TRAP        1