All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	bpf <bpf@vger.kernel.org>
Subject: RE: FW: BPF_PSEUDO_CALL question
Date: Tue, 16 Apr 2019 14:34:17 +0000	[thread overview]
Message-ID: <2601191342CEEE43887BDE71AB9772580148A9869C@irsmsx105.ger.corp.intel.com> (raw)
In-Reply-To: <CAADnVQJoo7vSaCCFGpTgrQmCw4Cq-FcLhPtzr=YNaZ7y31ahLg@mail.gmail.com>



> -----Original Message-----
> From: Alexei Starovoitov [mailto:alexei.starovoitov@gmail.com]
> Sent: Tuesday, April 16, 2019 2:01 AM
> To: Ananyev, Konstantin <konstantin.ananyev@intel.com>; bpf <bpf@vger.kernel.org>
> Subject: Re: FW: BPF_PSEUDO_CALL question
> 
> On Mon, Apr 15, 2019 at 5:13 AM Ananyev, Konstantin
> <konstantin.ananyev@intel.com> wrote:
> >
> > Hi Alexei,
> > I posted the question below on llvm-dev mailing list, but there is no answer so far.
> > As you seems the author of BPF_PSEUDO_CALL in LLVM (and linux kernel) thought might
> > be you know the answer?
> > I looked through the patches, but didn't spot anything myself.
> > Thanks
> > Konstantin
> >
> > -----Original Message-----
> > From: llvm-dev [mailto:llvm-dev-bounces@lists.llvm.org] On Behalf Of Ananyev, Konstantin via llvm-dev
> > Sent: Wednesday, April 10, 2019 7:37 PM
> > To: llvm-dev@lists.llvm.org
> > Subject: [llvm-dev] BPF_PSEUDO_CALL question
> >
> >
> > Hi everyone,
> > with clang 6.0 and onwards, for the following code:
> > $ cat t6.c
> >
> > #include <stdint.h>
> >
> > extern int ffx1(const void *p);
> >
> > uint64_t entry(const void *p)
> > {
> >         return ffx1(p);
> > }
> >
> > clang -O2  -target bpfel -c t6.c
> > generates for the call BPF_PSEUDO_CALL instruction:
> > entry:
> >        0:       85 10 00 00 ff ff ff ff         call -1
> >        1:       67 00 00 00 20 00 00 00         r0 <<= 32
> >        2:       c7 00 00 00 20 00 00 00         r0 s>>= 32
> >        3:       95 00 00 00 00 00 00 00         exit
> >
> > Is there any way to force clang to generate proper BPF_CALL instruction,
> > i.e: 85 00 00 00 ff ff ff ff (as it did in older versions)?
> 
> older version of llvm generated broken code.
> there are only two call flavors:
> - call imm -> calling particular kernel helper where imm==helper_id

Ok but in the example above, is it possible tell to the llvm that
ffx1() is actually a kernel helper with id==X?

> - call pseudo +-off -> call another bpf function
> there is no arbitrary call support yet.

  reply	other threads:[~2019-04-16 14:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2601191342CEEE43887BDE71AB9772580148A95A96@irsmsx105.ger.corp.intel.com>
     [not found] ` <2601191342CEEE43887BDE71AB9772580148A97E27@irsmsx105.ger.corp.intel.com>
2019-04-16  1:01   ` FW: BPF_PSEUDO_CALL question Alexei Starovoitov
2019-04-16 14:34     ` Ananyev, Konstantin [this message]
2019-04-16 16:12       ` Alexei Starovoitov
2019-04-19 11:16         ` Ananyev, Konstantin
2019-04-20  0:30           ` 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=2601191342CEEE43887BDE71AB9772580148A9869C@irsmsx105.ger.corp.intel.com \
    --to=konstantin.ananyev@intel.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=bpf@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.