mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Wang YanQing <udknight@gmail.com>,
	ast@kernel.org, davem@davemloft.net, kuznet@ms2.inr.ac.ru,
	tglx@linutronix.de, netdev@vger.kernel.org, bpf@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] bpf, x32: Fix bug for BPF_ALU64 | BPF_NEG
Date: Wed, 1 May 2019 23:43:45 +0200	[thread overview]
Message-ID: <091c2ed4-a07f-cc75-7b18-1c7cb7068652@iogearbox.net> (raw)
In-Reply-To: <20190428023302.GA29326@udknight>

On 04/28/2019 04:33 AM, Wang YanQing wrote:
> The current implementation has two errors:
> 1: The second xor instruction will clear carry flag which
>    is necessary for following sbb instruction.
> 2: The select coding for sbb instruction is wrong, the coding
>    is "sbb dreg_hi,ecx", but what we need is "sbb ecx,dreg_hi".
> 
> This patch rewrites the implementation and fixes the errors.
> 
> This patch fixes below errors reported by bpf/test_verifier in x32
> platform when the jit is enabled:
> "
> 0: (b4) w1 = 4
> 1: (b4) w2 = 4
> 2: (1f) r2 -= r1
> 3: (4f) r2 |= r1
> 4: (87) r2 = -r2
> 5: (c7) r2 s>>= 63
> 6: (5f) r1 &= r2
> 7: (bf) r0 = r1
> 8: (95) exit
> processed 9 insns (limit 131072), stack depth 0
> 0: (b4) w1 = 4
> 1: (b4) w2 = 4
> 2: (1f) r2 -= r1
> 3: (4f) r2 |= r1
> 4: (87) r2 = -r2
> 5: (c7) r2 s>>= 63
> 6: (5f) r1 &= r2
> 7: (bf) r0 = r1
> 8: (95) exit
> processed 9 insns (limit 131072), stack depth 0
> ......
> Summary: 1189 PASSED, 125 SKIPPED, 15 FAILED
> "
> 
> Signed-off-by: Wang YanQing <udknight@gmail.com>

Applied, thanks!

      reply	other threads:[~2019-05-01 21:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-28  2:33 Wang YanQing
2019-05-01 21:43 ` Daniel Borkmann [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=091c2ed4-a07f-cc75-7b18-1c7cb7068652@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=udknight@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®