From: Yixun Lan <dlan@gentoo.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Yonghong Song <yhs@fb.com>,
Andrii Nakryiko <andrii.nakryiko@gmail.com>,
Alan Maguire <alan.maguire@oracle.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
linux-riscv@lists.infradead.org,
Paul Walmsley <paul.walmsley@sifive.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@kernel.org>,
open list <linux-kernel@vger.kernel.org>,
Networking <netdev@vger.kernel.org>, bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH] RISC-V/bpf: Enable bpf_probe_read{, str}()
Date: Sat, 9 Jul 2022 09:01:10 +0800 [thread overview]
Message-ID: <YsjTVvyqdVGy1uYZ@ofant> (raw)
In-Reply-To: <YsUzX2IeNb/u9VmN@infradead.org>
Hi Christoph, YongHong
On 00:01 Wed 06 Jul , Christoph Hellwig wrote:
> On Tue, Jul 05, 2022 at 11:41:30PM -0700, Yonghong Song wrote:
> >
> >
> > On 7/5/22 10:00 PM, Andrii Nakryiko wrote:
> > > On Sun, Jul 3, 2022 at 10:53 PM Christoph Hellwig <hch@infradead.org> wrote:
> > > >
> > > > On Sun, Jul 03, 2022 at 09:09:24PM +0800, Yixun Lan wrote:
> > > > > Enable this option to fix a bcc error in RISC-V platform
> > > > >
> > > > > And, the error shows as follows:
> > > >
> > > > These should not be enabled on new platforms. Use the proper helpers
> > > > to probe kernel vs user pointers instead.
> > >
> > > riscv existed as of [0], so I'd argue it is a proper bug fix, as
> > > corresponding select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE should
> > > have been added back then.
> > >
> > > But I also agree that BCC tools should be updated to use proper
> > > bpf_probe_read_{kernel,user}[_str()] helpers, please contribute such
> > > fixes to BCC tools and BCC itself as well. Cc'ed Alan as his ksnoop in
> > > libbpf-tools seems to be using bpf_probe_read() as well and needs to
> > > be fixed.
> >
> > Yixun, the bcc change looks like below:
>
> No, this is broken. bcc needs to stop using bpf_probe_read entirely
> for user addresses and unconditionally use bpf_probe_read_user first
> and only fall back to bpf_probe_read if not supported.
I agree with Christoph, there is something in the bcc tools that
need to adjust in order to use new bpf_probe_read_{kernel,user}
Please check the ongoing discussion [0] in the bcc tools if you're
interested in, advice and comments are welcome
[0] https://github.com/iovisor/bcc/pull/4085#issuecomment-1179446738
--
Yixun Lan (dlan)
Gentoo Linux Developer
GPG Key ID AABEFD55
WARNING: multiple messages have this Message-ID (diff)
From: Yixun Lan <dlan@gentoo.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Yonghong Song <yhs@fb.com>,
Andrii Nakryiko <andrii.nakryiko@gmail.com>,
Alan Maguire <alan.maguire@oracle.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
linux-riscv@lists.infradead.org,
Paul Walmsley <paul.walmsley@sifive.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@kernel.org>,
open list <linux-kernel@vger.kernel.org>,
Networking <netdev@vger.kernel.org>, bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH] RISC-V/bpf: Enable bpf_probe_read{, str}()
Date: Sat, 9 Jul 2022 09:01:10 +0800 [thread overview]
Message-ID: <YsjTVvyqdVGy1uYZ@ofant> (raw)
In-Reply-To: <YsUzX2IeNb/u9VmN@infradead.org>
Hi Christoph, YongHong
On 00:01 Wed 06 Jul , Christoph Hellwig wrote:
> On Tue, Jul 05, 2022 at 11:41:30PM -0700, Yonghong Song wrote:
> >
> >
> > On 7/5/22 10:00 PM, Andrii Nakryiko wrote:
> > > On Sun, Jul 3, 2022 at 10:53 PM Christoph Hellwig <hch@infradead.org> wrote:
> > > >
> > > > On Sun, Jul 03, 2022 at 09:09:24PM +0800, Yixun Lan wrote:
> > > > > Enable this option to fix a bcc error in RISC-V platform
> > > > >
> > > > > And, the error shows as follows:
> > > >
> > > > These should not be enabled on new platforms. Use the proper helpers
> > > > to probe kernel vs user pointers instead.
> > >
> > > riscv existed as of [0], so I'd argue it is a proper bug fix, as
> > > corresponding select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE should
> > > have been added back then.
> > >
> > > But I also agree that BCC tools should be updated to use proper
> > > bpf_probe_read_{kernel,user}[_str()] helpers, please contribute such
> > > fixes to BCC tools and BCC itself as well. Cc'ed Alan as his ksnoop in
> > > libbpf-tools seems to be using bpf_probe_read() as well and needs to
> > > be fixed.
> >
> > Yixun, the bcc change looks like below:
>
> No, this is broken. bcc needs to stop using bpf_probe_read entirely
> for user addresses and unconditionally use bpf_probe_read_user first
> and only fall back to bpf_probe_read if not supported.
I agree with Christoph, there is something in the bcc tools that
need to adjust in order to use new bpf_probe_read_{kernel,user}
Please check the ongoing discussion [0] in the bcc tools if you're
interested in, advice and comments are welcome
[0] https://github.com/iovisor/bcc/pull/4085#issuecomment-1179446738
--
Yixun Lan (dlan)
Gentoo Linux Developer
GPG Key ID AABEFD55
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2022-07-09 1:01 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-03 13:09 [PATCH] RISC-V/bpf: Enable bpf_probe_read{, str}() Yixun Lan
2022-07-03 13:09 ` Yixun Lan
2022-07-03 13:12 ` Conor Dooley
2022-07-03 13:12 ` Conor Dooley
2022-07-04 2:20 ` Yixun Lan
2022-07-04 2:20 ` Yixun Lan
2022-07-04 6:29 ` Conor.Dooley
2022-07-04 6:29 ` Conor.Dooley
2022-07-04 5:53 ` Christoph Hellwig
2022-07-04 5:53 ` Christoph Hellwig
2022-07-06 5:00 ` Andrii Nakryiko
2022-07-06 5:00 ` Andrii Nakryiko
2022-07-06 6:41 ` Yonghong Song
2022-07-06 6:41 ` Yonghong Song
2022-07-06 7:01 ` Christoph Hellwig
2022-07-06 7:01 ` Christoph Hellwig
2022-07-09 1:01 ` Yixun Lan [this message]
2022-07-09 1:01 ` Yixun Lan
2022-07-09 6:24 ` Christoph Hellwig
2022-07-09 6:24 ` Christoph Hellwig
2022-07-09 8:48 ` Yixun Lan
2022-07-09 8:48 ` Yixun Lan
2022-07-11 3:58 ` Christoph Hellwig
2022-07-11 3:58 ` Christoph Hellwig
2022-07-06 7:00 ` Christoph Hellwig
2022-07-06 7:00 ` Christoph Hellwig
2022-07-08 22:22 ` Andrii Nakryiko
2022-07-08 22:22 ` Andrii Nakryiko
2022-07-09 6:25 ` Christoph Hellwig
2022-07-09 6:25 ` Christoph Hellwig
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=YsjTVvyqdVGy1uYZ@ofant \
--to=dlan@gentoo.org \
--cc=alan.maguire@oracle.com \
--cc=andrii.nakryiko@gmail.com \
--cc=andrii@kernel.org \
--cc=aou@eecs.berkeley.edu \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=hch@infradead.org \
--cc=john.fastabend@gmail.com \
--cc=kafai@fb.com \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=netdev@vger.kernel.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=songliubraving@fb.com \
--cc=yhs@fb.com \
/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.