From: "Jose E. Marchesi" <jose.marchesi@oracle.com>
To: David Faust <david.faust@oracle.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] sim: bpf: remove negi, neg32i insns
Date: Mon, 21 Aug 2023 19:05:38 +0200 [thread overview]
Message-ID: <875y58l40t.fsf@oracle.com> (raw)
In-Reply-To: <20230821170250.6457-1-david.faust@oracle.com> (David Faust's message of "Mon, 21 Aug 2023 10:02:50 -0700")
Hi Faust.
OK. Thanks.
> The BPF virtual machine does not support neg instructions operating on
> immediates, and these erroneous instructions were recently removed from
> gas. Remove them from the simulator as well.
>
> binutils patch:
> [PATCH] bpf: correct neg and neg32 instruction encoding
> https://sourceware.org/pipermail/binutils/2023-August/129135.html
>
> ---
> sim/bpf/bpf-sim.c | 8 --------
> 1 file changed, 8 deletions(-)
>
> diff --git a/sim/bpf/bpf-sim.c b/sim/bpf/bpf-sim.c
> index 5e01ddeca9f..a4af22b2308 100644
> --- a/sim/bpf/bpf-sim.c
> +++ b/sim/bpf/bpf-sim.c
> @@ -730,10 +730,6 @@ execute (SIM_CPU *cpu, struct bpf_insn *insn)
> BPF_TRACE ("BPF_INSN_NEGR\n");
> bpf_regs[insn->dst] = - (int64_t) bpf_regs[insn->dst];
> break;
> - case BPF_INSN_NEGI:
> - BPF_TRACE ("BPF_INSN_NEGI\n");
> - bpf_regs[insn->dst] = - (int64_t) insn->imm32;
> - break;
> case BPF_INSN_LSHR:
> BPF_TRACE ("BPF_INSN_LSHR\n");
> bpf_regs[insn->dst] <<= bpf_regs[insn->src];
> @@ -867,10 +863,6 @@ execute (SIM_CPU *cpu, struct bpf_insn *insn)
> BPF_TRACE ("BPF_INSN_NEG32R\n");
> bpf_regs[insn->dst] = (uint32_t) (- (int32_t) bpf_regs[insn->dst]);
> break;
> - case BPF_INSN_NEG32I:
> - BPF_TRACE ("BPF_INSN_NEG32I\n");
> - bpf_regs[insn->dst] = (uint32_t) - (int32_t) insn->imm32;
> - break;
> case BPF_INSN_LSH32R:
> BPF_TRACE ("BPF_INSN_LSH32R\n");
> bpf_regs[insn->dst] = (uint32_t) bpf_regs[insn->dst] << bpf_regs[insn->src];
prev parent reply other threads:[~2023-08-21 17:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-21 17:02 David Faust
2023-08-21 17:05 ` Jose E. Marchesi [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=875y58l40t.fsf@oracle.com \
--to=jose.marchesi@oracle.com \
--cc=david.faust@oracle.com \
--cc=gdb-patches@sourceware.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).