<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/s390/char/sclp.c, branch linux-6.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2024-07-25T07:53:34Z</updated>
<entry>
<title>s390/sclp: Fix sclp_init() cleanup on failure</title>
<updated>2024-07-25T07:53:34Z</updated>
<author>
<name>Heiko Carstens</name>
<email>hca@linux.ibm.com</email>
</author>
<published>2024-06-14T16:09:01Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=be0259796d0b76bbc7461e12c186814a9e58244c'/>
<id>urn:sha1:be0259796d0b76bbc7461e12c186814a9e58244c</id>
<content type='text'>
[ Upstream commit 6434b33faaa063df500af355ee6c3942e0f8d982 ]

If sclp_init() fails it only partially cleans up: if there are multiple
failing calls to sclp_init() sclp_state_change_event will be added several
times to sclp_reg_list, which results in the following warning:

------------[ cut here ]------------
list_add double add: new=000003ffe1598c10, prev=000003ffe1598bf0, next=000003ffe1598c10.
WARNING: CPU: 0 PID: 1 at lib/list_debug.c:35 __list_add_valid_or_report+0xde/0xf8
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.10.0-rc3
Krnl PSW : 0404c00180000000 000003ffe0d6076a (__list_add_valid_or_report+0xe2/0xf8)
           R:0 T:1 IO:0 EX:0 Key:0 M:1 W:0 P:0 AS:3 CC:0 PM:0 RI:0 EA:3
...
Call Trace:
 [&lt;000003ffe0d6076a&gt;] __list_add_valid_or_report+0xe2/0xf8
([&lt;000003ffe0d60766&gt;] __list_add_valid_or_report+0xde/0xf8)
 [&lt;000003ffe0a8d37e&gt;] sclp_init+0x40e/0x450
 [&lt;000003ffe00009f2&gt;] do_one_initcall+0x42/0x1e0
 [&lt;000003ffe15b77a6&gt;] do_initcalls+0x126/0x150
 [&lt;000003ffe15b7a0a&gt;] kernel_init_freeable+0x1ba/0x1f8
 [&lt;000003ffe0d6650e&gt;] kernel_init+0x2e/0x180
 [&lt;000003ffe000301c&gt;] __ret_from_fork+0x3c/0x60
 [&lt;000003ffe0d759ca&gt;] ret_from_fork+0xa/0x30

Fix this by removing sclp_state_change_event from sclp_reg_list when
sclp_init() fails.

Reviewed-by: Peter Oberparleiter &lt;oberpar@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;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>s390/sclp: replace deprecated strncpy with strtomem</title>
<updated>2023-10-25T13:08:30Z</updated>
<author>
<name>Justin Stitt</name>
<email>justinstitt@google.com</email>
</author>
<published>2023-10-23T19:14:49Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e37988bcd1fddb726cf08e4f04a1b8dc4a2f80aa'/>
<id>urn:sha1:e37988bcd1fddb726cf08e4f04a1b8dc4a2f80aa</id>
<content type='text'>
Let's move away from using strncpy() as it is deprecated [1].

Instead use strtomem() as `e.id` is already marked as nonstring:
|       char id[4] __nonstring;

We don't need strtomem_pad() because `e` is already memset to 0 --
rendering any additional NUL-padding useless.

Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1]
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Justin Stitt &lt;justinstitt@google.com&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Link: https://lore.kernel.org/r/20231023-strncpy-drivers-s390-char-sclp-c-v1-1-eaeef80522bb@google.com
Signed-off-by: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/ctlreg: add struct ctlreg</title>
<updated>2023-09-19T11:26:56Z</updated>
<author>
<name>Heiko Carstens</name>
<email>hca@linux.ibm.com</email>
</author>
<published>2023-09-11T19:40:04Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=527618abb92793b9d4dba548d55822dcebd95317'/>
<id>urn:sha1:527618abb92793b9d4dba548d55822dcebd95317</id>
<content type='text'>
Add struct ctlreg to enforce strict type checking / usage for control
register functions.

Reviewed-by: Alexander Gordeev &lt;agordeev@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/ctlreg: use local_ctl_load() and local_ctl_store() where possible</title>
<updated>2023-09-19T11:26:56Z</updated>
<author>
<name>Heiko Carstens</name>
<email>hca@linux.ibm.com</email>
</author>
<published>2023-09-11T19:40:00Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=2372d391421350e318c98844d21ab9ad16e3eac0'/>
<id>urn:sha1:2372d391421350e318c98844d21ab9ad16e3eac0</id>
<content type='text'>
Convert all single control register usages of __local_ctl_load() and
__local_ctl_store() to local_ctl_load() and local_ctl_store().

This also requires to change the type of some struct lowcore members
from __u64 to unsigned long.

Reviewed-by: Alexander Gordeev &lt;agordeev@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/ctlreg: add local and system prefix to some functions</title>
<updated>2023-09-19T11:26:56Z</updated>
<author>
<name>Heiko Carstens</name>
<email>hca@linux.ibm.com</email>
</author>
<published>2023-09-11T19:39:58Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=8d5e98f8d6b11dd0e61323ece3b7ccceea55c281'/>
<id>urn:sha1:8d5e98f8d6b11dd0e61323ece3b7ccceea55c281</id>
<content type='text'>
Add local and system prefix to some functions to clarify they change
control register contents on either the local CPU or the on all CPUs.

This results in the following API:

Two defines which load and save multiple control registers.
The defines correlate with the following C prototypes:

void __local_ctl_load(unsigned long *, unsigned int cr_low, unsigned int cr_high);
void __local_ctl_store(unsigned long *, unsigned int cr_low, unsigned int cr_high);

Two functions which locally set or clear one bit for a specified
control register:

void local_ctl_set_bit(unsigned int cr, unsigned int bit);
void local_ctl_clear_bit(unsigned int cr, unsigned int bit);

Two functions which set or clear one bit for a specified control
register on all CPUs:

void system_ctl_set_bit(unsigned int cr, unsigned int bit);
void system_ctl_clear_bit(unsigend int cr, unsigned int bit);

Reviewed-by: Alexander Gordeev &lt;agordeev@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/sclp: allow to change sclp_console_drop during runtime</title>
<updated>2022-11-29T13:17:04Z</updated>
<author>
<name>Heiko Carstens</name>
<email>hca@linux.ibm.com</email>
</author>
<published>2022-11-19T17:56:19Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1143f6f55d967ab414a10a559d58a2700f32a54d'/>
<id>urn:sha1:1143f6f55d967ab414a10a559d58a2700f32a54d</id>
<content type='text'>
Make sclp's con_drop sysfs attribute also writable, and allow to
change its value during runtime. This way handling of sclp console
drop handling is consistent with the 3215 device driver.

Reviewed-by: Peter Oberparleiter &lt;oberpar@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/sclp: convert to use sysfs_emit()</title>
<updated>2022-11-29T13:17:04Z</updated>
<author>
<name>Heiko Carstens</name>
<email>hca@linux.ibm.com</email>
</author>
<published>2022-11-19T17:53:49Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a086c53de982d6ae3f1e7e3c0f94efa66743b333'/>
<id>urn:sha1:a086c53de982d6ae3f1e7e3c0f94efa66743b333</id>
<content type='text'>
Use sysfs_emit() for all sclp sysfs show functions, which is the
current standard way to generate output strings.

Reviewed-by: Peter Oberparleiter &lt;oberpar@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/sclp: use kstrobool() to parse sclp_con_drop parameter</title>
<updated>2022-11-29T13:17:03Z</updated>
<author>
<name>Heiko Carstens</name>
<email>hca@linux.ibm.com</email>
</author>
<published>2022-11-19T17:32:18Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=2473be453c9023bafd6cc785a7f2ecd0eabda2fd'/>
<id>urn:sha1:2473be453c9023bafd6cc785a7f2ecd0eabda2fd</id>
<content type='text'>
Use kstrobool() to parse sclp_con_drop parameter. This way handling of
valid values for the sclp_con_drop parameter is identical to the
con3215_drop parameter. In particular this allows to pass values like
"yes" and "true", which was not possible before.

Reviewed-by: Peter Oberparleiter &lt;oberpar@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/sclp: Fix typo in comments</title>
<updated>2022-06-30T17:40:36Z</updated>
<author>
<name>Jiang Jian</name>
<email>jiangjian@cdjrlc.com</email>
</author>
<published>2022-06-22T14:27:13Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d608f45ed3cfd411a409cec93fa64232181752ff'/>
<id>urn:sha1:d608f45ed3cfd411a409cec93fa64232181752ff</id>
<content type='text'>
Remove the repeated word 'and' from comments

Signed-off-by: Jiang Jian &lt;jiangjian@cdjrlc.com&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Link: https://lore.kernel.org/r/20220622142713.14187-1-jiangjian@cdjrlc.com
Signed-off-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390: cleanup timer API use</title>
<updated>2022-03-27T20:18:39Z</updated>
<author>
<name>Yu Liao</name>
<email>liaoyu15@huawei.com</email>
</author>
<published>2022-03-22T03:00:57Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4f45c37ffd100522f890fc7f8bd71a3b8f79b6be'/>
<id>urn:sha1:4f45c37ffd100522f890fc7f8bd71a3b8f79b6be</id>
<content type='text'>
cleanup the s390's use of the timer API
- del_timer() contains timer_pending() condition
- mod_timer(timer, expires) is equivalent to:

	del_timer(timer);
	timer-&gt;expires = expires;
	add_timer(timer);

If the timer is inactive it will be activated, using add_timer() on
condition !timer_pending(&amp;private-&gt;timer) is redundant.

Just cleanup, no logic change.

Signed-off-by: Yu Liao &lt;liaoyu15@huawei.com&gt;
Link: https://lore.kernel.org/r/20220322030057.1243196-1-liaoyu15@huawei.com
Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Signed-off-by: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
</content>
</entry>
</feed>
