Skip to content

Commit 47477c8

Browse files
committed
Merge tag 's390-6.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 updates from Alexander Gordeev: - Factor out handle_write() function and simplify 3215 console write operation - When 3170 terminal emulator is connected to the 3215 console driver the boot time could be very long due to limited buffer space or missing operator input. Add con3215_drop command line parameter and con3215_drop sysfs attribute file to instruct the kernel drop console data when such conditions are met - Fix white space errors in 3215 console driver - Move enum paiext_mode definition to a header file and rename it to paievt_mode to indicate this is now used for several events. Rename PAI_MODE_COUNTER to PAI_MODE_COUNTING to make consistent with PAI_MODE_SAMPLING - Simplify the logic of PMU pai_crypto mapped buffer reference counter and make it consistent with PMU pai_ext - Rename PMU pai_crypto mapped buffer structure member users to active_events to make it consistent with PMU pai_ext - Enable HUGETLB_PAGE_OPTIMIZE_VMEMMAP configuration option. This results in saving of 12K per 1M hugetlb page (~1.2%) and 32764K per 2G hugetlb page (~1.6%) - Use generic serial.h, bugs.h, shmparam.h and vga.h header files and scrap s390-specific versions - The generic percpu setup code does not expect the s390-like implementation and emits a warning. To get rid of that warning and provide sane CPU-to-node and CPU-to-CPU distance mappings implementat a minimal version of setup_per_cpu_areas() - Use kstrtobool() instead of strtobool() for re-IPL sysfs device attributes - Avoid unnecessary lookup of a pointer to MSI descriptor when setting IRQ affinity for a PCI device - Get rid of "an incompatible function type cast" warning by changing debug_sprintf_format_fn() function prototype so it matches the debug_format_proc_t function type - Remove unused info_blk_hdr__pcpus() and get_page_state() functions - Get rid of clang "unused unused insn cache ops function" warning by moving s390_insn definition to a private header - Get rid of clang "unused function" warning by making function raw3270_state_final() only available if CONFIG_TN3270_CONSOLE is enabled - Use kstrobool() to parse sclp_con_drop parameter to make it identical to the con3215_drop parameter and allow passing values like "yes" and "true" - Use sysfs_emit() for all SCLP sysfs show functions, which is the current standard way to generate output strings - Make SCLP con_drop sysfs attribute also writable and allow to change its value during runtime. This makes SCLP console drop handling consistent with the 3215 device driver - Virtual and physical addresses are indentical on s390. However, there is still a confusion when pointers are directly casted to physical addresses or vice versa. Use correct address converters virt_to_phys() and phys_to_virt() for s390 channel IO drivers - Support for power managemant has been removed from s390 since quite some time. Remove unused power managemant code from the appldata device driver - Allow memory tools like KASAN see memory accesses from the checksum code. Switch to GENERIC_CSUM if KASAN is enabled, just like x86 does - Add support of ECKD DASDs disks so it could be used as boot and dump devices - Follow checkpatch recommendations and use octal values instead of S_IRUGO and S_IWUSR for dump device attributes in sysfs - Changes to vx-insn.h do not cause a recompile of C files that use asm(".include \"asm/vx-insn.h\"\n") magic to access vector instruction macros from inline assemblies. Add wrapper include header file to avoid this problem - Use vector instruction macros instead of byte patterns to increase register validation routine readability - The current machine check register validation handling does not take into account various scenarios and might lead to killing a wrong user process or potentially ignore corrupted FPU registers. Simplify logic of the machine check handler and stop the whole machine if the previous context was kerenel mode. If the previous context was user mode, kill the current task - Introduce sclp_emergency_printk() function which can be used to emit a message in emergency cases. It is supposed to be used in cases where regular console device drivers may not work anymore, e.g. unrecoverable machine checks Keep the early Service-Call Control Block so it can also be used after initdata has been freed to allow sclp_emergency_printk() implementation - In case a system will be stopped because of an unrecoverable machine check error print the machine check interruption code to give a hint of what went wrong - Move storage error checking from the assembly entry code to C in order to simplify machine check handling. Enter the handler with DAT turned on, which simplifies the entry code even more - The machine check extended save areas are allocated using a private "nmi_save_areas" slab cache which guarantees a required power-of-two alignment. Get rid of that cache in favour of kmalloc() * tag 's390-6.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (38 commits) s390/nmi: get rid of private slab cache s390/nmi: move storage error checking back to C, enter with DAT on s390/nmi: print machine check interruption code before stopping system s390/sclp: introduce sclp_emergency_printk() s390/sclp: keep sclp_early_sccb s390/nmi: rework register validation handling s390/nmi: use vector instruction macros instead of byte patterns s390/vx: add vx-insn.h wrapper include file s390/ipl: use octal values instead of S_* macros s390/ipl: add eckd dump support s390/ipl: add eckd support vfio/ccw: identify CCW data addresses as physical vfio/ccw: sort out physical vs virtual pointers usage s390/checksum: support GENERIC_CSUM, enable it for KASAN s390/appldata: remove power management callbacks s390/cio: sort out physical vs virtual pointers usage s390/sclp: allow to change sclp_console_drop during runtime s390/sclp: convert to use sysfs_emit() s390/sclp: use kstrobool() to parse sclp_con_drop parameter s390/3270: make raw3270_state_final() depend on CONFIG_TN3270_CONSOLE ...
2 parents 49d07f0 + bb3860c commit 47477c8

49 files changed

Lines changed: 1598 additions & 1199 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,17 @@
703703
condev= [HW,S390] console device
704704
conmode=
705705

706+
con3215_drop= [S390] 3215 console drop mode.
707+
Format: y|n|Y|N|1|0
708+
When set to true, drop data on the 3215 console when
709+
the console buffer is full. In this case the
710+
operator using a 3270 terminal emulator (for example
711+
x3270) does not have to enter the clear key for the
712+
console output to advance and the kernel to continue.
713+
This leads to a much faster boot time when a 3270
714+
terminal emulator is active. If no 3270 terminal
715+
emulator is used, this parameter has no effect.
716+
706717
console= [KNL] Output console device and options.
707718

708719
tty<n> Use the virtual console device <n>.

arch/s390/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ config GENERIC_BUG
2626
config GENERIC_BUG_RELATIVE_POINTERS
2727
def_bool y
2828

29+
config GENERIC_CSUM
30+
bool
31+
default y if KASAN
32+
2933
config GENERIC_LOCKBREAK
3034
def_bool y if PREEMPTION
3135

@@ -122,6 +126,7 @@ config S390
122126
select ARCH_WANTS_NO_INSTR
123127
select ARCH_WANT_DEFAULT_BPF_JIT
124128
select ARCH_WANT_IPC_PARSE_VERSION
129+
select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP
125130
select BUILDTIME_TABLE_SORT
126131
select CLONE_BACKWARDS2
127132
select DMA_OPS if PCI
@@ -197,6 +202,7 @@ config S390
197202
select HAVE_RSEQ
198203
select HAVE_SAMPLE_FTRACE_DIRECT
199204
select HAVE_SAMPLE_FTRACE_DIRECT_MULTI
205+
select HAVE_SETUP_PER_CPU_AREA
200206
select HAVE_SOFTIRQ_ON_OWN_STACK
201207
select HAVE_SYSCALL_TRACEPOINTS
202208
select HAVE_VIRT_CPU_ACCOUNTING
@@ -208,6 +214,7 @@ config S390
208214
select MMU_GATHER_MERGE_VMAS
209215
select MODULES_USE_ELF_RELA
210216
select NEED_DMA_MAP_STATE if PCI
217+
select NEED_PER_CPU_EMBED_FIRST_CHUNK
211218
select NEED_SG_DMA_LENGTH if PCI
212219
select OLD_SIGACTION
213220
select OLD_SIGSUSPEND3

arch/s390/appldata/appldata_base.c

Lines changed: 2 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
#include <linux/notifier.h>
2727
#include <linux/cpu.h>
2828
#include <linux/workqueue.h>
29-
#include <linux/suspend.h>
30-
#include <linux/platform_device.h>
3129
#include <asm/appldata.h>
3230
#include <asm/vtimer.h>
3331
#include <linux/uaccess.h>
@@ -44,8 +42,6 @@
4442
#define TOD_MICRO 0x01000 /* nr. of TOD clock units
4543
for 1 microsecond */
4644

47-
static struct platform_device *appldata_pdev;
48-
4945
/*
5046
* /proc entries (sysctl)
5147
*/
@@ -88,7 +84,6 @@ static struct vtimer_list appldata_timer;
8884
static DEFINE_SPINLOCK(appldata_timer_lock);
8985
static int appldata_interval = APPLDATA_CPU_INTERVAL;
9086
static int appldata_timer_active;
91-
static int appldata_timer_suspended = 0;
9287

9388
/*
9489
* Work queue
@@ -412,88 +407,6 @@ void appldata_unregister_ops(struct appldata_ops *ops)
412407
/********************** module-ops management <END> **************************/
413408

414409

415-
/**************************** suspend / resume *******************************/
416-
static int appldata_freeze(struct device *dev)
417-
{
418-
struct appldata_ops *ops;
419-
int rc;
420-
struct list_head *lh;
421-
422-
spin_lock(&appldata_timer_lock);
423-
if (appldata_timer_active) {
424-
__appldata_vtimer_setup(APPLDATA_DEL_TIMER);
425-
appldata_timer_suspended = 1;
426-
}
427-
spin_unlock(&appldata_timer_lock);
428-
429-
mutex_lock(&appldata_ops_mutex);
430-
list_for_each(lh, &appldata_ops_list) {
431-
ops = list_entry(lh, struct appldata_ops, list);
432-
if (ops->active == 1) {
433-
rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC,
434-
(unsigned long) ops->data, ops->size,
435-
ops->mod_lvl);
436-
if (rc != 0)
437-
pr_err("Stopping the data collection for %s "
438-
"failed with rc=%d\n", ops->name, rc);
439-
}
440-
}
441-
mutex_unlock(&appldata_ops_mutex);
442-
return 0;
443-
}
444-
445-
static int appldata_restore(struct device *dev)
446-
{
447-
struct appldata_ops *ops;
448-
int rc;
449-
struct list_head *lh;
450-
451-
spin_lock(&appldata_timer_lock);
452-
if (appldata_timer_suspended) {
453-
__appldata_vtimer_setup(APPLDATA_ADD_TIMER);
454-
appldata_timer_suspended = 0;
455-
}
456-
spin_unlock(&appldata_timer_lock);
457-
458-
mutex_lock(&appldata_ops_mutex);
459-
list_for_each(lh, &appldata_ops_list) {
460-
ops = list_entry(lh, struct appldata_ops, list);
461-
if (ops->active == 1) {
462-
ops->callback(ops->data); // init record
463-
rc = appldata_diag(ops->record_nr,
464-
APPLDATA_START_INTERVAL_REC,
465-
(unsigned long) ops->data, ops->size,
466-
ops->mod_lvl);
467-
if (rc != 0) {
468-
pr_err("Starting the data collection for %s "
469-
"failed with rc=%d\n", ops->name, rc);
470-
}
471-
}
472-
}
473-
mutex_unlock(&appldata_ops_mutex);
474-
return 0;
475-
}
476-
477-
static int appldata_thaw(struct device *dev)
478-
{
479-
return appldata_restore(dev);
480-
}
481-
482-
static const struct dev_pm_ops appldata_pm_ops = {
483-
.freeze = appldata_freeze,
484-
.thaw = appldata_thaw,
485-
.restore = appldata_restore,
486-
};
487-
488-
static struct platform_driver appldata_pdrv = {
489-
.driver = {
490-
.name = "appldata",
491-
.pm = &appldata_pm_ops,
492-
},
493-
};
494-
/************************* suspend / resume <END> ****************************/
495-
496-
497410
/******************************* init / exit *********************************/
498411

499412
/*
@@ -503,36 +416,14 @@ static struct platform_driver appldata_pdrv = {
503416
*/
504417
static int __init appldata_init(void)
505418
{
506-
int rc;
507-
508419
init_virt_timer(&appldata_timer);
509420
appldata_timer.function = appldata_timer_function;
510421
appldata_timer.data = (unsigned long) &appldata_work;
511-
512-
rc = platform_driver_register(&appldata_pdrv);
513-
if (rc)
514-
return rc;
515-
516-
appldata_pdev = platform_device_register_simple("appldata", -1, NULL,
517-
0);
518-
if (IS_ERR(appldata_pdev)) {
519-
rc = PTR_ERR(appldata_pdev);
520-
goto out_driver;
521-
}
522422
appldata_wq = alloc_ordered_workqueue("appldata", 0);
523-
if (!appldata_wq) {
524-
rc = -ENOMEM;
525-
goto out_device;
526-
}
527-
423+
if (!appldata_wq)
424+
return -ENOMEM;
528425
appldata_sysctl_header = register_sysctl_table(appldata_dir_table);
529426
return 0;
530-
531-
out_device:
532-
platform_device_unregister(appldata_pdev);
533-
out_driver:
534-
platform_driver_unregister(&appldata_pdrv);
535-
return rc;
536427
}
537428

538429
__initcall(appldata_init);

arch/s390/boot/ipl_parm.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ bool is_ipl_block_dump(void)
7777
if (ipl_block.pb0_hdr.pbt == IPL_PBT_NVME &&
7878
ipl_block.nvme.opt == IPL_PB0_NVME_OPT_DUMP)
7979
return true;
80+
if (ipl_block.pb0_hdr.pbt == IPL_PBT_ECKD &&
81+
ipl_block.eckd.opt == IPL_PB0_ECKD_OPT_DUMP)
82+
return true;
8083
return false;
8184
}
8285

@@ -108,6 +111,11 @@ static size_t ipl_block_get_ascii_scpdata(char *dest, size_t size,
108111
scp_data_len = ipb->nvme.scp_data_len;
109112
scp_data = ipb->nvme.scp_data;
110113
break;
114+
case IPL_PBT_ECKD:
115+
scp_data_len = ipb->eckd.scp_data_len;
116+
scp_data = ipb->eckd.scp_data;
117+
break;
118+
111119
default:
112120
goto out;
113121
}
@@ -153,6 +161,7 @@ static void append_ipl_block_parm(void)
153161
break;
154162
case IPL_PBT_FCP:
155163
case IPL_PBT_NVME:
164+
case IPL_PBT_ECKD:
156165
rc = ipl_block_get_ascii_scpdata(
157166
parm, COMMAND_LINE_SIZE - len - 1, &ipl_block);
158167
break;

arch/s390/hypfs/hypfs_diag.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,6 @@ static inline __u8 info_blk_hdr__flags(enum diag204_format type, void *hdr)
6868
return ((struct diag204_x_info_blk_hdr *)hdr)->flags;
6969
}
7070

71-
static inline __u16 info_blk_hdr__pcpus(enum diag204_format type, void *hdr)
72-
{
73-
if (type == DIAG204_INFO_SIMPLE)
74-
return ((struct diag204_info_blk_hdr *)hdr)->phys_cpus;
75-
else /* DIAG204_INFO_EXT */
76-
return ((struct diag204_x_info_blk_hdr *)hdr)->phys_cpus;
77-
}
78-
7971
/* Partition header */
8072

8173
static inline int part_hdr__size(enum diag204_format type)

arch/s390/include/asm/bugs.h

Lines changed: 0 additions & 21 deletions
This file was deleted.

arch/s390/include/asm/checksum.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
#ifndef _S390_CHECKSUM_H
1313
#define _S390_CHECKSUM_H
1414

15+
#ifdef CONFIG_GENERIC_CSUM
16+
17+
#include <asm-generic/checksum.h>
18+
19+
#else /* CONFIG_GENERIC_CSUM */
20+
1521
#include <linux/uaccess.h>
1622
#include <linux/in6.h>
1723

@@ -129,4 +135,5 @@ static inline __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
129135
return csum_fold((__force __wsum)(sum >> 32));
130136
}
131137

138+
#endif /* CONFIG_GENERIC_CSUM */
132139
#endif /* _S390_CHECKSUM_H */

arch/s390/include/asm/ipl.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ struct ipl_parameter_block {
2222
struct ipl_pb0_common common;
2323
struct ipl_pb0_fcp fcp;
2424
struct ipl_pb0_ccw ccw;
25+
struct ipl_pb0_eckd eckd;
2526
struct ipl_pb0_nvme nvme;
2627
char raw[PAGE_SIZE - sizeof(struct ipl_pl_hdr)];
2728
};
@@ -41,6 +42,10 @@ struct ipl_parameter_block {
4142
sizeof(struct ipl_pb0_ccw))
4243
#define IPL_BP0_CCW_LEN (sizeof(struct ipl_pb0_ccw))
4344

45+
#define IPL_BP_ECKD_LEN (sizeof(struct ipl_pl_hdr) + \
46+
sizeof(struct ipl_pb0_eckd))
47+
#define IPL_BP0_ECKD_LEN (sizeof(struct ipl_pb0_eckd))
48+
4449
#define IPL_MAX_SUPPORTED_VERSION (0)
4550

4651
#define IPL_RB_CERT_UNKNOWN ((unsigned short)-1)
@@ -68,6 +73,8 @@ enum ipl_type {
6873
IPL_TYPE_NSS = 16,
6974
IPL_TYPE_NVME = 32,
7075
IPL_TYPE_NVME_DUMP = 64,
76+
IPL_TYPE_ECKD = 128,
77+
IPL_TYPE_ECKD_DUMP = 256,
7178
};
7279

7380
struct ipl_info
@@ -77,6 +84,9 @@ struct ipl_info
7784
struct {
7885
struct ccw_dev_id dev_id;
7986
} ccw;
87+
struct {
88+
struct ccw_dev_id dev_id;
89+
} eckd;
8090
struct {
8191
struct ccw_dev_id dev_id;
8292
u64 wwpn;
@@ -99,6 +109,7 @@ extern void set_os_info_reipl_block(void);
99109
static inline bool is_ipl_type_dump(void)
100110
{
101111
return (ipl_info.type == IPL_TYPE_FCP_DUMP) ||
112+
(ipl_info.type == IPL_TYPE_ECKD_DUMP) ||
102113
(ipl_info.type == IPL_TYPE_NVME_DUMP);
103114
}
104115

arch/s390/include/asm/pai.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,10 @@ static __always_inline void pai_kernel_exit(struct pt_regs *regs)
7575
WRITE_ONCE(S390_lowcore.ccd, S390_lowcore.ccd & ~PAI_CRYPTO_KERNEL_OFFSET);
7676
}
7777

78+
enum paievt_mode {
79+
PAI_MODE_NONE,
80+
PAI_MODE_SAMPLING,
81+
PAI_MODE_COUNTING,
82+
};
83+
7884
#endif

arch/s390/include/asm/sclp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ struct sclp_info {
8787
unsigned char has_gisaf : 1;
8888
unsigned char has_diag318 : 1;
8989
unsigned char has_sipl : 1;
90+
unsigned char has_sipl_eckd : 1;
9091
unsigned char has_dirq : 1;
9192
unsigned char has_iplcc : 1;
9293
unsigned char has_zpci_lsi : 1;
@@ -131,6 +132,7 @@ void sclp_early_get_ipl_info(struct sclp_ipl_info *info);
131132
void sclp_early_detect(void);
132133
void sclp_early_printk(const char *s);
133134
void __sclp_early_printk(const char *s, unsigned int len);
135+
void sclp_emergency_printk(const char *s);
134136

135137
int sclp_early_get_memsize(unsigned long *mem);
136138
int sclp_early_get_hsa_size(unsigned long *hsa_size);

0 commit comments

Comments
 (0)