Skip to content

Commit 5be413a

Browse files
committed
Merge tag 's390-6.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 fixes from Heiko Carstens: - Add various missing READ_ONCE() to cmpxchg() loops prevent the compiler from potentially generating incorrect code. This includes a rather large change to the s390 specific hardware sampling code and its current use of cmpxchg_double(). Do the fix now to get it out of the way of Peter Zijlstra's cmpxchg128() work, and have something that can be backported. The added new code includes a private 128 bit cmpxchg variant which will be removed again after Peter's rework is available. Also note that this 128 bit cmpxchg variant is used to implement 128 bit READ_ONCE(), while strictly speaking it wouldn't be necessary, and _READ_ONCE() should also be sufficient; even though it isn't obvious for all converted locations that this is the case. Therefore use this implementation for for the sake of clarity and consistency for now. - Fix ipl report address handling to avoid kdump failures/hangs. - Fix misuse of #(el)if in kernel decompressor. - Define RUNTIME_DISCARD_EXIT to fix link error with GNU ld < 2.36, caused by the recently changed discard behaviour. - Make sure _edata and _end symbols are always page aligned. - The current header guard DEBUG_H in one of the s390 specific header files is too generic and conflicts with the ath9k wireless driver. Add an _ASM_S390_ prefix to the guard to make it unique. - Update defconfigs. * tag 's390-6.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390: update defconfigs KVM: s390: interrupt: use READ_ONCE() before cmpxchg() s390/percpu: add READ_ONCE() to arch_this_cpu_to_op_simple() s390/cpum_sf: add READ_ONCE() semantics to compare and swap loops s390/kexec: fix ipl report address for kdump s390: fix -Wundef warning for CONFIG_KERNEL_ZSTD s390: define RUNTIME_DISCARD_EXIT to fix link error with GNU ld < 2.36 s390: expicitly align _edata and _end symbols on page boundary s390/debug: add _ASM_S390_ prefix to header guard
2 parents bad8c4a + 1ecf7bd commit 5be413a

File tree

11 files changed

+107
-73
lines changed

11 files changed

+107
-73
lines changed

arch/s390/boot/decompressor.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
#define memmove memmove
2424
#define memzero(s, n) memset((s), 0, (n))
2525

26-
#ifdef CONFIG_KERNEL_BZIP2
26+
#if defined(CONFIG_KERNEL_BZIP2)
2727
#define BOOT_HEAP_SIZE 0x400000
28-
#elif CONFIG_KERNEL_ZSTD
28+
#elif defined(CONFIG_KERNEL_ZSTD)
2929
#define BOOT_HEAP_SIZE 0x30000
3030
#else
3131
#define BOOT_HEAP_SIZE 0x10000

arch/s390/configs/debug_defconfig

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ CONFIG_NFT_CT=m
190190
CONFIG_NFT_LOG=m
191191
CONFIG_NFT_LIMIT=m
192192
CONFIG_NFT_NAT=m
193-
CONFIG_NFT_OBJREF=m
194193
CONFIG_NFT_REJECT=m
195194
CONFIG_NFT_COMPAT=m
196195
CONFIG_NFT_HASH=m
@@ -569,6 +568,7 @@ CONFIG_INPUT_EVDEV=y
569568
# CONFIG_INPUT_MOUSE is not set
570569
# CONFIG_SERIO is not set
571570
CONFIG_LEGACY_PTY_COUNT=0
571+
# CONFIG_LEGACY_TIOCSTI is not set
572572
CONFIG_VIRTIO_CONSOLE=m
573573
CONFIG_HW_RANDOM_VIRTIO=m
574574
CONFIG_HANGCHECK_TIMER=m
@@ -660,6 +660,7 @@ CONFIG_CONFIGFS_FS=m
660660
CONFIG_ECRYPT_FS=m
661661
CONFIG_CRAMFS=m
662662
CONFIG_SQUASHFS=m
663+
CONFIG_SQUASHFS_CHOICE_DECOMP_BY_MOUNT=y
663664
CONFIG_SQUASHFS_XATTR=y
664665
CONFIG_SQUASHFS_LZ4=y
665666
CONFIG_SQUASHFS_LZO=y
@@ -705,6 +706,7 @@ CONFIG_SECURITY_LOCKDOWN_LSM_EARLY=y
705706
CONFIG_SECURITY_LANDLOCK=y
706707
CONFIG_INTEGRITY_SIGNATURE=y
707708
CONFIG_INTEGRITY_ASYMMETRIC_KEYS=y
709+
CONFIG_INTEGRITY_PLATFORM_KEYRING=y
708710
CONFIG_IMA=y
709711
CONFIG_IMA_DEFAULT_HASH_SHA256=y
710712
CONFIG_IMA_WRITE_POLICY=y
@@ -781,6 +783,7 @@ CONFIG_ZCRYPT=m
781783
CONFIG_PKEY=m
782784
CONFIG_CRYPTO_PAES_S390=m
783785
CONFIG_CRYPTO_DEV_VIRTIO=m
786+
CONFIG_SYSTEM_BLACKLIST_KEYRING=y
784787
CONFIG_CORDIC=m
785788
CONFIG_CRYPTO_LIB_CURVE25519=m
786789
CONFIG_CRYPTO_LIB_CHACHA20POLY1305=m
@@ -848,7 +851,6 @@ CONFIG_PREEMPT_TRACER=y
848851
CONFIG_SCHED_TRACER=y
849852
CONFIG_FTRACE_SYSCALLS=y
850853
CONFIG_BLK_DEV_IO_TRACE=y
851-
CONFIG_BPF_KPROBE_OVERRIDE=y
852854
CONFIG_HIST_TRIGGERS=y
853855
CONFIG_FTRACE_STARTUP_TEST=y
854856
# CONFIG_EVENT_TRACE_STARTUP_TEST is not set
@@ -870,7 +872,6 @@ CONFIG_FAIL_MAKE_REQUEST=y
870872
CONFIG_FAIL_IO_TIMEOUT=y
871873
CONFIG_FAIL_FUTEX=y
872874
CONFIG_FAULT_INJECTION_DEBUG_FS=y
873-
CONFIG_FAIL_FUNCTION=y
874875
CONFIG_FAULT_INJECTION_STACKTRACE_FILTER=y
875876
CONFIG_LKDTM=m
876877
CONFIG_TEST_MIN_HEAP=y

arch/s390/configs/defconfig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ CONFIG_NFT_CT=m
181181
CONFIG_NFT_LOG=m
182182
CONFIG_NFT_LIMIT=m
183183
CONFIG_NFT_NAT=m
184-
CONFIG_NFT_OBJREF=m
185184
CONFIG_NFT_REJECT=m
186185
CONFIG_NFT_COMPAT=m
187186
CONFIG_NFT_HASH=m
@@ -559,6 +558,7 @@ CONFIG_INPUT_EVDEV=y
559558
# CONFIG_INPUT_MOUSE is not set
560559
# CONFIG_SERIO is not set
561560
CONFIG_LEGACY_PTY_COUNT=0
561+
# CONFIG_LEGACY_TIOCSTI is not set
562562
CONFIG_VIRTIO_CONSOLE=m
563563
CONFIG_HW_RANDOM_VIRTIO=m
564564
CONFIG_HANGCHECK_TIMER=m
@@ -645,6 +645,7 @@ CONFIG_CONFIGFS_FS=m
645645
CONFIG_ECRYPT_FS=m
646646
CONFIG_CRAMFS=m
647647
CONFIG_SQUASHFS=m
648+
CONFIG_SQUASHFS_CHOICE_DECOMP_BY_MOUNT=y
648649
CONFIG_SQUASHFS_XATTR=y
649650
CONFIG_SQUASHFS_LZ4=y
650651
CONFIG_SQUASHFS_LZO=y
@@ -688,6 +689,7 @@ CONFIG_SECURITY_LOCKDOWN_LSM_EARLY=y
688689
CONFIG_SECURITY_LANDLOCK=y
689690
CONFIG_INTEGRITY_SIGNATURE=y
690691
CONFIG_INTEGRITY_ASYMMETRIC_KEYS=y
692+
CONFIG_INTEGRITY_PLATFORM_KEYRING=y
691693
CONFIG_IMA=y
692694
CONFIG_IMA_DEFAULT_HASH_SHA256=y
693695
CONFIG_IMA_WRITE_POLICY=y
@@ -766,6 +768,7 @@ CONFIG_ZCRYPT=m
766768
CONFIG_PKEY=m
767769
CONFIG_CRYPTO_PAES_S390=m
768770
CONFIG_CRYPTO_DEV_VIRTIO=m
771+
CONFIG_SYSTEM_BLACKLIST_KEYRING=y
769772
CONFIG_CORDIC=m
770773
CONFIG_PRIME_NUMBERS=m
771774
CONFIG_CRYPTO_LIB_CURVE25519=m
@@ -798,7 +801,6 @@ CONFIG_STACK_TRACER=y
798801
CONFIG_SCHED_TRACER=y
799802
CONFIG_FTRACE_SYSCALLS=y
800803
CONFIG_BLK_DEV_IO_TRACE=y
801-
CONFIG_BPF_KPROBE_OVERRIDE=y
802804
CONFIG_HIST_TRIGGERS=y
803805
CONFIG_SAMPLES=y
804806
CONFIG_SAMPLE_TRACE_PRINTK=m

arch/s390/configs/zfcpdump_defconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ CONFIG_TUNE_ZEC12=y
1313
# CONFIG_COMPAT is not set
1414
CONFIG_NR_CPUS=2
1515
CONFIG_HZ_100=y
16-
# CONFIG_RELOCATABLE is not set
1716
# CONFIG_CHSC_SCH is not set
1817
# CONFIG_SCM_BUS is not set
1918
CONFIG_CRASH_DUMP=y
@@ -50,6 +49,7 @@ CONFIG_ZFCP=y
5049
# CONFIG_INPUT_KEYBOARD is not set
5150
# CONFIG_INPUT_MOUSE is not set
5251
# CONFIG_SERIO is not set
52+
# CONFIG_LEGACY_TIOCSTI is not set
5353
# CONFIG_HVC_IUCV is not set
5454
# CONFIG_HW_RANDOM_S390 is not set
5555
# CONFIG_HMC_DRV is not set

arch/s390/include/asm/cpu_mf.h

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -131,19 +131,21 @@ struct hws_combined_entry {
131131
struct hws_diag_entry diag; /* Diagnostic-sampling data entry */
132132
} __packed;
133133

134-
struct hws_trailer_entry {
135-
union {
136-
struct {
137-
unsigned int f:1; /* 0 - Block Full Indicator */
138-
unsigned int a:1; /* 1 - Alert request control */
139-
unsigned int t:1; /* 2 - Timestamp format */
140-
unsigned int :29; /* 3 - 31: Reserved */
141-
unsigned int bsdes:16; /* 32-47: size of basic SDE */
142-
unsigned int dsdes:16; /* 48-63: size of diagnostic SDE */
143-
};
144-
unsigned long long flags; /* 0 - 63: All indicators */
134+
union hws_trailer_header {
135+
struct {
136+
unsigned int f:1; /* 0 - Block Full Indicator */
137+
unsigned int a:1; /* 1 - Alert request control */
138+
unsigned int t:1; /* 2 - Timestamp format */
139+
unsigned int :29; /* 3 - 31: Reserved */
140+
unsigned int bsdes:16; /* 32-47: size of basic SDE */
141+
unsigned int dsdes:16; /* 48-63: size of diagnostic SDE */
142+
unsigned long long overflow; /* 64 - Overflow Count */
145143
};
146-
unsigned long long overflow; /* 64 - sample Overflow count */
144+
__uint128_t val;
145+
};
146+
147+
struct hws_trailer_entry {
148+
union hws_trailer_header header; /* 0 - 15 Flags + Overflow Count */
147149
unsigned char timestamp[16]; /* 16 - 31 timestamp */
148150
unsigned long long reserved1; /* 32 -Reserved */
149151
unsigned long long reserved2; /* */
@@ -290,14 +292,11 @@ static inline unsigned long sample_rate_to_freq(struct hws_qsi_info_block *qsi,
290292
return USEC_PER_SEC * qsi->cpu_speed / rate;
291293
}
292294

293-
#define SDB_TE_ALERT_REQ_MASK 0x4000000000000000UL
294-
#define SDB_TE_BUFFER_FULL_MASK 0x8000000000000000UL
295-
296295
/* Return TOD timestamp contained in an trailer entry */
297296
static inline unsigned long long trailer_timestamp(struct hws_trailer_entry *te)
298297
{
299298
/* TOD in STCKE format */
300-
if (te->t)
299+
if (te->header.t)
301300
return *((unsigned long long *) &te->timestamp[1]);
302301

303302
/* TOD in STCK format */

arch/s390/include/asm/debug.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
*
55
* Copyright IBM Corp. 1999, 2020
66
*/
7-
#ifndef DEBUG_H
8-
#define DEBUG_H
7+
#ifndef _ASM_S390_DEBUG_H
8+
#define _ASM_S390_DEBUG_H
99

1010
#include <linux/string.h>
1111
#include <linux/spinlock.h>
@@ -487,4 +487,4 @@ void debug_register_static(debug_info_t *id, int pages_per_area, int nr_areas);
487487

488488
#endif /* MODULE */
489489

490-
#endif /* DEBUG_H */
490+
#endif /* _ASM_S390_DEBUG_H */

arch/s390/include/asm/percpu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
pcp_op_T__ *ptr__; \
3232
preempt_disable_notrace(); \
3333
ptr__ = raw_cpu_ptr(&(pcp)); \
34-
prev__ = *ptr__; \
34+
prev__ = READ_ONCE(*ptr__); \
3535
do { \
3636
old__ = prev__; \
3737
new__ = old__ op (val); \

arch/s390/kernel/machine_kexec_file.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,6 @@ static int kexec_file_add_ipl_report(struct kimage *image,
187187

188188
data->memsz = ALIGN(data->memsz, PAGE_SIZE);
189189
buf.mem = data->memsz;
190-
if (image->type == KEXEC_TYPE_CRASH)
191-
buf.mem += crashk_res.start;
192190

193191
ptr = (void *)ipl_cert_list_addr;
194192
end = ptr + ipl_cert_list_size;
@@ -225,6 +223,9 @@ static int kexec_file_add_ipl_report(struct kimage *image,
225223
data->kernel_buf + offsetof(struct lowcore, ipl_parmblock_ptr);
226224
*lc_ipl_parmblock_ptr = (__u32)buf.mem;
227225

226+
if (image->type == KEXEC_TYPE_CRASH)
227+
buf.mem += crashk_res.start;
228+
228229
ret = kexec_add_buffer(&buf);
229230
out:
230231
return ret;

0 commit comments

Comments
 (0)