On 29 Jan 2025, at 02:21, Mark Johnston <ma...@freebsd.org> wrote: > > The branch main has been updated by markj: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=70c067062217a5295ed321427b91cfd857c18b77 > > commit 70c067062217a5295ed321427b91cfd857c18b77 > Author: Mark Johnston <ma...@freebsd.org> > AuthorDate: 2025-01-29 01:05:03 +0000 > Commit: Mark Johnston <ma...@freebsd.org> > CommitDate: 2025-01-29 01:05:03 +0000 > > dtrace/arm64: Simplify dtrace_getarg() slightly > > The use of memcpy here is redundant, and also incorrect since memcpy() > might be instrumented by fbt or kinst. dtrace_bcopy() exists, but we > don't need it. > > MFC after: 2 weeks > Sponsored by: Innovate UK > --- > sys/cddl/dev/dtrace/aarch64/dtrace_isa.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c > b/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c > index ff0e068006bd..3e36004c6f0d 100644 > --- a/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c > +++ b/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c > @@ -256,7 +256,6 @@ dtrace_getarg(int arg, int aframes __unused) > return (tf->tf_x[arg]); > } else { > uintptr_t p; > - uint64_t val; > > p = (tf->tf_sp + (arg - 8) * sizeof(uint64_t)); > if ((p & 7) != 0) { > @@ -269,8 +268,7 @@ dtrace_getarg(int arg, int aframes __unused) > cpu_core[curcpu].cpuc_dtrace_illval = p; > return (0); > } > - memcpy(&val, (void *)p, sizeof(uint64_t)); > - return (val); > + return (p);
Doesn’t this change from dereferencing p to returning it? Surely p should be a uint64_t * that is dereferenced? Jess