From: Daniel Borkmann <daniel@iogearbox.net>
To: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>,
linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
netdev@vger.kernel.org, Michael Ellerman <mpe@ellerman.id.au>
Cc: Alexei Starovoitov <ast@fb.com>,
"David S. Miller" <davem@davemloft.net>,
Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Subject: Re: [PATCH 3/3] bpf powerpc: add support for bpf constant blinding
Date: Fri, 23 Sep 2016 23:40:42 +0200 [thread overview]
Message-ID: <57E5A15A.7090001@iogearbox.net> (raw)
In-Reply-To: <0ecead168c80b1c3d8a8101595e689ff7c7a735f.1474661927.git.naveen.n.rao@linux.vnet.ibm.com>
On 09/23/2016 10:35 PM, Naveen N. Rao wrote:
> In line with similar support for other architectures by Daniel Borkmann.
>
> 'MOD Default X' from test_bpf without constant blinding:
> 84 bytes emitted from JIT compiler (pass:3, flen:7)
> d0000000058a4688 + <x>:
> 0: nop
> 4: nop
> 8: std r27,-40(r1)
> c: std r28,-32(r1)
> 10: xor r8,r8,r8
> 14: xor r28,r28,r28
> 18: mr r27,r3
> 1c: li r8,66
> 20: cmpwi r28,0
> 24: bne 0x0000000000000030
> 28: li r8,0
> 2c: b 0x0000000000000044
> 30: divwu r9,r8,r28
> 34: mullw r9,r28,r9
> 38: subf r8,r9,r8
> 3c: rotlwi r8,r8,0
> 40: li r8,66
> 44: ld r27,-40(r1)
> 48: ld r28,-32(r1)
> 4c: mr r3,r8
> 50: blr
>
> ... and with constant blinding:
> 140 bytes emitted from JIT compiler (pass:3, flen:11)
> d00000000bd6ab24 + <x>:
> 0: nop
> 4: nop
> 8: std r27,-40(r1)
> c: std r28,-32(r1)
> 10: xor r8,r8,r8
> 14: xor r28,r28,r28
> 18: mr r27,r3
> 1c: lis r2,-22834
> 20: ori r2,r2,36083
> 24: rotlwi r2,r2,0
> 28: xori r2,r2,36017
> 2c: xoris r2,r2,42702
> 30: rotlwi r2,r2,0
> 34: mr r8,r2
> 38: rotlwi r8,r8,0
> 3c: cmpwi r28,0
> 40: bne 0x000000000000004c
> 44: li r8,0
> 48: b 0x000000000000007c
> 4c: divwu r9,r8,r28
> 50: mullw r9,r28,r9
> 54: subf r8,r9,r8
> 58: rotlwi r8,r8,0
> 5c: lis r2,-17137
> 60: ori r2,r2,39065
> 64: rotlwi r2,r2,0
> 68: xori r2,r2,39131
> 6c: xoris r2,r2,48399
> 70: rotlwi r2,r2,0
> 74: mr r8,r2
> 78: rotlwi r8,r8,0
> 7c: ld r27,-40(r1)
> 80: ld r28,-32(r1)
> 84: mr r3,r8
> 88: blr
>
> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
next prev parent reply other threads:[~2016-09-23 21:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-23 20:35 [PATCH 1/3] bpf powerpc: introduce accessors for using the tmp local stack space Naveen N. Rao
2016-09-23 20:35 ` [PATCH 2/3] bpf powerpc: implement support for tail calls Naveen N. Rao
2016-09-23 22:33 ` Daniel Borkmann
2016-09-24 7:30 ` Alexei Starovoitov
2016-09-26 8:56 ` Naveen N. Rao
2016-09-26 9:00 ` Daniel Borkmann
2016-09-26 9:09 ` Naveen N. Rao
2016-09-23 20:35 ` [PATCH 3/3] bpf powerpc: add support for bpf constant blinding Naveen N. Rao
2016-09-23 21:40 ` Daniel Borkmann [this message]
2016-10-05 2:36 ` [1/3] bpf powerpc: introduce accessors for using the tmp local stack space Michael Ellerman
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=57E5A15A.7090001@iogearbox.net \
--to=daniel@iogearbox.net \
--cc=ananth@in.ibm.com \
--cc=ast@fb.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=naveen.n.rao@linux.vnet.ibm.com \
--cc=netdev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox