Skip to content

Commit 0b707e5

Browse files
committed
Merge tag 's390-5.16-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 updates from Vasily Gorbik: - Add support for ftrace with direct call and ftrace direct call samples. - Add support for kernel command lines longer than current 896 bytes and make its length configurable. - Add support for BEAR enhancement facility to improve last breaking event instruction tracking. - Add kprobes sanity checks and testcases to prevent kprobe in the mid of an instruction. - Allow concurrent access to /dev/hwc for the CPUMF users. - Various ftrace / jump label improvements. - Convert unwinder tests to KUnit. - Add s390_iommu_aperture kernel parameter to tweak the limits on concurrently usable DMA mappings. - Add ap.useirq AP module option which can be used to disable interrupt use. - Add add_disk() error handling support to block device drivers. - Drop arch specific and use generic implementation of strlcpy and strrchr. - Several __pa/__va usages fixes. - Various cio, crypto, pci, kernel doc and other small fixes and improvements all over the code. [ Merge fixup as per https://lore.kernel.org/all/YXAqZ%2FEszRisunQw@osiris/ ] * tag 's390-5.16-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (63 commits) s390: make command line configurable s390: support command lines longer than 896 bytes s390/kexec_file: move kernel image size check s390/pci: add s390_iommu_aperture kernel parameter s390/spinlock: remove incorrect kernel doc indicator s390/string: use generic strlcpy s390/string: use generic strrchr s390/ap: function rework based on compiler warning s390/cio: make ccw_device_dma_* more robust s390/vfio-ap: s390/crypto: fix all kernel-doc warnings s390/hmcdrv: fix kernel doc comments s390/ap: new module option ap.useirq s390/cpumf: Allow multiple processes to access /dev/hwc s390/bitops: return true/false (not 1/0) from bool functions s390: add support for BEAR enhancement facility s390: introduce nospec_uses_trampoline() s390: rename last_break to pgm_last_break s390/ptrace: add last_break member to pt_regs s390/sclp: sort out physical vs virtual pointers usage s390/setup: convert start and end initrd pointers to virtual ...
2 parents 0c5c62d + 622021c commit 0b707e5

Some content is hidden

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

97 files changed

+1283
-653
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4992,6 +4992,18 @@
49924992
an IOTLB flush. Default is lazy flushing before reuse,
49934993
which is faster.
49944994

4995+
s390_iommu_aperture= [KNL,S390]
4996+
Specifies the size of the per device DMA address space
4997+
accessible through the DMA and IOMMU APIs as a decimal
4998+
factor of the size of main memory.
4999+
The default is 1 meaning that one can concurrently use
5000+
as many DMA addresses as physical memory is installed,
5001+
if supported by hardware, and thus map all of memory
5002+
once. With a value of 2 one can map all of memory twice
5003+
and so on. As a special case a factor of 0 imposes no
5004+
restrictions other than those given by hardware at the
5005+
cost of significant additional memory use for tables.
5006+
49955007
sa1100ir [NET]
49965008
See drivers/net/irda/sa1100_ir.c.
49975009

arch/s390/Kconfig

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,15 @@ config S390
153153
select HAVE_DEBUG_KMEMLEAK
154154
select HAVE_DMA_CONTIGUOUS
155155
select HAVE_DYNAMIC_FTRACE
156+
select HAVE_DYNAMIC_FTRACE_WITH_ARGS
157+
select HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
156158
select HAVE_DYNAMIC_FTRACE_WITH_REGS
157159
select HAVE_EBPF_JIT if PACK_STACK && HAVE_MARCH_Z196_FEATURES
158160
select HAVE_EFFICIENT_UNALIGNED_ACCESS
159161
select HAVE_FAST_GUP
160162
select HAVE_FENTRY
161163
select HAVE_FTRACE_MCOUNT_RECORD
164+
select HAVE_FUNCTION_ARG_ACCESS_API
162165
select HAVE_FUNCTION_ERROR_INJECTION
163166
select HAVE_FUNCTION_GRAPH_TRACER
164167
select HAVE_FUNCTION_TRACER
@@ -190,6 +193,7 @@ config S390
190193
select HAVE_REGS_AND_STACK_ACCESS_API
191194
select HAVE_RELIABLE_STACKTRACE
192195
select HAVE_RSEQ
196+
select HAVE_SAMPLE_FTRACE_DIRECT
193197
select HAVE_SOFTIRQ_ON_OWN_STACK
194198
select HAVE_SYSCALL_TRACEPOINTS
195199
select HAVE_VIRT_CPU_ACCOUNTING
@@ -434,6 +438,14 @@ endchoice
434438
config 64BIT
435439
def_bool y
436440

441+
config COMMAND_LINE_SIZE
442+
int "Maximum size of kernel command line"
443+
default 4096
444+
range 896 1048576
445+
help
446+
This allows you to specify the maximum length of the kernel command
447+
line.
448+
437449
config COMPAT
438450
def_bool y
439451
prompt "Kernel support for 31 bit emulation"
@@ -938,6 +950,8 @@ menu "Selftests"
938950

939951
config S390_UNWIND_SELFTEST
940952
def_tristate n
953+
depends on KUNIT
954+
default KUNIT_ALL_TESTS
941955
prompt "Test unwind functions"
942956
help
943957
This option enables s390 specific stack unwinder testing kernel
@@ -946,4 +960,16 @@ config S390_UNWIND_SELFTEST
946960

947961
Say N if you are unsure.
948962

963+
config S390_KPROBES_SANITY_TEST
964+
def_tristate n
965+
prompt "Enable s390 specific kprobes tests"
966+
depends on KPROBES
967+
depends on KUNIT
968+
help
969+
This option enables an s390 specific kprobes test module. This option
970+
is not useful for distributions or general kernels, but only for kernel
971+
developers working on architecture code.
972+
973+
Say N if you are unsure.
974+
949975
endmenu

arch/s390/boot/compressed/decompressor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ struct vmlinux_info {
2424
unsigned long dynsym_start;
2525
unsigned long rela_dyn_start;
2626
unsigned long rela_dyn_end;
27+
unsigned long amode31_size;
2728
};
2829

2930
/* Symbols defined by linker scripts */

arch/s390/boot/head.S

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -184,35 +184,23 @@ iplstart:
184184
bas %r14,.Lloader # load parameter file
185185
ltr %r2,%r2 # got anything ?
186186
bz .Lnopf
187-
chi %r2,895
188-
bnh .Lnotrunc
189-
la %r2,895
187+
l %r3,MAX_COMMAND_LINE_SIZE+ARCH_OFFSET-PARMAREA(%r12)
188+
ahi %r3,-1
189+
clr %r2,%r3
190+
bl .Lnotrunc
191+
lr %r2,%r3
190192
.Lnotrunc:
191193
l %r4,.Linitrd
192194
clc 0(3,%r4),.L_hdr # if it is HDRx
193195
bz .Lagain1 # skip dataset header
194196
clc 0(3,%r4),.L_eof # if it is EOFx
195197
bz .Lagain1 # skip dateset trailer
196-
la %r5,0(%r4,%r2)
197-
lr %r3,%r2
198-
la %r3,COMMAND_LINE-PARMAREA(%r12) # load adr. of command line
199-
mvc 0(256,%r3),0(%r4)
200-
mvc 256(256,%r3),256(%r4)
201-
mvc 512(256,%r3),512(%r4)
202-
mvc 768(122,%r3),768(%r4)
203-
slr %r0,%r0
204-
b .Lcntlp
205-
.Ldelspc:
206-
ic %r0,0(%r2,%r3)
207-
chi %r0,0x20 # is it a space ?
208-
be .Lcntlp
209-
ahi %r2,1
210-
b .Leolp
211-
.Lcntlp:
212-
brct %r2,.Ldelspc
213-
.Leolp:
214-
slr %r0,%r0
215-
stc %r0,0(%r2,%r3) # terminate buffer
198+
199+
lr %r5,%r2
200+
la %r6,COMMAND_LINE-PARMAREA(%r12)
201+
lr %r7,%r2
202+
ahi %r7,1
203+
mvcl %r6,%r4
216204
.Lnopf:
217205

218206
#
@@ -317,6 +305,7 @@ SYM_CODE_START_LOCAL(startup_normal)
317305
xc 0x300(256),0x300
318306
xc 0xe00(256),0xe00
319307
xc 0xf00(256),0xf00
308+
lctlg %c0,%c15,.Lctl-.LPG0(%r13) # load control registers
320309
stcke __LC_BOOT_CLOCK
321310
mvc __LC_LAST_UPDATE_CLOCK(8),__LC_BOOT_CLOCK+1
322311
spt 6f-.LPG0(%r13)
@@ -335,6 +324,22 @@ SYM_CODE_END(startup_normal)
335324
.quad 0x0000000180000000,startup_pgm_check_handler
336325
.Lio_new_psw:
337326
.quad 0x0002000180000000,0x1f0 # disabled wait
327+
.Lctl: .quad 0x04040000 # cr0: AFP registers & secondary space
328+
.quad 0 # cr1: primary space segment table
329+
.quad 0 # cr2: dispatchable unit control table
330+
.quad 0 # cr3: instruction authorization
331+
.quad 0xffff # cr4: instruction authorization
332+
.quad 0 # cr5: primary-aste origin
333+
.quad 0 # cr6: I/O interrupts
334+
.quad 0 # cr7: secondary space segment table
335+
.quad 0x0000000000008000 # cr8: access registers translation
336+
.quad 0 # cr9: tracing off
337+
.quad 0 # cr10: tracing off
338+
.quad 0 # cr11: tracing off
339+
.quad 0 # cr12: tracing off
340+
.quad 0 # cr13: home space segment table
341+
.quad 0xc0000000 # cr14: machine check handling off
342+
.quad 0 # cr15: linkage stack operations
338343

339344
#include "head_kdump.S"
340345

@@ -377,11 +382,10 @@ SYM_DATA_START(parmarea)
377382
.quad 0 # OLDMEM_BASE
378383
.quad 0 # OLDMEM_SIZE
379384
.quad kernel_version # points to kernel version string
385+
.quad COMMAND_LINE_SIZE
380386

381387
.org COMMAND_LINE
382388
.byte "root=/dev/ram0 ro"
383389
.byte 0
384390
.org PARMAREA+__PARMAREA_SIZE
385391
SYM_DATA_END(parmarea)
386-
387-
.org HEAD_END

arch/s390/boot/ipl_parm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,10 @@ static inline int has_ebcdic_char(const char *str)
170170

171171
void setup_boot_command_line(void)
172172
{
173-
parmarea.command_line[ARCH_COMMAND_LINE_SIZE - 1] = 0;
173+
parmarea.command_line[COMMAND_LINE_SIZE - 1] = 0;
174174
/* convert arch command line to ascii if necessary */
175175
if (has_ebcdic_char(parmarea.command_line))
176-
EBCASC(parmarea.command_line, ARCH_COMMAND_LINE_SIZE);
176+
EBCASC(parmarea.command_line, COMMAND_LINE_SIZE);
177177
/* copy arch command line */
178178
strcpy(early_command_line, strim(parmarea.command_line));
179179

arch/s390/boot/pgm_check_info.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,6 @@ void print_pgm_check_info(void)
175175
gpregs[12], gpregs[13], gpregs[14], gpregs[15]);
176176
print_stacktrace();
177177
decompressor_printk("Last Breaking-Event-Address:\n");
178-
decompressor_printk(" [<%016lx>] %pS\n", (unsigned long)S390_lowcore.breaking_event_addr,
179-
(void *)S390_lowcore.breaking_event_addr);
178+
decompressor_printk(" [<%016lx>] %pS\n", (unsigned long)S390_lowcore.pgm_last_break,
179+
(void *)S390_lowcore.pgm_last_break);
180180
}

arch/s390/boot/startup.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "uv.h"
1616

1717
unsigned long __bootdata_preserved(__kaslr_offset);
18+
unsigned long __bootdata(__amode31_base);
1819
unsigned long __bootdata_preserved(VMALLOC_START);
1920
unsigned long __bootdata_preserved(VMALLOC_END);
2021
struct page *__bootdata_preserved(vmemmap);
@@ -259,6 +260,12 @@ static void offset_vmlinux_info(unsigned long offset)
259260
vmlinux.dynsym_start += offset;
260261
}
261262

263+
static unsigned long reserve_amode31(unsigned long safe_addr)
264+
{
265+
__amode31_base = PAGE_ALIGN(safe_addr);
266+
return safe_addr + vmlinux.amode31_size;
267+
}
268+
262269
void startup_kernel(void)
263270
{
264271
unsigned long random_lma;
@@ -273,6 +280,7 @@ void startup_kernel(void)
273280
setup_lpp();
274281
store_ipl_parmblock();
275282
safe_addr = mem_safe_offset();
283+
safe_addr = reserve_amode31(safe_addr);
276284
safe_addr = read_ipl_report(safe_addr);
277285
uv_query_info();
278286
rescue_initrd(safe_addr);

arch/s390/configs/debug_defconfig

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ CONFIG_PROTECTED_VIRTUALIZATION_GUEST=y
6161
CONFIG_CMM=m
6262
CONFIG_APPLDATA_BASE=y
6363
CONFIG_KVM=m
64-
CONFIG_S390_UNWIND_SELFTEST=y
64+
CONFIG_S390_UNWIND_SELFTEST=m
65+
CONFIG_S390_KPROBES_SANITY_TEST=m
6566
CONFIG_KPROBES=y
6667
CONFIG_JUMP_LABEL=y
6768
CONFIG_STATIC_KEYS_SELFTEST=y
@@ -776,7 +777,6 @@ CONFIG_CRC8=m
776777
CONFIG_RANDOM32_SELFTEST=y
777778
CONFIG_DMA_CMA=y
778779
CONFIG_CMA_SIZE_MBYTES=0
779-
CONFIG_DMA_API_DEBUG=y
780780
CONFIG_PRINTK_TIME=y
781781
CONFIG_DYNAMIC_DEBUG=y
782782
CONFIG_DEBUG_INFO=y
@@ -839,8 +839,13 @@ CONFIG_BPF_KPROBE_OVERRIDE=y
839839
CONFIG_HIST_TRIGGERS=y
840840
CONFIG_FTRACE_STARTUP_TEST=y
841841
# CONFIG_EVENT_TRACE_STARTUP_TEST is not set
842+
CONFIG_SAMPLES=y
843+
CONFIG_SAMPLE_TRACE_PRINTK=m
844+
CONFIG_SAMPLE_FTRACE_DIRECT=m
842845
CONFIG_DEBUG_ENTRY=y
843846
CONFIG_CIO_INJECT=y
847+
CONFIG_KUNIT=m
848+
CONFIG_KUNIT_DEBUGFS=y
844849
CONFIG_NOTIFIER_ERROR_INJECTION=m
845850
CONFIG_NETDEV_NOTIFIER_ERROR_INJECT=m
846851
CONFIG_FAULT_INJECTION=y

arch/s390/configs/defconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ CONFIG_CMM=m
6060
CONFIG_APPLDATA_BASE=y
6161
CONFIG_KVM=m
6262
CONFIG_S390_UNWIND_SELFTEST=m
63+
CONFIG_S390_KPROBES_SANITY_TEST=m
6364
CONFIG_KPROBES=y
6465
CONFIG_JUMP_LABEL=y
6566
# CONFIG_GCC_PLUGINS is not set
@@ -788,6 +789,11 @@ CONFIG_FTRACE_SYSCALLS=y
788789
CONFIG_BLK_DEV_IO_TRACE=y
789790
CONFIG_BPF_KPROBE_OVERRIDE=y
790791
CONFIG_HIST_TRIGGERS=y
792+
CONFIG_SAMPLES=y
793+
CONFIG_SAMPLE_TRACE_PRINTK=m
794+
CONFIG_SAMPLE_FTRACE_DIRECT=m
795+
CONFIG_KUNIT=m
796+
CONFIG_KUNIT_DEBUGFS=y
791797
CONFIG_LKDTM=m
792798
CONFIG_PERCPU_TEST=m
793799
CONFIG_ATOMIC64_SELFTEST=y

arch/s390/include/asm/barrier.h

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,24 @@
1616

1717
#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
1818
/* Fast-BCR without checkpoint synchronization */
19-
#define __ASM_BARRIER "bcr 14,0\n"
19+
#define __ASM_BCR_SERIALIZE "bcr 14,0\n"
2020
#else
21-
#define __ASM_BARRIER "bcr 15,0\n"
21+
#define __ASM_BCR_SERIALIZE "bcr 15,0\n"
2222
#endif
2323

24-
#define mb() do { asm volatile(__ASM_BARRIER : : : "memory"); } while (0)
24+
static __always_inline void bcr_serialize(void)
25+
{
26+
asm volatile(__ASM_BCR_SERIALIZE : : : "memory");
27+
}
2528

26-
#define rmb() barrier()
27-
#define wmb() barrier()
28-
#define dma_rmb() mb()
29-
#define dma_wmb() mb()
30-
#define __smp_mb() mb()
31-
#define __smp_rmb() rmb()
32-
#define __smp_wmb() wmb()
29+
#define mb() bcr_serialize()
30+
#define rmb() barrier()
31+
#define wmb() barrier()
32+
#define dma_rmb() mb()
33+
#define dma_wmb() mb()
34+
#define __smp_mb() mb()
35+
#define __smp_rmb() rmb()
36+
#define __smp_wmb() wmb()
3337

3438
#define __smp_store_release(p, v) \
3539
do { \

0 commit comments

Comments
 (0)