]> www.infradead.org Git - users/jedix/linux-maple.git/commit
arm64: probes: Move kprobes-specific fields
authorMark Rutland <mark.rutland@arm.com>
Tue, 8 Oct 2024 15:58:49 +0000 (16:58 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 15 Oct 2024 17:16:19 +0000 (18:16 +0100)
commit6105c5d46d0b39ccf01e329fc4449ba840c2937d
tree192b82e87f0260ea80d2227c3588a04ee9c72fed
parent13f8f1e05f1dc36dbba6cba0ae03354c0dafcde7
arm64: probes: Move kprobes-specific fields

We share struct arch_probe_insn between krpboes and uprobes, but most of
its fields aren't necessary for uprobes:

* The 'insn' field is only used by kprobes as a pointer to the XOL slot.

* The 'restore' field is only used by probes as the PC to restore after
  stepping an instruction in the XOL slot.

* The 'pstate_cc' field isn't used by kprobes or uprobes, and seems to
  only exist as a result of copy-pasting the 32-bit arm implementation
  of kprobes.

As these fields live in struct arch_probe_insn they cannot use
definitions that only exist when CONFIG_KPROBES=y, such as the
kprobe_opcode_t typedef, which we'd like to use in subsequent patches.

Clean this up by removing the 'pstate_cc' field, and moving the
kprobes-specific fields into the kprobes-specific struct
arch_specific_insn. To make it clear that the fields are related to
stepping instructions in the XOL slot, 'insn' is renamed to 'xol_insn'
and 'restore' is renamed to 'xol_restore'

At the same time, remove the misleading and useless comment above struct
arch_probe_insn.

The should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20241008155851.801546-5-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/probes.h
arch/arm64/kernel/probes/kprobes.c