[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200828205706.09f010c99f331b2ac03fcea7@kernel.org>
Date: Fri, 28 Aug 2020 20:57:06 +0900
From: Masami Hiramatsu <mhiramat@...nel.org>
To: Vamshi K Sthambamkadi <vamshi.k.sthambamkadi@...il.com>
Cc: rostedt@...dmis.org, mingo@...hat.com, davem@...emloft.net,
oleg@...hat.com, naveen.n.rao@...ux.ibm.com,
anil.s.keshavamurthy@...el.com, tglx@...utronix.de, bp@...en8.de,
hpa@...or.com, x86@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kprobes, x86/ptrace.h: fix regs argument order for i386
On Fri, 28 Aug 2020 17:02:46 +0530
Vamshi K Sthambamkadi <vamshi.k.sthambamkadi@...il.com> wrote:
> On i386, the order of parameters passed on regs is eax,edx,and ecx
> (as per regparm(3) calling conventions).
>
> Change the mapping in regs_get_kernel_argument(), so that arg1=ax
> arg2=dx, and arg3=cx.
>
> Running the selftests testcase kprobes_args_use.tc shows the result
> as passed.
Good catch! BTW, this is for tracing (ftrace kprobe events), so the "tracing/kprobes:" tag is better.
Anyway,
Acked-by: Masami Hiramatsu <mhiramat@...nel.org>
Thank you,
>
> Signed-off-by: Vamshi K Sthambamkadi <vamshi.k.sthambamkadi@...il.com>
> ---
> arch/x86/include/asm/ptrace.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h
> index 40aa69d..d8324a2 100644
> --- a/arch/x86/include/asm/ptrace.h
> +++ b/arch/x86/include/asm/ptrace.h
> @@ -327,8 +327,8 @@ static inline unsigned long regs_get_kernel_argument(struct pt_regs *regs,
> static const unsigned int argument_offs[] = {
> #ifdef __i386__
> offsetof(struct pt_regs, ax),
> - offsetof(struct pt_regs, cx),
> offsetof(struct pt_regs, dx),
> + offsetof(struct pt_regs, cx),
> #define NR_REG_ARGUMENTS 3
> #else
> offsetof(struct pt_regs, di),
> --
> 2.7.4
>
--
Masami Hiramatsu <mhiramat@...nel.org>
Powered by blists - more mailing lists