All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Jerry Crunchtime <jerry.c.t@web.de>
Cc: bpf@vger.kernel.org, andriin@fb.com
Subject: Re: [PATCH bpf] libbpf: Fix register in PT_REGS MIPS macros
Date: Fri, 31 Jul 2020 12:31:32 +0200	[thread overview]
Message-ID: <c185d3eb-9253-5854-70ac-32a0d47ec4cd@iogearbox.net> (raw)
In-Reply-To: <a6cdc832-1142-f1e0-4393-b982c51eac89@web.de>

On 7/31/20 11:56 AM, Jerry Crunchtime wrote:
> Hi,
> 
>  > Jerry, your patch is missing a Signed-off-by from you.
> 
> Signed-off-by: Jerry Crunchtime <jerry.c.t@web.de>

Thanks! One more comment below:

> On 7/31/20 1:00 AM, Daniel Borkmann wrote:
>> On 7/30/20 1:44 PM, Jerry Crunchtime wrote:
>>> The o32, n32 and n64 calling conventions require the return
>>> value to be stored in $v0 which maps to $2 register, i.e.,
>>> the second register.
>>>
>>> Fixes: c1932cd ("bpf: Add MIPS support to samples/bpf.")
>>
>> Jerry, your patch is missing a Signed-off-by from you. It should be
>> enough if
>> you just reply with one in here that I'll add to the commit message and
>> I'll
>> take it via bpf tree then, thanks.
>>
>>> ---
>>>   tools/lib/bpf/bpf_tracing.h | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/tools/lib/bpf/bpf_tracing.h b/tools/lib/bpf/bpf_tracing.h
>>> index 58eceb884..ae205dcf8 100644
>>> --- a/tools/lib/bpf/bpf_tracing.h
>>> +++ b/tools/lib/bpf/bpf_tracing.h
>>> @@ -215,7 +215,7 @@ struct pt_regs;
>>>   #define PT_REGS_PARM5(x) ((x)->regs[8])
>>>   #define PT_REGS_RET(x) ((x)->regs[31])
>>>   #define PT_REGS_FP(x) ((x)->regs[30]) /* Works only with
>>> CONFIG_FRAME_POINTER */
>>> -#define PT_REGS_RC(x) ((x)->regs[1])
>>> +#define PT_REGS_RC(x) ((x)->regs[2])
>>>   #define PT_REGS_SP(x) ((x)->regs[29])
>>>   #define PT_REGS_IP(x) ((x)->cp0_epc)

While in process of applying, I noticed that there is one more thing broken; you
fixed the PT_REGS_RC() but by that logic at the same time we would also need to
fix PT_REGS_RC_CORE() given it still points to regs[1] as well:

   #define PT_REGS_RC_CORE(x) BPF_CORE_READ((x), regs[1])

Please fix up and resubmit.

Thanks,
Daniel

      reply	other threads:[~2020-07-31 10:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-30 11:44 [PATCH bpf] libbpf: Fix register in PT_REGS MIPS macros Jerry Cruntime
2020-07-30 19:55 ` Andrii Nakryiko
2020-07-30 20:38   ` Jerry Cruntime
2020-07-30 20:43     ` Andrii Nakryiko
2020-07-30 23:00 ` Daniel Borkmann
2020-07-31  9:56   ` Jerry Crunchtime
2020-07-31 10:31     ` Daniel Borkmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c185d3eb-9253-5854-70ac-32a0d47ec4cd@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=andriin@fb.com \
    --cc=bpf@vger.kernel.org \
    --cc=jerry.c.t@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.