aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/kprobes.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-05 18:32:18 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-05 18:32:18 -0500
commitc2ed69cdc9da49a8d2d7b4212fd225abf902ceaa (patch)
treeae98c43f8f9e0828b64e0d8fca2d6402f424bf77 /arch/x86/kernel/kprobes.c
parentef26b1691d11e17af205a4ff9c91458d931d11db (diff)
parent9eaa192d8988d621217a9e6071cd403fd6010496 (diff)
Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: x86: Fix a section mismatch in arch/x86/kernel/setup.c x86: Fixup last users of irq_chip->typename x86: Remove BKL from apm_32 x86: Remove BKL from microcode x86: use kernel_stack_pointer() in kprobes.c x86: use kernel_stack_pointer() in kgdb.c x86: use kernel_stack_pointer() in dumpstack.c x86: use kernel_stack_pointer() in process_32.c
Diffstat (limited to 'arch/x86/kernel/kprobes.c')
-rw-r--r--arch/x86/kernel/kprobes.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c
index 3fe86d706a14..1f3186ce213c 100644
--- a/arch/x86/kernel/kprobes.c
+++ b/arch/x86/kernel/kprobes.c
@@ -63,19 +63,7 @@ void jprobe_return_end(void);
63DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; 63DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
64DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); 64DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
65 65
66#ifdef CONFIG_X86_64 66#define stack_addr(regs) ((unsigned long *)kernel_stack_pointer(regs))
67#define stack_addr(regs) ((unsigned long *)regs->sp)
68#else
69/*
70 * "&regs->sp" looks wrong, but it's correct for x86_32. x86_32 CPUs
71 * don't save the ss and esp registers if the CPU is already in kernel
72 * mode when it traps. So for kprobes, regs->sp and regs->ss are not
73 * the [nonexistent] saved stack pointer and ss register, but rather
74 * the top 8 bytes of the pre-int3 stack. So &regs->sp happens to
75 * point to the top of the pre-int3 stack.
76 */
77#define stack_addr(regs) ((unsigned long *)&regs->sp)
78#endif
79 67
80#define W(row, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, ba, bb, bc, bd, be, bf)\ 68#define W(row, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, ba, bb, bc, bd, be, bf)\
81 (((b0##UL << 0x0)|(b1##UL << 0x1)|(b2##UL << 0x2)|(b3##UL << 0x3) | \ 69 (((b0##UL << 0x0)|(b1##UL << 0x1)|(b2##UL << 0x2)|(b3##UL << 0x3) | \