<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/s390/include/asm/processor.h, branch linux-6.10.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2024-05-14T11:37:08Z</updated>
<entry>
<title>s390: Mark psw in __load_psw_mask() as __unitialized</title>
<updated>2024-05-14T11:37:08Z</updated>
<author>
<name>Sven Schnelle</name>
</author>
<published>2024-04-30T14:30:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7278a8fb8d032dfdc03d9b5d17e0bc451cdc1492'/>
<id>urn:sha1:7278a8fb8d032dfdc03d9b5d17e0bc451cdc1492</id>
<content type='text'>
Without __unitialized, the following code is generated when
INIT_STACK_ALL_ZERO is enabled:

86: d7 0f f0 a0 f0 a0     xc      160(16,%r15), 160(%r15)
8c: e3 40 f0 a0 00 24     stg     %r4, 160(%r15)
92: c0 10 00 00 00 08     larl    %r1, 0xa2
98: e3 10 f0 a8 00 24     stg     %r1, 168(%r15)
9e: b2 b2 f0 a0           lpswe   160(%r15)

The xc is not adding any security because psw is fully initialized
with the following instructions. Add __unitialized to the psw
definitiation to avoid the superfluous clearing of psw.

Reviewed-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Signed-off-by: Sven Schnelle &lt;svens@linux.ibm.com&gt;
Signed-off-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/idle: Rewrite psw_idle() in C</title>
<updated>2024-05-14T11:37:07Z</updated>
<author>
<name>Sven Schnelle</name>
</author>
<published>2024-04-30T14:29:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fa2ae4a377c0fbbcbcd4252842e702f7e4187170'/>
<id>urn:sha1:fa2ae4a377c0fbbcbcd4252842e702f7e4187170</id>
<content type='text'>
To ease maintenance and further enhancements, convert
the psw_idle() function to C.

Reviewed-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Signed-off-by: Sven Schnelle &lt;svens@linux.ibm.com&gt;
Signed-off-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/stackstrace: Detect vdso stack frames</title>
<updated>2024-05-14T11:37:07Z</updated>
<author>
<name>Heiko Carstens</name>
</author>
<published>2024-04-29T12:28:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=62b672c4ba90e726cc39b5c3d6dffd1ca817e143'/>
<id>urn:sha1:62b672c4ba90e726cc39b5c3d6dffd1ca817e143</id>
<content type='text'>
Clear the backchain of the extra stack frame added by the vdso user wrapper
code. This allows the user stack walker to detect and skip the non-standard
stack frame. Without this an incorrect instruction pointer would be added
to stack traces, and stack frame walking would be continued with a more or
less random back chain.

Fixes: aa44433ac4ee ("s390: add USER_STACKTRACE support")
Reviewed-by: Jens Remus &lt;jremus@linux.ibm.com&gt;
Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Signed-off-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/entry: add CIF_SIE flag and remove sie64a() address check</title>
<updated>2024-03-17T18:08:49Z</updated>
<author>
<name>Sven Schnelle</name>
</author>
<published>2024-02-20T13:21:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c239c83ed5c558be3b5926c7f11639f02c8acd00'/>
<id>urn:sha1:c239c83ed5c558be3b5926c7f11639f02c8acd00</id>
<content type='text'>
When a program check, interrupt or machine check is triggered, the
PSW address is compared to a certain range of the sie64a() function
to figure out whether SIE was interrupted and a cleanup of SIE is
needed.

This doesn't work with kprobes: If kprobes probes an instruction, it
copies the instruction to the kprobes instruction page and overwrites the
original instruction with an undefind instruction (Opcode 00). When this
instruction is hit later, kprobes single-steps the instruction on the
kprobes_instruction page.

However, if this instruction is a relative branch instruction it will now
point to a different location in memory due to being moved to the kprobes
instruction page. If the new branch target points into sie64a() the kernel
assumes it interrupted SIE when processing the breakpoint and will crash
trying to access the SIE control block.

Instead of comparing the address, introduce a new CIF_SIE flag which
indicates whether SIE was interrupted.

Signed-off-by: Sven Schnelle &lt;svens@linux.ibm.com&gt;
Suggested-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Reviewed-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/fpu: limit save and restore to used registers</title>
<updated>2024-02-16T13:30:16Z</updated>
<author>
<name>Heiko Carstens</name>
</author>
<published>2024-02-03T10:45:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8c09871a950a3fe686e0e27fd4193179c5f74f37'/>
<id>urn:sha1:8c09871a950a3fe686e0e27fd4193179c5f74f37</id>
<content type='text'>
The first invocation of kernel_fpu_begin() after switching from user to
kernel context will save all vector registers, even if only parts of the
vector registers are used within the kernel fpu context. Given that save
and restore of all vector registers is quite expensive change the current
approach in several ways:

- Instead of saving and restoring all user registers limit this to those
  registers which are actually used within an kernel fpu context.

- On context switch save all remaining user fpu registers, so they can be
  restored when the task is rescheduled.

- Saving user registers within kernel_fpu_begin() is done without disabling
  and enabling interrupts - which also slightly reduces runtime. In worst
  case (e.g. interrupt context uses the same registers) this may lead to
  the situation that registers are saved several times, however the
  assumption is that this will not happen frequently, so that the new
  method is faster in nearly all cases.

- save_user_fpu_regs() can still be called from all contexts and saves all
  (or all remaining) user registers to a tasks ufpu user fpu save area.

Overall this reduces the time required to save and restore the user fpu
context for nearly all cases.

Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/fpu: remove regs member from struct fpu</title>
<updated>2024-02-16T13:30:16Z</updated>
<author>
<name>Heiko Carstens</name>
</author>
<published>2024-02-03T10:45:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9cbff7f2214d16af5c10f1f55ac72d4c1a8bd787'/>
<id>urn:sha1:9cbff7f2214d16af5c10f1f55ac72d4c1a8bd787</id>
<content type='text'>
KVM was the only user which modified the regs pointer in struct fpu. Remove
the pointer and convert the rest of the core fpu code to directly access
the save area embedded within struct fpu.

Reviewed-by: Claudio Imbrenda &lt;imbrenda@linux.ibm.com&gt;
Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/fpu: make kernel fpu context preemptible</title>
<updated>2024-02-16T13:30:15Z</updated>
<author>
<name>Heiko Carstens</name>
</author>
<published>2024-02-03T10:45:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4eed43de9ba0ae3af6716544408d185a152424cd'/>
<id>urn:sha1:4eed43de9ba0ae3af6716544408d185a152424cd</id>
<content type='text'>
Make the kernel fpu context preemptible. Add another fpu structure to the
thread_struct, and use it to save and restore the kernel fpu context if its
task uses fpu registers when it is preempted.

Reviewed-by: Claudio Imbrenda &lt;imbrenda@linux.ibm.com&gt;
Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/fpu: rename save_fpu_regs() to save_user_fpu_regs(), etc</title>
<updated>2024-02-16T13:30:15Z</updated>
<author>
<name>Heiko Carstens</name>
</author>
<published>2024-02-03T10:45:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=87c5c70036813d26e6e7e4393747a4fdc63cf193'/>
<id>urn:sha1:87c5c70036813d26e6e7e4393747a4fdc63cf193</id>
<content type='text'>
Rename save_fpu_regs(), load_fpu_regs(), and struct thread_struct's fpu
member to save_user_fpu_regs(), load_user_fpu_regs(), and ufpu. This way
the function and variable names reflect for which context they are supposed
to be used.

This large and trivial conversion is a prerequisite for making the kernel
fpu usage preemptible.

Reviewed-by: Claudio Imbrenda &lt;imbrenda@linux.ibm.com&gt;
Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/fpu: convert FPU CIF flag to regular TIF flag</title>
<updated>2024-02-16T13:30:15Z</updated>
<author>
<name>Heiko Carstens</name>
</author>
<published>2024-02-03T10:45:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=419abc4d3828813b58d047da146f519eedaa395b'/>
<id>urn:sha1:419abc4d3828813b58d047da146f519eedaa395b</id>
<content type='text'>
The FPU state, as represented by the CIF_FPU flag reflects the FPU state of
a task, not the CPU it is running on. Therefore convert the flag to a
regular TIF flag.

This removes the magic in switch_to() where a save_fpu_regs() call for the
currently (previous) running task sets the per-cpu CIF_FPU flag, which is
required to restore FPU register contents of the next task, when it returns
to user space.

Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/fpu: move, rename, and merge header files</title>
<updated>2024-02-16T13:30:14Z</updated>
<author>
<name>Heiko Carstens</name>
</author>
<published>2024-02-03T10:45:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fd2527f20915d041e838b6e4a08122dbc73c7abc'/>
<id>urn:sha1:fd2527f20915d041e838b6e4a08122dbc73c7abc</id>
<content type='text'>
Move, rename, and merge the fpu and vx header files. This way fpu header
files have a consistent naming scheme (fpu*.h).

Also get rid of the fpu subdirectory and move header files to asm
directory, so that all fpu and vx header files can be found at the same
location.

Merge internal.h header file into other header files, since the internal
helpers are used at many locations. so those helper functions are really
not internal.

Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
</content>
</entry>
</feed>
