Commit ac92c279 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 's390-6.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull s390 fixes from Alexander Gordeev:

 - Add check whether the required facilities are installed before using
   the s390-specific ChaCha20 implementation

 - Key blobs for s390 protected key interface IOCTLs commands
   PKEY_VERIFYKEY2 and PKEY_VERIFYKEY3 may contain clear key material.
   Zeroize copies of these keys in kernel memory after creating
   protected keys

 - Set CONFIG_INIT_STACK_NONE=y in defconfigs to avoid extra overhead of
   initializing all stack variables by default

 - Make sure that when a new channel-path is enabled all subchannels are
   evaluated: with and without any devices connected on it

 - When SMT thread CPUs are added to CPU topology masks the nr_cpu_ids
   limit is not checked and could be exceeded. Respect the nr_cpu_ids
   limit and avoid a warning when CONFIG_DEBUG_PER_CPU_MAPS is set

 - The pointer to IPL Parameter Information Block is stored in the
   absolute lowcore as a virtual address. Save it as the physical
   address for later use by dump tools

 - Fix a Queued Direct I/O (QDIO) problem on z/VM guests using QIOASSIST
   with dedicated (pass through) QDIO-based devices such as FCP, real
   OSA or HiperSockets

 - s390's struct statfs and struct statfs64 contain padding, which
   field-by-field copying does not set. Initialize the respective
   structures with zeros before filling them and copying to userspace

 - Grow s390 compat_statfs64, statfs and statfs64 structures f_spare
   array member to cover padding and simplify things

 - Remove obsolete SCHED_BOOK and SCHED_DRAWER configs

 - Remove unneeded S390_CCW_IOMMU and S390_AP_IOM configs

* tag 's390-6.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/iommu: get rid of S390_CCW_IOMMU and S390_AP_IOMMU
  s390/Kconfig: remove obsolete configs SCHED_{BOOK,DRAWER}
  s390/uapi: cover statfs padding by growing f_spare
  statfs: enforce statfs[64] structure initialization
  s390/qdio: fix do_sqbs() inline assembly constraint
  s390/ipl: fix IPIB virtual vs physical address confusion
  s390/topology: honour nr_cpu_ids when adding CPUs
  s390/cio: include subchannels without devices also for evaluation
  s390/defconfigs: set CONFIG_INIT_STACK_NONE=y
  s390/pkey: zeroize key blobs
  s390/crypto: use vector instructions only if available for ChaCha20
parents 4ffd96c9 0f1cbf94
...@@ -551,7 +551,6 @@ These are the steps: ...@@ -551,7 +551,6 @@ These are the steps:
* IOMMU_SUPPORT * IOMMU_SUPPORT
* S390 * S390
* ZCRYPT * ZCRYPT
* S390_AP_IOMMU
* VFIO * VFIO
* KVM * KVM
......
...@@ -469,19 +469,11 @@ config SCHED_SMT ...@@ -469,19 +469,11 @@ config SCHED_SMT
config SCHED_MC config SCHED_MC
def_bool n def_bool n
config SCHED_BOOK
def_bool n
config SCHED_DRAWER
def_bool n
config SCHED_TOPOLOGY config SCHED_TOPOLOGY
def_bool y def_bool y
prompt "Topology scheduler support" prompt "Topology scheduler support"
select SCHED_SMT select SCHED_SMT
select SCHED_MC select SCHED_MC
select SCHED_BOOK
select SCHED_DRAWER
help help
Topology scheduler support improves the CPU scheduler's decision Topology scheduler support improves the CPU scheduler's decision
making when dealing with machines that have multi-threading, making when dealing with machines that have multi-threading,
...@@ -716,7 +708,6 @@ config EADM_SCH ...@@ -716,7 +708,6 @@ config EADM_SCH
config VFIO_CCW config VFIO_CCW
def_tristate n def_tristate n
prompt "Support for VFIO-CCW subchannels" prompt "Support for VFIO-CCW subchannels"
depends on S390_CCW_IOMMU
depends on VFIO depends on VFIO
select VFIO_MDEV select VFIO_MDEV
help help
...@@ -728,7 +719,7 @@ config VFIO_CCW ...@@ -728,7 +719,7 @@ config VFIO_CCW
config VFIO_AP config VFIO_AP
def_tristate n def_tristate n
prompt "VFIO support for AP devices" prompt "VFIO support for AP devices"
depends on S390_AP_IOMMU && KVM depends on KVM
depends on VFIO depends on VFIO
depends on ZCRYPT depends on ZCRYPT
select VFIO_MDEV select VFIO_MDEV
......
...@@ -591,8 +591,6 @@ CONFIG_VIRTIO_BALLOON=m ...@@ -591,8 +591,6 @@ 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_S390_CCW_IOMMU=y
CONFIG_S390_AP_IOMMU=y
CONFIG_EXT4_FS=y CONFIG_EXT4_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y CONFIG_EXT4_FS_SECURITY=y
...@@ -703,6 +701,7 @@ CONFIG_IMA_DEFAULT_HASH_SHA256=y ...@@ -703,6 +701,7 @@ CONFIG_IMA_DEFAULT_HASH_SHA256=y
CONFIG_IMA_WRITE_POLICY=y CONFIG_IMA_WRITE_POLICY=y
CONFIG_IMA_APPRAISE=y CONFIG_IMA_APPRAISE=y
CONFIG_LSM="yama,loadpin,safesetid,integrity,selinux,smack,tomoyo,apparmor" CONFIG_LSM="yama,loadpin,safesetid,integrity,selinux,smack,tomoyo,apparmor"
CONFIG_INIT_STACK_NONE=y
CONFIG_CRYPTO_USER=m CONFIG_CRYPTO_USER=m
# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set # CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
CONFIG_CRYPTO_PCRYPT=m CONFIG_CRYPTO_PCRYPT=m
......
...@@ -580,8 +580,6 @@ CONFIG_VIRTIO_BALLOON=m ...@@ -580,8 +580,6 @@ 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_S390_CCW_IOMMU=y
CONFIG_S390_AP_IOMMU=y
CONFIG_EXT4_FS=y CONFIG_EXT4_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y CONFIG_EXT4_FS_SECURITY=y
...@@ -686,6 +684,7 @@ CONFIG_IMA_DEFAULT_HASH_SHA256=y ...@@ -686,6 +684,7 @@ CONFIG_IMA_DEFAULT_HASH_SHA256=y
CONFIG_IMA_WRITE_POLICY=y CONFIG_IMA_WRITE_POLICY=y
CONFIG_IMA_APPRAISE=y CONFIG_IMA_APPRAISE=y
CONFIG_LSM="yama,loadpin,safesetid,integrity,selinux,smack,tomoyo,apparmor" CONFIG_LSM="yama,loadpin,safesetid,integrity,selinux,smack,tomoyo,apparmor"
CONFIG_INIT_STACK_NONE=y
CONFIG_CRYPTO_FIPS=y CONFIG_CRYPTO_FIPS=y
CONFIG_CRYPTO_USER=m CONFIG_CRYPTO_USER=m
# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set # CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
......
...@@ -67,6 +67,7 @@ CONFIG_ZFCP=y ...@@ -67,6 +67,7 @@ CONFIG_ZFCP=y
# CONFIG_MISC_FILESYSTEMS is not set # CONFIG_MISC_FILESYSTEMS is not set
# CONFIG_NETWORK_FILESYSTEMS is not set # CONFIG_NETWORK_FILESYSTEMS is not set
CONFIG_LSM="yama,loadpin,safesetid,integrity" CONFIG_LSM="yama,loadpin,safesetid,integrity"
CONFIG_INIT_STACK_NONE=y
# CONFIG_ZLIB_DFLTCC is not set # CONFIG_ZLIB_DFLTCC is not set
CONFIG_XZ_DEC_MICROLZMA=y CONFIG_XZ_DEC_MICROLZMA=y
CONFIG_PRINTK_TIME=y CONFIG_PRINTK_TIME=y
......
...@@ -82,7 +82,7 @@ void chacha_crypt_arch(u32 *state, u8 *dst, const u8 *src, ...@@ -82,7 +82,7 @@ void chacha_crypt_arch(u32 *state, u8 *dst, const u8 *src,
* it cannot handle a block of data or less, but otherwise * it cannot handle a block of data or less, but otherwise
* it can handle data of arbitrary size * it can handle data of arbitrary size
*/ */
if (bytes <= CHACHA_BLOCK_SIZE || nrounds != 20) if (bytes <= CHACHA_BLOCK_SIZE || nrounds != 20 || !MACHINE_HAS_VX)
chacha_crypt_generic(state, dst, src, bytes, nrounds); chacha_crypt_generic(state, dst, src, bytes, nrounds);
else else
chacha20_crypt_s390(state, dst, src, bytes, chacha20_crypt_s390(state, dst, src, bytes,
......
...@@ -112,7 +112,7 @@ struct compat_statfs64 { ...@@ -112,7 +112,7 @@ struct compat_statfs64 {
u32 f_namelen; u32 f_namelen;
u32 f_frsize; u32 f_frsize;
u32 f_flags; u32 f_flags;
u32 f_spare[4]; u32 f_spare[5];
}; };
/* /*
......
...@@ -30,7 +30,7 @@ struct statfs { ...@@ -30,7 +30,7 @@ struct statfs {
unsigned int f_namelen; unsigned int f_namelen;
unsigned int f_frsize; unsigned int f_frsize;
unsigned int f_flags; unsigned int f_flags;
unsigned int f_spare[4]; unsigned int f_spare[5];
}; };
struct statfs64 { struct statfs64 {
...@@ -45,7 +45,7 @@ struct statfs64 { ...@@ -45,7 +45,7 @@ struct statfs64 {
unsigned int f_namelen; unsigned int f_namelen;
unsigned int f_frsize; unsigned int f_frsize;
unsigned int f_flags; unsigned int f_flags;
unsigned int f_spare[4]; unsigned int f_spare[5];
}; };
#endif #endif
...@@ -1935,14 +1935,13 @@ static struct shutdown_action __refdata dump_action = { ...@@ -1935,14 +1935,13 @@ static struct shutdown_action __refdata dump_action = {
static void dump_reipl_run(struct shutdown_trigger *trigger) static void dump_reipl_run(struct shutdown_trigger *trigger)
{ {
unsigned long ipib = (unsigned long) reipl_block_actual;
struct lowcore *abs_lc; struct lowcore *abs_lc;
unsigned int csum; unsigned int csum;
csum = (__force unsigned int) csum = (__force unsigned int)
csum_partial(reipl_block_actual, reipl_block_actual->hdr.len, 0); csum_partial(reipl_block_actual, reipl_block_actual->hdr.len, 0);
abs_lc = get_abs_lowcore(); abs_lc = get_abs_lowcore();
abs_lc->ipib = ipib; abs_lc->ipib = __pa(reipl_block_actual);
abs_lc->ipib_checksum = csum; abs_lc->ipib_checksum = csum;
put_abs_lowcore(abs_lc); put_abs_lowcore(abs_lc);
dump_run(trigger); dump_run(trigger);
......
...@@ -95,7 +95,7 @@ static void cpu_group_map(cpumask_t *dst, struct mask_info *info, unsigned int c ...@@ -95,7 +95,7 @@ static void cpu_group_map(cpumask_t *dst, struct mask_info *info, unsigned int c
static void cpu_thread_map(cpumask_t *dst, unsigned int cpu) static void cpu_thread_map(cpumask_t *dst, unsigned int cpu)
{ {
static cpumask_t mask; static cpumask_t mask;
int i; unsigned int max_cpu;
cpumask_clear(&mask); cpumask_clear(&mask);
if (!cpumask_test_cpu(cpu, &cpu_setup_mask)) if (!cpumask_test_cpu(cpu, &cpu_setup_mask))
...@@ -104,9 +104,10 @@ static void cpu_thread_map(cpumask_t *dst, unsigned int cpu) ...@@ -104,9 +104,10 @@ static void cpu_thread_map(cpumask_t *dst, unsigned int cpu)
if (topology_mode != TOPOLOGY_MODE_HW) if (topology_mode != TOPOLOGY_MODE_HW)
goto out; goto out;
cpu -= cpu % (smp_cpu_mtid + 1); cpu -= cpu % (smp_cpu_mtid + 1);
for (i = 0; i <= smp_cpu_mtid; i++) { max_cpu = min(cpu + smp_cpu_mtid, nr_cpu_ids - 1);
if (cpumask_test_cpu(cpu + i, &cpu_setup_mask)) for (; cpu <= max_cpu; cpu++) {
cpumask_set_cpu(cpu + i, &mask); if (cpumask_test_cpu(cpu, &cpu_setup_mask))
cpumask_set_cpu(cpu, &mask);
} }
out: out:
cpumask_copy(dst, &mask); cpumask_copy(dst, &mask);
...@@ -123,25 +124,26 @@ static void add_cpus_to_mask(struct topology_core *tl_core, ...@@ -123,25 +124,26 @@ static void add_cpus_to_mask(struct topology_core *tl_core,
unsigned int core; unsigned int core;
for_each_set_bit(core, &tl_core->mask, TOPOLOGY_CORE_BITS) { for_each_set_bit(core, &tl_core->mask, TOPOLOGY_CORE_BITS) {
unsigned int rcore; unsigned int max_cpu, rcore;
int lcpu, i; int cpu;
rcore = TOPOLOGY_CORE_BITS - 1 - core + tl_core->origin; rcore = TOPOLOGY_CORE_BITS - 1 - core + tl_core->origin;
lcpu = smp_find_processor_id(rcore << smp_cpu_mt_shift); cpu = smp_find_processor_id(rcore << smp_cpu_mt_shift);
if (lcpu < 0) if (cpu < 0)
continue; continue;
for (i = 0; i <= smp_cpu_mtid; i++) { max_cpu = min(cpu + smp_cpu_mtid, nr_cpu_ids - 1);
topo = &cpu_topology[lcpu + i]; for (; cpu <= max_cpu; cpu++) {
topo = &cpu_topology[cpu];
topo->drawer_id = drawer->id; topo->drawer_id = drawer->id;
topo->book_id = book->id; topo->book_id = book->id;
topo->socket_id = socket->id; topo->socket_id = socket->id;
topo->core_id = rcore; topo->core_id = rcore;
topo->thread_id = lcpu + i; topo->thread_id = cpu;
topo->dedicated = tl_core->d; topo->dedicated = tl_core->d;
cpumask_set_cpu(lcpu + i, &drawer->mask); cpumask_set_cpu(cpu, &drawer->mask);
cpumask_set_cpu(lcpu + i, &book->mask); cpumask_set_cpu(cpu, &book->mask);
cpumask_set_cpu(lcpu + i, &socket->mask); cpumask_set_cpu(cpu, &socket->mask);
smp_cpu_set_polarization(lcpu + i, tl_core->pp); smp_cpu_set_polarization(cpu, tl_core->pp);
} }
} }
} }
......
...@@ -417,22 +417,6 @@ config S390_IOMMU ...@@ -417,22 +417,6 @@ config S390_IOMMU
help help
Support for the IOMMU API for s390 PCI devices. Support for the IOMMU API for s390 PCI devices.
config S390_CCW_IOMMU
bool "S390 CCW IOMMU Support"
depends on S390 && CCW || COMPILE_TEST
select IOMMU_API
help
Enables bits of IOMMU API required by VFIO. The iommu_ops
is not implemented as it is not necessary for VFIO.
config S390_AP_IOMMU
bool "S390 AP IOMMU Support"
depends on S390 && ZCRYPT || COMPILE_TEST
select IOMMU_API
help
Enables bits of IOMMU API required by VFIO. The iommu_ops
is not implemented as it is not necessary for VFIO.
config MTK_IOMMU config MTK_IOMMU
tristate "MediaTek IOMMU Support" tristate "MediaTek IOMMU Support"
depends on ARCH_MEDIATEK || COMPILE_TEST depends on ARCH_MEDIATEK || COMPILE_TEST
......
...@@ -1111,6 +1111,8 @@ static void io_subchannel_verify(struct subchannel *sch) ...@@ -1111,6 +1111,8 @@ static void io_subchannel_verify(struct subchannel *sch)
cdev = sch_get_cdev(sch); cdev = sch_get_cdev(sch);
if (cdev) if (cdev)
dev_fsm_event(cdev, DEV_EVENT_VERIFY); dev_fsm_event(cdev, DEV_EVENT_VERIFY);
else
css_schedule_eval(sch->schid);
} }
static void io_subchannel_terminate_path(struct subchannel *sch, u8 mask) static void io_subchannel_terminate_path(struct subchannel *sch, u8 mask)
......
...@@ -95,7 +95,7 @@ static inline int do_sqbs(u64 token, unsigned char state, int queue, ...@@ -95,7 +95,7 @@ static inline int do_sqbs(u64 token, unsigned char state, int queue,
" lgr 1,%[token]\n" " lgr 1,%[token]\n"
" .insn rsy,0xeb000000008a,%[qs],%[ccq],0(%[state])" " .insn rsy,0xeb000000008a,%[qs],%[ccq],0(%[state])"
: [ccq] "+&d" (_ccq), [qs] "+&d" (_queuestart) : [ccq] "+&d" (_ccq), [qs] "+&d" (_queuestart)
: [state] "d" ((unsigned long)state), [token] "d" (token) : [state] "a" ((unsigned long)state), [token] "d" (token)
: "memory", "cc", "1"); : "memory", "cc", "1");
*count = _ccq & 0xff; *count = _ccq & 0xff;
*start = _queuestart & 0xff; *start = _queuestart & 0xff;
......
...@@ -1293,6 +1293,7 @@ static long pkey_unlocked_ioctl(struct file *filp, unsigned int cmd, ...@@ -1293,6 +1293,7 @@ static long pkey_unlocked_ioctl(struct file *filp, unsigned int cmd,
return PTR_ERR(kkey); return PTR_ERR(kkey);
rc = pkey_keyblob2pkey(kkey, ktp.keylen, &ktp.protkey); rc = pkey_keyblob2pkey(kkey, ktp.keylen, &ktp.protkey);
DEBUG_DBG("%s pkey_keyblob2pkey()=%d\n", __func__, rc); DEBUG_DBG("%s pkey_keyblob2pkey()=%d\n", __func__, rc);
memzero_explicit(kkey, ktp.keylen);
kfree(kkey); kfree(kkey);
if (rc) if (rc)
break; break;
...@@ -1426,6 +1427,7 @@ static long pkey_unlocked_ioctl(struct file *filp, unsigned int cmd, ...@@ -1426,6 +1427,7 @@ static long pkey_unlocked_ioctl(struct file *filp, unsigned int cmd,
kkey, ktp.keylen, &ktp.protkey); kkey, ktp.keylen, &ktp.protkey);
DEBUG_DBG("%s pkey_keyblob2pkey2()=%d\n", __func__, rc); DEBUG_DBG("%s pkey_keyblob2pkey2()=%d\n", __func__, rc);
kfree(apqns); kfree(apqns);
memzero_explicit(kkey, ktp.keylen);
kfree(kkey); kfree(kkey);
if (rc) if (rc)
break; break;
...@@ -1552,6 +1554,7 @@ static long pkey_unlocked_ioctl(struct file *filp, unsigned int cmd, ...@@ -1552,6 +1554,7 @@ static long pkey_unlocked_ioctl(struct file *filp, unsigned int cmd,
protkey, &protkeylen); protkey, &protkeylen);
DEBUG_DBG("%s pkey_keyblob2pkey3()=%d\n", __func__, rc); DEBUG_DBG("%s pkey_keyblob2pkey3()=%d\n", __func__, rc);
kfree(apqns); kfree(apqns);
memzero_explicit(kkey, ktp.keylen);
kfree(kkey); kfree(kkey);
if (rc) { if (rc) {
kfree(protkey); kfree(protkey);
......
...@@ -130,6 +130,7 @@ static int do_statfs_native(struct kstatfs *st, struct statfs __user *p) ...@@ -130,6 +130,7 @@ static int do_statfs_native(struct kstatfs *st, struct statfs __user *p)
if (sizeof(buf) == sizeof(*st)) if (sizeof(buf) == sizeof(*st))
memcpy(&buf, st, sizeof(*st)); memcpy(&buf, st, sizeof(*st));
else { else {
memset(&buf, 0, sizeof(buf));
if (sizeof buf.f_blocks == 4) { if (sizeof buf.f_blocks == 4) {
if ((st->f_blocks | st->f_bfree | st->f_bavail | if ((st->f_blocks | st->f_bfree | st->f_bavail |
st->f_bsize | st->f_frsize) & st->f_bsize | st->f_frsize) &
...@@ -158,7 +159,6 @@ static int do_statfs_native(struct kstatfs *st, struct statfs __user *p) ...@@ -158,7 +159,6 @@ static int do_statfs_native(struct kstatfs *st, struct statfs __user *p)
buf.f_namelen = st->f_namelen; buf.f_namelen = st->f_namelen;
buf.f_frsize = st->f_frsize; buf.f_frsize = st->f_frsize;
buf.f_flags = st->f_flags; buf.f_flags = st->f_flags;
memset(buf.f_spare, 0, sizeof(buf.f_spare));
} }
if (copy_to_user(p, &buf, sizeof(buf))) if (copy_to_user(p, &buf, sizeof(buf)))
return -EFAULT; return -EFAULT;
...@@ -171,6 +171,7 @@ static int do_statfs64(struct kstatfs *st, struct statfs64 __user *p) ...@@ -171,6 +171,7 @@ static int do_statfs64(struct kstatfs *st, struct statfs64 __user *p)
if (sizeof(buf) == sizeof(*st)) if (sizeof(buf) == sizeof(*st))
memcpy(&buf, st, sizeof(*st)); memcpy(&buf, st, sizeof(*st));
else { else {
memset(&buf, 0, sizeof(buf));
buf.f_type = st->f_type; buf.f_type = st->f_type;
buf.f_bsize = st->f_bsize; buf.f_bsize = st->f_bsize;
buf.f_blocks = st->f_blocks; buf.f_blocks = st->f_blocks;
...@@ -182,7 +183,6 @@ static int do_statfs64(struct kstatfs *st, struct statfs64 __user *p) ...@@ -182,7 +183,6 @@ static int do_statfs64(struct kstatfs *st, struct statfs64 __user *p)
buf.f_namelen = st->f_namelen; buf.f_namelen = st->f_namelen;
buf.f_frsize = st->f_frsize; buf.f_frsize = st->f_frsize;
buf.f_flags = st->f_flags; buf.f_flags = st->f_flags;
memset(buf.f_spare, 0, sizeof(buf.f_spare));
} }
if (copy_to_user(p, &buf, sizeof(buf))) if (copy_to_user(p, &buf, sizeof(buf)))
return -EFAULT; return -EFAULT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment