bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Song Liu <songliubraving@fb.com>
To: Yonghong Song <yhs@fb.com>
Cc: bpf <bpf@vger.kernel.org>, Alexei Starovoitov <ast@fb.com>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	Kernel Team <Kernel-team@fb.com>
Subject: Re: [PATCH bpf-next v2] [tools/bpf] workaround a verifier failure for test_progs
Date: Thu, 7 Nov 2019 23:10:10 +0000	[thread overview]
Message-ID: <BDA6DC5F-1C36-4E62-967E-43FA0DCC6231@fb.com> (raw)
In-Reply-To: <20191107170045.2503480-1-yhs@fb.com>



> On Nov 7, 2019, at 9:00 AM, Yonghong Song <yhs@fb.com> wrote:
> 

[...]

> Let us workaound this issue until we found a compiler and/or
> verifier solution. The workaround in this patch is
> to make variable 'ret' volatile, which will force a reload
> and then '&' operation to ensure better value range.
> With this patch, I got the below byte code for the loop,
>  0000000000000328 LBB0_9:
>     101:       r4 = r10
>     102:       r4 += -288
>     103:       r4 += r7
>     104:       w8 &= 255
>     105:       r1 = r10
>     106:       r1 += -488
>     107:       r1 += r8
>     108:       r2 = 7
>     109:       r3 = 0
>     110:       call 106
>     111:       *(u32 *)(r10 - 64) = r0
>     112:       r1 = *(u32 *)(r10 - 64)
>     113:       if w1 s< 1 goto -28 <LBB0_5>
>     114:       r1 = *(u32 *)(r10 - 64)
>     115:       if w1 s> 7 goto -30 <LBB0_5>
>     116:       r1 = *(u32 *)(r10 - 64)
>     117:       w1 &= 7
>     118:       w1 += w8
>     119:       r7 += 8
>     120:       w8 = w1
>     121:       if r7 != 224 goto -21 <LBB0_9>
> Insn 117 did the '&' operation and we got more precise
> value range for 'w8' at insn 120.

Thanks for adding this information. 

> The test is happy then.
>  #3/17 test_sysctl_loop1.o:OK
> 
> Signed-off-by: Yonghong Song <yhs@fb.com>

Acked-by: Song Liu <songliubraving@fb.com>




  reply	other threads:[~2019-11-07 23:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-07 17:00 [PATCH bpf-next v2] [tools/bpf] workaround a verifier failure for test_progs Yonghong Song
2019-11-07 23:10 ` Song Liu [this message]
2019-11-11 13:07 ` Daniel Borkmann
2020-04-28  2:56 Ma Xinjian
2020-04-28  6:13 ` Yonghong Song
2020-04-28 22:33   ` Alexei Starovoitov

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=BDA6DC5F-1C36-4E62-967E-43FA0DCC6231@fb.com \
    --to=songliubraving@fb.com \
    --cc=Kernel-team@fb.com \
    --cc=ast@fb.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=yhs@fb.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;
as well as URLs for NNTP newsgroup(s).