<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/sparc/net, branch linux-4.12.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.12.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.12.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2017-05-02T03:48:36Z</updated>
<entry>
<title>sparc64: Fix BPF JIT wrt. branches and ldimm64 instructions.</title>
<updated>2017-05-02T03:48:36Z</updated>
<author>
<name>David S. Miller</name>
</author>
<published>2017-05-02T03:26:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e3bf4c61da801c7967d0efff0c3f6b22d2c0e544'/>
<id>urn:sha1:e3bf4c61da801c7967d0efff0c3f6b22d2c0e544</id>
<content type='text'>
Like other JITs, sparc64 maintains an array of instruction offsets but
stores the entries off by one.  This is done because jumps to the
exit block are indexed to one past the last BPF instruction.

So if we size the array by the program length, we need to record
the previous instruction in order to stay within the array bounds.

This is explained in ARM JIT commit 8eee539ddea0 ("arm64: bpf: fix
out-of-bounds read in bpf2a64_offset()").

But this scheme requires a little bit of careful handling when
the instruction before the branch destination is a 64-bit load
immediate.  It takes up 2 BPF instruction slots.

Therefore, we have to fill in the array entry for the second
half of the 64-bit load immediate instruction rather than for
the one for the beginning of that instruction.

Fixes: 7a12b5031c6b ("sparc64: Add eBPF JIT.")
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sparc64: Improve 64-bit constant loading in eBPF JIT.</title>
<updated>2017-04-25T03:32:15Z</updated>
<author>
<name>David S. Miller</name>
</author>
<published>2017-04-25T02:42:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=14933dc8d9964e46f1d5bd2a4dfe3d3be8e420e0'/>
<id>urn:sha1:14933dc8d9964e46f1d5bd2a4dfe3d3be8e420e0</id>
<content type='text'>
Doing a full 64-bit decomposition is really stupid especially for
simple values like 0 and -1.

But if we are going to optimize this, go all the way and try for all 2
and 3 instruction sequences not requiring a temporary register as
well.

First we do the easy cases where it's a zero or sign extended 32-bit
number (sethi+or, sethi+xor, respectively).

Then we try to find a range of set bits we can load simply then shift
up into place, in various ways.

Then we try negating the constant and see if we can do a simple
sequence using that with a xor at the end.  (f.e. the range of set
bits can't be loaded simply, but for the negated value it can)

The final optimized strategy involves 4 instructions sequences not
needing a temporary register.

Otherwise we sadly fully decompose using a temp..

Example, from ALU64_XOR_K: 0x0000ffffffff0000 ^ 0x0 = 0x0000ffffffff0000:

0000000000000000 &lt;foo&gt;:
   0:   9d e3 bf 50     save  %sp, -176, %sp
   4:   01 00 00 00     nop
   8:   90 10 00 18     mov  %i0, %o0
   c:   13 3f ff ff     sethi  %hi(0xfffffc00), %o1
  10:   92 12 63 ff     or  %o1, 0x3ff, %o1     ! ffffffff &lt;foo+0xffffffff&gt;
  14:   93 2a 70 10     sllx  %o1, 0x10, %o1
  18:   15 3f ff ff     sethi  %hi(0xfffffc00), %o2
  1c:   94 12 a3 ff     or  %o2, 0x3ff, %o2     ! ffffffff &lt;foo+0xffffffff&gt;
  20:   95 2a b0 10     sllx  %o2, 0x10, %o2
  24:   92 1a 60 00     xor  %o1, 0, %o1
  28:   12 e2 40 8a     cxbe  %o1, %o2, 38 &lt;foo+0x38&gt;
  2c:   9a 10 20 02     mov  2, %o5
  30:   10 60 00 03     b,pn   %xcc, 3c &lt;foo+0x3c&gt;
  34:   01 00 00 00     nop
  38:   9a 10 20 01     mov  1, %o5     ! 1 &lt;foo+0x1&gt;
  3c:   81 c7 e0 08     ret
  40:   91 eb 40 00     restore  %o5, %g0, %o0

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sparc64: Support cbcond instructions in eBPF JIT.</title>
<updated>2017-04-24T22:56:21Z</updated>
<author>
<name>David S. Miller</name>
</author>
<published>2017-04-24T22:56:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e3a724edeec3836ed44675a6587a6db7b6b68dbe'/>
<id>urn:sha1:e3a724edeec3836ed44675a6587a6db7b6b68dbe</id>
<content type='text'>
cbcond combines a compare with a branch into a single instruction.

The limitations are:

1) Only newer chips support it

2) For immediate compares we are limited to 5-bit signed immediate
   values

3) The branch displacement is limited to 10-bit signed

4) We cannot use it for JSET

Also, cbcond (unlike all other sparc control transfers) lacks a delay
slot.

Currently we don't have a useful instruction we can push into the
delay slot of normal branches.  So using cbcond pretty much always
increases code density, and is therefore a win.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sparc64: Add eBPF JIT.</title>
<updated>2017-04-22T19:10:52Z</updated>
<author>
<name>David S. Miller</name>
</author>
<published>2017-04-18T01:44:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7a12b5031c6b947cc13918237ae652b536243b76'/>
<id>urn:sha1:7a12b5031c6b947cc13918237ae652b536243b76</id>
<content type='text'>
This is an eBPF JIT for sparc64.  All major features are supported.

All tests under tools/testing/selftests/bpf/ pass.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sparc: Split BPF JIT into 32-bit and 64-bit.</title>
<updated>2017-04-22T19:10:52Z</updated>
<author>
<name>David S. Miller</name>
</author>
<published>2017-04-18T01:25:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6b3d4eec7f34c21df80191bfd72657404dad0f0a'/>
<id>urn:sha1:6b3d4eec7f34c21df80191bfd72657404dad0f0a</id>
<content type='text'>
This is in preparation for adding the 64-bit eBPF JIT.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sparc: Fix misspellings in comments.</title>
<updated>2016-03-21T04:28:58Z</updated>
<author>
<name>Adam Buchbinder</name>
</author>
<published>2016-03-04T19:21:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=08f80073039aba911fbf3f316a00a4ac5d03052f'/>
<id>urn:sha1:08f80073039aba911fbf3f316a00a4ac5d03052f</id>
<content type='text'>
Signed-off-by: Adam Buchbinder &lt;adam.buchbinder@gmail.com&gt;
Reviewed-by: Julian Calaby &lt;julian.calaby@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: filter: make JITs zero A for SKF_AD_ALU_XOR_X</title>
<updated>2016-01-06T05:43:52Z</updated>
<author>
<name>Rabin Vincent</name>
</author>
<published>2016-01-05T15:23:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=55795ef5469290f89f04e12e662ded604909e462'/>
<id>urn:sha1:55795ef5469290f89f04e12e662ded604909e462</id>
<content type='text'>
The SKF_AD_ALU_XOR_X ancillary is not like the other ancillary data
instructions since it XORs A with X while all the others replace A with
some loaded value.  All the BPF JITs fail to clear A if this is used as
the first instruction in a filter.  This was found using american fuzzy
lop.

Add a helper to determine if A needs to be cleared given the first
instruction in a filter, and use this in the JITs.  Except for ARM, the
rest have only been compile-tested.

Fixes: 3480593131e0 ("net: filter: get rid of BPF_S_* enum")
Signed-off-by: Rabin Vincent &lt;rabin@rab.in&gt;
Acked-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ebpf: migrate bpf_prog's flags to bitfield</title>
<updated>2015-10-03T12:02:39Z</updated>
<author>
<name>Daniel Borkmann</name>
</author>
<published>2015-09-29T23:41:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a91263d520246b63c63e75ddfb072ee6a853fe15'/>
<id>urn:sha1:a91263d520246b63c63e75ddfb072ee6a853fe15</id>
<content type='text'>
As we need to add further flags to the bpf_prog structure, lets migrate
both bools to a bitfield representation. The size of the base structure
(excluding insns) remains unchanged at 40 bytes.

Add also tags for the kmemchecker, so that it doesn't throw false
positives. Even in case gcc would generate suboptimal code, it's not
being accessed in performance critical paths.

Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>bpf, x86/sparc: show actual number of passes in bpf_jit_dump</title>
<updated>2015-07-30T18:13:21Z</updated>
<author>
<name>Daniel Borkmann</name>
</author>
<published>2015-07-30T10:42:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=485d6511e71e5810f07eec29b884c98021e67911'/>
<id>urn:sha1:485d6511e71e5810f07eec29b884c98021e67911</id>
<content type='text'>
When bpf_jit_compile() got split into two functions via commit
f3c2af7ba17a ("net: filter: x86: split bpf_jit_compile()"), bpf_jit_dump()
was changed to always show 0 as number of compiler passes. Change it to
dump the actual number. Also on sparc, we count passes starting from 0,
so add 1 for the debug dump as well.

Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>module: remove mod arg from module_free, rename module_memfree().</title>
<updated>2015-01-20T01:08:33Z</updated>
<author>
<name>Rusty Russell</name>
</author>
<published>2015-01-19T22:37:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=be1f221c0445a4157d177197c236f888d3581914'/>
<id>urn:sha1:be1f221c0445a4157d177197c236f888d3581914</id>
<content type='text'>
Nothing needs the module pointer any more, and the next patch will
call it from RCU, where the module itself might no longer exist.
Removing the arg is the safest approach.

This just codifies the use of the module_alloc/module_free pattern
which ftrace and bpf use.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Acked-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Cc: Mikael Starvik &lt;starvik@axis.com&gt;
Cc: Jesper Nilsson &lt;jesper.nilsson@axis.com&gt;
Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Cc: Ley Foon Tan &lt;lftan@altera.com&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Chris Metcalf &lt;cmetcalf@ezchip.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: x86@kernel.org
Cc: Ananth N Mavinakayanahalli &lt;ananth@in.ibm.com&gt;
Cc: Anil S Keshavamurthy &lt;anil.s.keshavamurthy@intel.com&gt;
Cc: Masami Hiramatsu &lt;masami.hiramatsu.pt@hitachi.com&gt;
Cc: linux-cris-kernel@axis.com
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: nios2-dev@lists.rocketboards.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: sparclinux@vger.kernel.org
Cc: netdev@vger.kernel.org
</content>
</entry>
</feed>
