]> xenbits.xen.org Git - xenclient/kernel.git/commitdiff
imported patch veritas-kdb-xen.patch veritas-kdb-xs-2.6.18.patch
authort_jeang <devnull@localhost>
Tue, 6 Jan 2009 12:06:06 +0000 (12:06 +0000)
committert_jeang <devnull@localhost>
Tue, 6 Jan 2009 12:06:06 +0000 (12:06 +0000)
22 files changed:
arch/i386/kdb/kdba_bt.c
arch/i386/kdb/kdba_io.c
arch/i386/kdb/kdbasupport.c
arch/i386/kernel/entry-xen.S
arch/i386/kernel/smp-xen.c
arch/i386/kernel/traps-xen.c
arch/x86_64/kdb/kdba_bt.c
arch/x86_64/kdb/kdba_io.c
arch/x86_64/kdb/kdbasupport.c
arch/x86_64/kernel/entry-xen.S
arch/x86_64/kernel/head-xen.S
arch/x86_64/kernel/traps-xen.c
drivers/serial/8250.c
drivers/xen/console/console.c
drivers/xen/core/smpboot.c
include/asm-i386/mach-xen/asm/hw_irq.h
include/asm-i386/mach-xen/asm/ptrace.h
include/asm-i386/mach-xen/irq_vectors.h
include/asm-x86_64/mach-xen/asm/desc.h
include/asm-x86_64/mach-xen/asm/hw_irq.h
include/asm-x86_64/mach-xen/asm/irq.h
include/asm-x86_64/mach-xen/irq_vectors.h

index 9b0563a9132e39661c1220ab4d1d2becd6b75194..ebef72171f96dcb05e86d013501759e8dc5c4f20 100644 (file)
@@ -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");
 
index 3324129ae2623928a182df27c250a2b29dbec746..35faeafdaa8bb57fe3bc1bc10ec8475dc5b79095 100644 (file)
 #include <linux/kdbprivate.h>
 #include <asm/pc_keyb.h>
 
+#if defined(CONFIG_XEN) 
+#include <xen/interface/xen.h>
+#include <xen/interface/event_channel.h>
+#include <asm/hypervisor.h>
+#include <xen/evtchn.h>
+#include <xen/xencons.h>
+#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
index ed8bf34d0e1500281c8da159ebb5ecd63f500faa..3327bccf97e929f46013651192d00a8f15656b92 100644 (file)
@@ -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
index a8b32bffd326266ddd20b3cf2f58f6e907f7f739..43f0065f9c25e44f8dab3b69431421379073d40e 100644 (file)
@@ -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)
index 4bd43b2ac05281b026a31a5e7fc54156d58bffdd..0350a147699804e84357fdefa588696793c46b1a 100644 (file)
 #endif
 #include <xen/evtchn.h>
 
+#ifdef  CONFIG_KDB
+#include <linux/kdb.h>
+#include <linux/kdbprivate.h>
+#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 */
+
+
index f4b983a7211d9e79c4a733076b6110c7ad62e7cd..6e77ae2e5b8f6da60cb39518a6e7a8115b2185df 100644 (file)
 #include <linux/mca.h>
 #endif
 
+#ifdef  CONFIG_KDB
+#include <linux/kdb.h>
+#endif  /* CONFIG_KDB */
+
 #include <asm/processor.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
 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)
index ebc451da2b1cf56f4bd8d438b724c89efd48bb6f..4aacc1204231819960808bb21740be6e648c9b03 100644 (file)
@@ -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");
 
index 20aa6d5a67a9a186bda6595e477ec15b88890bc2..2fe3761d5b428acee073b497d5a825efb4fb7681 100644 (file)
 #include <linux/kdbprivate.h>
 #include <asm/pc_keyb.h>
 
+#if defined(CONFIG_XEN)
+#include <xen/interface/xen.h>
+#include <xen/interface/event_channel.h>
+#include <asm/hypervisor.h>
+#include <xen/evtchn.h>
+#include <xen/xencons.h>
+#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
index 314944c1f079eff9c396b4e075560f435fad0007..2ab36bedd52b3758bb4792134bb239048613d30b 100644 (file)
 #include <asm/hw_irq.h>
 #include <asm/desc.h>
 
+#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 */
index b23abfb371b5b593fc2f34255880d4aefb70e78d..5188aec0918d3f2d15c00947d0aa3ea1b796bdbc 100644 (file)
@@ -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
index 5dc76077b631f70cf36179c912d3061175e27b3d..40c2839cd3698fa49f3c973f70e16aeae445e9ce 100644 (file)
@@ -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)
index 173c37d4823739a53d740d8c3375b87771402cc2..5319323678eef702430509ec124950a68d6bb2a1 100644 (file)
@@ -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)
 { 
index a7ef8afe40f6b0c2547e9e077ac4f3f182398cc9..9eaa4a5512c1636bc2101ac3a8573691c55f727a 100644 (file)
@@ -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;
index 29c5bd9ea7f71ed2265fbd1023b4dde62f576c5e..8584b2a4812df6e5c7a8598d4178c9b62adae915 100644 (file)
 #include <xen/xenbus.h>
 #include <xen/xencons.h>
 
+#ifdef  CONFIG_KDB
+#include <linux/kdb.h>
+#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 */
index cd005f69356edb31adc6caab396d88dc5fa4ed17..96e6c5100108aa491c420f5947a1c2a4710856fa 100644 (file)
@@ -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
 
index c75d15436e79158b1b259bc53422d8de75f7e5fc..790673394122189c58b6b19c5e41c2f90601c09e 100644 (file)
@@ -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
index 8b95045e4edb4849a7160d1bba21d10a437fe255..16ee34103e3c66bd19857412aa924c758bdcbc2d 100644 (file)
@@ -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 <asm/vm86.h>
index 6d3a3ae45cb78d13034c968ca11134594133a85d..80040a0a2af75c0ea7104713b417e9b3188ee786 100644 (file)
@@ -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
index 33b57c816b4ce7ab9c2a1372872e1f7dd04f1bea..e1ea9ec355bb6e7cfd242a9ee26f602da8badde6 100644 (file)
@@ -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) 
index 4990f4c93980a8e6e8609955be585fa3278d6291..e2f6984a7d7031db20ec30cfa35437b512ed9dff 100644 (file)
@@ -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
index f489bf586e82b2297f84c0026620d8eb0eb719b3..22868e2033bd3b2a7bb782c877ea487e9421faa2 100644 (file)
@@ -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)
 
index 42b2dfc244a390e5e1913adb6ccaeedb8682d16b..ed461651a0b6ac21c383d07ae723d7f0b2cf16d6 100644 (file)
@@ -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