* [PATCH] arm64: patching: Use uintptr_t in aarch64_insn_patch_text_nosync()
@ 2026-11-04 9:59 Thorsten Blum
2026-11-27 18:39 ` Will Deacon
0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2026-11-04 9:59 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, Mark Rutland, Thorsten Blum
Cc: linux-arm-kernel, linux-kernel
Use uintptr_t for tp instead of casting it multiple times and pass addr
directly to aarch64_insn_write().
Signed-off-by: Thorsten Blum <blum@kernel.org>
---
arch/arm64/kernel/patching.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/arch/arm64/kernel/patching.c b/arch/arm64/kernel/patching.c
index 09f019c6547a..24333419a8f1 100644
--- a/arch/arm64/kernel/patching.c
+++ b/arch/arm64/kernel/patching.c
@@ -178,17 +178,16 @@ noinstr void *aarch64_insn_set(void *dst, u32 insn, size_t len)
int __kprobes aarch64_insn_patch_text_nosync(void *addr, u32 insn)
{
- u32 *tp = addr;
+ uintptr_t tp = (uintptr_t)addr;
int ret;
/* A64 instructions must be word aligned */
- if ((uintptr_t)tp & 0x3)
+ if (tp & 0x3)
return -EINVAL;
- ret = aarch64_insn_write(tp, insn);
+ ret = aarch64_insn_write(addr, insn);
if (ret == 0)
- caches_clean_inval_pou((uintptr_t)tp,
- (uintptr_t)tp + AARCH64_INSN_SIZE);
+ caches_clean_inval_pou(tp, tp + AARCH64_INSN_SIZE);
return ret;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] arm64: patching: Use uintptr_t in aarch64_insn_patch_text_nosync()
2026-11-04 9:59 [PATCH] arm64: patching: Use uintptr_t in aarch64_insn_patch_text_nosync() Thorsten Blum
@ 2026-11-27 18:39 ` Will Deacon
0 siblings, 0 replies; 2+ messages in thread
From: Will Deacon @ 2026-11-27 18:39 UTC (permalink / raw)
To: Catalin Marinas, Mark Rutland, Thorsten Blum
Cc: kernel-team, Will Deacon, linux-arm-kernel, linux-kernel
On Wed, 04 Nov 2026 10:59:43 +0100, Thorsten Blum wrote:
> Use uintptr_t for tp instead of casting it multiple times and pass addr
> directly to aarch64_insn_write().
>
>
Applied to arm64 (for-next/misc), thanks!
[1/1] arm64: patching: Use uintptr_t in aarch64_insn_patch_text_nosync()
https://git.kernel.org/arm64/c/df82e34e4a18
Cheers,
--
Will
https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-27 18:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-04 9:59 [PATCH] arm64: patching: Use uintptr_t in aarch64_insn_patch_text_nosync() Thorsten Blum
2026-11-27 18:39 ` Will Deacon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®