]> Git Repo - linux.git/commitdiff
arm64: probes: Remove probe_opcode_t
authorMark Rutland <[email protected]>
Tue, 8 Oct 2024 15:58:51 +0000 (16:58 +0100)
committerCatalin Marinas <[email protected]>
Tue, 15 Oct 2024 17:16:20 +0000 (18:16 +0100)
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 <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Will Deacon <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Catalin Marinas <[email protected]>
arch/arm64/include/asm/probes.h
arch/arm64/kernel/probes/decode-insn.c
arch/arm64/kernel/probes/decode-insn.h
arch/arm64/kernel/probes/uprobes.c

index 11e809733b7d97f8db3259577f07f3a2a6394bd8..d49368886309406a3cf7b4ebc48e8b4851933dae 100644 (file)
@@ -9,7 +9,6 @@
 
 #include <asm/insn.h>
 
-typedef u32 probe_opcode_t;
 typedef void (probes_handler_t) (u32 opcode, long addr, struct pt_regs *);
 
 struct arch_probe_insn {
index 147d6ddf3a4c9d2dfbc77b99424f637ac0916265..41b100bcb041d2991af11f07f5abb5997dc0e107 100644 (file)
@@ -73,7 +73,7 @@ static bool __kprobes aarch64_insn_is_steppable(u32 insn)
  *   INSN_GOOD_NO_SLOT If instruction is supported but doesn't use its slot.
  */
 enum probe_insn __kprobes
-arm_probe_decode_insn(probe_opcode_t insn, struct arch_probe_insn *api)
+arm_probe_decode_insn(u32 insn, struct arch_probe_insn *api)
 {
        /*
         * Instructions reading or modifying the PC won't work from the XOL
@@ -133,7 +133,7 @@ enum probe_insn __kprobes
 arm_kprobe_decode_insn(kprobe_opcode_t *addr, struct arch_specific_insn *asi)
 {
        enum probe_insn decoded;
-       probe_opcode_t insn = le32_to_cpu(*addr);
+       u32 insn = le32_to_cpu(*addr);
        kprobe_opcode_t *scan_end = NULL;
        unsigned long size = 0, offset = 0;
        struct arch_probe_insn *api = &asi->api;
index 8b758c5a206222c3572cb5bceecb56fca030e061..0e4195de820619fa5450d87c22d8acaf28053a4d 100644 (file)
@@ -28,6 +28,6 @@ enum probe_insn __kprobes
 arm_kprobe_decode_insn(kprobe_opcode_t *addr, struct arch_specific_insn *asi);
 #endif
 enum probe_insn __kprobes
-arm_probe_decode_insn(probe_opcode_t insn, struct arch_probe_insn *asi);
+arm_probe_decode_insn(u32 insn, struct arch_probe_insn *asi);
 
 #endif /* _ARM_KERNEL_KPROBES_ARM64_H */
index a2f137a595fc1c06b71a0965bbba441e8101d180..fa0b7941d204c007ae8c804854a38b6fb9807c29 100644 (file)
@@ -34,7 +34,7 @@ unsigned long uprobe_get_swbp_addr(struct pt_regs *regs)
 int arch_uprobe_analyze_insn(struct arch_uprobe *auprobe, struct mm_struct *mm,
                unsigned long addr)
 {
-       probe_opcode_t insn;
+       u32 insn;
 
        /* TODO: Currently we do not support AARCH32 instruction probing */
        if (mm->context.flags & MMCF_AARCH32)
@@ -102,7 +102,7 @@ bool arch_uprobe_xol_was_trapped(struct task_struct *t)
 
 bool arch_uprobe_skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs)
 {
-       probe_opcode_t insn;
+       u32 insn;
        unsigned long addr;
 
        if (!auprobe->simulate)
This page took 0.063635 seconds and 4 git commands to generate.