From: t_jeang Date: Tue, 6 Jan 2009 12:06:06 +0000 (+0000) Subject: imported patch veritas-kdb-xen.patch X-Git-Tag: veritas-kdb-xs-2.6.18.patch X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=631560faa947c9ce8c02e0a9efebaad15c46f429;p=xenclient%2Fkernel.git imported patch veritas-kdb-xen.patch --- diff --git a/arch/i386/kdb/kdba_bt.c b/arch/i386/kdb/kdba_bt.c index 9b0563a9..ebef7217 100644 --- a/arch/i386/kdb/kdba_bt.c +++ b/arch/i386/kdb/kdba_bt.c @@ -837,10 +837,12 @@ kdba_bt_stack(kdb_machreg_t addr, int argcount, const struct task_struct *p) } ss = esp & -THREAD_SIZE; +#if 0 if ((cs & 0xffff) != __KERNEL_CS) { kdb_printf("Stack is not in kernel space, backtrace not available\n"); return 0; } +#endif kdb_printf("ESP EIP Function (args)\n"); diff --git a/arch/i386/kdb/kdba_io.c b/arch/i386/kdb/kdba_io.c index 3324129a..35faeafd 100644 --- a/arch/i386/kdb/kdba_io.c +++ b/arch/i386/kdb/kdba_io.c @@ -22,6 +22,14 @@ #include #include +#if defined(CONFIG_XEN) +#include +#include +#include +#include +#include +#endif + #ifdef CONFIG_VT_CONSOLE #define KDB_BLINK_LED 1 #else @@ -205,6 +213,23 @@ static int get_serial_char(void) } #endif /* CONFIG_SERIAL_CONSOLE */ +#if defined(CONFIG_XEN) +static int get_xen_char(void) +{ + static char rbuf[16]; + + if ((HYPERVISOR_console_io(CONSOLEIO_read, 1, rbuf)) > 0) + { + if (rbuf[0] == 0x7f) + { + return 0x8; + } + return(rbuf[0]); + } + return -1; +} +#endif + #ifdef CONFIG_VT_CONSOLE static int kbd_exists = -1; @@ -421,6 +446,9 @@ static int blink_led(void) #endif get_char_func poll_funcs[] = { +#if defined(CONFIG_XEN) + get_xen_char, +#endif #if defined(CONFIG_VT_CONSOLE) get_kbd_char, #endif diff --git a/arch/i386/kdb/kdbasupport.c b/arch/i386/kdb/kdbasupport.c index ed8bf34d..3327bccf 100644 --- a/arch/i386/kdb/kdbasupport.c +++ b/arch/i386/kdb/kdbasupport.c @@ -1045,6 +1045,14 @@ kdba_verify_rw(unsigned long addr, size_t size) /* When first entering KDB, try a normal IPI. That reduces backtrace problems * on the other cpus. */ +#ifdef CONFIG_XEN +void +smp_kdb_stop(void) +{ + if (!KDB_FLAG(NOIPI)) + send_IPI_allbutself(KDB_VECTOR); +} +#else void smp_kdb_stop(void) { @@ -1059,6 +1067,7 @@ smp_kdb_stop(void) send_IPI_mask(cpu_mask, KDB_VECTOR); } } +#endif /* CONFIG_XEN */ /* The normal KDB IPI handler */ fastcall void diff --git a/arch/i386/kernel/entry-xen.S b/arch/i386/kernel/entry-xen.S index a8b32bff..43f0065f 100644 --- a/arch/i386/kernel/entry-xen.S +++ b/arch/i386/kernel/entry-xen.S @@ -246,6 +246,18 @@ ENTRY(ret_from_fork) jmp syscall_exit CFI_ENDPROC +#if defined(CONFIG_KDB) +ENTRY(kdb_call) + pushl %eax # save orig EAX + SAVE_ALL + pushl %esp # struct pt_regs + pushl $0 # error_code + pushl $7 # KDB_REASON_ENTRY + call kdb + addl $12,%esp # remove args + jmp ret_from_exception +#endif + /* * Return to user mode is not as complex as all this looks, * but we want the default path for a system call return to @@ -704,12 +716,14 @@ ENTRY(name) \ #define UNWIND_ESPFIX_STACK #endif -ENTRY(kdb_interrupt) \ - pushl $(0xf8); \ - SAVE_ALL \ - movl %esp,%eax; \ - call smp_kdb_interrupt; \ - jmp ret_from_intr; +#if defined(CONFIG_KDB) && defined(CONFIG_SMP) +ENTRY(kdb_interrupt) + pushl $(0xf8) + SAVE_ALL + movl %esp,%eax + call smp_kdb_interrupt + jmp ret_from_intr +#endif ENTRY(divide_error) diff --git a/arch/i386/kernel/smp-xen.c b/arch/i386/kernel/smp-xen.c index 4bd43b2a..0350a147 100644 --- a/arch/i386/kernel/smp-xen.c +++ b/arch/i386/kernel/smp-xen.c @@ -29,6 +29,11 @@ #endif #include +#ifdef CONFIG_KDB +#include +#include +#endif /* CONFIG_KDB */ + /* * Some notes on x86 processor bugs affecting SMP operation: * @@ -606,3 +611,13 @@ irqreturn_t smp_call_function_interrupt(int irq, void *dev_id, return IRQ_HANDLED; } +#ifdef CONFIG_KDB +irqreturn_t smp_kdba_process_ipi(int irq, void *data, struct pt_regs *regs) +{ + kdb_print_state(__FUNCTION__, 0); + kdb_ipi(regs, NULL); + return IRQ_HANDLED; +} +#endif /* CONFIG_KDB */ + + diff --git a/arch/i386/kernel/traps-xen.c b/arch/i386/kernel/traps-xen.c index f4b983a7..6e77ae2e 100644 --- a/arch/i386/kernel/traps-xen.c +++ b/arch/i386/kernel/traps-xen.c @@ -39,6 +39,10 @@ #include #endif +#ifdef CONFIG_KDB +#include +#endif /* CONFIG_KDB */ + #include #include #include @@ -61,6 +65,10 @@ int panic_on_unrecovered_nmi; asmlinkage int system_call(void); +#ifdef CONFIG_KDB +asmlinkage int kdb_call(void); +#endif /* CONFIG_KDB */ + struct desc_struct default_ldt[] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }; @@ -459,6 +467,10 @@ void die(const char * str, struct pt_regs * regs, long err) bust_spinlocks(0); die.lock_owner = -1; spin_unlock_irqrestore(&die.lock, flags); +#ifdef CONFIG_KDB + kdb_diemsg = str; + kdb(KDB_REASON_OOPS, err, regs); +#endif /* CONFIG_KDB */ if (!regs) return; @@ -567,7 +579,7 @@ fastcall void do_##name(struct pt_regs * regs, long error_code) \ } DO_VM86_ERROR_INFO( 0, SIGFPE, "divide error", divide_error, FPE_INTDIV, regs->eip) -#ifndef CONFIG_KPROBES +#if !defined(CONFIG_KPROBES) && !defined(CONFIG_KDB) DO_VM86_ERROR( 3, SIGTRAP, "int3", int3) #endif DO_VM86_ERROR( 4, SIGSEGV, "overflow", overflow) @@ -733,6 +745,9 @@ static void io_check_error(unsigned char reason, struct pt_regs * regs) static void unknown_nmi_error(unsigned char reason, struct pt_regs * regs) { +#ifdef CONFIG_KDB + (void)kdb(KDB_REASON_NMI, reason, regs); +#endif /* CONFIG_KDB */ #ifdef CONFIG_MCA /* Might actually be able to figure out what the guilty party * is. */ @@ -768,6 +783,10 @@ void die_nmi (struct pt_regs *regs, const char *msg) printk(" on CPU%d, eip %08lx, registers:\n", smp_processor_id(), regs->eip); show_registers(regs); +#ifdef CONFIG_KDB + kdb(KDB_REASON_NMI, 0, regs); +#endif /* CONFIG_KDB */ + printk(KERN_EMERG "console shuts up ...\n"); console_silent(); spin_unlock(&nmi_print_lock); @@ -791,6 +810,17 @@ static void default_do_nmi(struct pt_regs * regs) /* Only the BSP gets external NMIs from the system. */ if (!smp_processor_id()) reason = get_nmi_reason(); + +#if defined(CONFIG_SMP) && defined(CONFIG_KDB) + /* + * Call the kernel debugger to see if this NMI is due + * to an KDB requested IPI. If so, kdb will handle it. + */ + if (kdb_ipi(regs, NULL)) { + return; + } +#endif /* defined(CONFIG_SMP) && defined(CONFIG_KDB) */ + if (!(reason & 0xc0)) { if (notify_die(DIE_NMI_IPI, "nmi_ipi", regs, reason, 2, SIGINT) @@ -858,7 +888,17 @@ void unset_nmi_callback(void) } EXPORT_SYMBOL_GPL(unset_nmi_callback); -#ifdef CONFIG_KPROBES + +#if defined(CONFIG_KDB) && !defined(CONFIG_KPROBES) +fastcall void do_int3(struct pt_regs * regs, long error_code) +{ + if (kdb(KDB_REASON_BREAK, error_code, regs)) + return; + do_trap(3, SIGTRAP, "int3", 1, regs, error_code, NULL); +} +#endif /* CONFIG_KDB */ + +#ifdef CONFIG_KPROBES fastcall void __kprobes do_int3(struct pt_regs *regs, long error_code) { if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) @@ -900,6 +940,11 @@ fastcall void __kprobes do_debug(struct pt_regs * regs, long error_code) get_debugreg(condition, 6); +#ifdef CONFIG_KDB + if (kdb(KDB_REASON_DEBUG, error_code, regs)) + return; +#endif /* CONFIG_KDB */ + if (notify_die(DIE_DEBUG, "debug", regs, condition, error_code, SIGTRAP) == NOTIFY_STOP) return; @@ -1226,12 +1271,19 @@ static trap_info_t __cpuinitdata trap_table[] = { #endif { 19, 0, __KERNEL_CS, (unsigned long)simd_coprocessor_error }, { SYSCALL_VECTOR, 3, __KERNEL_CS, (unsigned long)system_call }, +#ifdef CONFIG_KDB + { KDBENTER_VECTOR, 3|4, __KERNEL_CS, (unsigned long)kdb_call }, +#endif + { 0, 0, 0, 0 } }; void __init trap_init(void) { int ret; +#ifdef CONFIG_KDB +/* this is gone - kdb_enablehwfault(); */ +#endif ret = HYPERVISOR_set_trap_table(trap_table); if (ret) diff --git a/arch/x86_64/kdb/kdba_bt.c b/arch/x86_64/kdb/kdba_bt.c index ebc451da..4aacc120 100644 --- a/arch/x86_64/kdb/kdba_bt.c +++ b/arch/x86_64/kdb/kdba_bt.c @@ -754,10 +754,12 @@ kdba_bt_stack(kdb_machreg_t addr, int argcount, const struct task_struct *p) } ss = rsp & -THREAD_SIZE; +#if 0 if ((cs & 0xffff) != __KERNEL_CS) { kdb_printf("Stack is not in kernel space, backtrace not available\n"); return 0; } +#endif kdb_printf("RSP RIP Function (args)\n"); diff --git a/arch/x86_64/kdb/kdba_io.c b/arch/x86_64/kdb/kdba_io.c index 20aa6d5a..2fe3761d 100644 --- a/arch/x86_64/kdb/kdba_io.c +++ b/arch/x86_64/kdb/kdba_io.c @@ -22,6 +22,14 @@ #include #include +#if defined(CONFIG_XEN) +#include +#include +#include +#include +#include +#endif + #ifdef CONFIG_VT_CONSOLE #define KDB_BLINK_LED 1 #else @@ -205,6 +213,24 @@ static int get_serial_char(void) } #endif /* CONFIG_SERIAL_CONSOLE */ +#if defined(CONFIG_XEN) +static int get_xen_char(void) +{ + static char rbuf[16]; + + if ((HYPERVISOR_console_io(CONSOLEIO_read, 1, rbuf)) > 0) + { + if (rbuf[0] == 0x7f) + { + return 0x8; + } + return(rbuf[0]); + } + return -1; +} +#endif + + #ifdef CONFIG_VT_CONSOLE static int kbd_exists = -1; @@ -421,6 +447,9 @@ static int blink_led(void) #endif get_char_func poll_funcs[] = { +#if defined(CONFIG_XEN) + get_xen_char, +#endif #if defined(CONFIG_VT_CONSOLE) get_kbd_char, #endif diff --git a/arch/x86_64/kdb/kdbasupport.c b/arch/x86_64/kdb/kdbasupport.c index 314944c1..2ab36bed 100644 --- a/arch/x86_64/kdb/kdbasupport.c +++ b/arch/x86_64/kdb/kdbasupport.c @@ -26,12 +26,25 @@ #include #include +#define KDBENTER_VECTOR 0xf8 +extern asmlinkage void kdb_interrupt(void); kdb_machreg_t kdba_getdr6(void) { return kdba_getdr(6); } + +/* + * Following definitions are placed here to resolve build + * erros which occur when KDB is being compiled for XEN + * hence the use of ifdef CONFIG_XEN + */ +#ifdef CONFIG_XEN +#define KDBENTER_VECTOR 0xf8 +extern asmlinkage void kdb_interrupt(void); +#endif + kdb_machreg_t kdba_getdr7(void) { @@ -1070,4 +1083,11 @@ kdba_wait_for_cpus(void) send_IPI_mask(cpumask_of_cpu(c), NMI_VECTOR); } -#endif /* CONFIG_SMP */ + +asmlinkage void smp_kdba_process_ipi(struct pt_regs regs) +{ + kdb_print_state(__FUNCTION__, 0); + kdb_ipi(regs, NULL); +} + +#endif /* CONFIG_SMP */ diff --git a/arch/x86_64/kernel/entry-xen.S b/arch/x86_64/kernel/entry-xen.S index b23abfb3..5188aec0 100644 --- a/arch/x86_64/kernel/entry-xen.S +++ b/arch/x86_64/kernel/entry-xen.S @@ -521,6 +521,42 @@ END(stub_rt_sigreturn) CFI_REL_OFFSET rcx,0; \ CFI_REL_OFFSET r11,8 + +/* + * Interrupt entry/exit. + * + * Interrupt entry points save only callee clobbered registers in fast path. + * + * Entry runs with interrupts off. + */ + +/* 0(%rsp): interrupt number */ + .macro interrupt func + cld + SAVE_ARGS + leaq -ARGOFFSET(%rsp),%rdi # arg1 for handler + pushq %rbp + CFI_ADJUST_CFA_OFFSET 8 + CFI_REL_OFFSET rbp, 0 + movq %rsp,%rbp + CFI_DEF_CFA_REGISTER rbp + testl $3,CS(%rdi) + je 1f + swapgs +1: incl %gs:pda_irqcount # RED-PEN should check preempt count + cmoveq %gs:pda_irqstackptr,%rsp + push %rbp # backlink for old unwinder + CFI_ADJUST_CFA_OFFSET 8 + CFI_REL_OFFSET rbp,0 + /* + * We entered an interrupt context - irqs are off: + */ + TRACE_IRQS_OFF + call \func + .endm + + + /* * Interrupt exit. * @@ -1288,3 +1324,40 @@ ENTRY(call_softirq) CFI_ENDPROC ENDPROC(call_softirq) + +#ifdef CONFIG_KDB +KPROBE_ENTRY(call_debug) + INTR_FRAME +/* pushq $0 + CFI_ADJUST_CFA_OFFSET 8 */ + zeroentry do_call_debug +/* jmp paranoid_exit */ + CFI_ENDPROC + .previous .text + +#ifdef CONFIG_SMP +ENTRY(kdb_interrupt) + apicinterrupt 0xf8,smp_kdb_interrupt +END(kdb_interrupt) +#endif /* CONFIG_SMP */ + + + +ENTRY(kdb_call) + INTR_FRAME + cld + pushq $-1 # orig_eax + CFI_ADJUST_CFA_OFFSET 8 + SAVE_ALL + movq $1,%rdi # KDB_REASON_ENTER + movq $0,%rsi # error_code + movq %rsp,%rdx # struct pt_regs + call kdb + RESTORE_ALL + addq $8,%rsp # forget orig_eax + CFI_ADJUST_CFA_OFFSET -8 + iretq + CFI_ENDPROC +END(kdb_call) + +#endif diff --git a/arch/x86_64/kernel/head-xen.S b/arch/x86_64/kernel/head-xen.S index 5dc76077..40c2839c 100644 --- a/arch/x86_64/kernel/head-xen.S +++ b/arch/x86_64/kernel/head-xen.S @@ -157,6 +157,11 @@ gdt_end: /* zero the remaining page */ .fill PAGE_SIZE / 8 - GDT_ENTRIES,8,0 + .section .bss, "aw", @nobits + .align L1_CACHE_BYTES +ENTRY(idt_table) + .skip 256 * 16 + .section .bss.page_aligned, "aw", @nobits .align PAGE_SIZE ENTRY(empty_zero_page) diff --git a/arch/x86_64/kernel/traps-xen.c b/arch/x86_64/kernel/traps-xen.c index 173c37d4..53193236 100644 --- a/arch/x86_64/kernel/traps-xen.c +++ b/arch/x86_64/kernel/traps-xen.c @@ -68,6 +68,9 @@ asmlinkage void reserved(void); asmlinkage void alignment_check(void); asmlinkage void machine_check(void); asmlinkage void spurious_interrupt_bug(void); +#ifdef CONFIG_KDB +asmlinkage void call_debug(void); +#endif ATOMIC_NOTIFIER_HEAD(die_chain); EXPORT_SYMBOL(die_chain); @@ -1108,9 +1111,19 @@ static trap_info_t __cpuinitdata trap_table[] = { #ifdef CONFIG_IA32_EMULATION { IA32_SYSCALL_VECTOR, 3, __KERNEL_CS, (unsigned long)ia32_syscall}, #endif +#ifdef CONFIG_KDB + { KDB_VECTOR, 3|4, __KERNEL_CS, (unsigned long)call_debug }, +#endif { 0, 0, 0, 0 } }; +#ifdef CONFIG_KDB +asmlinkage void do_call_debug(struct pt_regs *regs) +{ + notify_die(DIE_CALL, "debug call", regs, 0, 255, SIGINT); +} +#endif + void __init trap_init(void) { int ret; @@ -1137,6 +1150,11 @@ void __cpuinit smp_trap_init(trap_info_t *trap_ctxt) } +#ifdef CONFIG_KDB +int kdb_enter = KDBENTER_VECTOR; +EXPORT_SYMBOL(kdb_enter); +#endif + /* Actual parsing is done early in setup.c. */ static int __init oops_dummy(char *s) { diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index a7ef8afe..9eaa4a55 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -57,6 +57,9 @@ * the serial line, you can use the 'kdb=early' flag to lilo and set the * appropriate breakpoints. */ +#ifdef CONFIG_XEN +atomic_t kdb_8250; +#endif /* CONFIG_XEN */ static int kdb_serial_line = -1; static const char *kdb_serial_ptr = kdb_serial_str; diff --git a/drivers/xen/console/console.c b/drivers/xen/console/console.c index 29c5bd9e..8584b2a4 100644 --- a/drivers/xen/console/console.c +++ b/drivers/xen/console/console.c @@ -60,6 +60,10 @@ #include #include +#ifdef CONFIG_KDB +#include +#endif + /* * Modes: * 'xencons=off' [XC_OFF]: Console is disabled. @@ -367,6 +371,12 @@ void xencons_rx(char *buf, unsigned len, struct pt_regs *regs) goto out; for (i = 0; i < len; i++) { +#ifdef CONFIG_KDB + if ( (buf[i] == 0x01) ) + { + kdb(KDB_REASON_KEYBOARD, 0, regs); + } +#endif /* CONFIG_KDB */ #ifdef CONFIG_MAGIC_SYSRQ if (sysrq_enabled) { if (buf[i] == '\x0f') { /* ^O */ diff --git a/drivers/xen/core/smpboot.c b/drivers/xen/core/smpboot.c index cd005f69..96e6c510 100644 --- a/drivers/xen/core/smpboot.c +++ b/drivers/xen/core/smpboot.c @@ -27,6 +27,9 @@ extern irqreturn_t smp_reschedule_interrupt(int, void *, struct pt_regs *); extern irqreturn_t smp_call_function_interrupt(int, void *, struct pt_regs *); +#ifdef CONFIG_KDB +extern irqreturn_t smp_kdba_process_ipi(int, void *, struct pt_regs *); +#endif extern int local_setup_timer(unsigned int cpu); extern void local_teardown_timer(unsigned int cpu); @@ -56,6 +59,10 @@ static DEFINE_PER_CPU(int, resched_irq); static DEFINE_PER_CPU(int, callfunc_irq); static char resched_name[NR_CPUS][15]; static char callfunc_name[NR_CPUS][15]; +#ifdef CONFIG_KDB +static DEFINE_PER_CPU(int, kdba_irq); +static char kdba_name[NR_CPUS][15]; +#endif u8 cpu_2_logical_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID }; @@ -141,6 +148,24 @@ static int __cpuinit xen_smp_intr_init(unsigned int cpu) goto fail; per_cpu(callfunc_irq, cpu) = rc; +#ifdef CONFIG_KDB + sprintf(kdba_name[cpu], "kdba%d", cpu); + per_cpu(kdba_irq, cpu) = + bind_ipi_to_irqhandler( +#ifdef CONFIG_X86_32 + KDB_VECTOR, +#else + NMI_VECTOR, +#endif + cpu, + smp_kdba_process_ipi, + SA_INTERRUPT, + kdba_name[cpu], + NULL); + BUG_ON(per_cpu(kdba_irq, cpu) < 0); +#endif + + if ((cpu != 0) && ((rc = local_setup_timer(cpu)) != 0)) goto fail; @@ -162,6 +187,10 @@ static void xen_smp_intr_exit(unsigned int cpu) unbind_from_irqhandler(per_cpu(resched_irq, cpu), NULL); unbind_from_irqhandler(per_cpu(callfunc_irq, cpu), NULL); +#ifdef CONFIG_KDB + unbind_from_irqhandler(per_cpu(kdba_irq, cpu), NULL); +#endif + } #endif diff --git a/include/asm-i386/mach-xen/asm/hw_irq.h b/include/asm-i386/mach-xen/asm/hw_irq.h index c75d1543..79067339 100644 --- a/include/asm-i386/mach-xen/asm/hw_irq.h +++ b/include/asm-i386/mach-xen/asm/hw_irq.h @@ -38,6 +38,7 @@ extern void (*interrupt[NR_IRQS])(void); fastcall void reschedule_interrupt(void); fastcall void invalidate_interrupt(void); fastcall void call_function_interrupt(void); +asmlinkage void kdba_process_ipi(void); #endif #ifdef CONFIG_X86_LOCAL_APIC diff --git a/include/asm-i386/mach-xen/asm/ptrace.h b/include/asm-i386/mach-xen/asm/ptrace.h index 8b95045e..16ee3410 100644 --- a/include/asm-i386/mach-xen/asm/ptrace.h +++ b/include/asm-i386/mach-xen/asm/ptrace.h @@ -57,6 +57,29 @@ struct pt_regs { #define PTRACE_SYSEMU 31 #define PTRACE_SYSEMU_SINGLESTEP 32 +enum EFLAGS { + EF_CF = 0x00000001, + EF_PF = 0x00000004, + EF_AF = 0x00000010, + EF_ZF = 0x00000040, + EF_SF = 0x00000080, + EF_TF = 0x00000100, + EF_IE = 0x00000200, + EF_DF = 0x00000400, + EF_OF = 0x00000800, + EF_IOPL = 0x00003000, + EF_IOPL_RING0 = 0x00000000, + EF_IOPL_RING1 = 0x00001000, + EF_IOPL_RING2 = 0x00002000, + EF_NT = 0x00004000, /* nested task */ + EF_RF = 0x00010000, /* resume */ + EF_VM = 0x00020000, /* virtual mode */ + EF_AC = 0x00040000, /* alignment */ + EF_VIF = 0x00080000, /* virtual interrupt */ + EF_VIP = 0x00100000, /* virtual interrupt pending */ + EF_ID = 0x00200000, /* id */ +}; + #ifdef __KERNEL__ #include diff --git a/include/asm-i386/mach-xen/irq_vectors.h b/include/asm-i386/mach-xen/irq_vectors.h index 6d3a3ae4..80040a0a 100644 --- a/include/asm-i386/mach-xen/irq_vectors.h +++ b/include/asm-i386/mach-xen/irq_vectors.h @@ -29,6 +29,7 @@ #define FIRST_EXTERNAL_VECTOR 0x20 #define SYSCALL_VECTOR 0x80 +#define KDBENTER_VECTOR 0x81 /* * Vectors 0x20-0x2f are used for ISA interrupts. @@ -82,7 +83,8 @@ #define RESCHEDULE_VECTOR 0 #define CALL_FUNCTION_VECTOR 1 -#define NR_IPIS 2 +#define KDB_VECTOR 2 +#define NR_IPIS 3 /* * The maximum number of vectors supported by i386 processors diff --git a/include/asm-x86_64/mach-xen/asm/desc.h b/include/asm-x86_64/mach-xen/asm/desc.h index 33b57c81..e1ea9ec3 100644 --- a/include/asm-x86_64/mach-xen/asm/desc.h +++ b/include/asm-x86_64/mach-xen/asm/desc.h @@ -89,10 +89,9 @@ static inline void clear_LDT(void) * This is the ldt that every process will get unless we need * something other than this. */ -extern struct desc_struct default_ldt[]; -#ifndef CONFIG_X86_NO_IDT +/* #ifndef CONFIG_X86_NO_IDT */ extern struct gate_struct idt_table[]; -#endif +/* #endif */ extern struct desc_ptr cpu_gdt_descr[]; /* the cpu gdt accessor */ @@ -115,7 +114,7 @@ static inline void _set_gate(void *adr, unsigned type, unsigned long func, unsig memcpy(adr, &s, 16); } -#ifndef CONFIG_X86_NO_IDT +/* #ifndef CONFIG_X86_NO_IDT */ static inline void set_intr_gate(int nr, void *func) { BUG_ON((unsigned)nr > 0xFF); @@ -138,7 +137,7 @@ static inline void set_system_gate_ist(int nr, void *func, unsigned ist) { _set_gate(&idt_table[nr], GATE_INTERRUPT, (unsigned long) func, 3, ist); } -#endif +/* #endif */ static inline void set_tssldt_descriptor(void *ptr, unsigned long tss, unsigned type, unsigned size) diff --git a/include/asm-x86_64/mach-xen/asm/hw_irq.h b/include/asm-x86_64/mach-xen/asm/hw_irq.h index 4990f4c9..e2f6984a 100644 --- a/include/asm-x86_64/mach-xen/asm/hw_irq.h +++ b/include/asm-x86_64/mach-xen/asm/hw_irq.h @@ -23,7 +23,6 @@ struct hw_interrupt_type; #endif -#define NMI_VECTOR 0x02 /* * IDT vectors usable for external interrupt sources start * at 0x20: @@ -60,6 +59,9 @@ struct hw_interrupt_type; #define NUM_INVALIDATE_TLB_VECTORS 8 #endif +#define TEDKDB_VECTOR 0xf8 +#define KDB_VECTOR 0xf8 + /* * Local APIC timer IRQ vector is on a different priority level, * to work around the 'lost local interrupt if more than 2 IRQ diff --git a/include/asm-x86_64/mach-xen/asm/irq.h b/include/asm-x86_64/mach-xen/asm/irq.h index f489bf58..22868e20 100644 --- a/include/asm-x86_64/mach-xen/asm/irq.h +++ b/include/asm-x86_64/mach-xen/asm/irq.h @@ -24,7 +24,7 @@ static __inline__ int irq_canonicalize(int irq) #define ARCH_HAS_NMI_WATCHDOG /* See include/linux/nmi.h */ #endif -#define KDB_VECTOR 0xf9 +#define KDBENTER_VECTOR 0xf8 # define irq_ctx_init(cpu) do { } while (0) diff --git a/include/asm-x86_64/mach-xen/irq_vectors.h b/include/asm-x86_64/mach-xen/irq_vectors.h index 42b2dfc2..ed461651 100644 --- a/include/asm-x86_64/mach-xen/irq_vectors.h +++ b/include/asm-x86_64/mach-xen/irq_vectors.h @@ -80,7 +80,8 @@ #define RESCHEDULE_VECTOR 0 #define CALL_FUNCTION_VECTOR 1 -#define NR_IPIS 2 +#define NMI_VECTOR 2 +#define NR_IPIS 3 /* * The maximum number of vectors supported by i386 processors