<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/s390/net, branch linux-5.8.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.8.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.8.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-08-19T06:26:42Z</updated>
<entry>
<title>s390/bpf: Tolerate not converging code shrinking</title>
<updated>2020-08-19T06:26:42Z</updated>
<author>
<name>Ilya Leoshkevich</name>
</author>
<published>2020-07-17T16:53:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=23072846b309a3da9a22f2fcb769615816a481bc'/>
<id>urn:sha1:23072846b309a3da9a22f2fcb769615816a481bc</id>
<content type='text'>
[ Upstream commit 1491b73311a15bb5beeab5d30e03bff761ef6c18 ]

"BPF_MAXINSNS: Maximum possible literals" unnecessarily falls back to
the interpreter because of failing sanity check in bpf_set_addr. The
problem is that there are a lot of branches that can be shrunk, and
doing so opens up the possibility to shrink even more. This process
does not converge after 3 passes, causing code offsets to change during
the codegen pass, which must never happen.

Fix by inserting nops during codegen pass in order to preserve code
offets.

Fixes: 4e9b4a6883dd ("s390/bpf: Use relative long branches")
Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20200717165326.6786-5-iii@linux.ibm.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>s390/bpf: Use brcl for jumping to exit_ip if necessary</title>
<updated>2020-08-19T06:26:42Z</updated>
<author>
<name>Ilya Leoshkevich</name>
</author>
<published>2020-07-17T16:53:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a463d46b323c4acb4a8003f0745486de8aed6dfe'/>
<id>urn:sha1:a463d46b323c4acb4a8003f0745486de8aed6dfe</id>
<content type='text'>
[ Upstream commit 5fa6974471c5518a50bdd814067508dbcb477251 ]

"BPF_MAXINSNS: Maximum possible literals" test causes panic with
bpf_jit_harden = 2. The reason is that BPF_JMP | BPF_EXIT is always
emitted as brc, however, after removal of JITed image size
limitations, brcl might be required.

Fix by using brcl when necessary.

Fixes: 4e9b4a6883dd ("s390/bpf: Use relative long branches")
Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20200717165326.6786-4-iii@linux.ibm.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>s390/bpf: Fix sign extension in branch_ku</title>
<updated>2020-08-19T06:26:41Z</updated>
<author>
<name>Ilya Leoshkevich</name>
</author>
<published>2020-07-17T16:53:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fa9a83dab397b709869692b592acc37b506851f7'/>
<id>urn:sha1:fa9a83dab397b709869692b592acc37b506851f7</id>
<content type='text'>
[ Upstream commit 7477d43be5b1448bc0d4c85cb185a0144cc080e1 ]

Both signed and unsigned variants of BPF_JMP | BPF_K require
sign-extending the immediate. JIT emits cgfi for the signed case,
which is correct, and clgfi for the unsigned case, which is not
correct: clgfi zero-extends the immediate.

s390 does not provide an instruction that does sign-extension and
unsigned comparison at the same time. Therefore, fix by first loading
the sign-extended immediate into work register REG_1 and proceeding
as if it's BPF_X.

Fixes: 4e9b4a6883dd ("s390/bpf: Use relative long branches")
Reported-by: Seth Forshee &lt;seth.forshee@canonical.com&gt;
Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Tested-by: Seth Forshee &lt;seth.forshee@canonical.com&gt;
Link: https://lore.kernel.org/bpf/20200717165326.6786-3-iii@linux.ibm.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>s390/bpf: Use bcr 0,%0 as tail call nop filler</title>
<updated>2020-06-02T19:04:04Z</updated>
<author>
<name>Ilya Leoshkevich</name>
</author>
<published>2020-06-02T17:45:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=33d21f18204cb33b43ca6c78c8180949f6dc7227'/>
<id>urn:sha1:33d21f18204cb33b43ca6c78c8180949f6dc7227</id>
<content type='text'>
Currently used 0x0000 filler confuses bfd disassembler, making bpftool
prog dump xlated output nearly useless. Fix by using a real instruction.

Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20200602174555.2501389-1-iii@linux.ibm.com
</content>
</entry>
<entry>
<title>s390/bpf: Maintain 8-byte stack alignment</title>
<updated>2020-06-02T19:00:56Z</updated>
<author>
<name>Ilya Leoshkevich</name>
</author>
<published>2020-06-02T17:43:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=effe5be17706167ee968fa28afe40dec9c6f71db'/>
<id>urn:sha1:effe5be17706167ee968fa28afe40dec9c6f71db</id>
<content type='text'>
Certain kernel functions (e.g. get_vtimer/set_vtimer) cause kernel
panic when the stack is not 8-byte aligned. Currently JITed BPF programs
may trigger this by allocating stack frames with non-rounded sizes and
then being interrupted. Fix by using rounded fp-&gt;aux-&gt;stack_depth.

Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20200602174339.2501066-1-iii@linux.ibm.com
</content>
</entry>
<entry>
<title>s390/bpf: Remove JITed image size limitations</title>
<updated>2019-11-19T03:51:16Z</updated>
<author>
<name>Ilya Leoshkevich</name>
</author>
<published>2019-11-18T18:03:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d1242b10ff03a40ae095e6dd54aac4a6f0f547d5'/>
<id>urn:sha1:d1242b10ff03a40ae095e6dd54aac4a6f0f547d5</id>
<content type='text'>
Now that jump and long displacement ranges are no longer a problem,
remove the limit on JITed image size. In practice it's still limited by
2G, but with verifier allowing "only" 1M instructions, it's not an
issue.

Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20191118180340.68373-7-iii@linux.ibm.com
</content>
</entry>
<entry>
<title>s390/bpf: Use lg(f)rl when long displacement cannot be used</title>
<updated>2019-11-19T03:51:16Z</updated>
<author>
<name>Ilya Leoshkevich</name>
</author>
<published>2019-11-18T18:03:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b25c57b6b7dda3799aaebc5f463776e4a0555927'/>
<id>urn:sha1:b25c57b6b7dda3799aaebc5f463776e4a0555927</id>
<content type='text'>
If literal pool grows past 524287 mark, it's no longer possible to use
long displacement to reference literal pool entries. In JIT setting
maintaining multiple literal pool registers is next to impossible, since
we operate on one instruction at a time.

Therefore, fall back to loading literal pool entry using PC-relative
addressing, and then using a register-register form of the following
machine instruction.

Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20191118180340.68373-6-iii@linux.ibm.com
</content>
</entry>
<entry>
<title>s390/bpf: Use lgrl instead of lg where possible</title>
<updated>2019-11-19T03:51:16Z</updated>
<author>
<name>Ilya Leoshkevich</name>
</author>
<published>2019-11-18T18:03:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=451e448ff4bb137da3d4b8b26a8260a2ff66869a'/>
<id>urn:sha1:451e448ff4bb137da3d4b8b26a8260a2ff66869a</id>
<content type='text'>
lg and lgrl have the same performance characteristics, but the former
requires a base register and is subject to long displacement range
limits, while the latter does not. Therefore, lgrl is totally superior
to lg and should be used instead whenever possible.

Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20191118180340.68373-5-iii@linux.ibm.com
</content>
</entry>
<entry>
<title>s390/bpf: Load literal pool register using larl</title>
<updated>2019-11-19T03:51:16Z</updated>
<author>
<name>Ilya Leoshkevich</name>
</author>
<published>2019-11-18T18:03:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c1aff5682da2977c26fc087cf6a28e31a430174b'/>
<id>urn:sha1:c1aff5682da2977c26fc087cf6a28e31a430174b</id>
<content type='text'>
Currently literal pool register is loaded using basr, which makes it
point not to the beginning of the literal pool, but rather to the next
instruction. In case JITed code is larger than 512k, this renders
literal pool register absolutely useless due to long displacement range
restrictions.

The solution is to use larl to make literal pool register point to the
very beginning of the literal pool. This makes it always possible to
address 512k worth of literal pool entries using long displacement.

However, for short programs, in which the entire literal pool is covered
by basr-generated base, it is still beneficial to use basr, since it is
4 bytes shorter than larl.

Detect situations when basr-generated base does not cover the entire
literal pool, and in such cases use larl instead.

Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20191118180340.68373-4-iii@linux.ibm.com
</content>
</entry>
<entry>
<title>s390/bpf: Align literal pool entries</title>
<updated>2019-11-19T03:51:16Z</updated>
<author>
<name>Ilya Leoshkevich</name>
</author>
<published>2019-11-18T18:03:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e0491f64795bfc71ef6b13ba6b6fa6e176fa3c23'/>
<id>urn:sha1:e0491f64795bfc71ef6b13ba6b6fa6e176fa3c23</id>
<content type='text'>
When literal pool size exceeds 512k, it's no longer possible to
reference all the entries in it using a single base register and long
displacement. Therefore, PC-relative lgfrl and lgrl instructions need to
be used.

Unfortunately, they require their arguments to be aligned to 4- and
8-byte boundaries respectively. This generates certain overhead due to
necessary padding bytes. Grouping 4- and 8-byte entries together reduces
the maximum overhead to 6 bytes (2 for aligning 4-byte entries and 4 for
aligning 8-byte entries).

While in theory it is possible to detect whether or not alignment is
needed by comparing the literal pool size with 512k, in practice this
leads to having two ways of emitting constants, making the code more
complicated.

Prefer code simplicity over trivial size saving, and always group and
align literal pool entries.

Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20191118180340.68373-3-iii@linux.ibm.com
</content>
</entry>
</feed>
