public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiong Wang <jiong.wang@netronome.com>
To: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
Cc: Jiong Wang <jiong.wang@netronome.com>,
	linux-kernel@vger.kernel.org, Jiri Olsa <jolsa@redhat.com>,
	Jiri Benc <jbenc@redhat.com>
Subject: Re: ebpf: BPF_ALU32 | BPF_ARSH on BE arches
Date: Tue, 25 Jun 2019 11:20:07 +0100	[thread overview]
Message-ID: <87ef3i9dbc.fsf@netronome.com> (raw)
In-Reply-To: <xunyo92mox9h.fsf@redhat.com>


Yauheni Kaliuta writes:

> Hi!
>
> Looks like the code:
>
>        ALU_ARSH_X:
>                DST = (u64) (u32) ((*(s32 *) &DST) >> SRC);
>                CONT;
>        ALU_ARSH_K:
>                DST = (u64) (u32) ((*(s32 *) &DST) >> IMM);
>                CONT;
>
> works incorrectly on BE arches since it must operate on lower
> parts of 64bit registers.
>
> See failure of test_verifier test 'arsh32 on imm 2' (#23 on
> 5.2-rc6).

Ah, thanks for reporting this.

Should not taken the address directly, does the following fix resolved the
failure?

        ALU_ARSH_X:
                DST = (u64) (u32) ((s32) DST) >> SRC);
                CONT;
        ALU_ARSH_K:
                DST = (u64) (u32) ((s32) DST) >> IMM);
                CONT;

Regards,
Jiong

  reply	other threads:[~2019-06-25 10:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-25  9:00 ebpf: BPF_ALU32 | BPF_ARSH on BE arches Yauheni Kaliuta
2019-06-25 10:20 ` Jiong Wang [this message]
2019-06-25 10:41   ` Yauheni Kaliuta

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=87ef3i9dbc.fsf@netronome.com \
    --to=jiong.wang@netronome.com \
    --cc=jbenc@redhat.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yauheni.kaliuta@redhat.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