diff options
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/include/asm/uprobes.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/uprobes.c | 15 |
2 files changed, 9 insertions, 8 deletions
diff --git a/arch/x86/include/asm/uprobes.h b/arch/x86/include/asm/uprobes.h index 5c399e446512..384f1bebf884 100644 --- a/arch/x86/include/asm/uprobes.h +++ b/arch/x86/include/asm/uprobes.h | |||
@@ -39,5 +39,5 @@ struct arch_uprobe { | |||
39 | #endif | 39 | #endif |
40 | }; | 40 | }; |
41 | 41 | ||
42 | extern int arch_uprobes_analyze_insn(struct mm_struct *mm, struct arch_uprobe *arch_uprobe); | 42 | extern int arch_uprobes_analyze_insn(struct arch_uprobe *aup, struct mm_struct *mm); |
43 | #endif /* _ASM_UPROBES_H */ | 43 | #endif /* _ASM_UPROBES_H */ |
diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c index 6dfa89e6f24a..851a11b0d38c 100644 --- a/arch/x86/kernel/uprobes.c +++ b/arch/x86/kernel/uprobes.c | |||
@@ -297,7 +297,8 @@ static void prepare_fixups(struct arch_uprobe *auprobe, struct insn *insn) | |||
297 | * - There's never a SIB byte. | 297 | * - There's never a SIB byte. |
298 | * - The displacement is always 4 bytes. | 298 | * - The displacement is always 4 bytes. |
299 | */ | 299 | */ |
300 | static void handle_riprel_insn(struct mm_struct *mm, struct arch_uprobe *auprobe, struct insn *insn) | 300 | static void |
301 | handle_riprel_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, struct insn *insn) | ||
301 | { | 302 | { |
302 | u8 *cursor; | 303 | u8 *cursor; |
303 | u8 reg; | 304 | u8 reg; |
@@ -381,19 +382,19 @@ static int validate_insn_64bits(struct arch_uprobe *auprobe, struct insn *insn) | |||
381 | return -ENOTSUPP; | 382 | return -ENOTSUPP; |
382 | } | 383 | } |
383 | 384 | ||
384 | static int validate_insn_bits(struct mm_struct *mm, struct arch_uprobe *auprobe, struct insn *insn) | 385 | static int validate_insn_bits(struct arch_uprobe *auprobe, struct mm_struct *mm, struct insn *insn) |
385 | { | 386 | { |
386 | if (mm->context.ia32_compat) | 387 | if (mm->context.ia32_compat) |
387 | return validate_insn_32bits(auprobe, insn); | 388 | return validate_insn_32bits(auprobe, insn); |
388 | return validate_insn_64bits(auprobe, insn); | 389 | return validate_insn_64bits(auprobe, insn); |
389 | } | 390 | } |
390 | #else /* 32-bit: */ | 391 | #else /* 32-bit: */ |
391 | static void handle_riprel_insn(struct mm_struct *mm, struct arch_uprobe *auprobe, struct insn *insn) | 392 | static void handle_riprel_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, struct insn *insn) |
392 | { | 393 | { |
393 | /* No RIP-relative addressing on 32-bit */ | 394 | /* No RIP-relative addressing on 32-bit */ |
394 | } | 395 | } |
395 | 396 | ||
396 | static int validate_insn_bits(struct mm_struct *mm, struct arch_uprobe *auprobe, struct insn *insn) | 397 | static int validate_insn_bits(struct arch_uprobe *auprobe, struct mm_struct *mm, struct insn *insn) |
397 | { | 398 | { |
398 | return validate_insn_32bits(auprobe, insn); | 399 | return validate_insn_32bits(auprobe, insn); |
399 | } | 400 | } |
@@ -405,17 +406,17 @@ static int validate_insn_bits(struct mm_struct *mm, struct arch_uprobe *auprobe, | |||
405 | * @arch_uprobe: the probepoint information. | 406 | * @arch_uprobe: the probepoint information. |
406 | * Return 0 on success or a -ve number on error. | 407 | * Return 0 on success or a -ve number on error. |
407 | */ | 408 | */ |
408 | int arch_uprobes_analyze_insn(struct mm_struct *mm, struct arch_uprobe *auprobe) | 409 | int arch_uprobes_analyze_insn(struct arch_uprobe *auprobe, struct mm_struct *mm) |
409 | { | 410 | { |
410 | int ret; | 411 | int ret; |
411 | struct insn insn; | 412 | struct insn insn; |
412 | 413 | ||
413 | auprobe->fixups = 0; | 414 | auprobe->fixups = 0; |
414 | ret = validate_insn_bits(mm, auprobe, &insn); | 415 | ret = validate_insn_bits(auprobe, mm, &insn); |
415 | if (ret != 0) | 416 | if (ret != 0) |
416 | return ret; | 417 | return ret; |
417 | 418 | ||
418 | handle_riprel_insn(mm, auprobe, &insn); | 419 | handle_riprel_insn(auprobe, mm, &insn); |
419 | prepare_fixups(auprobe, &insn); | 420 | prepare_fixups(auprobe, &insn); |
420 | 421 | ||
421 | return 0; | 422 | return 0; |