s390 updates for 5.18-rc3

- 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.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEECMNfWEw3SLnmiLkZIg7DeRspbsIFAmJYSFIACgkQIg7DeRsp
 bsJoXQ//Yefu38RdkEKYa4yxIfVIgtET9dNTI9rac2J6E9rzNKF6gAs5YT5IZW+5
 iMTr4Tnx3PJffG3EIROUHt2An+XATfnnGt9Bq4g5bM8JUz+mpoVhQMG5ftyfvwlr
 I151mzNO5YjcMcqOYeUHWUQeLWOx/MIHUMGzK2BL3DnmiCrdMeoRGfyujRy9eT10
 Ge0lFAuk0wbHGa5tH4ugiOMmTYfNYRRLmLQgvjpBR5UicITkE5FKuItlXYDt05EL
 Kh7snibJIsLv814rDt+/PyJATGwJrz5naSALpd1QrQhhPgqf5zDFWLAQfmV5JHmW
 +qzJhOu8wmLXrCAjPT5famuWSB03phTGxhiKFNmwM0ER0Oki5Tv/lAYN+wDsbZoX
 hU3PbJXDlA+Mz4EDrj0MpEd/Jku1yaXmpy4s/YuWzr80qE9kPJGIo4JDbhSYeWdY
 CE4Rbuk0gfzvSMSQh6Kr/9BApjaRR2KWHOOB+d0prmBePyxhM2iA/kcDQKStNy25
 1ysBrgDGvw+c111PGyIPfSz2TZlwYn8gmKq/Yr6721zEhQ/+D7KSprCswfLhRqpF
 ikM5k3fFr/WZD4FBWONf+eCFte8aX7bjy+tzq1aaRDteUkEZGqiUpjiBnFBT4l/p
 auveRe7c2KvRki9OD1Lx1EOGp/BzQlJ7iKJCe1q1PxAaCprqsk0=
 =Tqzs
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2022-04-14 12:17:25 -07:00
commit 115acbb569
11 changed files with 43 additions and 18 deletions

View File

@ -255,6 +255,10 @@ config HAVE_MARCH_Z15_FEATURES
def_bool n def_bool n
select HAVE_MARCH_Z14_FEATURES select HAVE_MARCH_Z14_FEATURES
config HAVE_MARCH_Z16_FEATURES
def_bool n
select HAVE_MARCH_Z15_FEATURES
choice choice
prompt "Processor type" prompt "Processor type"
default MARCH_Z196 default MARCH_Z196
@ -312,6 +316,14 @@ config MARCH_Z15
and 8561 series). The kernel will be slightly faster but will not and 8561 series). The kernel will be slightly faster but will not
work on older machines. work on older machines.
config MARCH_Z16
bool "IBM z16"
select HAVE_MARCH_Z16_FEATURES
depends on $(cc-option,-march=z16)
help
Select this to enable optimizations for IBM z16 (3931 and
3932 series).
endchoice endchoice
config MARCH_Z10_TUNE config MARCH_Z10_TUNE
@ -332,6 +344,9 @@ config MARCH_Z14_TUNE
config MARCH_Z15_TUNE config MARCH_Z15_TUNE
def_bool TUNE_Z15 || MARCH_Z15 && TUNE_DEFAULT def_bool TUNE_Z15 || MARCH_Z15 && TUNE_DEFAULT
config MARCH_Z16_TUNE
def_bool TUNE_Z16 || MARCH_Z16 && TUNE_DEFAULT
choice choice
prompt "Tune code generation" prompt "Tune code generation"
default TUNE_DEFAULT default TUNE_DEFAULT
@ -372,6 +387,10 @@ config TUNE_Z15
bool "IBM z15" bool "IBM z15"
depends on $(cc-option,-mtune=z15) depends on $(cc-option,-mtune=z15)
config TUNE_Z16
bool "IBM z16"
depends on $(cc-option,-mtune=z16)
endchoice endchoice
config 64BIT config 64BIT

View File

@ -42,6 +42,7 @@ mflags-$(CONFIG_MARCH_ZEC12) := -march=zEC12
mflags-$(CONFIG_MARCH_Z13) := -march=z13 mflags-$(CONFIG_MARCH_Z13) := -march=z13
mflags-$(CONFIG_MARCH_Z14) := -march=z14 mflags-$(CONFIG_MARCH_Z14) := -march=z14
mflags-$(CONFIG_MARCH_Z15) := -march=z15 mflags-$(CONFIG_MARCH_Z15) := -march=z15
mflags-$(CONFIG_MARCH_Z16) := -march=z16
export CC_FLAGS_MARCH := $(mflags-y) export CC_FLAGS_MARCH := $(mflags-y)
@ -54,6 +55,7 @@ cflags-$(CONFIG_MARCH_ZEC12_TUNE) += -mtune=zEC12
cflags-$(CONFIG_MARCH_Z13_TUNE) += -mtune=z13 cflags-$(CONFIG_MARCH_Z13_TUNE) += -mtune=z13
cflags-$(CONFIG_MARCH_Z14_TUNE) += -mtune=z14 cflags-$(CONFIG_MARCH_Z14_TUNE) += -mtune=z14
cflags-$(CONFIG_MARCH_Z15_TUNE) += -mtune=z15 cflags-$(CONFIG_MARCH_Z15_TUNE) += -mtune=z15
cflags-$(CONFIG_MARCH_Z16_TUNE) += -mtune=z16
cflags-y += -Wa,-I$(srctree)/arch/$(ARCH)/include cflags-y += -Wa,-I$(srctree)/arch/$(ARCH)/include

View File

@ -499,11 +499,13 @@ CONFIG_NLMON=m
# CONFIG_NET_VENDOR_CHELSIO is not set # CONFIG_NET_VENDOR_CHELSIO is not set
# CONFIG_NET_VENDOR_CISCO is not set # CONFIG_NET_VENDOR_CISCO is not set
# CONFIG_NET_VENDOR_CORTINA is not set # CONFIG_NET_VENDOR_CORTINA is not set
# CONFIG_NET_VENDOR_DAVICOM is not set
# CONFIG_NET_VENDOR_DEC is not set # CONFIG_NET_VENDOR_DEC is not set
# CONFIG_NET_VENDOR_DLINK is not set # CONFIG_NET_VENDOR_DLINK is not set
# CONFIG_NET_VENDOR_EMULEX is not set # CONFIG_NET_VENDOR_EMULEX is not set
# CONFIG_NET_VENDOR_ENGLEDER is not set # CONFIG_NET_VENDOR_ENGLEDER is not set
# CONFIG_NET_VENDOR_EZCHIP is not set # CONFIG_NET_VENDOR_EZCHIP is not set
# CONFIG_NET_VENDOR_FUNGIBLE is not set
# CONFIG_NET_VENDOR_GOOGLE is not set # CONFIG_NET_VENDOR_GOOGLE is not set
# CONFIG_NET_VENDOR_HUAWEI is not set # CONFIG_NET_VENDOR_HUAWEI is not set
# CONFIG_NET_VENDOR_INTEL is not set # CONFIG_NET_VENDOR_INTEL is not set
@ -588,13 +590,13 @@ CONFIG_MLX5_INFINIBAND=m
CONFIG_SYNC_FILE=y CONFIG_SYNC_FILE=y
CONFIG_VFIO=m CONFIG_VFIO=m
CONFIG_VFIO_PCI=m CONFIG_VFIO_PCI=m
CONFIG_MLX5_VFIO_PCI=m
CONFIG_VFIO_MDEV=m CONFIG_VFIO_MDEV=m
CONFIG_VIRTIO_PCI=m CONFIG_VIRTIO_PCI=m
CONFIG_VIRTIO_BALLOON=m CONFIG_VIRTIO_BALLOON=m
CONFIG_VIRTIO_INPUT=y CONFIG_VIRTIO_INPUT=y
CONFIG_VHOST_NET=m CONFIG_VHOST_NET=m
CONFIG_VHOST_VSOCK=m CONFIG_VHOST_VSOCK=m
# CONFIG_SURFACE_PLATFORMS is not set
CONFIG_S390_CCW_IOMMU=y CONFIG_S390_CCW_IOMMU=y
CONFIG_S390_AP_IOMMU=y CONFIG_S390_AP_IOMMU=y
CONFIG_EXT4_FS=y CONFIG_EXT4_FS=y
@ -690,6 +692,7 @@ CONFIG_ENCRYPTED_KEYS=m
CONFIG_KEY_NOTIFICATIONS=y CONFIG_KEY_NOTIFICATIONS=y
CONFIG_SECURITY=y CONFIG_SECURITY=y
CONFIG_SECURITY_NETWORK=y CONFIG_SECURITY_NETWORK=y
CONFIG_HARDENED_USERCOPY=y
CONFIG_FORTIFY_SOURCE=y CONFIG_FORTIFY_SOURCE=y
CONFIG_SECURITY_SELINUX=y CONFIG_SECURITY_SELINUX=y
CONFIG_SECURITY_SELINUX_BOOTPARAM=y CONFIG_SECURITY_SELINUX_BOOTPARAM=y
@ -733,6 +736,7 @@ CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_MICHAEL_MIC=m CONFIG_CRYPTO_MICHAEL_MIC=m
CONFIG_CRYPTO_RMD160=m CONFIG_CRYPTO_RMD160=m
CONFIG_CRYPTO_SHA3=m CONFIG_CRYPTO_SHA3=m
CONFIG_CRYPTO_SM3=m
CONFIG_CRYPTO_WP512=m CONFIG_CRYPTO_WP512=m
CONFIG_CRYPTO_AES_TI=m CONFIG_CRYPTO_AES_TI=m
CONFIG_CRYPTO_ANUBIS=m CONFIG_CRYPTO_ANUBIS=m
@ -786,7 +790,6 @@ CONFIG_DMA_CMA=y
CONFIG_CMA_SIZE_MBYTES=0 CONFIG_CMA_SIZE_MBYTES=0
CONFIG_PRINTK_TIME=y CONFIG_PRINTK_TIME=y
CONFIG_DYNAMIC_DEBUG=y CONFIG_DYNAMIC_DEBUG=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_INFO_DWARF4=y CONFIG_DEBUG_INFO_DWARF4=y
CONFIG_DEBUG_INFO_BTF=y CONFIG_DEBUG_INFO_BTF=y
CONFIG_GDB_SCRIPTS=y CONFIG_GDB_SCRIPTS=y
@ -814,6 +817,7 @@ CONFIG_DEBUG_MEMORY_INIT=y
CONFIG_MEMORY_NOTIFIER_ERROR_INJECT=m CONFIG_MEMORY_NOTIFIER_ERROR_INJECT=m
CONFIG_DEBUG_PER_CPU_MAPS=y CONFIG_DEBUG_PER_CPU_MAPS=y
CONFIG_KFENCE=y CONFIG_KFENCE=y
CONFIG_KFENCE_DEFERRABLE=y
CONFIG_KFENCE_STATIC_KEYS=y CONFIG_KFENCE_STATIC_KEYS=y
CONFIG_DEBUG_SHIRQ=y CONFIG_DEBUG_SHIRQ=y
CONFIG_PANIC_ON_OOPS=y CONFIG_PANIC_ON_OOPS=y

View File

@ -490,11 +490,13 @@ CONFIG_NLMON=m
# CONFIG_NET_VENDOR_CHELSIO is not set # CONFIG_NET_VENDOR_CHELSIO is not set
# CONFIG_NET_VENDOR_CISCO is not set # CONFIG_NET_VENDOR_CISCO is not set
# CONFIG_NET_VENDOR_CORTINA is not set # CONFIG_NET_VENDOR_CORTINA is not set
# CONFIG_NET_VENDOR_DAVICOM is not set
# CONFIG_NET_VENDOR_DEC is not set # CONFIG_NET_VENDOR_DEC is not set
# CONFIG_NET_VENDOR_DLINK is not set # CONFIG_NET_VENDOR_DLINK is not set
# CONFIG_NET_VENDOR_EMULEX is not set # CONFIG_NET_VENDOR_EMULEX is not set
# CONFIG_NET_VENDOR_ENGLEDER is not set # CONFIG_NET_VENDOR_ENGLEDER is not set
# CONFIG_NET_VENDOR_EZCHIP is not set # CONFIG_NET_VENDOR_EZCHIP is not set
# CONFIG_NET_VENDOR_FUNGIBLE is not set
# CONFIG_NET_VENDOR_GOOGLE is not set # CONFIG_NET_VENDOR_GOOGLE is not set
# CONFIG_NET_VENDOR_HUAWEI is not set # CONFIG_NET_VENDOR_HUAWEI is not set
# CONFIG_NET_VENDOR_INTEL is not set # CONFIG_NET_VENDOR_INTEL is not set
@ -578,13 +580,13 @@ CONFIG_MLX5_INFINIBAND=m
CONFIG_SYNC_FILE=y CONFIG_SYNC_FILE=y
CONFIG_VFIO=m CONFIG_VFIO=m
CONFIG_VFIO_PCI=m CONFIG_VFIO_PCI=m
CONFIG_MLX5_VFIO_PCI=m
CONFIG_VFIO_MDEV=m CONFIG_VFIO_MDEV=m
CONFIG_VIRTIO_PCI=m CONFIG_VIRTIO_PCI=m
CONFIG_VIRTIO_BALLOON=m CONFIG_VIRTIO_BALLOON=m
CONFIG_VIRTIO_INPUT=y CONFIG_VIRTIO_INPUT=y
CONFIG_VHOST_NET=m CONFIG_VHOST_NET=m
CONFIG_VHOST_VSOCK=m CONFIG_VHOST_VSOCK=m
# CONFIG_SURFACE_PLATFORMS is not set
CONFIG_S390_CCW_IOMMU=y CONFIG_S390_CCW_IOMMU=y
CONFIG_S390_AP_IOMMU=y CONFIG_S390_AP_IOMMU=y
CONFIG_EXT4_FS=y CONFIG_EXT4_FS=y
@ -720,6 +722,7 @@ CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_MICHAEL_MIC=m CONFIG_CRYPTO_MICHAEL_MIC=m
CONFIG_CRYPTO_RMD160=m CONFIG_CRYPTO_RMD160=m
CONFIG_CRYPTO_SHA3=m CONFIG_CRYPTO_SHA3=m
CONFIG_CRYPTO_SM3=m
CONFIG_CRYPTO_WP512=m CONFIG_CRYPTO_WP512=m
CONFIG_CRYPTO_AES_TI=m CONFIG_CRYPTO_AES_TI=m
CONFIG_CRYPTO_ANUBIS=m CONFIG_CRYPTO_ANUBIS=m
@ -772,7 +775,6 @@ CONFIG_DMA_CMA=y
CONFIG_CMA_SIZE_MBYTES=0 CONFIG_CMA_SIZE_MBYTES=0
CONFIG_PRINTK_TIME=y CONFIG_PRINTK_TIME=y
CONFIG_DYNAMIC_DEBUG=y CONFIG_DYNAMIC_DEBUG=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_INFO_DWARF4=y CONFIG_DEBUG_INFO_DWARF4=y
CONFIG_DEBUG_INFO_BTF=y CONFIG_DEBUG_INFO_BTF=y
CONFIG_GDB_SCRIPTS=y CONFIG_GDB_SCRIPTS=y

View File

@ -26,6 +26,7 @@ CONFIG_CRASH_DUMP=y
# CONFIG_S390_GUEST is not set # CONFIG_S390_GUEST is not set
# CONFIG_SECCOMP is not set # CONFIG_SECCOMP is not set
# CONFIG_GCC_PLUGINS is not set # CONFIG_GCC_PLUGINS is not set
# CONFIG_BLOCK_LEGACY_AUTOLOAD is not set
CONFIG_PARTITION_ADVANCED=y CONFIG_PARTITION_ADVANCED=y
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
# CONFIG_COMPACTION is not set # CONFIG_COMPACTION is not set
@ -60,7 +61,6 @@ CONFIG_ZFCP=y
# CONFIG_HID is not set # CONFIG_HID is not set
# CONFIG_VIRTIO_MENU is not set # CONFIG_VIRTIO_MENU is not set
# CONFIG_VHOST_MENU is not set # CONFIG_VHOST_MENU is not set
# CONFIG_SURFACE_PLATFORMS is not set
# CONFIG_IOMMU_SUPPORT is not set # CONFIG_IOMMU_SUPPORT is not set
# CONFIG_DNOTIFY is not set # CONFIG_DNOTIFY is not set
# CONFIG_INOTIFY_USER is not set # CONFIG_INOTIFY_USER is not set
@ -71,10 +71,10 @@ CONFIG_LSM="yama,loadpin,safesetid,integrity"
CONFIG_XZ_DEC_MICROLZMA=y CONFIG_XZ_DEC_MICROLZMA=y
CONFIG_PRINTK_TIME=y CONFIG_PRINTK_TIME=y
# CONFIG_SYMBOLIC_ERRNAME is not set # CONFIG_SYMBOLIC_ERRNAME is not set
CONFIG_DEBUG_INFO=y CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_INFO_DWARF4=y
CONFIG_DEBUG_INFO_BTF=y CONFIG_DEBUG_INFO_BTF=y
CONFIG_DEBUG_FS=y CONFIG_DEBUG_FS=y
CONFIG_DEBUG_KERNEL=y
CONFIG_PANIC_ON_OOPS=y CONFIG_PANIC_ON_OOPS=y
# CONFIG_SCHED_DEBUG is not set # CONFIG_SCHED_DEBUG is not set
CONFIG_RCU_CPU_STALL_TIMEOUT=60 CONFIG_RCU_CPU_STALL_TIMEOUT=60

View File

@ -58,7 +58,7 @@ static inline void arch_exit_to_user_mode_prepare(struct pt_regs *regs,
static inline bool on_thread_stack(void) static inline bool on_thread_stack(void)
{ {
return !(((unsigned long)(current->stack) ^ current_stack_pointer()) & ~(THREAD_SIZE - 1)); return !(((unsigned long)(current->stack) ^ current_stack_pointer) & ~(THREAD_SIZE - 1));
} }
#endif #endif

View File

@ -200,13 +200,7 @@ unsigned long __get_wchan(struct task_struct *p);
/* Has task runtime instrumentation enabled ? */ /* Has task runtime instrumentation enabled ? */
#define is_ri_task(tsk) (!!(tsk)->thread.ri_cb) #define is_ri_task(tsk) (!!(tsk)->thread.ri_cb)
static __always_inline unsigned long current_stack_pointer(void) register unsigned long current_stack_pointer asm("r15");
{
unsigned long sp;
asm volatile("la %0,0(15)" : "=a" (sp));
return sp;
}
static __always_inline unsigned short stap(void) static __always_inline unsigned short stap(void)
{ {

View File

@ -46,7 +46,7 @@ struct stack_frame {
}; };
/* /*
* Unlike current_stack_pointer() which simply returns current value of %r15 * Unlike current_stack_pointer which simply contains the current value of %r15
* current_frame_address() returns function stack frame address, which matches * current_frame_address() returns function stack frame address, which matches
* %r15 upon function invocation. It may differ from %r15 later if function * %r15 upon function invocation. It may differ from %r15 later if function
* allocates stack for local variables or new stack frame to call other * allocates stack for local variables or new stack frame to call other

View File

@ -54,7 +54,7 @@ static void __do_machine_kdump(void *image)
* This need to be done *after* s390_reset_system set the * This need to be done *after* s390_reset_system set the
* prefix register of this CPU to zero * prefix register of this CPU to zero
*/ */
memcpy((void *) __LC_FPREGS_SAVE_AREA, memcpy(absolute_pointer(__LC_FPREGS_SAVE_AREA),
(void *)(prefix + __LC_FPREGS_SAVE_AREA), 512); (void *)(prefix + __LC_FPREGS_SAVE_AREA), 512);
__load_psw_mask(PSW_MASK_BASE | PSW_DEFAULT_KEY | PSW_MASK_EA | PSW_MASK_BA); __load_psw_mask(PSW_MASK_BASE | PSW_DEFAULT_KEY | PSW_MASK_EA | PSW_MASK_BA);

View File

@ -283,6 +283,10 @@ static int __init setup_elf_platform(void)
case 0x8562: case 0x8562:
strcpy(elf_platform, "z15"); strcpy(elf_platform, "z15");
break; break;
case 0x3931:
case 0x3932:
strcpy(elf_platform, "z16");
break;
} }
return 0; return 0;
} }

View File

@ -147,7 +147,7 @@ static __always_inline struct pt_regs fake_pt_regs(void)
struct pt_regs regs; struct pt_regs regs;
memset(&regs, 0, sizeof(regs)); memset(&regs, 0, sizeof(regs));
regs.gprs[15] = current_stack_pointer(); regs.gprs[15] = current_stack_pointer;
asm volatile( asm volatile(
"basr %[psw_addr],0\n" "basr %[psw_addr],0\n"