direct-io.hg
changeset 1160:687886732fd0
bitkeeper revision 1.778.1.1 (40502370V4WBJ27H6luInkhjjlnUBA)
traps.c, pdb-stub.c:
Enable interrupts in exception handlers.
traps.c, pdb-stub.c:
Enable interrupts in exception handlers.
author | kaf24@scramble.cl.cam.ac.uk |
---|---|
date | Thu Mar 11 08:29:36 2004 +0000 (2004-03-11) |
parents | 3a610b209872 |
children | f512e09a64c0 |
files | xen/arch/i386/pdb-stub.c xen/arch/i386/traps.c |
line diff
1.1 --- a/xen/arch/i386/pdb-stub.c Wed Mar 10 18:19:16 2004 +0000 1.2 +++ b/xen/arch/i386/pdb-stub.c Thu Mar 11 08:29:36 2004 +0000 1.3 @@ -29,7 +29,7 @@ static int pdb_stepping = 0; 1.4 1.5 void pdb_put_packet (unsigned char *buffer, int ack); 1.6 1.7 -static int pdb_initialized = 0; 1.8 +int pdb_initialized = 0; 1.9 static int pdb_serhnd = -1; 1.10 1.11 #define RX_SIZE 32
2.1 --- a/xen/arch/i386/traps.c Wed Mar 10 18:19:16 2004 +0000 2.2 +++ b/xen/arch/i386/traps.c Thu Mar 11 08:29:36 2004 +0000 2.3 @@ -196,6 +196,8 @@ static inline void do_trap(int trapnr, c 2.4 trap_info_t *ti; 2.5 unsigned long fixup; 2.6 2.7 + __sti(); 2.8 + 2.9 if (!(regs->xcs & 3)) 2.10 goto fault_in_hypervisor; 2.11 2.12 @@ -257,6 +259,8 @@ asmlinkage void do_int3(struct pt_regs * 2.13 struct guest_trap_bounce *gtb = guest_trap_bounce+smp_processor_id(); 2.14 trap_info_t *ti; 2.15 2.16 + __sti(); 2.17 + 2.18 if ( (regs->xcs & 3) != 3 ) 2.19 { 2.20 if ( pdb_handle_exception(3, regs) == 0 ) 2.21 @@ -323,6 +327,8 @@ asmlinkage void do_page_fault(struct pt_ 2.22 2.23 __asm__ __volatile__ ("movl %%cr2,%0" : "=r" (addr) : ); 2.24 2.25 + __sti(); 2.26 + 2.27 if ( unlikely(addr >= LDT_VIRT_START) && 2.28 (addr < (LDT_VIRT_START + (p->mm.ldt_ents*LDT_ENTRY_SIZE))) ) 2.29 { 2.30 @@ -390,6 +396,8 @@ asmlinkage void do_general_protection(st 2.31 trap_info_t *ti; 2.32 unsigned long fixup; 2.33 2.34 + __sti(); 2.35 + 2.36 /* Badness if error in ring 0, or result of an interrupt. */ 2.37 if ( !(regs->xcs & 3) || (error_code & 1) ) 2.38 goto gp_in_kernel; 2.39 @@ -498,6 +506,8 @@ asmlinkage void math_state_restore(struc 2.40 /* Prevent recursion. */ 2.41 clts(); 2.42 2.43 + __sti(); 2.44 + 2.45 if ( !test_bit(PF_USEDFPU, ¤t->flags) ) 2.46 { 2.47 if ( test_bit(PF_DONEFPUINIT, ¤t->flags) ) 2.48 @@ -516,36 +526,13 @@ asmlinkage void math_state_restore(struc 2.49 } 2.50 } 2.51 2.52 -asmlinkage void do_debug(struct pt_regs * regs, long error_code) 2.53 +asmlinkage void do_debug_orig(struct pt_regs *regs, long error_code) 2.54 { 2.55 unsigned int condition; 2.56 struct task_struct *tsk = current; 2.57 struct guest_trap_bounce *gtb = guest_trap_bounce+smp_processor_id(); 2.58 2.59 - __asm__ __volatile__("movl %%db6,%0" : "=r" (condition)); 2.60 - 2.61 - if ((condition & (1 << 14)) != (1 << 14)) 2.62 - { 2.63 - printk ("\nwarning: debug trap w/o BS bit [0x%x]\n\n", condition); 2.64 - } 2.65 - __asm__("movl %0,%%db6" : : "r" (0)); 2.66 - 2.67 - if ( pdb_handle_exception(1, regs) != 0 ) 2.68 - { 2.69 - tsk->thread.debugreg[6] = condition; 2.70 - 2.71 - gtb->flags = GTBF_TRAP_NOCODE; 2.72 - gtb->cs = tsk->thread.traps[1].cs; 2.73 - gtb->eip = tsk->thread.traps[1].address; 2.74 - } 2.75 -} 2.76 - 2.77 - 2.78 -asmlinkage void do_debug_orig(struct pt_regs * regs, long error_code) 2.79 -{ 2.80 - unsigned int condition; 2.81 - struct task_struct *tsk = current; 2.82 - struct guest_trap_bounce *gtb = guest_trap_bounce+smp_processor_id(); 2.83 + __sti(); 2.84 2.85 __asm__ __volatile__("movl %%db6,%0" : "=r" (condition)); 2.86 2.87 @@ -580,6 +567,37 @@ asmlinkage void do_debug_orig(struct pt_ 2.88 } 2.89 2.90 2.91 +asmlinkage void do_debug(struct pt_regs *regs, long error_code) 2.92 +{ 2.93 + unsigned int condition; 2.94 + struct task_struct *tsk = current; 2.95 + struct guest_trap_bounce *gtb = guest_trap_bounce+smp_processor_id(); 2.96 + 2.97 + /* This handler is broken! Only use it if PDB is enabled. */ 2.98 + if ( !pdb_initialized ) 2.99 + { 2.100 + do_debug_orig(regs, error_code); 2.101 + return; 2.102 + } 2.103 + 2.104 + __sti(); 2.105 + 2.106 + __asm__ __volatile__("movl %%db6,%0" : "=r" (condition)); 2.107 + if ( (condition & (1 << 14)) != (1 << 14) ) 2.108 + printk("\nwarning: debug trap w/o BS bit [0x%x]\n\n", condition); 2.109 + __asm__("movl %0,%%db6" : : "r" (0)); 2.110 + 2.111 + if ( pdb_handle_exception(1, regs) != 0 ) 2.112 + { 2.113 + tsk->thread.debugreg[6] = condition; 2.114 + 2.115 + gtb->flags = GTBF_TRAP_NOCODE; 2.116 + gtb->cs = tsk->thread.traps[1].cs; 2.117 + gtb->eip = tsk->thread.traps[1].address; 2.118 + } 2.119 +} 2.120 + 2.121 + 2.122 asmlinkage void do_spurious_interrupt_bug(struct pt_regs * regs, 2.123 long error_code) 2.124 { /* nothing */ }