<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/arch/s390/include/asm/lowcore.h, branch linux-7.0.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.0.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.0.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-11-24T10:45:21+00:00</updated>
<entry>
<title>s390: Add stackprotector support</title>
<updated>2025-11-24T10:45:21+00:00</updated>
<author>
<name>Heiko Carstens</name>
<email>hca@linux.ibm.com</email>
</author>
<published>2025-11-17T14:09:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f5730d44e05efb43a5cb64e5eb04e24994bbb50f'/>
<id>urn:sha1:f5730d44e05efb43a5cb64e5eb04e24994bbb50f</id>
<content type='text'>
Stackprotector support was previously unavailable on s390 because by
default compilers generate code which is not suitable for the kernel:
the canary value is accessed via thread local storage, where the address
of thread local storage is within access registers 0 and 1.

Using those registers also for the kernel would come with a significant
performance impact and more complicated kernel entry/exit code, since
access registers contents would have to be exchanged on every kernel entry
and exit.

With the upcoming gcc 16 release new compiler options will become available
which allow to generate code suitable for the kernel. [1]

Compiler option -mstack-protector-guard=global instructs gcc to generate
stackprotector code that refers to a global stackprotector canary value via
symbol __stack_chk_guard. Access to this value is guaranteed to occur via
larl and lgrl instructions.

Furthermore, compiler option -mstack-protector-guard-record generates a
section containing all code addresses that reference the canary value.

To allow for per task canary values the instructions which load the address
of __stack_chk_guard are patched so they access a lowcore field instead: a
per task canary value is available within the task_struct of each task, and
is written to the per-cpu lowcore location on each context switch.

Also add sanity checks and debugging option to be consistent with other
kernel code patching mechanisms.

Full debugging output can be enabled with the following kernel command line
options:

debug_stackprotector
bootdebug
ignore_loglevel
earlyprintk
dyndbg="file stackprotector.c +p"

Example debug output:

stackprot: 0000021e402d4eda: c010005a9ae3 -&gt; c01f00070240

where "&lt;insn address&gt;: &lt;old insn&gt; -&gt; &lt;new insn&gt;".

[1] gcc commit 0cd1f03939d5 ("s390: Support global stack protector")

Reviewed-by: Sven Schnelle &lt;svens@linux.ibm.com&gt;
Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers</title>
<updated>2025-06-16T14:23:02+00:00</updated>
<author>
<name>Thomas Huth</name>
<email>thuth@redhat.com</email>
</author>
<published>2025-06-11T14:00:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=42398caf16c955251a2dab86f797b76adeb99899'/>
<id>urn:sha1:42398caf16c955251a2dab86f797b76adeb99899</id>
<content type='text'>
While the GCC and Clang compilers already define __ASSEMBLER__
automatically when compiling assembler code, __ASSEMBLY__ is a
macro that only gets defined by the Makefiles in the kernel.
This is bad since macros starting with two underscores are names
that are reserved by the C language. It can also be very confusing
for the developers when switching between userspace and kernelspace
coding, or when dealing with uapi headers that rather should use
__ASSEMBLER__  instead. So let's now standardize on the __ASSEMBLER__
macro that is provided by the compilers.

This is a completely mechanical patch (done with a simple "sed -i"
statement), with some manual fixups done later while rebasing the
patch.

Signed-off-by: Thomas Huth &lt;thuth@redhat.com&gt;
Acked-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/20250611140046.137739-3-thuth@redhat.com
Signed-off-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/lowcore: Remove unused machine_flags</title>
<updated>2025-03-31T10:20:39+00:00</updated>
<author>
<name>Heiko Carstens</name>
<email>hca@linux.ibm.com</email>
</author>
<published>2025-03-20T13:49:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1f266fd704ef3be8a4b2a066edf25b75fd90a9c6'/>
<id>urn:sha1:1f266fd704ef3be8a4b2a066edf25b75fd90a9c6</id>
<content type='text'>
The machine_flags member in struct lowcore is not used anymore.
Remove it.

Reviewed-by: Sven Schnelle &lt;svens@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;
</content>
</entry>
<entry>
<title>s390/lowcore: Use lghi instead llilh to clear register</title>
<updated>2025-03-18T16:13:05+00:00</updated>
<author>
<name>Heiko Carstens</name>
<email>hca@linux.ibm.com</email>
</author>
<published>2025-03-10T09:33:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=df4623fb53c2014e39a07801dd2ac49cb8701f44'/>
<id>urn:sha1:df4623fb53c2014e39a07801dd2ac49cb8701f44</id>
<content type='text'>
lghi is the fastest way to clear a register. Use that intead of llilh.

Suggested-by: Juergen Christ &lt;jchrist@linux.ibm.com&gt;
Reviewed-by: Juergen Christ &lt;jchrist@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;
</content>
</entry>
<entry>
<title>s390/lowcore: Use inline qualifier for get_lowcore() inline assembly</title>
<updated>2025-03-18T16:13:04+00:00</updated>
<author>
<name>Heiko Carstens</name>
<email>hca@linux.ibm.com</email>
</author>
<published>2025-03-10T09:33:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=430693c836c3828c72db2e1b1a7d2ddc97509cb8'/>
<id>urn:sha1:430693c836c3828c72db2e1b1a7d2ddc97509cb8</id>
<content type='text'>
Use asm_inline to let the compiler know that the get_lowcore() inline
assembly has the smallest possible size. The ALTERNATIVE construct is used
to generate a single instruction, however the macro expands to multiple
lines. GCC uses the number of lines of an inline assembly to count the
number of instructions within an inline assembly, which then has an effect
on inlining decisions.

In order to avoid incorrect assumptions use asm_inline. The result is that
more functions are inlined, which results in a small growth of the kernel
image:

add/remove: 59/480 grow/shrink: 854/647 up/down: 168780/-162394 (6386)

Reviewed-by: Juergen Christ &lt;jchrist@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;
</content>
</entry>
<entry>
<title>s390/time: Convert MACHINE_HAS_SCC to machine_has_scc()</title>
<updated>2025-03-04T16:18:06+00:00</updated>
<author>
<name>Heiko Carstens</name>
<email>hca@linux.ibm.com</email>
</author>
<published>2025-02-07T14:48:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f931f67cfc274682aecc9f727eecc89779fc47b7'/>
<id>urn:sha1:f931f67cfc274682aecc9f727eecc89779fc47b7</id>
<content type='text'>
Use static branch(es) to implement and use machine_has_scc() instead
of a runtime check via MACHINE_HAS_SCC.

This comes with a cleanup of early time initialization: the initial
tod_clock_base value is now passed via the bootdata mechanism, instead
of using absolute lowcore as transport vehicle from the decompressor
to the kernel.

Also the early tod clock initialization is moved to the decompressor
which allows to use a static branch with machine_has_scc() within the
kernel.

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;
</content>
</entry>
<entry>
<title>s390/lowcore: Convert relocated lowcore alternative to machine feature</title>
<updated>2025-03-04T16:18:05+00:00</updated>
<author>
<name>Heiko Carstens</name>
<email>hca@linux.ibm.com</email>
</author>
<published>2025-02-07T14:48:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e4da8249cf1e2aac1f2ca3d8bbe6c7589b4a7a13'/>
<id>urn:sha1:e4da8249cf1e2aac1f2ca3d8bbe6c7589b4a7a13</id>
<content type='text'>
Convert the explicit relocated lowcore alternative type to a more
generic machine feature. This only reduces the number of alternative
types, but has no impact on code generation.

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;
</content>
</entry>
<entry>
<title>s390: Remove gmap pointer from lowcore</title>
<updated>2024-10-29T10:49:19+00:00</updated>
<author>
<name>Claudio Imbrenda</name>
<email>imbrenda@linux.ibm.com</email>
</author>
<published>2024-10-22T12:05:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e8d8d97218190d9cb7ddd6cb50205570d2e5b295'/>
<id>urn:sha1:e8d8d97218190d9cb7ddd6cb50205570d2e5b295</id>
<content type='text'>
Remove the gmap pointer from lowcore, since it is not used anymore.

Signed-off-by: Claudio Imbrenda &lt;imbrenda@linux.ibm.com&gt;
Reviewed-by: Steffen Eiden &lt;seiden@linux.ibm.com&gt;
Reviewed-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/20241022120601.167009-9-imbrenda@linux.ibm.com
Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/entry: Unify save_area_sync and save_area_async</title>
<updated>2024-08-29T20:56:34+00:00</updated>
<author>
<name>Sven Schnelle</name>
<email>svens@linux.ibm.com</email>
</author>
<published>2024-08-28T11:50:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ee3daf7c05e70a0b88723ceb18587aed75716729'/>
<id>urn:sha1:ee3daf7c05e70a0b88723ceb18587aed75716729</id>
<content type='text'>
In the past two save areas existed because interrupt handlers
and system call / program check handlers where entered with
interrupts enabled. To prevent a handler from overwriting the
save areas from the previous handler, interrupts used the async
save area, while system call and program check handler used the
sync save area.

Since the removal of critical section cleanup from entry.S, handlers are
entered with interrupts disabled. When the interrupts are re-enabled,
the save area is no longer need. Therefore merge both save areas into one.

Reviewed-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Reviewed-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
Signed-off-by: Sven Schnelle &lt;svens@linux.ibm.com&gt;
Signed-off-by: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/entry: Make pgm_check_handler() ready for lowcore relocation</title>
<updated>2024-07-23T14:02:32+00:00</updated>
<author>
<name>Sven Schnelle</name>
<email>svens@linux.ibm.com</email>
</author>
<published>2024-07-22T13:41:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9e1e275fa28d5896ca7cdf8afa5eb58c0117a303'/>
<id>urn:sha1:9e1e275fa28d5896ca7cdf8afa5eb58c0117a303</id>
<content type='text'>
In preparation of having lowcore at different address than zero,
add the base register to all lowcore accesses in pgm_check_handler().

Reviewed-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Signed-off-by: Sven Schnelle &lt;svens@linux.ibm.com&gt;
Signed-off-by: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
</content>
</entry>
</feed>
