lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aAuMDEyiahZi6zIa@krava>
Date: Fri, 25 Apr 2025 15:20:12 +0200
From: Jiri Olsa <olsajiri@...il.com>
To: Andrii Nakryiko <andrii.nakryiko@...il.com>
Cc: Jiri Olsa <olsajiri@...il.com>, Oleg Nesterov <oleg@...hat.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Andrii Nakryiko <andrii@...nel.org>, bpf@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
	x86@...nel.org, Song Liu <songliubraving@...com>,
	Yonghong Song <yhs@...com>,
	John Fastabend <john.fastabend@...il.com>,
	Hao Luo <haoluo@...gle.com>, Steven Rostedt <rostedt@...dmis.org>,
	Masami Hiramatsu <mhiramat@...nel.org>,
	Alan Maguire <alan.maguire@...cle.com>,
	David Laight <David.Laight@...lab.com>,
	Thomas Weißschuh <thomas@...ch.de>,
	Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH perf/core 11/22] selftests/bpf: Use 5-byte nop for x86
 usdt probes

On Thu, Apr 24, 2025 at 11:20:11AM -0700, Andrii Nakryiko wrote:
> On Thu, Apr 24, 2025 at 9:29 AM Andrii Nakryiko
> <andrii.nakryiko@...il.com> wrote:
> >
> > On Thu, Apr 24, 2025 at 5:49 AM Jiri Olsa <olsajiri@...il.com> wrote:
> > >
> > > On Wed, Apr 23, 2025 at 10:33:18AM -0700, Andrii Nakryiko wrote:
> > > > On Mon, Apr 21, 2025 at 2:46 PM Jiri Olsa <jolsa@...nel.org> wrote:
> > > > >
> > > > > Using 5-byte nop for x86 usdt probes so we can switch
> > > > > to optimized uprobe them.
> > > > >
> > > > > Signed-off-by: Jiri Olsa <jolsa@...nel.org>
> > > > > ---
> > > > >  tools/testing/selftests/bpf/sdt.h | 9 ++++++++-
> > > > >  1 file changed, 8 insertions(+), 1 deletion(-)
> > > > >
> > > >
> > > > So sdt.h is an exact copy/paste from systemtap-sdt sources. I'd prefer
> > > > to not modify it unnecessarily.
> > > >
> > > > How about we copy/paste usdt.h ([0]) and use *that* for your
> > > > benchmarks? I've already anticipated the need to change nop
> > > > instruction, so you won't even need to modify the usdt.h file itself,
> > > > just
> > > >
> > > > #define USDT_NOP .byte 0x0f, 0x1f, 0x44, 0x00, 0x00
> > > >
> > > > before #include "usdt.h"
> > >
> > >
> > > sounds good, but it seems we need bit more changes for that,
> > > so far I ended up with:
> > >
> > > -       __usdt_asm1(990:        USDT_NOP)                                                       \
> > > +       __usdt_asm5(990:        USDT_NOP)                                                       \
> > >
> > > but it still won't compile, will need to spend more time on that,
> > > unless you have better solution
> > >
> >
> > Use
> >
> > #define USDT_NOP .ascii "\x0F\x1F\x44\x00\x00"
> >
> > for now, I'll need to improve macro magic to handle instructions with
> > commas in them...
> 
> Ok, fixed in [0]. If you get the latest version, the .byte approach
> will work (I have tests in CI now to validate this).
> 
>   [0] https://github.com/libbpf/usdt/pull/12

yep, works nicely, thanks

jirka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ