aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/kprobes.c
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-01-30 07:31:43 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:31:43 -0500
commite7b5e11eaaa8ef93a34e68016de51152d0d62911 (patch)
treedba4e39c71bbdd6ad2d6fc5c4f1e5c7819b04bd5 /arch/x86/kernel/kprobes.c
parentab4a574ef23cfa801a5078f7d7c2f2b76ecd6d91 (diff)
x86: kprobes leftover cleanups
Eliminate __always_inline, all of these static functions are only called once. Minor whitespace cleanup. Eliminate one supefluous return at end of void function. Change the one #ifndef to #ifdef to match the sense of the rest of the config tests. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Acked-by: Masami Hiramatsu <mhiramat@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/kprobes.c')
-rw-r--r--arch/x86/kernel/kprobes.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c
index 7848bf74e2ab..521a469acaad 100644
--- a/arch/x86/kernel/kprobes.c
+++ b/arch/x86/kernel/kprobes.c
@@ -159,7 +159,7 @@ struct kretprobe_blackpoint kretprobe_blacklist[] = {
159const int kretprobe_blacklist_size = ARRAY_SIZE(kretprobe_blacklist); 159const int kretprobe_blacklist_size = ARRAY_SIZE(kretprobe_blacklist);
160 160
161/* Insert a jump instruction at address 'from', which jumps to address 'to'.*/ 161/* Insert a jump instruction at address 'from', which jumps to address 'to'.*/
162static __always_inline void set_jmp_op(void *from, void *to) 162static void __kprobes set_jmp_op(void *from, void *to)
163{ 163{
164 struct __arch_jmp_op { 164 struct __arch_jmp_op {
165 char op; 165 char op;
@@ -174,7 +174,7 @@ static __always_inline void set_jmp_op(void *from, void *to)
174 * Returns non-zero if opcode is boostable. 174 * Returns non-zero if opcode is boostable.
175 * RIP relative instructions are adjusted at copying time in 64 bits mode 175 * RIP relative instructions are adjusted at copying time in 64 bits mode
176 */ 176 */
177static __always_inline int can_boost(kprobe_opcode_t *opcodes) 177static int __kprobes can_boost(kprobe_opcode_t *opcodes)
178{ 178{
179 kprobe_opcode_t opcode; 179 kprobe_opcode_t opcode;
180 kprobe_opcode_t *orig_opcodes = opcodes; 180 kprobe_opcode_t *orig_opcodes = opcodes;
@@ -392,13 +392,13 @@ static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs,
392 kcb->kprobe_saved_flags &= ~X86_EFLAGS_IF; 392 kcb->kprobe_saved_flags &= ~X86_EFLAGS_IF;
393} 393}
394 394
395static __always_inline void clear_btf(void) 395static void __kprobes clear_btf(void)
396{ 396{
397 if (test_thread_flag(TIF_DEBUGCTLMSR)) 397 if (test_thread_flag(TIF_DEBUGCTLMSR))
398 wrmsr(MSR_IA32_DEBUGCTLMSR, 0, 0); 398 wrmsr(MSR_IA32_DEBUGCTLMSR, 0, 0);
399} 399}
400 400
401static __always_inline void restore_btf(void) 401static void __kprobes restore_btf(void)
402{ 402{
403 if (test_thread_flag(TIF_DEBUGCTLMSR)) 403 if (test_thread_flag(TIF_DEBUGCTLMSR))
404 wrmsr(MSR_IA32_DEBUGCTLMSR, current->thread.debugctlmsr, 0); 404 wrmsr(MSR_IA32_DEBUGCTLMSR, current->thread.debugctlmsr, 0);
@@ -409,7 +409,7 @@ static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
409 clear_btf(); 409 clear_btf();
410 regs->flags |= X86_EFLAGS_TF; 410 regs->flags |= X86_EFLAGS_TF;
411 regs->flags &= ~X86_EFLAGS_IF; 411 regs->flags &= ~X86_EFLAGS_IF;
412 /*single step inline if the instruction is an int3*/ 412 /* single step inline if the instruction is an int3 */
413 if (p->opcode == BREAKPOINT_INSTRUCTION) 413 if (p->opcode == BREAKPOINT_INSTRUCTION)
414 regs->ip = (unsigned long)p->addr; 414 regs->ip = (unsigned long)p->addr;
415 else 415 else
@@ -767,7 +767,7 @@ static void __kprobes resume_execution(struct kprobe *p,
767 case 0xe8: /* call relative - Fix return addr */ 767 case 0xe8: /* call relative - Fix return addr */
768 *tos = orig_ip + (*tos - copy_ip); 768 *tos = orig_ip + (*tos - copy_ip);
769 break; 769 break;
770#ifndef CONFIG_X86_64 770#ifdef CONFIG_X86_32
771 case 0x9a: /* call absolute -- same as call absolute, indirect */ 771 case 0x9a: /* call absolute -- same as call absolute, indirect */
772 *tos = orig_ip + (*tos - copy_ip); 772 *tos = orig_ip + (*tos - copy_ip);
773 goto no_change; 773 goto no_change;
@@ -813,8 +813,6 @@ static void __kprobes resume_execution(struct kprobe *p,
813 813
814no_change: 814no_change:
815 restore_btf(); 815 restore_btf();
816
817 return;
818} 816}
819 817
820/* 818/*