<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/s390/include, branch linux-4.19.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2024-11-08T15:19:16Z</updated>
<entry>
<title>s390/facility: Disable compile time optimization for decompressor code</title>
<updated>2024-11-08T15:19:16Z</updated>
<author>
<name>Heiko Carstens</name>
</author>
<published>2024-09-04T09:39:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f559306a168fb92a936beaa1f020f5c45cdedac6'/>
<id>urn:sha1:f559306a168fb92a936beaa1f020f5c45cdedac6</id>
<content type='text'>
[ Upstream commit 0147addc4fb72a39448b8873d8acdf3a0f29aa65 ]

Disable compile time optimizations of test_facility() for the
decompressor. The decompressor should not contain any optimized code
depending on the architecture level set the kernel image is compiled
for to avoid unexpected operation exceptions.

Add a __DECOMPRESSOR check to test_facility() to enforce that
facilities are always checked during runtime for the decompressor.

Reviewed-by: Sven Schnelle &lt;svens@linux.ibm.com&gt;
Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>asm-generic: Move common compat types to asm-generic/compat.h</title>
<updated>2024-07-18T09:39:31Z</updated>
<author>
<name>Arnd Bergmann</name>
</author>
<published>2018-04-18T20:01:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a8a223aa3fb7790168fbf777a8db5bcef011b4dc'/>
<id>urn:sha1:a8a223aa3fb7790168fbf777a8db5bcef011b4dc</id>
<content type='text'>
commit fb3739759474d150a9927b920a80ea2afb4c2a51 upstream.

While converting compat system call handlers to work on 32-bit
architectures, I found a number of types used in those handlers
that are identical between all architectures.

Let's move all the identical ones into asm-generic/compat.h to avoid
having to add even more identical definitions of those types.

For unknown reasons, mips defines __compat_gid32_t, __compat_uid32_t
and compat_caddr_t as signed, while all others have them unsigned.
This seems to be a mistake, but I'm leaving it alone here. The other
types all differ by size or alignment on at least on architecture.

compat_aio_context_t is currently defined in linux/compat.h but
also needed for compat_sys_io_getevents(), so let's move it into
the same place.

While we still have not decided whether the 32-bit time handling
will always use the compat syscalls, or in which form, I think this
is a useful cleanup that we can merge regardless.

Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Frank Scheiner &lt;frank.scheiner@web.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>s390/vx: fix save/restore of fpu kernel context</title>
<updated>2024-01-08T10:27:33Z</updated>
<author>
<name>Heiko Carstens</name>
</author>
<published>2023-12-08T14:03:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a40ad41b9f0bc9975f9e4a5e6aee9e28a954bdd5'/>
<id>urn:sha1:a40ad41b9f0bc9975f9e4a5e6aee9e28a954bdd5</id>
<content type='text'>
[ Upstream commit e6b2dab41888332bf83f592131e7ea07756770a4 ]

The KERNEL_FPR mask only contains a flag for the first eight vector
registers. However floating point registers overlay parts of the first
sixteen vector registers.

This could lead to vector register corruption if a kernel fpu context uses
any of the vector registers 8 to 15 and is interrupted or calls a
KERNEL_FPR context. If that context uses also vector registers 8 to 15,
their contents will be corrupted on return.

Luckily this is currently not a real bug, since the kernel has only one
KERNEL_FPR user with s390_adjust_jiffies() and it is only using floating
point registers 0 to 2.

Fix this by using the correct bits for KERNEL_FPR.

Fixes: 7f79695cc1b6 ("s390/fpu: improve kernel_fpu_[begin|end]")
Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Reviewed-by: Hendrik Brueckner &lt;brueckner@linux.ibm.com&gt;
Signed-off-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>s390/percpu: add READ_ONCE() to arch_this_cpu_to_op_simple()</title>
<updated>2023-01-18T10:30:52Z</updated>
<author>
<name>Heiko Carstens</name>
</author>
<published>2023-01-09T10:51:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5a56f7cd5e15e0602550675854fefca765775c3b'/>
<id>urn:sha1:5a56f7cd5e15e0602550675854fefca765775c3b</id>
<content type='text'>
commit e3f360db08d55a14112bd27454e616a24296a8b0 upstream.

Make sure that *ptr__ within arch_this_cpu_to_op_simple() is only
dereferenced once by using READ_ONCE(). Otherwise the compiler could
generate incorrect code.

Cc: &lt;stable@vger.kernel.org&gt;
Reviewed-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>s390/futex: add missing EX_TABLE entry to __futex_atomic_op()</title>
<updated>2022-11-03T14:52:29Z</updated>
<author>
<name>Heiko Carstens</name>
</author>
<published>2022-10-18T11:44:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e2efdae04da4163f7143802c161fa3338a3d49d7'/>
<id>urn:sha1:e2efdae04da4163f7143802c161fa3338a3d49d7</id>
<content type='text'>
commit a262d3ad6a433e4080cecd0a8841104a5906355e upstream.

For some exception types the instruction address points behind the
instruction that caused the exception. Take that into account and add
the missing exception table entry.

Cc: &lt;stable@vger.kernel.org&gt;
Reviewed-by: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Signed-off-by: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>s390/hugetlb: fix prepare_hugepage_range() check for 2 GB hugepages</title>
<updated>2022-09-15T10:17:04Z</updated>
<author>
<name>Gerald Schaefer</name>
</author>
<published>2022-08-19T16:53:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=87286f9ab923a9f0b929f80decd9f4491e10092e'/>
<id>urn:sha1:87286f9ab923a9f0b929f80decd9f4491e10092e</id>
<content type='text'>
commit 7c8d42fdf1a84b1a0dd60d6528309c8ec127e87c upstream.

The alignment check in prepare_hugepage_range() is wrong for 2 GB
hugepages, it only checks for 1 MB hugepage alignment.

This can result in kernel crash in __unmap_hugepage_range() at the
BUG_ON(start &amp; ~huge_page_mask(h)) alignment check, for mappings
created with MAP_FIXED at unaligned address.

Fix this by correctly handling multiple hugepage sizes, similar to the
generic version of prepare_hugepage_range().

Fixes: d08de8e2d867 ("s390/mm: add support for 2GB hugepages")
Cc: &lt;stable@vger.kernel.org&gt; # 4.8+
Acked-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
Signed-off-by: Gerald Schaefer &lt;gerald.schaefer@linux.ibm.com&gt;
Signed-off-by: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>s390/archrandom: prevent CPACF trng invocations in interrupt context</title>
<updated>2022-08-11T10:48:38Z</updated>
<author>
<name>Harald Freudenberger</name>
</author>
<published>2022-07-13T13:17:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6e1b411c358aec14ece26cbc91b0e7dcccf1248b'/>
<id>urn:sha1:6e1b411c358aec14ece26cbc91b0e7dcccf1248b</id>
<content type='text'>
commit 918e75f77af7d2e049bb70469ec0a2c12782d96a upstream.

This patch slightly reworks the s390 arch_get_random_seed_{int,long}
implementation: Make sure the CPACF trng instruction is never
called in any interrupt context. This is done by adding an
additional condition in_task().

Justification:

There are some constrains to satisfy for the invocation of the
arch_get_random_seed_{int,long}() functions:
- They should provide good random data during kernel initialization.
- They should not be called in interrupt context as the TRNG
  instruction is relatively heavy weight and may for example
  make some network loads cause to timeout and buck.

However, it was not clear what kind of interrupt context is exactly
encountered during kernel init or network traffic eventually calling
arch_get_random_seed_long().

After some days of investigations it is clear that the s390
start_kernel function is not running in any interrupt context and
so the trng is called:

Jul 11 18:33:39 t35lp54 kernel:  [&lt;00000001064e90ca&gt;] arch_get_random_seed_long.part.0+0x32/0x70
Jul 11 18:33:39 t35lp54 kernel:  [&lt;000000010715f246&gt;] random_init+0xf6/0x238
Jul 11 18:33:39 t35lp54 kernel:  [&lt;000000010712545c&gt;] start_kernel+0x4a4/0x628
Jul 11 18:33:39 t35lp54 kernel:  [&lt;000000010590402a&gt;] startup_continue+0x2a/0x40

The condition in_task() is true and the CPACF trng provides random data
during kernel startup.

The network traffic however, is more difficult. A typical call stack
looks like this:

Jul 06 17:37:07 t35lp54 kernel:  [&lt;000000008b5600fc&gt;] extract_entropy.constprop.0+0x23c/0x240
Jul 06 17:37:07 t35lp54 kernel:  [&lt;000000008b560136&gt;] crng_reseed+0x36/0xd8
Jul 06 17:37:07 t35lp54 kernel:  [&lt;000000008b5604b8&gt;] crng_make_state+0x78/0x340
Jul 06 17:37:07 t35lp54 kernel:  [&lt;000000008b5607e0&gt;] _get_random_bytes+0x60/0xf8
Jul 06 17:37:07 t35lp54 kernel:  [&lt;000000008b56108a&gt;] get_random_u32+0xda/0x248
Jul 06 17:37:07 t35lp54 kernel:  [&lt;000000008aefe7a8&gt;] kfence_guarded_alloc+0x48/0x4b8
Jul 06 17:37:07 t35lp54 kernel:  [&lt;000000008aeff35e&gt;] __kfence_alloc+0x18e/0x1b8
Jul 06 17:37:07 t35lp54 kernel:  [&lt;000000008aef7f10&gt;] __kmalloc_node_track_caller+0x368/0x4d8
Jul 06 17:37:07 t35lp54 kernel:  [&lt;000000008b611eac&gt;] kmalloc_reserve+0x44/0xa0
Jul 06 17:37:07 t35lp54 kernel:  [&lt;000000008b611f98&gt;] __alloc_skb+0x90/0x178
Jul 06 17:37:07 t35lp54 kernel:  [&lt;000000008b6120dc&gt;] __napi_alloc_skb+0x5c/0x118
Jul 06 17:37:07 t35lp54 kernel:  [&lt;000000008b8f06b4&gt;] qeth_extract_skb+0x13c/0x680
Jul 06 17:37:07 t35lp54 kernel:  [&lt;000000008b8f6526&gt;] qeth_poll+0x256/0x3f8
Jul 06 17:37:07 t35lp54 kernel:  [&lt;000000008b63d76e&gt;] __napi_poll.constprop.0+0x46/0x2f8
Jul 06 17:37:07 t35lp54 kernel:  [&lt;000000008b63dbec&gt;] net_rx_action+0x1cc/0x408
Jul 06 17:37:07 t35lp54 kernel:  [&lt;000000008b937302&gt;] __do_softirq+0x132/0x6b0
Jul 06 17:37:07 t35lp54 kernel:  [&lt;000000008abf46ce&gt;] __irq_exit_rcu+0x13e/0x170
Jul 06 17:37:07 t35lp54 kernel:  [&lt;000000008abf531a&gt;] irq_exit_rcu+0x22/0x50
Jul 06 17:37:07 t35lp54 kernel:  [&lt;000000008b922506&gt;] do_io_irq+0xe6/0x198
Jul 06 17:37:07 t35lp54 kernel:  [&lt;000000008b935826&gt;] io_int_handler+0xd6/0x110
Jul 06 17:37:07 t35lp54 kernel:  [&lt;000000008b9358a6&gt;] psw_idle_exit+0x0/0xa
Jul 06 17:37:07 t35lp54 kernel: ([&lt;000000008ab9c59a&gt;] arch_cpu_idle+0x52/0xe0)
Jul 06 17:37:07 t35lp54 kernel:  [&lt;000000008b933cfe&gt;] default_idle_call+0x6e/0xd0
Jul 06 17:37:07 t35lp54 kernel:  [&lt;000000008ac59f4e&gt;] do_idle+0xf6/0x1b0
Jul 06 17:37:07 t35lp54 kernel:  [&lt;000000008ac5a28e&gt;] cpu_startup_entry+0x36/0x40
Jul 06 17:37:07 t35lp54 kernel:  [&lt;000000008abb0d90&gt;] smp_start_secondary+0x148/0x158
Jul 06 17:37:07 t35lp54 kernel:  [&lt;000000008b935b9e&gt;] restart_int_handler+0x6e/0x90

which confirms that the call is in softirq context. So in_task() covers exactly
the cases where we want to have CPACF trng called: not in nmi, not in hard irq,
not in soft irq but in normal task context and during kernel init.

Signed-off-by: Harald Freudenberger &lt;freude@linux.ibm.com&gt;
Acked-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
Reviewed-by: Juergen Christ &lt;jchrist@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/20220713131721.257907-1-freude@linux.ibm.com
Fixes: e4f74400308c ("s390/archrandom: simplify back to earlier design and initialize earlier")
[agordeev@linux.ibm.com changed desc, added Fixes and Link, removed -stable]
Signed-off-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>s390/archrandom: simplify back to earlier design and initialize earlier</title>
<updated>2022-07-07T15:35:09Z</updated>
<author>
<name>Jason A. Donenfeld</name>
</author>
<published>2022-06-10T22:20:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7b13597b9168253d1e7ac14e64aa4caada0c729f'/>
<id>urn:sha1:7b13597b9168253d1e7ac14e64aa4caada0c729f</id>
<content type='text'>
commit e4f74400308cb8abde5fdc9cad609c2aba32110c upstream.

s390x appears to present two RNG interfaces:
- a "TRNG" that gathers entropy using some hardware function; and
- a "DRBG" that takes in a seed and expands it.

Previously, the TRNG was wired up to arch_get_random_{long,int}(), but
it was observed that this was being called really frequently, resulting
in high overhead. So it was changed to be wired up to arch_get_random_
seed_{long,int}(), which was a reasonable decision. Later on, the DRBG
was then wired up to arch_get_random_{long,int}(), with a complicated
buffer filling thread, to control overhead and rate.

Fortunately, none of the performance issues matter much now. The RNG
always attempts to use arch_get_random_seed_{long,int}() first, which
means a complicated implementation of arch_get_random_{long,int}() isn't
really valuable or useful to have around. And it's only used when
reseeding, which means it won't hit the high throughput complications
that were faced before.

So this commit returns to an earlier design of just calling the TRNG in
arch_get_random_seed_{long,int}(), and returning false in arch_get_
random_{long,int}().

Part of what makes the simplification possible is that the RNG now seeds
itself using the TRNG at bootup. But this only works if the TRNG is
detected early in boot, before random_init() is called. So this commit
also causes that check to happen in setup_arch().

Cc: stable@vger.kernel.org
Cc: Harald Freudenberger &lt;freude@linux.ibm.com&gt;
Cc: Ingo Franzki &lt;ifranzki@linux.ibm.com&gt;
Cc: Juergen Christ &lt;jchrist@linux.ibm.com&gt;
Cc: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
Link: https://lore.kernel.org/r/20220610222023.378448-1-Jason@zx2c4.com
Reviewed-by: Harald Freudenberger &lt;freude@linux.ibm.com&gt;
Acked-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Signed-off-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kexec_file: drop weak attribute from arch_kexec_apply_relocations[_add]</title>
<updated>2022-07-02T14:27:39Z</updated>
<author>
<name>Naveen N. Rao</name>
</author>
<published>2022-05-19T09:12:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=24f3fca3f380660d644736108bdc858600868019'/>
<id>urn:sha1:24f3fca3f380660d644736108bdc858600868019</id>
<content type='text'>
commit 3e35142ef99fe6b4fe5d834ad43ee13cca10a2dc upstream.

Since commit d1bcae833b32f1 ("ELF: Don't generate unused section
symbols") [1], binutils (v2.36+) started dropping section symbols that
it thought were unused.  This isn't an issue in general, but with
kexec_file.c, gcc is placing kexec_arch_apply_relocations[_add] into a
separate .text.unlikely section and the section symbol ".text.unlikely"
is being dropped. Due to this, recordmcount is unable to find a non-weak
symbol in .text.unlikely to generate a relocation record against.

Address this by dropping the weak attribute from these functions.
Instead, follow the existing pattern of having architectures #define the
name of the function they want to override in their headers.

[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=d1bcae833b32f1

[akpm@linux-foundation.org: arch/s390/include/asm/kexec.h needs linux/module.h]
Link: https://lkml.kernel.org/r/20220519091237.676736-1-naveen.n.rao@linux.vnet.ibm.com
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Signed-off-by: Naveen N. Rao &lt;naveen.n.rao@linux.vnet.ibm.com&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>s390: define get_cycles macro for arch-override</title>
<updated>2022-06-25T09:49:09Z</updated>
<author>
<name>Jason A. Donenfeld</name>
</author>
<published>2022-04-23T19:11:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=56fffd6d20faec91782a43cf1565900eefe0314c'/>
<id>urn:sha1:56fffd6d20faec91782a43cf1565900eefe0314c</id>
<content type='text'>
commit 2e3df523256cb9836de8441e9c791a796759bb3c upstream.

S390x defines a get_cycles() function, but it does not do the usual
`#define get_cycles get_cycles` dance, making it impossible for generic
code to see if an arch-specific function was defined. While the
get_cycles() ifdef is not currently used, the following timekeeping
patch in this series will depend on the macro existing (or not existing)
when defining random_get_entropy().

Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
Cc: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
Cc: Christian Borntraeger &lt;borntraeger@linux.ibm.com&gt;
Cc: Sven Schnelle &lt;svens@linux.ibm.com&gt;
Acked-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
