<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/s390/net, branch linux-4.6.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.6.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.6.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2016-06-24T17:22:02Z</updated>
<entry>
<title>s390/bpf: reduce maximum program size to 64 KB</title>
<updated>2016-06-24T17:22:02Z</updated>
<author>
<name>Michael Holzheu</name>
</author>
<published>2016-05-12T16:10:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=73e6619018a702f23001fda820dd124c87a68a73'/>
<id>urn:sha1:73e6619018a702f23001fda820dd124c87a68a73</id>
<content type='text'>
commit 0fa963553a5c28d8f8aabd8878326d3f782045fc upstream.

The s390 BFP compiler currently uses relative branch instructions
that only support jumps up to 64 KB. Examples are "j", "jnz", "cgrj",
etc.  Currently the maximum size of s390 BPF programs is set
to 0x7ffff.  If branches over 64 KB are generated the, kernel can
crash due to incorrect code.

So fix this an reduce the maximum size to 64 KB. Programs larger than
that will be interpreted.

Fixes: ce2b6ad9c185 ("s390/bpf: increase BPF_SIZE_MAX")
Signed-off-by: Michael Holzheu &lt;holzheu@linux.vnet.ibm.com&gt;
Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>s390/bpf: fix recache skb-&gt;data/hlen for skb_vlan_push/pop</title>
<updated>2016-06-24T17:22:02Z</updated>
<author>
<name>Michael Holzheu</name>
</author>
<published>2016-05-11T19:13:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=66babd49e858d58ad9f9e9b644f5ffdd16bc37ac'/>
<id>urn:sha1:66babd49e858d58ad9f9e9b644f5ffdd16bc37ac</id>
<content type='text'>
commit 6edf0aa4f8bbdfbb4d6d786892fa02728d05dc36 upstream.

In case of usage of skb_vlan_push/pop, in the prologue we store
the SKB pointer on the stack and restore it after BPF_JMP_CALL
to skb_vlan_push/pop.

Unfortunately currently there are two bugs in the code:

 1) The wrong stack slot (offset 170 instead of 176) is used
 2) The wrong register (W1 instead of B1) is saved

So fix this and use correct stack slot and register.

Fixes: 9db7f2b81880 ("s390/bpf: recache skb-&gt;data/hlen for skb_vlan_push/pop")
Signed-off-by: Michael Holzheu &lt;holzheu@linux.vnet.ibm.com&gt;
Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>bpf: move clearing of A/X into classic to eBPF migration prologue</title>
<updated>2015-12-18T21:04:51Z</updated>
<author>
<name>Daniel Borkmann</name>
</author>
<published>2015-12-17T22:51:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8b614aebecdf2b1f72d51b1527f5a75d218b78e2'/>
<id>urn:sha1:8b614aebecdf2b1f72d51b1527f5a75d218b78e2</id>
<content type='text'>
Back in the days where eBPF (or back then "internal BPF" ;-&gt;) was not
exposed to user space, and only the classic BPF programs internally
translated into eBPF programs, we missed the fact that for classic BPF
A and X needed to be cleared. It was fixed back then via 83d5b7ef99c9
("net: filter: initialize A and X registers"), and thus classic BPF
specifics were added to the eBPF interpreter core to work around it.

This added some confusion for JIT developers later on that take the
eBPF interpreter code as an example for deriving their JIT. F.e. in
f75298f5c3fe ("s390/bpf: clear correct BPF accumulator register"), at
least X could leak stack memory. Furthermore, since this is only needed
for classic BPF translations and not for eBPF (verifier takes care
that read access to regs cannot be done uninitialized), more complexity
is added to JITs as they need to determine whether they deal with
migrations or native eBPF where they can just omit clearing A/X in
their prologue and thus reduce image size a bit, see f.e. cde66c2d88da
("s390/bpf: Only clear A and X for converted BPF programs"). In other
cases (x86, arm64), A and X is being cleared in the prologue also for
eBPF case, which is unnecessary.

Lets move this into the BPF migration in bpf_convert_filter() where it
actually belongs as long as the number of eBPF JITs are still few. It
can thus be done generically; allowing us to remove the quirk from
__bpf_prog_run() and to slightly reduce JIT image size in case of eBPF,
while reducing code duplication on this matter in current(/future) eBPF
JITs.

Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Reviewed-by: Michael Holzheu &lt;holzheu@linux.vnet.ibm.com&gt;
Tested-by: Michael Holzheu &lt;holzheu@linux.vnet.ibm.com&gt;
Cc: Zi Shen Lim &lt;zlim.lnx@gmail.com&gt;
Cc: Yang Shi &lt;yang.shi@linaro.org&gt;
Acked-by: Yang Shi &lt;yang.shi@linaro.org&gt;
Acked-by: Zi Shen Lim &lt;zlim.lnx@gmail.com&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: s390: Fix build error caused by the struct bpf_array member name changed</title>
<updated>2015-08-11T18:49:40Z</updated>
<author>
<name>Kaixu Xia</name>
</author>
<published>2015-08-11T08:56:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2c9c3bbbbfe9f7f700c30d9ac40c1abca59d39ee'/>
<id>urn:sha1:2c9c3bbbbfe9f7f700c30d9ac40c1abca59d39ee</id>
<content type='text'>
There is a build error that "'struct bpf_array' has no member
named 'prog'" on s390. In commit 2a36f0b92eb6 ("bpf: Make the
bpf_prog_array_map more generic"), the member 'prog' of struct
bpf_array is replaced by 'ptrs'. So this patch fixes it.

Fixes: 2a36f0b92eb6 ("bpf: Make the bpf_prog_array_map more generic")
Reported-by: Wu Fengguang &lt;fengguang.wu@intel.com&gt;
Signed-off-by: Kaixu Xia &lt;xiakaixu@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>bpf: provide helper that indicates eBPF was migrated</title>
<updated>2015-07-30T18:13:20Z</updated>
<author>
<name>Daniel Borkmann</name>
</author>
<published>2015-07-30T10:42:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7b36f92934e40d1ee24e5617ddedb852e10086ca'/>
<id>urn:sha1:7b36f92934e40d1ee24e5617ddedb852e10086ca</id>
<content type='text'>
During recent discussions we had with Michael, we found that it would
be useful to have an indicator that tells the JIT that an eBPF program
had been migrated from classic instructions into eBPF instructions, as
only in that case A and X need to be cleared in the prologue. Such eBPF
programs do not set a particular type, but all have BPF_PROG_TYPE_UNSPEC.
Thus, introduce a small helper for cde66c2d88da ("s390/bpf: Only clear
A and X for converted BPF programs") and possibly others in future.

Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Cc: Michael Holzheu &lt;holzheu@linux.vnet.ibm.com&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>s390/bpf: recache skb-&gt;data/hlen for skb_vlan_push/pop</title>
<updated>2015-07-29T21:59:58Z</updated>
<author>
<name>Michael Holzheu</name>
</author>
<published>2015-07-29T19:15:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9db7f2b818809ef2c40fbd64cfcf5ccb0107d7e8'/>
<id>urn:sha1:9db7f2b818809ef2c40fbd64cfcf5ccb0107d7e8</id>
<content type='text'>
Allow eBPF programs attached to TC qdiscs call skb_vlan_push/pop
via helper functions. These functions may change skb-&gt;data/hlen.
This data is cached by s390 JIT to improve performance of ld_abs/ld_ind
instructions. Therefore after a change we have to reload the data.

In case of usage of skb_vlan_push/pop, in the prologue we store
the SKB pointer on the stack and restore it after BPF_JMP_CALL
to skb_vlan_push/pop.

Signed-off-by: Michael Holzheu &lt;holzheu@linux.vnet.ibm.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>s390/bpf: Only clear A and X for converted BPF programs</title>
<updated>2015-07-29T21:59:58Z</updated>
<author>
<name>Michael Holzheu</name>
</author>
<published>2015-07-29T19:15:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cde66c2d88da1d73d755109c80ce4c34b917596b'/>
<id>urn:sha1:cde66c2d88da1d73d755109c80ce4c34b917596b</id>
<content type='text'>
Only classic BPF programs that have been converted to eBPF need to clear
the A and X registers. We can check for converted programs with:

  bpf_prog-&gt;type == BPF_PROG_TYPE_UNSPEC

So add the check and skip initialization for real eBPF programs.

Signed-off-by: Michael Holzheu &lt;holzheu@linux.vnet.ibm.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>s390/bpf: increase BPF_SIZE_MAX</title>
<updated>2015-07-29T21:59:58Z</updated>
<author>
<name>Michael Holzheu</name>
</author>
<published>2015-07-29T19:15:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ce2b6ad9c1856fac5d5e8d3351b3dd5392e09b7a'/>
<id>urn:sha1:ce2b6ad9c1856fac5d5e8d3351b3dd5392e09b7a</id>
<content type='text'>
Currently we have the restriction that jitted BPF programs can
have a maximum size of one page. The reason is that we use short
displacements for the literal pool.

The 20 bit displacements are available since z990 and BPF requires
z196 as minimum. Therefore we can remove this restriction and use
everywhere 20 bit signed long displacements.

Acked-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Signed-off-by: Michael Holzheu &lt;holzheu@linux.vnet.ibm.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>s390/bpf: Fix multiple macro expansions</title>
<updated>2015-07-29T21:59:58Z</updated>
<author>
<name>Michael Holzheu</name>
</author>
<published>2015-07-29T19:15:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1df03ffdded54fbb6507ef494ece071f3501410e'/>
<id>urn:sha1:1df03ffdded54fbb6507ef494ece071f3501410e</id>
<content type='text'>
The EMIT6_DISP_LH macro passes the "disp" parameter to the _EMIT6_DISP_LH
macro. The _EMIT6_DISP_LH macro uses the "disp" parameter twice:

 unsigned int __disp_h = ((u32)disp) &amp; 0xff000;
 unsigned int __disp_l = ((u32)disp) &amp; 0x00fff;

The EMIT6_DISP_LH is used several times with EMIT_CONST_U64() as "disp"
parameter. Therefore always two constants are created per usage of
EMIT6_DISP_LH.

Fix this and add variable "_disp" to avoid multiple expansions.

* v2: Move "_disp" to _EMIT6_DISP_LH as suggested by Joe Perches

Fixes: 054623105728 ("s390/bpf: Add s390x eBPF JIT compiler backend")
Signed-off-by: Michael Holzheu &lt;holzheu@linux.vnet.ibm.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
