[PATCH] ppc: Fix BPF JIT for ABIv2

From: Thadeu Lima de Souza Cascardo
Date: Fri Jun 17 2016 - 09:00:56 EST


On Fri, Jun 17, 2016 at 10:53:21PM +1000, Michael Ellerman wrote:
> On Tue, 2016-07-06 at 13:32:23 UTC, "Naveen N. Rao" wrote:
> > diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc/net/bpf_jit_comp64.c
> > new file mode 100644
> > index 0000000..954ff53
> > --- /dev/null
> > +++ b/arch/powerpc/net/bpf_jit_comp64.c
> > @@ -0,0 +1,956 @@
> ...
> > +
> > +static void bpf_jit_fill_ill_insns(void *area, unsigned int size)
> > +{
> > + int *p = area;
> > +
> > + /* Fill whole space with trap instructions */
> > + while (p < (int *)((char *)area + size))
> > + *p++ = BREAKPOINT_INSTRUCTION;
> > +}
>
> This breaks the build for some configs, presumably you're missing a header:
>
> arch/powerpc/net/bpf_jit_comp64.c:30:10: error: 'BREAKPOINT_INSTRUCTION' undeclared (first use in this function)
>
> http://kisskb.ellerman.id.au/kisskb/buildresult/12720611/
>
> cheers

Hi, Michael and Naveen.

I noticed independently that there is a problem with BPF JIT and ABIv2, and
worked out the patch below before I noticed Naveen's patchset and the latest
changes in ppc tree for a better way to check for ABI versions.

However, since the issue described below affect mainline and stable kernels,
would you consider applying it before merging your two patchsets, so that we can
more easily backport the fix?

Thanks.
Cascardo.

---