Skip to content

Commit bcf5470

Browse files
committed
Merge tag 's390-6.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 updates from Heiko Carstens: - Large cleanup of the con3270/tty3270 driver. Among others this fixes: - Background Color Support - ASCII Line Character Support - VT100 Support - Geometries other than 80x24 - Cleanup and improve cmpxchg() code. Also add cmpxchg_user_key() to uaccess functions, which will be used by KVM to access KVM guest memory with a specific storage key - Add support for user space events counting to CPUMF - Cleanup the vfio/ccw code, which also allows now to properly support 2K Format-2 IDALs - Move kernel page table allocation and initialization to decompressor, which finally allows to enter the kernel with dynamic address translation enabled. This in turn allows to get rid of code with special handling in the kernel, which has to distinguish if DAT is on or off - Replace kretprobe with rethook - Various improvements to vfio/ap queue resets: - Use TAPQ to verify completion of a reset in progress rather than multiple invocations of ZAPQ. - Check TAPQ response codes when verifying successful completion of ZAPQ. - Fix erroneous handling of some error response codes. - Increase the maximum amount of time to wait for successful completion of ZAPQ - Rework system call wrappers to get rid of alias functions, which were only left on s390 - Cleanup diag288_wdt watchdog driver. It has been agreed on with Guenter Roeck that this goes upstream via the s390 tree - Add missing loadparm parameter handling for list-directed ECKD ipl/reipl - Various improvements to memory detection code - Remove arch_cpu_idle_time() since the current implementation is broken, and allows user space observable accounted idle times which can temporarily decrease - Add Reset DAT-Protection support: (only) allow to change PTEs from RO to RW with a new RDP instruction. Unlike the currently used IPTE instruction, this does not necessarily guarantee that TLBs of all CPUs are synchronously flushed; and that remote CPUs can see spurious protection faults. The overall improvement for not requiring an all CPU synchronization, like it is required with IPTE, should be beneficial - Fix KFENCE page fault reporting - Smaller cleanups and improvement all over the place * tag 's390-6.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (182 commits) s390/irq,idle: simplify idle check s390/processor: add test_and_set_cpu_flag() and test_and_clear_cpu_flag() s390/processor: let cpu helper functions return boolean values s390/kfence: fix page fault reporting s390/zcrypt: introduce ctfm field in struct CPRBX s390: remove confusing comment from uapi types header file vfio/ccw: remove WARN_ON during shutdown s390/entry: remove toolchain dependent micro-optimization s390/mem_detect: do not truncate online memory ranges info s390/vx: remove __uint128_t type from __vector128 struct again s390/mm: add support for RDP (Reset DAT-Protection) s390/mm: define private VM_FAULT_* reasons from top bits Documentation: s390: correct spelling s390/ap: fix status returned by ap_qact() s390/ap: fix status returned by ap_aqic() s390: vfio-ap: tighten the NIB validity check Revert "s390/mem_detect: do not update output parameters on failure" s390/idle: remove arch_cpu_idle_time() and corresponding code s390/vx: use simple assignments to access __vector128 members s390/vx: add 64 and 128 bit members to __vector128 struct ...
2 parents 8779347 + 6472a2d commit bcf5470

Some content is hidden

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

102 files changed

+4581
-4583
lines changed

Documentation/ABI/testing/sysfs-bus-css

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
What: /sys/bus/css/devices/.../type
22
Date: March 2008
3-
Contact: Cornelia Huck <[email protected]>
4-
3+
54
Description: Contains the subchannel type, as reported by the hardware.
65
This attribute is present for all subchannel types.
76

87
What: /sys/bus/css/devices/.../modalias
98
Date: March 2008
10-
Contact: Cornelia Huck <[email protected]>
11-
9+
1210
Description: Contains the module alias as reported with uevents.
1311
It is of the format css:t<type> and present for all
1412
subchannel types.
1513

1614
What: /sys/bus/css/drivers/io_subchannel/.../chpids
1715
Date: December 2002
18-
Contact: Cornelia Huck <[email protected]>
19-
16+
2017
Description: Contains the ids of the channel paths used by this
2118
subchannel, as reported by the channel subsystem
2219
during subchannel recognition.
@@ -26,8 +23,7 @@ Users: s390-tools, HAL
2623

2724
What: /sys/bus/css/drivers/io_subchannel/.../pimpampom
2825
Date: December 2002
29-
Contact: Cornelia Huck <[email protected]>
30-
26+
3127
Description: Contains the PIM/PAM/POM values, as reported by the
3228
channel subsystem when last queried by the common I/O
3329
layer (this implies that this attribute is not necessarily
@@ -38,8 +34,7 @@ Users: s390-tools, HAL
3834

3935
What: /sys/bus/css/devices/.../driver_override
4036
Date: June 2019
41-
Contact: Cornelia Huck <[email protected]>
42-
37+
4338
Description: This file allows the driver for a device to be specified. When
4439
specified, only a driver with a name matching the value written
4540
to driver_override will have an opportunity to bind to the

Documentation/s390/pci.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Entries specific to zPCI functions and entries that hold zPCI information.
5151

5252
The slot entries are set up using the function identifier (FID) of the
5353
PCI function. The format depicted as XXXXXXXX above is 8 hexadecimal digits
54-
with 0 padding and lower case hexadecimal digitis.
54+
with 0 padding and lower case hexadecimal digits.
5555

5656
- /sys/bus/pci/slots/XXXXXXXX/power
5757

@@ -66,7 +66,7 @@ Entries specific to zPCI functions and entries that hold zPCI information.
6666

6767
- function_handle
6868
Low-level identifier used for a configured PCI function.
69-
It might be useful for debuging.
69+
It might be useful for debugging.
7070

7171
- pchid
7272
Model-dependent location of the I/O adapter.

Documentation/s390/vfio-ccw.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ The process of how these work together.
176176
Use the 'mdev_create' sysfs file, we need to manually create one (and
177177
only one for our case) mediated device.
178178
3. vfio_mdev.ko drives the mediated ccw device.
179-
vfio_mdev is also the vfio device drvier. It will probe the mdev and
179+
vfio_mdev is also the vfio device driver. It will probe the mdev and
180180
add it to an iommu_group and a vfio_group. Then we could pass through
181181
the mdev to a guest.
182182

@@ -219,8 +219,8 @@ values may occur:
219219
The operation was successful.
220220

221221
``-EOPNOTSUPP``
222-
The orb specified transport mode or an unidentified IDAW format, or the
223-
scsw specified a function other than the start function.
222+
The ORB specified transport mode or the
223+
SCSW specified a function other than the start function.
224224

225225
``-EIO``
226226
A request was issued while the device was not in a state ready to accept

MAINTAINERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18111,6 +18111,7 @@ F: Documentation/driver-api/s390-drivers.rst
1811118111
F: Documentation/s390/
1811218112
F: arch/s390/
1811318113
F: drivers/s390/
18114+
F: drivers/watchdog/diag288_wdt.c
1811418115

1811518116
S390 COMMON I/O LAYER
1811618117
M: Vineeth Vijayan <[email protected]>
@@ -18171,6 +18172,13 @@ F: arch/s390/pci/
1817118172
F: drivers/pci/hotplug/s390_pci_hpc.c
1817218173
F: Documentation/s390/pci.rst
1817318174

18175+
S390 SCM DRIVER
18176+
M: Vineeth Vijayan <[email protected]>
18177+
18178+
S: Supported
18179+
F: drivers/s390/block/scm*
18180+
F: drivers/s390/cio/scm.c
18181+
1817418182
S390 VFIO AP DRIVER
1817518183
M: Tony Krowiak <[email protected]>
1817618184
M: Halil Pasic <[email protected]>

arch/s390/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ config S390
187187
select HAVE_KPROBES
188188
select HAVE_KPROBES_ON_FTRACE
189189
select HAVE_KRETPROBES
190+
select HAVE_RETHOOK
190191
select HAVE_KVM
191192
select HAVE_LIVEPATCH
192193
select HAVE_MEMBLOCK_PHYS_MAP

arch/s390/boot/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ endif
3535

3636
CFLAGS_sclp_early_core.o += -I$(srctree)/drivers/s390/char
3737

38-
obj-y := head.o als.o startup.o mem_detect.o ipl_parm.o ipl_report.o
38+
obj-y := head.o als.o startup.o mem_detect.o ipl_parm.o ipl_report.o vmem.o
3939
obj-y += string.o ebcdic.o sclp_early_core.o mem.o ipl_vmparm.o cmdline.o
4040
obj-y += version.o pgm_check_info.o ctype.o ipl_data.o machine_kexec_reloc.o
4141
obj-$(findstring y, $(CONFIG_PROTECTED_VIRTUALIZATION_GUEST) $(CONFIG_PGSTE)) += uv.o

arch/s390/boot/boot.h

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,49 @@
88

99
#ifndef __ASSEMBLY__
1010

11+
struct machine_info {
12+
unsigned char has_edat1 : 1;
13+
unsigned char has_edat2 : 1;
14+
unsigned char has_nx : 1;
15+
};
16+
17+
struct vmlinux_info {
18+
unsigned long default_lma;
19+
unsigned long entry;
20+
unsigned long image_size; /* does not include .bss */
21+
unsigned long bss_size; /* uncompressed image .bss size */
22+
unsigned long bootdata_off;
23+
unsigned long bootdata_size;
24+
unsigned long bootdata_preserved_off;
25+
unsigned long bootdata_preserved_size;
26+
unsigned long dynsym_start;
27+
unsigned long rela_dyn_start;
28+
unsigned long rela_dyn_end;
29+
unsigned long amode31_size;
30+
unsigned long init_mm_off;
31+
unsigned long swapper_pg_dir_off;
32+
unsigned long invalid_pg_dir_off;
33+
};
34+
1135
void startup_kernel(void);
12-
unsigned long detect_memory(void);
36+
unsigned long detect_memory(unsigned long *safe_addr);
37+
void mem_detect_set_usable_limit(unsigned long limit);
1338
bool is_ipl_block_dump(void);
1439
void store_ipl_parmblock(void);
40+
unsigned long read_ipl_report(unsigned long safe_addr);
1541
void setup_boot_command_line(void);
1642
void parse_boot_command_line(void);
1743
void verify_facilities(void);
1844
void print_missing_facilities(void);
1945
void sclp_early_setup_buffer(void);
2046
void print_pgm_check_info(void);
2147
unsigned long get_random_base(unsigned long safe_addr);
48+
void setup_vmem(unsigned long asce_limit);
49+
unsigned long vmem_estimate_memory_needs(unsigned long online_mem_total);
2250
void __printf(1, 2) decompressor_printk(const char *fmt, ...);
51+
void error(char *m);
52+
53+
extern struct machine_info machine;
2354

2455
/* Symbols defined by linker scripts */
2556
extern const char kernel_version[];
@@ -31,8 +62,13 @@ extern char __boot_data_start[], __boot_data_end[];
3162
extern char __boot_data_preserved_start[], __boot_data_preserved_end[];
3263
extern char _decompressor_syms_start[], _decompressor_syms_end[];
3364
extern char _stack_start[], _stack_end[];
65+
extern char _end[];
66+
extern unsigned char _compressed_start[];
67+
extern unsigned char _compressed_end[];
68+
extern struct vmlinux_info _vmlinux_info;
69+
#define vmlinux _vmlinux_info
3470

35-
unsigned long read_ipl_report(unsigned long safe_offset);
71+
#define __abs_lowcore_pa(x) (((unsigned long)(x) - __abs_lowcore) % sizeof(struct lowcore))
3672

3773
#endif /* __ASSEMBLY__ */
3874
#endif /* BOOT_BOOT_H */

arch/s390/boot/decompressor.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/string.h>
1212
#include <asm/page.h>
1313
#include "decompressor.h"
14+
#include "boot.h"
1415

1516
/*
1617
* gzip declarations

arch/s390/boot/decompressor.h

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,11 @@
22
#ifndef BOOT_COMPRESSED_DECOMPRESSOR_H
33
#define BOOT_COMPRESSED_DECOMPRESSOR_H
44

5-
#include <linux/stddef.h>
6-
75
#ifdef CONFIG_KERNEL_UNCOMPRESSED
86
static inline void *decompress_kernel(void) { return NULL; }
97
#else
108
void *decompress_kernel(void);
119
#endif
1210
unsigned long mem_safe_offset(void);
13-
void error(char *m);
14-
15-
struct vmlinux_info {
16-
unsigned long default_lma;
17-
void (*entry)(void);
18-
unsigned long image_size; /* does not include .bss */
19-
unsigned long bss_size; /* uncompressed image .bss size */
20-
unsigned long bootdata_off;
21-
unsigned long bootdata_size;
22-
unsigned long bootdata_preserved_off;
23-
unsigned long bootdata_preserved_size;
24-
unsigned long dynsym_start;
25-
unsigned long rela_dyn_start;
26-
unsigned long rela_dyn_end;
27-
unsigned long amode31_size;
28-
};
29-
30-
/* Symbols defined by linker scripts */
31-
extern char _end[];
32-
extern unsigned char _compressed_start[];
33-
extern unsigned char _compressed_end[];
34-
extern char _vmlinux_info[];
35-
36-
#define vmlinux (*(struct vmlinux_info *)_vmlinux_info)
3711

3812
#endif /* BOOT_COMPRESSED_DECOMPRESSOR_H */

arch/s390/boot/kaslr.c

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ static unsigned long count_valid_kernel_positions(unsigned long kernel_size,
132132
unsigned long start, end, pos = 0;
133133
int i;
134134

135-
for_each_mem_detect_block(i, &start, &end) {
135+
for_each_mem_detect_usable_block(i, &start, &end) {
136136
if (_min >= end)
137137
continue;
138138
if (start >= _max)
@@ -153,7 +153,7 @@ static unsigned long position_to_address(unsigned long pos, unsigned long kernel
153153
unsigned long start, end;
154154
int i;
155155

156-
for_each_mem_detect_block(i, &start, &end) {
156+
for_each_mem_detect_usable_block(i, &start, &end) {
157157
if (_min >= end)
158158
continue;
159159
if (start >= _max)
@@ -172,26 +172,20 @@ static unsigned long position_to_address(unsigned long pos, unsigned long kernel
172172

173173
unsigned long get_random_base(unsigned long safe_addr)
174174
{
175+
unsigned long usable_total = get_mem_detect_usable_total();
175176
unsigned long memory_limit = get_mem_detect_end();
176177
unsigned long base_pos, max_pos, kernel_size;
177-
unsigned long kasan_needs;
178178
int i;
179179

180-
memory_limit = min(memory_limit, ident_map_size);
181-
182180
/*
183181
* Avoid putting kernel in the end of physical memory
184-
* which kasan will use for shadow memory and early pgtable
185-
* mapping allocations.
182+
* which vmem and kasan code will use for shadow memory and
183+
* pgtable mapping allocations.
186184
*/
187-
memory_limit -= kasan_estimate_memory_needs(memory_limit);
185+
memory_limit -= kasan_estimate_memory_needs(usable_total);
186+
memory_limit -= vmem_estimate_memory_needs(usable_total);
188187

189-
if (IS_ENABLED(CONFIG_BLK_DEV_INITRD) && initrd_data.start && initrd_data.size) {
190-
if (safe_addr < initrd_data.start + initrd_data.size)
191-
safe_addr = initrd_data.start + initrd_data.size;
192-
}
193188
safe_addr = ALIGN(safe_addr, THREAD_SIZE);
194-
195189
kernel_size = vmlinux.image_size + vmlinux.bss_size;
196190
if (safe_addr + kernel_size > memory_limit)
197191
return 0;

0 commit comments

Comments
 (0)