提交 762db434 编写于 作者: A Alexander van Heukelum 提交者: Ingo Molnar

i386: remove kprobes' restore_interrupts in favour of conditional_sti

x86_64 uses a helper function conditional_sti in traps_64.c which
is equal to restore_interrupts in kprobes.h. The only user of
restore_interrupts is in traps_32.c. Introduce conditional_sti
for i386 and remove restore_interrupts.
Signed-off-by: NAlexander van Heukelum <heukelum@fastmail.fm>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 927604c7
...@@ -84,6 +84,12 @@ static unsigned int code_bytes = 64; ...@@ -84,6 +84,12 @@ static unsigned int code_bytes = 64;
static int ignore_nmis; static int ignore_nmis;
static int die_counter; static int die_counter;
static inline void conditional_sti(struct pt_regs *regs)
{
if (regs->flags & X86_EFLAGS_IF)
local_irq_enable();
}
void printk_address(unsigned long address, int reliable) void printk_address(unsigned long address, int reliable)
{ {
#ifdef CONFIG_KALLSYMS #ifdef CONFIG_KALLSYMS
...@@ -859,7 +865,7 @@ void __kprobes do_int3(struct pt_regs *regs, long error_code) ...@@ -859,7 +865,7 @@ void __kprobes do_int3(struct pt_regs *regs, long error_code)
* This is an interrupt gate, because kprobes wants interrupts * This is an interrupt gate, because kprobes wants interrupts
* disabled. Normal trap handlers don't. * disabled. Normal trap handlers don't.
*/ */
restore_interrupts(regs); conditional_sti(regs);
do_trap(3, SIGTRAP, "int3", 1, regs, error_code, NULL); do_trap(3, SIGTRAP, "int3", 1, regs, error_code, NULL);
} }
......
...@@ -82,15 +82,6 @@ struct kprobe_ctlblk { ...@@ -82,15 +82,6 @@ struct kprobe_ctlblk {
struct prev_kprobe prev_kprobe; struct prev_kprobe prev_kprobe;
}; };
/* trap3/1 are intr gates for kprobes. So, restore the status of IF,
* if necessary, before executing the original int3/1 (trap) handler.
*/
static inline void restore_interrupts(struct pt_regs *regs)
{
if (regs->flags & X86_EFLAGS_IF)
local_irq_enable();
}
extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr); extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
extern int kprobe_exceptions_notify(struct notifier_block *self, extern int kprobe_exceptions_notify(struct notifier_block *self,
unsigned long val, void *data); unsigned long val, void *data);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册