Skip to content

Commit 115acbb

Browse files
committed
Merge tag 's390-5.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 fixes from Heiko Carstens: - Convert current_stack_pointer to a register alias like it is assumed if ARCH_HAS_CURRENT_STACK_POINTER is selected. The existing implementation as a function breaks CONFIG_HARDENED_USERCOPY sanity-checks - Get rid of -Warray-bounds warning within kexec code - Add minimal IBM z16 support by reporting a proper elf platform, and adding compile options - Update defconfigs * tag 's390-5.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390: enable CONFIG_HARDENED_USERCOPY in debug_defconfig s390: current_stack_pointer shouldn't be a function s390: update defconfigs s390/kexec: silence -Warray-bounds warning s390: allow to compile with z16 optimizations s390: add z16 elf platform
2 parents d20339f + c68c634 commit 115acbb

11 files changed

Lines changed: 43 additions & 18 deletions

File tree

arch/s390/Kconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,10 @@ config HAVE_MARCH_Z15_FEATURES
255255
def_bool n
256256
select HAVE_MARCH_Z14_FEATURES
257257

258+
config HAVE_MARCH_Z16_FEATURES
259+
def_bool n
260+
select HAVE_MARCH_Z15_FEATURES
261+
258262
choice
259263
prompt "Processor type"
260264
default MARCH_Z196
@@ -312,6 +316,14 @@ config MARCH_Z15
312316
and 8561 series). The kernel will be slightly faster but will not
313317
work on older machines.
314318

319+
config MARCH_Z16
320+
bool "IBM z16"
321+
select HAVE_MARCH_Z16_FEATURES
322+
depends on $(cc-option,-march=z16)
323+
help
324+
Select this to enable optimizations for IBM z16 (3931 and
325+
3932 series).
326+
315327
endchoice
316328

317329
config MARCH_Z10_TUNE
@@ -332,6 +344,9 @@ config MARCH_Z14_TUNE
332344
config MARCH_Z15_TUNE
333345
def_bool TUNE_Z15 || MARCH_Z15 && TUNE_DEFAULT
334346

347+
config MARCH_Z16_TUNE
348+
def_bool TUNE_Z16 || MARCH_Z16 && TUNE_DEFAULT
349+
335350
choice
336351
prompt "Tune code generation"
337352
default TUNE_DEFAULT
@@ -372,6 +387,10 @@ config TUNE_Z15
372387
bool "IBM z15"
373388
depends on $(cc-option,-mtune=z15)
374389

390+
config TUNE_Z16
391+
bool "IBM z16"
392+
depends on $(cc-option,-mtune=z16)
393+
375394
endchoice
376395

377396
config 64BIT

arch/s390/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ mflags-$(CONFIG_MARCH_ZEC12) := -march=zEC12
4242
mflags-$(CONFIG_MARCH_Z13) := -march=z13
4343
mflags-$(CONFIG_MARCH_Z14) := -march=z14
4444
mflags-$(CONFIG_MARCH_Z15) := -march=z15
45+
mflags-$(CONFIG_MARCH_Z16) := -march=z16
4546

4647
export CC_FLAGS_MARCH := $(mflags-y)
4748

@@ -54,6 +55,7 @@ cflags-$(CONFIG_MARCH_ZEC12_TUNE) += -mtune=zEC12
5455
cflags-$(CONFIG_MARCH_Z13_TUNE) += -mtune=z13
5556
cflags-$(CONFIG_MARCH_Z14_TUNE) += -mtune=z14
5657
cflags-$(CONFIG_MARCH_Z15_TUNE) += -mtune=z15
58+
cflags-$(CONFIG_MARCH_Z16_TUNE) += -mtune=z16
5759

5860
cflags-y += -Wa,-I$(srctree)/arch/$(ARCH)/include
5961

arch/s390/configs/debug_defconfig

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,11 +499,13 @@ CONFIG_NLMON=m
499499
# CONFIG_NET_VENDOR_CHELSIO is not set
500500
# CONFIG_NET_VENDOR_CISCO is not set
501501
# CONFIG_NET_VENDOR_CORTINA is not set
502+
# CONFIG_NET_VENDOR_DAVICOM is not set
502503
# CONFIG_NET_VENDOR_DEC is not set
503504
# CONFIG_NET_VENDOR_DLINK is not set
504505
# CONFIG_NET_VENDOR_EMULEX is not set
505506
# CONFIG_NET_VENDOR_ENGLEDER is not set
506507
# CONFIG_NET_VENDOR_EZCHIP is not set
508+
# CONFIG_NET_VENDOR_FUNGIBLE is not set
507509
# CONFIG_NET_VENDOR_GOOGLE is not set
508510
# CONFIG_NET_VENDOR_HUAWEI is not set
509511
# CONFIG_NET_VENDOR_INTEL is not set
@@ -588,13 +590,13 @@ CONFIG_MLX5_INFINIBAND=m
588590
CONFIG_SYNC_FILE=y
589591
CONFIG_VFIO=m
590592
CONFIG_VFIO_PCI=m
593+
CONFIG_MLX5_VFIO_PCI=m
591594
CONFIG_VFIO_MDEV=m
592595
CONFIG_VIRTIO_PCI=m
593596
CONFIG_VIRTIO_BALLOON=m
594597
CONFIG_VIRTIO_INPUT=y
595598
CONFIG_VHOST_NET=m
596599
CONFIG_VHOST_VSOCK=m
597-
# CONFIG_SURFACE_PLATFORMS is not set
598600
CONFIG_S390_CCW_IOMMU=y
599601
CONFIG_S390_AP_IOMMU=y
600602
CONFIG_EXT4_FS=y
@@ -690,6 +692,7 @@ CONFIG_ENCRYPTED_KEYS=m
690692
CONFIG_KEY_NOTIFICATIONS=y
691693
CONFIG_SECURITY=y
692694
CONFIG_SECURITY_NETWORK=y
695+
CONFIG_HARDENED_USERCOPY=y
693696
CONFIG_FORTIFY_SOURCE=y
694697
CONFIG_SECURITY_SELINUX=y
695698
CONFIG_SECURITY_SELINUX_BOOTPARAM=y
@@ -733,6 +736,7 @@ CONFIG_CRYPTO_MD5=y
733736
CONFIG_CRYPTO_MICHAEL_MIC=m
734737
CONFIG_CRYPTO_RMD160=m
735738
CONFIG_CRYPTO_SHA3=m
739+
CONFIG_CRYPTO_SM3=m
736740
CONFIG_CRYPTO_WP512=m
737741
CONFIG_CRYPTO_AES_TI=m
738742
CONFIG_CRYPTO_ANUBIS=m
@@ -786,7 +790,6 @@ CONFIG_DMA_CMA=y
786790
CONFIG_CMA_SIZE_MBYTES=0
787791
CONFIG_PRINTK_TIME=y
788792
CONFIG_DYNAMIC_DEBUG=y
789-
CONFIG_DEBUG_INFO=y
790793
CONFIG_DEBUG_INFO_DWARF4=y
791794
CONFIG_DEBUG_INFO_BTF=y
792795
CONFIG_GDB_SCRIPTS=y
@@ -814,6 +817,7 @@ CONFIG_DEBUG_MEMORY_INIT=y
814817
CONFIG_MEMORY_NOTIFIER_ERROR_INJECT=m
815818
CONFIG_DEBUG_PER_CPU_MAPS=y
816819
CONFIG_KFENCE=y
820+
CONFIG_KFENCE_DEFERRABLE=y
817821
CONFIG_KFENCE_STATIC_KEYS=y
818822
CONFIG_DEBUG_SHIRQ=y
819823
CONFIG_PANIC_ON_OOPS=y

arch/s390/configs/defconfig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,11 +490,13 @@ CONFIG_NLMON=m
490490
# CONFIG_NET_VENDOR_CHELSIO is not set
491491
# CONFIG_NET_VENDOR_CISCO is not set
492492
# CONFIG_NET_VENDOR_CORTINA is not set
493+
# CONFIG_NET_VENDOR_DAVICOM is not set
493494
# CONFIG_NET_VENDOR_DEC is not set
494495
# CONFIG_NET_VENDOR_DLINK is not set
495496
# CONFIG_NET_VENDOR_EMULEX is not set
496497
# CONFIG_NET_VENDOR_ENGLEDER is not set
497498
# CONFIG_NET_VENDOR_EZCHIP is not set
499+
# CONFIG_NET_VENDOR_FUNGIBLE is not set
498500
# CONFIG_NET_VENDOR_GOOGLE is not set
499501
# CONFIG_NET_VENDOR_HUAWEI is not set
500502
# CONFIG_NET_VENDOR_INTEL is not set
@@ -578,13 +580,13 @@ CONFIG_MLX5_INFINIBAND=m
578580
CONFIG_SYNC_FILE=y
579581
CONFIG_VFIO=m
580582
CONFIG_VFIO_PCI=m
583+
CONFIG_MLX5_VFIO_PCI=m
581584
CONFIG_VFIO_MDEV=m
582585
CONFIG_VIRTIO_PCI=m
583586
CONFIG_VIRTIO_BALLOON=m
584587
CONFIG_VIRTIO_INPUT=y
585588
CONFIG_VHOST_NET=m
586589
CONFIG_VHOST_VSOCK=m
587-
# CONFIG_SURFACE_PLATFORMS is not set
588590
CONFIG_S390_CCW_IOMMU=y
589591
CONFIG_S390_AP_IOMMU=y
590592
CONFIG_EXT4_FS=y
@@ -720,6 +722,7 @@ CONFIG_CRYPTO_MD5=y
720722
CONFIG_CRYPTO_MICHAEL_MIC=m
721723
CONFIG_CRYPTO_RMD160=m
722724
CONFIG_CRYPTO_SHA3=m
725+
CONFIG_CRYPTO_SM3=m
723726
CONFIG_CRYPTO_WP512=m
724727
CONFIG_CRYPTO_AES_TI=m
725728
CONFIG_CRYPTO_ANUBIS=m
@@ -772,7 +775,6 @@ CONFIG_DMA_CMA=y
772775
CONFIG_CMA_SIZE_MBYTES=0
773776
CONFIG_PRINTK_TIME=y
774777
CONFIG_DYNAMIC_DEBUG=y
775-
CONFIG_DEBUG_INFO=y
776778
CONFIG_DEBUG_INFO_DWARF4=y
777779
CONFIG_DEBUG_INFO_BTF=y
778780
CONFIG_GDB_SCRIPTS=y

arch/s390/configs/zfcpdump_defconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ CONFIG_CRASH_DUMP=y
2626
# CONFIG_S390_GUEST is not set
2727
# CONFIG_SECCOMP is not set
2828
# CONFIG_GCC_PLUGINS is not set
29+
# CONFIG_BLOCK_LEGACY_AUTOLOAD is not set
2930
CONFIG_PARTITION_ADVANCED=y
3031
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
3132
# CONFIG_COMPACTION is not set
@@ -60,7 +61,6 @@ CONFIG_ZFCP=y
6061
# CONFIG_HID is not set
6162
# CONFIG_VIRTIO_MENU is not set
6263
# CONFIG_VHOST_MENU is not set
63-
# CONFIG_SURFACE_PLATFORMS is not set
6464
# CONFIG_IOMMU_SUPPORT is not set
6565
# CONFIG_DNOTIFY is not set
6666
# CONFIG_INOTIFY_USER is not set
@@ -71,10 +71,10 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
7171
CONFIG_XZ_DEC_MICROLZMA=y
7272
CONFIG_PRINTK_TIME=y
7373
# CONFIG_SYMBOLIC_ERRNAME is not set
74-
CONFIG_DEBUG_INFO=y
74+
CONFIG_DEBUG_KERNEL=y
75+
CONFIG_DEBUG_INFO_DWARF4=y
7576
CONFIG_DEBUG_INFO_BTF=y
7677
CONFIG_DEBUG_FS=y
77-
CONFIG_DEBUG_KERNEL=y
7878
CONFIG_PANIC_ON_OOPS=y
7979
# CONFIG_SCHED_DEBUG is not set
8080
CONFIG_RCU_CPU_STALL_TIMEOUT=60

arch/s390/include/asm/entry-common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static inline void arch_exit_to_user_mode_prepare(struct pt_regs *regs,
5858

5959
static inline bool on_thread_stack(void)
6060
{
61-
return !(((unsigned long)(current->stack) ^ current_stack_pointer()) & ~(THREAD_SIZE - 1));
61+
return !(((unsigned long)(current->stack) ^ current_stack_pointer) & ~(THREAD_SIZE - 1));
6262
}
6363

6464
#endif

arch/s390/include/asm/processor.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,7 @@ unsigned long __get_wchan(struct task_struct *p);
200200
/* Has task runtime instrumentation enabled ? */
201201
#define is_ri_task(tsk) (!!(tsk)->thread.ri_cb)
202202

203-
static __always_inline unsigned long current_stack_pointer(void)
204-
{
205-
unsigned long sp;
206-
207-
asm volatile("la %0,0(15)" : "=a" (sp));
208-
return sp;
209-
}
203+
register unsigned long current_stack_pointer asm("r15");
210204

211205
static __always_inline unsigned short stap(void)
212206
{

arch/s390/include/asm/stacktrace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ struct stack_frame {
4646
};
4747

4848
/*
49-
* Unlike current_stack_pointer() which simply returns current value of %r15
49+
* Unlike current_stack_pointer which simply contains the current value of %r15
5050
* current_frame_address() returns function stack frame address, which matches
5151
* %r15 upon function invocation. It may differ from %r15 later if function
5252
* allocates stack for local variables or new stack frame to call other

arch/s390/kernel/machine_kexec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static void __do_machine_kdump(void *image)
5454
* This need to be done *after* s390_reset_system set the
5555
* prefix register of this CPU to zero
5656
*/
57-
memcpy((void *) __LC_FPREGS_SAVE_AREA,
57+
memcpy(absolute_pointer(__LC_FPREGS_SAVE_AREA),
5858
(void *)(prefix + __LC_FPREGS_SAVE_AREA), 512);
5959

6060
__load_psw_mask(PSW_MASK_BASE | PSW_DEFAULT_KEY | PSW_MASK_EA | PSW_MASK_BA);

arch/s390/kernel/processor.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,10 @@ static int __init setup_elf_platform(void)
283283
case 0x8562:
284284
strcpy(elf_platform, "z15");
285285
break;
286+
case 0x3931:
287+
case 0x3932:
288+
strcpy(elf_platform, "z16");
289+
break;
286290
}
287291
return 0;
288292
}

0 commit comments

Comments
 (0)