Skip to content

Commit 4ab6cfc

Browse files
committed
Merge tag 's390-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull more s390 updates from Heiko Carstens: "Just a couple of small improvements, bug fixes and cleanups: - Add Eric Farman as maintainer for s390 virtio drivers. - Improve machine check handling, and avoid incorrectly injecting a machine check into a kvm guest. - Add cond_resched() call to gmap page table walker in order to avoid possible huge latencies. Also use non-quiesing sske instruction to speed up storage key handling. - Add __GFP_NORETRY to KEXEC_CONTROL_MEMORY_GFP so s390 behaves similar like common code. - Get sie control block address from correct stack slot in perf event code. This fixes potential random memory accesses. - Change uaccess code so that the exception handler sets the result of get_user() and __get_kernel_nofault() to zero in case of a fault. Until now this was done via input parameters for inline assemblies. Doing it via fault handling is what most or even all other architectures are doing. - Couple of other small cleanups and fixes" * tag 's390-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/stack: add union to reflect kvm stack slot usages s390/stack: merge empty stack frame slots s390/uaccess: whitespace cleanup s390/uaccess: use __noreturn instead of __attribute__((noreturn)) s390/uaccess: use exception handler to zero result on get_user() failure s390/uaccess: use symbolic names for inline assembler operands s390/mcck: isolate SIE instruction when setting CIF_MCCK_GUEST flag s390/mm: use non-quiescing sske for KVM switch to keyed guest s390/gmap: voluntarily schedule during key setting MAINTAINERS: Update s390 virtio-ccw s390/kexec: add __GFP_NORETRY to KEXEC_CONTROL_MEMORY_GFP s390/Kconfig.debug: fix indentation s390/Kconfig: fix indentation s390/perf: obtain sie_block from the right address s390: generate register offsets into pt_regs automatically s390: simplify early program check handler s390/crypto: fix scatterwalk_unmap() callers in AES-GCM
2 parents 93ce794 + e0ffcf3 commit 4ab6cfc

File tree

19 files changed

+289
-211
lines changed

19 files changed

+289
-211
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21057,6 +21057,7 @@ F: include/uapi/linux/virtio_crypto.h
2105721057
VIRTIO DRIVERS FOR S390
2105821058
M: Cornelia Huck <[email protected]>
2105921059
M: Halil Pasic <[email protected]>
21060+
M: Eric Farman <[email protected]>
2106021061
2106121062
2106221063

arch/s390/Kconfig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -732,11 +732,11 @@ config VFIO_AP
732732
depends on S390_AP_IOMMU && VFIO_MDEV && KVM
733733
depends on ZCRYPT
734734
help
735-
This driver grants access to Adjunct Processor (AP) devices
736-
via the VFIO mediated device interface.
735+
This driver grants access to Adjunct Processor (AP) devices
736+
via the VFIO mediated device interface.
737737

738-
To compile this driver as a module, choose M here: the module
739-
will be called vfio_ap.
738+
To compile this driver as a module, choose M here: the module
739+
will be called vfio_ap.
740740

741741
endmenu
742742

arch/s390/Kconfig.debug

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ config DEBUG_ENTRY
1414
If unsure, say N.
1515

1616
config CIO_INJECT
17-
bool "CIO Inject interfaces"
18-
depends on DEBUG_KERNEL && DEBUG_FS
19-
help
20-
This option provides a debugging facility to inject certain artificial events
21-
and instruction responses to the CIO layer of Linux kernel. The newly created
22-
debugfs user-interfaces will be at /sys/kernel/debug/s390/cio/*
17+
bool "CIO Inject interfaces"
18+
depends on DEBUG_KERNEL && DEBUG_FS
19+
help
20+
This option provides a debugging facility to inject certain artificial events
21+
and instruction responses to the CIO layer of Linux kernel. The newly created
22+
debugfs user-interfaces will be at /sys/kernel/debug/s390/cio/*

arch/s390/crypto/aes_s390.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ static inline void _gcm_sg_unmap_and_advance(struct gcm_sg_walk *gw,
701701
unsigned int nbytes)
702702
{
703703
gw->walk_bytes_remain -= nbytes;
704-
scatterwalk_unmap(&gw->walk);
704+
scatterwalk_unmap(gw->walk_ptr);
705705
scatterwalk_advance(&gw->walk, nbytes);
706706
scatterwalk_done(&gw->walk, 0, gw->walk_bytes_remain);
707707
gw->walk_ptr = NULL;
@@ -776,7 +776,7 @@ static int gcm_out_walk_go(struct gcm_sg_walk *gw, unsigned int minbytesneeded)
776776
goto out;
777777
}
778778

779-
scatterwalk_unmap(&gw->walk);
779+
scatterwalk_unmap(gw->walk_ptr);
780780
gw->walk_ptr = NULL;
781781

782782
gw->ptr = gw->buf;

arch/s390/include/asm/asm-extable.h

Lines changed: 63 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,24 @@
33
#define __ASM_EXTABLE_H
44

55
#include <linux/stringify.h>
6+
#include <linux/bits.h>
67
#include <asm/asm-const.h>
78

8-
#define EX_TYPE_NONE 0
9-
#define EX_TYPE_FIXUP 1
10-
#define EX_TYPE_BPF 2
11-
#define EX_TYPE_UACCESS 3
9+
#define EX_TYPE_NONE 0
10+
#define EX_TYPE_FIXUP 1
11+
#define EX_TYPE_BPF 2
12+
#define EX_TYPE_UA_STORE 3
13+
#define EX_TYPE_UA_LOAD_MEM 4
14+
#define EX_TYPE_UA_LOAD_REG 5
15+
16+
#define EX_DATA_REG_ERR_SHIFT 0
17+
#define EX_DATA_REG_ERR GENMASK(3, 0)
18+
19+
#define EX_DATA_REG_ADDR_SHIFT 4
20+
#define EX_DATA_REG_ADDR GENMASK(7, 4)
21+
22+
#define EX_DATA_LEN_SHIFT 8
23+
#define EX_DATA_LEN GENMASK(11, 8)
1224

1325
#define __EX_TABLE(_section, _fault, _target, _type) \
1426
stringify_in_c(.section _section,"a";) \
@@ -19,35 +31,58 @@
1931
stringify_in_c(.short 0;) \
2032
stringify_in_c(.previous)
2133

22-
#define __EX_TABLE_UA(_section, _fault, _target, _type, _reg) \
23-
stringify_in_c(.section _section,"a";) \
24-
stringify_in_c(.align 4;) \
25-
stringify_in_c(.long (_fault) - .;) \
26-
stringify_in_c(.long (_target) - .;) \
27-
stringify_in_c(.short (_type);) \
28-
stringify_in_c(.macro extable_reg reg;) \
29-
stringify_in_c(.set .Lfound, 0;) \
30-
stringify_in_c(.set .Lregnr, 0;) \
31-
stringify_in_c(.irp rs,r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15;) \
32-
stringify_in_c(.ifc "\reg", "%%\rs";) \
33-
stringify_in_c(.set .Lfound, 1;) \
34-
stringify_in_c(.short .Lregnr;) \
35-
stringify_in_c(.endif;) \
36-
stringify_in_c(.set .Lregnr, .Lregnr+1;) \
37-
stringify_in_c(.endr;) \
38-
stringify_in_c(.ifne (.Lfound != 1);) \
39-
stringify_in_c(.error "extable_reg: bad register argument";) \
40-
stringify_in_c(.endif;) \
41-
stringify_in_c(.endm;) \
42-
stringify_in_c(extable_reg _reg;) \
43-
stringify_in_c(.purgem extable_reg;) \
34+
#define __EX_TABLE_UA(_section, _fault, _target, _type, _regerr, _regaddr, _len)\
35+
stringify_in_c(.section _section,"a";) \
36+
stringify_in_c(.align 4;) \
37+
stringify_in_c(.long (_fault) - .;) \
38+
stringify_in_c(.long (_target) - .;) \
39+
stringify_in_c(.short (_type);) \
40+
stringify_in_c(.macro extable_reg regerr, regaddr;) \
41+
stringify_in_c(.set .Lfound, 0;) \
42+
stringify_in_c(.set .Lcurr, 0;) \
43+
stringify_in_c(.irp rs,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15;) \
44+
stringify_in_c( .ifc "\regerr", "%%r\rs";) \
45+
stringify_in_c( .set .Lfound, 1;) \
46+
stringify_in_c( .set .Lregerr, .Lcurr;) \
47+
stringify_in_c( .endif;) \
48+
stringify_in_c( .set .Lcurr, .Lcurr+1;) \
49+
stringify_in_c(.endr;) \
50+
stringify_in_c(.ifne (.Lfound != 1);) \
51+
stringify_in_c( .error "extable_reg: bad register argument1";) \
52+
stringify_in_c(.endif;) \
53+
stringify_in_c(.set .Lfound, 0;) \
54+
stringify_in_c(.set .Lcurr, 0;) \
55+
stringify_in_c(.irp rs,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15;) \
56+
stringify_in_c( .ifc "\regaddr", "%%r\rs";) \
57+
stringify_in_c( .set .Lfound, 1;) \
58+
stringify_in_c( .set .Lregaddr, .Lcurr;) \
59+
stringify_in_c( .endif;) \
60+
stringify_in_c( .set .Lcurr, .Lcurr+1;) \
61+
stringify_in_c(.endr;) \
62+
stringify_in_c(.ifne (.Lfound != 1);) \
63+
stringify_in_c( .error "extable_reg: bad register argument2";) \
64+
stringify_in_c(.endif;) \
65+
stringify_in_c(.short .Lregerr << EX_DATA_REG_ERR_SHIFT | \
66+
.Lregaddr << EX_DATA_REG_ADDR_SHIFT | \
67+
_len << EX_DATA_LEN_SHIFT;) \
68+
stringify_in_c(.endm;) \
69+
stringify_in_c(extable_reg _regerr,_regaddr;) \
70+
stringify_in_c(.purgem extable_reg;) \
4471
stringify_in_c(.previous)
4572

4673
#define EX_TABLE(_fault, _target) \
4774
__EX_TABLE(__ex_table, _fault, _target, EX_TYPE_FIXUP)
75+
4876
#define EX_TABLE_AMODE31(_fault, _target) \
4977
__EX_TABLE(.amode31.ex_table, _fault, _target, EX_TYPE_FIXUP)
50-
#define EX_TABLE_UA(_fault, _target, _reg) \
51-
__EX_TABLE_UA(__ex_table, _fault, _target, EX_TYPE_UACCESS, _reg)
78+
79+
#define EX_TABLE_UA_STORE(_fault, _target, _regerr) \
80+
__EX_TABLE_UA(__ex_table, _fault, _target, EX_TYPE_UA_STORE, _regerr, _regerr, 0)
81+
82+
#define EX_TABLE_UA_LOAD_MEM(_fault, _target, _regerr, _regmem, _len) \
83+
__EX_TABLE_UA(__ex_table, _fault, _target, EX_TYPE_UA_LOAD_MEM, _regerr, _regmem, _len)
84+
85+
#define EX_TABLE_UA_LOAD_REG(_fault, _target, _regerr, _regzero) \
86+
__EX_TABLE_UA(__ex_table, _fault, _target, EX_TYPE_UA_LOAD_REG, _regerr, _regzero, 0)
5287

5388
#endif /* __ASM_EXTABLE_H */

arch/s390/include/asm/kexec.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#define KEXEC_CONTROL_MEMORY_LIMIT (1UL<<31)
3232

3333
/* Allocate control page with GFP_DMA */
34-
#define KEXEC_CONTROL_MEMORY_GFP GFP_DMA
34+
#define KEXEC_CONTROL_MEMORY_GFP (GFP_DMA | __GFP_NORETRY)
3535

3636
/* Maximum address we can use for the crash control pages */
3737
#define KEXEC_CRASH_CONTROL_MEMORY_LIMIT (-1UL)

arch/s390/include/asm/processor.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -304,12 +304,6 @@ static __always_inline void __noreturn disabled_wait(void)
304304
while (1);
305305
}
306306

307-
/*
308-
* Basic Program Check Handler.
309-
*/
310-
extern void s390_base_pgm_handler(void);
311-
extern void (*s390_base_pgm_handler_fn)(struct pt_regs *regs);
312-
313307
#define ARCH_LOW_ADDRESS_LIMIT 0x7fffffffUL
314308

315309
extern int memcpy_real(void *, unsigned long, size_t);

arch/s390/include/asm/stacktrace.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,15 @@ static inline bool on_stack(struct stack_info *info,
3939
* Kernel uses the packed stack layout (-mpacked-stack).
4040
*/
4141
struct stack_frame {
42-
unsigned long empty1[5];
43-
unsigned int empty2[8];
42+
union {
43+
unsigned long empty[9];
44+
struct {
45+
unsigned long sie_control_block;
46+
unsigned long sie_savearea;
47+
unsigned long sie_reason;
48+
unsigned long sie_flags;
49+
};
50+
};
4451
unsigned long gprs[10];
4552
unsigned long back_chain;
4653
};

0 commit comments

Comments
 (0)