summaryrefslogtreecommitdiffstats
path: root/arch/s390/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-04-09 12:04:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-04-09 12:04:10 -0400
commitbecdce1c66b21ce1c0452e16127182ef692f47ba (patch)
treea37f26fbbc43fad56b12881f6d57dc4a0fdb8d98 /arch/s390/include
parentf8cf2f16a7c95acce497bfafa90e7c6d8397d653 (diff)
parent92fa7a13c845c91f6a8177250474bbcab7fcf45e (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 updates from Martin Schwidefsky: - Improvements for the spectre defense: * The spectre related code is consolidated to a single file nospec-branch.c * Automatic enable/disable for the spectre v2 defenses (expoline vs. nobp) * Syslog messages for specve v2 are added * Enable CONFIG_GENERIC_CPU_VULNERABILITIES and define the attribute functions for spectre v1 and v2 - Add helper macros for assembler alternatives and use them to shorten the code in entry.S. - Add support for persistent configuration data via the SCLP Store Data interface. The H/W interface requires a page table that uses 4K pages only, the code to setup such an address space is added as well. - Enable virtio GPU emulation in QEMU. To do this the depends statements for a few common Kconfig options are modified. - Add support for format-3 channel path descriptors and add a binary sysfs interface to export the associated utility strings. - Add a sysfs attribute to control the IFCC handling in case of constant channel errors. - The vfio-ccw changes from Cornelia. - Bug fixes and cleanups. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (40 commits) s390/kvm: improve stack frame constants in entry.S s390/lpp: use assembler alternatives for the LPP instruction s390/entry.S: use assembler alternatives s390: add assembler macros for CPU alternatives s390: add sysfs attributes for spectre s390: report spectre mitigation via syslog s390: add automatic detection of the spectre defense s390: move nobp parameter functions to nospec-branch.c s390/cio: add util_string sysfs attribute s390/chsc: query utility strings via fmt3 channel path descriptor s390/cio: rename struct channel_path_desc s390/cio: fix unbind of io_subchannel_driver s390/qdio: split up CCQ handling for EQBS / SQBS s390/qdio: don't retry EQBS after CCQ 96 s390/qdio: restrict buffer merging to eligible devices s390/qdio: don't merge ERROR output buffers s390/qdio: simplify math in get_*_buffer_frontier() s390/decompressor: trim uncompressed image head during the build s390/crypto: Fix kernel crash on aes_s390 module remove. s390/defkeymap: fix global init to zero ...
Diffstat (limited to 'arch/s390/include')
-rw-r--r--arch/s390/include/asm/alternative-asm.h108
-rw-r--r--arch/s390/include/asm/ccwdev.h2
-rw-r--r--arch/s390/include/asm/chpid.h2
-rw-r--r--arch/s390/include/asm/cio.h2
-rw-r--r--arch/s390/include/asm/cpu_mf.h4
-rw-r--r--arch/s390/include/asm/css_chars.h6
-rw-r--r--arch/s390/include/asm/nospec-branch.h6
-rw-r--r--arch/s390/include/asm/pgalloc.h3
-rw-r--r--arch/s390/include/asm/scsw.h4
-rw-r--r--arch/s390/include/asm/setup.h2
-rw-r--r--arch/s390/include/uapi/asm/dasd.h38
11 files changed, 144 insertions, 33 deletions
diff --git a/arch/s390/include/asm/alternative-asm.h b/arch/s390/include/asm/alternative-asm.h
new file mode 100644
index 000000000000..955d620db23e
--- /dev/null
+++ b/arch/s390/include/asm/alternative-asm.h
@@ -0,0 +1,108 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _ASM_S390_ALTERNATIVE_ASM_H
3#define _ASM_S390_ALTERNATIVE_ASM_H
4
5#ifdef __ASSEMBLY__
6
7/*
8 * Check the length of an instruction sequence. The length may not be larger
9 * than 254 bytes and it has to be divisible by 2.
10 */
11.macro alt_len_check start,end
12 .if ( \end - \start ) > 254
13 .error "cpu alternatives does not support instructions blocks > 254 bytes\n"
14 .endif
15 .if ( \end - \start ) % 2
16 .error "cpu alternatives instructions length is odd\n"
17 .endif
18.endm
19
20/*
21 * Issue one struct alt_instr descriptor entry (need to put it into
22 * the section .altinstructions, see below). This entry contains
23 * enough information for the alternatives patching code to patch an
24 * instruction. See apply_alternatives().
25 */
26.macro alt_entry orig_start, orig_end, alt_start, alt_end, feature
27 .long \orig_start - .
28 .long \alt_start - .
29 .word \feature
30 .byte \orig_end - \orig_start
31 .byte \alt_end - \alt_start
32.endm
33
34/*
35 * Fill up @bytes with nops. The macro emits 6-byte nop instructions
36 * for the bulk of the area, possibly followed by a 4-byte and/or
37 * a 2-byte nop if the size of the area is not divisible by 6.
38 */
39.macro alt_pad_fill bytes
40 .fill ( \bytes ) / 6, 6, 0xc0040000
41 .fill ( \bytes ) % 6 / 4, 4, 0x47000000
42 .fill ( \bytes ) % 6 % 4 / 2, 2, 0x0700
43.endm
44
45/*
46 * Fill up @bytes with nops. If the number of bytes is larger
47 * than 6, emit a jg instruction to branch over all nops, then
48 * fill an area of size (@bytes - 6) with nop instructions.
49 */
50.macro alt_pad bytes
51 .if ( \bytes > 0 )
52 .if ( \bytes > 6 )
53 jg . + \bytes
54 alt_pad_fill \bytes - 6
55 .else
56 alt_pad_fill \bytes
57 .endif
58 .endif
59.endm
60
61/*
62 * Define an alternative between two instructions. If @feature is
63 * present, early code in apply_alternatives() replaces @oldinstr with
64 * @newinstr. ".skip" directive takes care of proper instruction padding
65 * in case @newinstr is longer than @oldinstr.
66 */
67.macro ALTERNATIVE oldinstr, newinstr, feature
68 .pushsection .altinstr_replacement,"ax"
69770: \newinstr
70771: .popsection
71772: \oldinstr
72773: alt_len_check 770b, 771b
73 alt_len_check 772b, 773b
74 alt_pad ( ( 771b - 770b ) - ( 773b - 772b ) )
75774: .pushsection .altinstructions,"a"
76 alt_entry 772b, 774b, 770b, 771b, \feature
77 .popsection
78.endm
79
80/*
81 * Define an alternative between two instructions. If @feature is
82 * present, early code in apply_alternatives() replaces @oldinstr with
83 * @newinstr. ".skip" directive takes care of proper instruction padding
84 * in case @newinstr is longer than @oldinstr.
85 */
86.macro ALTERNATIVE_2 oldinstr, newinstr1, feature1, newinstr2, feature2
87 .pushsection .altinstr_replacement,"ax"
88770: \newinstr1
89771: \newinstr2
90772: .popsection
91773: \oldinstr
92774: alt_len_check 770b, 771b
93 alt_len_check 771b, 772b
94 alt_len_check 773b, 774b
95 .if ( 771b - 770b > 772b - 771b )
96 alt_pad ( ( 771b - 770b ) - ( 774b - 773b ) )
97 .else
98 alt_pad ( ( 772b - 771b ) - ( 774b - 773b ) )
99 .endif
100775: .pushsection .altinstructions,"a"
101 alt_entry 773b, 775b, 770b, 771b,\feature1
102 alt_entry 773b, 775b, 771b, 772b,\feature2
103 .popsection
104.endm
105
106#endif /* __ASSEMBLY__ */
107
108#endif /* _ASM_S390_ALTERNATIVE_ASM_H */
diff --git a/arch/s390/include/asm/ccwdev.h b/arch/s390/include/asm/ccwdev.h
index 633f8da86137..20bce136b2e5 100644
--- a/arch/s390/include/asm/ccwdev.h
+++ b/arch/s390/include/asm/ccwdev.h
@@ -230,5 +230,5 @@ int ccw_device_siosl(struct ccw_device *);
230 230
231extern void ccw_device_get_schid(struct ccw_device *, struct subchannel_id *); 231extern void ccw_device_get_schid(struct ccw_device *, struct subchannel_id *);
232 232
233struct channel_path_desc *ccw_device_get_chp_desc(struct ccw_device *, int); 233struct channel_path_desc_fmt0 *ccw_device_get_chp_desc(struct ccw_device *, int);
234#endif /* _S390_CCWDEV_H_ */ 234#endif /* _S390_CCWDEV_H_ */
diff --git a/arch/s390/include/asm/chpid.h b/arch/s390/include/asm/chpid.h
index 4773f747915c..20e0d22f29e9 100644
--- a/arch/s390/include/asm/chpid.h
+++ b/arch/s390/include/asm/chpid.h
@@ -9,7 +9,7 @@
9#include <uapi/asm/chpid.h> 9#include <uapi/asm/chpid.h>
10#include <asm/cio.h> 10#include <asm/cio.h>
11 11
12struct channel_path_desc { 12struct channel_path_desc_fmt0 {
13 u8 flags; 13 u8 flags;
14 u8 lsn; 14 u8 lsn;
15 u8 desc; 15 u8 desc;
diff --git a/arch/s390/include/asm/cio.h b/arch/s390/include/asm/cio.h
index dc84a0171bb3..847a04262b9c 100644
--- a/arch/s390/include/asm/cio.h
+++ b/arch/s390/include/asm/cio.h
@@ -227,7 +227,7 @@ struct esw_eadm {
227 * a field is valid; a field not being valid is always passed as %0. 227 * a field is valid; a field not being valid is always passed as %0.
228 * If a unit check occurred, @ecw may contain sense data; this is retrieved 228 * If a unit check occurred, @ecw may contain sense data; this is retrieved
229 * by the common I/O layer itself if the device doesn't support concurrent 229 * by the common I/O layer itself if the device doesn't support concurrent
230 * sense (so that the device driver never needs to perform basic sene itself). 230 * sense (so that the device driver never needs to perform basic sense itself).
231 * For unsolicited interrupts, the irb is passed as-is (expect for sense data, 231 * For unsolicited interrupts, the irb is passed as-is (expect for sense data,
232 * if applicable). 232 * if applicable).
233 */ 233 */
diff --git a/arch/s390/include/asm/cpu_mf.h b/arch/s390/include/asm/cpu_mf.h
index dd08db491b89..f58d17e9dd65 100644
--- a/arch/s390/include/asm/cpu_mf.h
+++ b/arch/s390/include/asm/cpu_mf.h
@@ -29,12 +29,12 @@
29/* CPU measurement facility support */ 29/* CPU measurement facility support */
30static inline int cpum_cf_avail(void) 30static inline int cpum_cf_avail(void)
31{ 31{
32 return MACHINE_HAS_LPP && test_facility(67); 32 return test_facility(40) && test_facility(67);
33} 33}
34 34
35static inline int cpum_sf_avail(void) 35static inline int cpum_sf_avail(void)
36{ 36{
37 return MACHINE_HAS_LPP && test_facility(68); 37 return test_facility(40) && test_facility(68);
38} 38}
39 39
40 40
diff --git a/arch/s390/include/asm/css_chars.h b/arch/s390/include/asm/css_chars.h
index fb56fa3283a2..0563fd3e8458 100644
--- a/arch/s390/include/asm/css_chars.h
+++ b/arch/s390/include/asm/css_chars.h
@@ -32,8 +32,10 @@ struct css_general_char {
32 u32 fcx : 1; /* bit 88 */ 32 u32 fcx : 1; /* bit 88 */
33 u32 : 19; 33 u32 : 19;
34 u32 alt_ssi : 1; /* bit 108 */ 34 u32 alt_ssi : 1; /* bit 108 */
35 u32:1; 35 u32 : 1;
36 u32 narf:1; /* bit 110 */ 36 u32 narf : 1; /* bit 110 */
37 u32 : 12;
38 u32 util_str : 1;/* bit 123 */
37} __packed; 39} __packed;
38 40
39extern struct css_general_char css_general_characteristics; 41extern struct css_general_char css_general_characteristics;
diff --git a/arch/s390/include/asm/nospec-branch.h b/arch/s390/include/asm/nospec-branch.h
index 7df48e5cf36f..35bf28fe4c64 100644
--- a/arch/s390/include/asm/nospec-branch.h
+++ b/arch/s390/include/asm/nospec-branch.h
@@ -6,12 +6,10 @@
6 6
7#include <linux/types.h> 7#include <linux/types.h>
8 8
9extern int nospec_call_disable; 9extern int nospec_disable;
10extern int nospec_return_disable;
11 10
12void nospec_init_branches(void); 11void nospec_init_branches(void);
13void nospec_call_revert(s32 *start, s32 *end); 12void nospec_revert(s32 *start, s32 *end);
14void nospec_return_revert(s32 *start, s32 *end);
15 13
16#endif /* __ASSEMBLY__ */ 14#endif /* __ASSEMBLY__ */
17 15
diff --git a/arch/s390/include/asm/pgalloc.h b/arch/s390/include/asm/pgalloc.h
index c7b4333d1de0..f0f9bcf94c03 100644
--- a/arch/s390/include/asm/pgalloc.h
+++ b/arch/s390/include/asm/pgalloc.h
@@ -151,4 +151,7 @@ void vmem_map_init(void);
151void *vmem_crst_alloc(unsigned long val); 151void *vmem_crst_alloc(unsigned long val);
152pte_t *vmem_pte_alloc(void); 152pte_t *vmem_pte_alloc(void);
153 153
154unsigned long base_asce_alloc(unsigned long addr, unsigned long num_pages);
155void base_asce_free(unsigned long asce);
156
154#endif /* _S390_PGALLOC_H */ 157#endif /* _S390_PGALLOC_H */
diff --git a/arch/s390/include/asm/scsw.h b/arch/s390/include/asm/scsw.h
index 79b7ffa91832..c00f7b031628 100644
--- a/arch/s390/include/asm/scsw.h
+++ b/arch/s390/include/asm/scsw.h
@@ -390,10 +390,10 @@ static inline int scsw_cmd_is_valid_key(union scsw *scsw)
390} 390}
391 391
392/** 392/**
393 * scsw_cmd_is_valid_sctl - check fctl field validity 393 * scsw_cmd_is_valid_sctl - check sctl field validity
394 * @scsw: pointer to scsw 394 * @scsw: pointer to scsw
395 * 395 *
396 * Return non-zero if the fctl field of the specified command mode scsw is 396 * Return non-zero if the sctl field of the specified command mode scsw is
397 * valid, zero otherwise. 397 * valid, zero otherwise.
398 */ 398 */
399static inline int scsw_cmd_is_valid_sctl(union scsw *scsw) 399static inline int scsw_cmd_is_valid_sctl(union scsw *scsw)
diff --git a/arch/s390/include/asm/setup.h b/arch/s390/include/asm/setup.h
index 2eb0c8a7b664..124154fdfc97 100644
--- a/arch/s390/include/asm/setup.h
+++ b/arch/s390/include/asm/setup.h
@@ -25,7 +25,6 @@
25#define MACHINE_FLAG_DIAG44 _BITUL(6) 25#define MACHINE_FLAG_DIAG44 _BITUL(6)
26#define MACHINE_FLAG_EDAT1 _BITUL(7) 26#define MACHINE_FLAG_EDAT1 _BITUL(7)
27#define MACHINE_FLAG_EDAT2 _BITUL(8) 27#define MACHINE_FLAG_EDAT2 _BITUL(8)
28#define MACHINE_FLAG_LPP _BITUL(9)
29#define MACHINE_FLAG_TOPOLOGY _BITUL(10) 28#define MACHINE_FLAG_TOPOLOGY _BITUL(10)
30#define MACHINE_FLAG_TE _BITUL(11) 29#define MACHINE_FLAG_TE _BITUL(11)
31#define MACHINE_FLAG_TLB_LC _BITUL(12) 30#define MACHINE_FLAG_TLB_LC _BITUL(12)
@@ -66,7 +65,6 @@ extern void detect_memory_memblock(void);
66#define MACHINE_HAS_DIAG44 (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG44) 65#define MACHINE_HAS_DIAG44 (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG44)
67#define MACHINE_HAS_EDAT1 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT1) 66#define MACHINE_HAS_EDAT1 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT1)
68#define MACHINE_HAS_EDAT2 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT2) 67#define MACHINE_HAS_EDAT2 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT2)
69#define MACHINE_HAS_LPP (S390_lowcore.machine_flags & MACHINE_FLAG_LPP)
70#define MACHINE_HAS_TOPOLOGY (S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY) 68#define MACHINE_HAS_TOPOLOGY (S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY)
71#define MACHINE_HAS_TE (S390_lowcore.machine_flags & MACHINE_FLAG_TE) 69#define MACHINE_HAS_TE (S390_lowcore.machine_flags & MACHINE_FLAG_TE)
72#define MACHINE_HAS_TLB_LC (S390_lowcore.machine_flags & MACHINE_FLAG_TLB_LC) 70#define MACHINE_HAS_TLB_LC (S390_lowcore.machine_flags & MACHINE_FLAG_TLB_LC)
diff --git a/arch/s390/include/uapi/asm/dasd.h b/arch/s390/include/uapi/asm/dasd.h
index 451c601406b6..832be5c2584f 100644
--- a/arch/s390/include/uapi/asm/dasd.h
+++ b/arch/s390/include/uapi/asm/dasd.h
@@ -68,25 +68,27 @@ typedef struct dasd_information2_t {
68#define DASD_FORMAT_CDL 2 68#define DASD_FORMAT_CDL 2
69/* 69/*
70 * values to be used for dasd_information_t.features 70 * values to be used for dasd_information_t.features
71 * 0x00: default features 71 * 0x100: default features
72 * 0x01: readonly (ro) 72 * 0x001: readonly (ro)
73 * 0x02: use diag discipline (diag) 73 * 0x002: use diag discipline (diag)
74 * 0x04: set the device initially online (internal use only) 74 * 0x004: set the device initially online (internal use only)
75 * 0x08: enable ERP related logging 75 * 0x008: enable ERP related logging
76 * 0x10: allow I/O to fail on lost paths 76 * 0x010: allow I/O to fail on lost paths
77 * 0x20: allow I/O to fail when a lock was stolen 77 * 0x020: allow I/O to fail when a lock was stolen
78 * 0x40: give access to raw eckd data 78 * 0x040: give access to raw eckd data
79 * 0x80: enable discard support 79 * 0x080: enable discard support
80 * 0x100: enable autodisable for IFCC errors (default)
80 */ 81 */
81#define DASD_FEATURE_DEFAULT 0x00 82#define DASD_FEATURE_READONLY 0x001
82#define DASD_FEATURE_READONLY 0x01 83#define DASD_FEATURE_USEDIAG 0x002
83#define DASD_FEATURE_USEDIAG 0x02 84#define DASD_FEATURE_INITIAL_ONLINE 0x004
84#define DASD_FEATURE_INITIAL_ONLINE 0x04 85#define DASD_FEATURE_ERPLOG 0x008
85#define DASD_FEATURE_ERPLOG 0x08 86#define DASD_FEATURE_FAILFAST 0x010
86#define DASD_FEATURE_FAILFAST 0x10 87#define DASD_FEATURE_FAILONSLCK 0x020
87#define DASD_FEATURE_FAILONSLCK 0x20 88#define DASD_FEATURE_USERAW 0x040
88#define DASD_FEATURE_USERAW 0x40 89#define DASD_FEATURE_DISCARD 0x080
89#define DASD_FEATURE_DISCARD 0x80 90#define DASD_FEATURE_PATH_AUTODISABLE 0x100
91#define DASD_FEATURE_DEFAULT DASD_FEATURE_PATH_AUTODISABLE
90 92
91#define DASD_PARTN_BITS 2 93#define DASD_PARTN_BITS 2
92 94