public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Quentin Monnet <qmo@kernel.org>
To: Simone Magnani <simone.magnani@isovalent.com>, bpf@vger.kernel.org
Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	martin.lau@linux.dev, eddyz87@gmail.com, song@kernel.org,
	yonghong.song@linux.dev, john.fastabend@gmail.com,
	kpsingh@kernel.org, sdf@fomichev.me, haoluo@google.com,
	jolsa@kernel.org, nathan@kernel.org, ndesaulniers@google.com,
	morbo@google.com, justinstitt@google.com,
	linux-kernel@vger.kernel.org, llvm@lists.linux.dev
Subject: Re: [PATCH bpf-next v2] bpftool: Probe for ISA v4 instruction set extension
Date: Mon, 9 Dec 2024 17:05:57 +0000	[thread overview]
Message-ID: <98c2ad67-2672-4eef-b952-18e6ad28a027@kernel.org> (raw)
In-Reply-To: <ca871055-0b4c-4380-8f32-a4a7152345c6@isovalent.com>

2024-12-09 18:01 UTC+0100 ~ Simone Magnani <simone.magnani@isovalent.com>
> On 09/12/24 16:20, Quentin Monnet wrote:
>> Looking again at the probe itself, does the second instruction serve any
>> practical purpose here? Don't you just need to test the BPF_JMP32_A?
>>
>> Looks good otherwise, thank you!
>>
>> Reviewed-by: Quentin Monnet <qmo@kernel.org>
> 
> I wanted to keep probes similar to the previous ones (especially v3
> and v2), despite we never check their return codes. This means
> having as 4th instruction `BPF_MOV64_IMM(BPF_REG_0, 1)`. However,
> to do so, I also need the 2nd instruction, otherwise I'd hit an
> `Invalid Argument` error while calling `bpf_prog_load()`: I think
> that would be due to the fact that no execution paths would
> execute that instruction otherwise.


Right, that's what I missed.


> 
> An alternative approach less consistent with the others would be:
> 
> struct bpf_insn insns[3] = {
> 		BPF_MOV64_IMM(BPF_REG_0, 0),
> 		BPF_JMP32_A(0),
> 		BPF_EXIT_INSN()
> 	};
> 
> Please let me know if you have any further questions, need
> additional information, or if I could improve the patch.


No it's all good to me in that case, thank you!

Quentin

  reply	other threads:[~2024-12-09 17:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20241209102644.29880-1-simone.magnani@isovalent.com>
2024-12-09 14:54 ` [PATCH bpf-next v2] bpftool: Probe for ISA v4 instruction set extension Simone Magnani
2024-12-09 15:20   ` Quentin Monnet
2024-12-09 17:01     ` Simone Magnani
2024-12-09 17:05       ` Quentin Monnet [this message]
2024-12-12 16:40   ` patchwork-bot+netdevbpf

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=98c2ad67-2672-4eef-b952-18e6ad28a027@kernel.org \
    --to=qmo@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=justinstitt@google.com \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=martin.lau@linux.dev \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=sdf@fomichev.me \
    --cc=simone.magnani@isovalent.com \
    --cc=song@kernel.org \
    --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