Skip to content

Commit 1476210

Browse files
mrutland-armctmarinas
authored andcommitted
arm64: probes: Remove probe_opcode_t
The probe_opcode_t typedef for u32 isn't necessary, and is a source of confusion as it is easily confused with kprobe_opcode_t, which is a typedef for __le32. The typedef is only used within arch/arm64, and all of arm64's commn insn code uses u32 for the endian-agnostic value of an instruction, so it'd be clearer to use u32 consistently. Remove probe_opcode_t and use u32 directly. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Cc: Catalin Marinas <catalin.marnias@arm.com> Cc: Will Deacon <will@kernel.org> Link: https://lore.kernel.org/r/20241008155851.801546-7-mark.rutland@arm.com Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent dd0eb50 commit 1476210

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

arch/arm64/include/asm/probes.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#include <asm/insn.h>
1111

12-
typedef u32 probe_opcode_t;
1312
typedef void (probes_handler_t) (u32 opcode, long addr, struct pt_regs *);
1413

1514
struct arch_probe_insn {

arch/arm64/kernel/probes/decode-insn.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static bool __kprobes aarch64_insn_is_steppable(u32 insn)
7373
* INSN_GOOD_NO_SLOT If instruction is supported but doesn't use its slot.
7474
*/
7575
enum probe_insn __kprobes
76-
arm_probe_decode_insn(probe_opcode_t insn, struct arch_probe_insn *api)
76+
arm_probe_decode_insn(u32 insn, struct arch_probe_insn *api)
7777
{
7878
/*
7979
* Instructions reading or modifying the PC won't work from the XOL
@@ -133,7 +133,7 @@ enum probe_insn __kprobes
133133
arm_kprobe_decode_insn(kprobe_opcode_t *addr, struct arch_specific_insn *asi)
134134
{
135135
enum probe_insn decoded;
136-
probe_opcode_t insn = le32_to_cpu(*addr);
136+
u32 insn = le32_to_cpu(*addr);
137137
kprobe_opcode_t *scan_end = NULL;
138138
unsigned long size = 0, offset = 0;
139139
struct arch_probe_insn *api = &asi->api;

arch/arm64/kernel/probes/decode-insn.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ enum probe_insn __kprobes
2828
arm_kprobe_decode_insn(kprobe_opcode_t *addr, struct arch_specific_insn *asi);
2929
#endif
3030
enum probe_insn __kprobes
31-
arm_probe_decode_insn(probe_opcode_t insn, struct arch_probe_insn *asi);
31+
arm_probe_decode_insn(u32 insn, struct arch_probe_insn *asi);
3232

3333
#endif /* _ARM_KERNEL_KPROBES_ARM64_H */

arch/arm64/kernel/probes/uprobes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ unsigned long uprobe_get_swbp_addr(struct pt_regs *regs)
3434
int arch_uprobe_analyze_insn(struct arch_uprobe *auprobe, struct mm_struct *mm,
3535
unsigned long addr)
3636
{
37-
probe_opcode_t insn;
37+
u32 insn;
3838

3939
/* TODO: Currently we do not support AARCH32 instruction probing */
4040
if (mm->context.flags & MMCF_AARCH32)
@@ -102,7 +102,7 @@ bool arch_uprobe_xol_was_trapped(struct task_struct *t)
102102

103103
bool arch_uprobe_skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs)
104104
{
105-
probe_opcode_t insn;
105+
u32 insn;
106106
unsigned long addr;
107107

108108
if (!auprobe->simulate)

0 commit comments

Comments
 (0)