From: Eduard Zingerman <eddyz87@gmail.com>
To: Yonghong Song <yonghong.song@linux.dev>,
bpf@vger.kernel.org, ast@kernel.org
Cc: andrii@kernel.org, daniel@iogearbox.net, martin.lau@linux.dev,
kernel-team@fb.com, hffilwlqm@gmail.com
Subject: Re: [PATCH bpf-next 4/4] selftests/bpf: validate jit behaviour for tail calls
Date: Thu, 15 Aug 2024 14:47:21 -0700 [thread overview]
Message-ID: <f49cc01dfea19be0d287995e8bb539a14dd31cf1.camel@gmail.com> (raw)
In-Reply-To: <78d7872d-4644-4a9a-9ef2-f4823fd7944f@linux.dev>
On Thu, 2024-08-15 at 14:32 -0700, Yonghong Song wrote:
[...]
> > +__success
> > +/* program entry for main(), regular function prologue */
> > +__jit_x86(" endbr64")
> > +__jit_x86(" nopl (%rax,%rax)")
> > +__jit_x86(" xorq %rax, %rax")
> > +__jit_x86(" pushq %rbp")
> > +__jit_x86(" movq %rsp, %rbp")
>
> How do we hanble multi architectures (x86, arm64, riscv64)?
>
> Do we support the following?
>
> __jit_x86(...)
> __jit_x86(...)
> ...
>
> __jit_arm64(...)
> __jit_arm64(...)
> ...
>
> __jit_riscv64(...)
> __jit_riscv64(...)
> ...
^^^^
I was thinking about this variant (and this is how things are now implemented).
Whenever there would be a need for that, just add one more arch
specific macro.
>
> Or we can use macro like
>
> #ifdef __TARGET_ARCH_x86
> __jit(...)
> ...
> #elif defined(__TARGET_ARCH_arm64)
> __jit(...)
> ...
> #elif defined(...)
>
> Or we can have
>
> __arch_x86_64
> __jit(...) // code for x86
> ...
>
> __arch_arm64
> __jit(...) // code for arm64
> ...
>
> __arch_riscv
> __jit(...) // code for riscv
> ...
This also looks good, and will work better with "*_next" and "*_not"
variants if we are going to borrow from llvm-lit/FileCheck.
> For xlated, different archs could share the same code.
> Bot for jited code, different arch has different encoding,
> so we need to figure out a format suitable for multiple
> archs.
I'll go with whatever way mailing list likes better.
[...]
next prev parent reply other threads:[~2024-08-15 21:47 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-09 1:05 [PATCH bpf-next 0/4] __jited_x86 test tag to check x86 assembly after jit Eduard Zingerman
2024-08-09 1:05 ` [PATCH bpf-next 1/4] selftests/bpf: less spam in the log for message matching Eduard Zingerman
2024-08-09 1:05 ` [PATCH bpf-next 2/4] selftests/bpf: utility function to get program disassembly after jit Eduard Zingerman
2024-08-13 16:05 ` Yonghong Song
2024-08-13 22:01 ` Eduard Zingerman
2024-08-15 19:27 ` Yonghong Song
2024-08-15 19:34 ` Eduard Zingerman
2024-08-15 21:06 ` Andrii Nakryiko
2024-08-15 21:50 ` Eduard Zingerman
2024-08-15 22:04 ` Andrii Nakryiko
2024-08-19 19:45 ` Eduard Zingerman
2024-08-19 21:05 ` Andrii Nakryiko
2024-08-09 1:05 ` [PATCH bpf-next 3/4] selftests/bpf: __jited_x86 test tag to check x86 assembly " Eduard Zingerman
2024-08-15 21:11 ` Andrii Nakryiko
2024-08-15 21:48 ` Eduard Zingerman
2024-08-09 1:05 ` [PATCH bpf-next 4/4] selftests/bpf: validate jit behaviour for tail calls Eduard Zingerman
2024-08-15 21:15 ` Andrii Nakryiko
2024-08-15 21:42 ` Eduard Zingerman
2024-08-15 22:07 ` Andrii Nakryiko
2024-08-15 22:10 ` Eduard Zingerman
2024-08-15 22:14 ` Andrii Nakryiko
2024-08-15 22:19 ` Eduard Zingerman
2024-08-15 21:32 ` Yonghong Song
2024-08-15 21:47 ` Eduard Zingerman [this message]
2024-08-15 22:09 ` Andrii Nakryiko
2024-08-15 22:16 ` Eduard Zingerman
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=f49cc01dfea19be0d287995e8bb539a14dd31cf1.camel@gmail.com \
--to=eddyz87@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=hffilwlqm@gmail.com \
--cc=kernel-team@fb.com \
--cc=martin.lau@linux.dev \
--cc=yonghong.song@linux.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox