Skip to content

Commit e3e047e

Browse files
committed
Merge remote-tracking branch 'stable/linux-4.14.y' into rpi-4.14.y
2 parents a2a82c7 + 102b97d commit e3e047e

155 files changed

Lines changed: 1784 additions & 894 deletions

File tree

Some content is hidden

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

‎Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
VERSION = 4
33
PATCHLEVEL = 14
4-
SUBLEVEL = 43
4+
SUBLEVEL = 44
55
EXTRAVERSION =
66
NAME = Petit Gorille
77

‎arch/arm/boot/dts/imx7d-sdb.dts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
enable-active-high;
8383
};
8484

85-
reg_usb_otg2_vbus: regulator-usb-otg1-vbus {
85+
reg_usb_otg2_vbus: regulator-usb-otg2-vbus {
8686
compatible = "regulator-fixed";
8787
regulator-name = "usb_otg2_vbus";
8888
regulator-min-microvolt = <5000000>;

‎arch/s390/crypto/crc32be-vx.S‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*/
1414

1515
#include <linux/linkage.h>
16+
#include <asm/nospec-insn.h>
1617
#include <asm/vx-insn.h>
1718

1819
/* Vector register range containing CRC-32 constants */
@@ -67,6 +68,8 @@
6768

6869
.previous
6970

71+
GEN_BR_THUNK %r14
72+
7073
.text
7174
/*
7275
* The CRC-32 function(s) use these calling conventions:
@@ -203,6 +206,6 @@ ENTRY(crc32_be_vgfm_16)
203206

204207
.Ldone:
205208
VLGVF %r2,%v2,3
206-
br %r14
209+
BR_EX %r14
207210

208211
.previous

‎arch/s390/crypto/crc32le-vx.S‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*/
1515

1616
#include <linux/linkage.h>
17+
#include <asm/nospec-insn.h>
1718
#include <asm/vx-insn.h>
1819

1920
/* Vector register range containing CRC-32 constants */
@@ -76,6 +77,7 @@
7677

7778
.previous
7879

80+
GEN_BR_THUNK %r14
7981

8082
.text
8183

@@ -264,6 +266,6 @@ crc32_le_vgfm_generic:
264266

265267
.Ldone:
266268
VLGVF %r2,%v2,2
267-
br %r14
269+
BR_EX %r14
268270

269271
.previous
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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"
69+
770: \newinstr
70+
771: .popsection
71+
772: \oldinstr
72+
773: alt_len_check 770b, 771b
73+
alt_len_check 772b, 773b
74+
alt_pad ( ( 771b - 770b ) - ( 773b - 772b ) )
75+
774: .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"
88+
770: \newinstr1
89+
771: \newinstr2
90+
772: .popsection
91+
773: \oldinstr
92+
774: 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
100+
775: .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 */
Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef _ASM_S390_NOSPEC_ASM_H
3+
#define _ASM_S390_NOSPEC_ASM_H
4+
5+
#include <asm/alternative-asm.h>
6+
#include <asm/asm-offsets.h>
7+
8+
#ifdef __ASSEMBLY__
9+
10+
#ifdef CONFIG_EXPOLINE
11+
12+
_LC_BR_R1 = __LC_BR_R1
13+
14+
/*
15+
* The expoline macros are used to create thunks in the same format
16+
* as gcc generates them. The 'comdat' section flag makes sure that
17+
* the various thunks are merged into a single copy.
18+
*/
19+
.macro __THUNK_PROLOG_NAME name
20+
.pushsection .text.\name,"axG",@progbits,\name,comdat
21+
.globl \name
22+
.hidden \name
23+
.type \name,@function
24+
\name:
25+
.cfi_startproc
26+
.endm
27+
28+
.macro __THUNK_EPILOG
29+
.cfi_endproc
30+
.popsection
31+
.endm
32+
33+
.macro __THUNK_PROLOG_BR r1,r2
34+
__THUNK_PROLOG_NAME __s390x_indirect_jump_r\r2\()use_r\r1
35+
.endm
36+
37+
.macro __THUNK_PROLOG_BC d0,r1,r2
38+
__THUNK_PROLOG_NAME __s390x_indirect_branch_\d0\()_\r2\()use_\r1
39+
.endm
40+
41+
.macro __THUNK_BR r1,r2
42+
jg __s390x_indirect_jump_r\r2\()use_r\r1
43+
.endm
44+
45+
.macro __THUNK_BC d0,r1,r2
46+
jg __s390x_indirect_branch_\d0\()_\r2\()use_\r1
47+
.endm
48+
49+
.macro __THUNK_BRASL r1,r2,r3
50+
brasl \r1,__s390x_indirect_jump_r\r3\()use_r\r2
51+
.endm
52+
53+
.macro __DECODE_RR expand,reg,ruse
54+
.set __decode_fail,1
55+
.irp r1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
56+
.ifc \reg,%r\r1
57+
.irp r2,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
58+
.ifc \ruse,%r\r2
59+
\expand \r1,\r2
60+
.set __decode_fail,0
61+
.endif
62+
.endr
63+
.endif
64+
.endr
65+
.if __decode_fail == 1
66+
.error "__DECODE_RR failed"
67+
.endif
68+
.endm
69+
70+
.macro __DECODE_RRR expand,rsave,rtarget,ruse
71+
.set __decode_fail,1
72+
.irp r1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
73+
.ifc \rsave,%r\r1
74+
.irp r2,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
75+
.ifc \rtarget,%r\r2
76+
.irp r3,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
77+
.ifc \ruse,%r\r3
78+
\expand \r1,\r2,\r3
79+
.set __decode_fail,0
80+
.endif
81+
.endr
82+
.endif
83+
.endr
84+
.endif
85+
.endr
86+
.if __decode_fail == 1
87+
.error "__DECODE_RRR failed"
88+
.endif
89+
.endm
90+
91+
.macro __DECODE_DRR expand,disp,reg,ruse
92+
.set __decode_fail,1
93+
.irp r1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
94+
.ifc \reg,%r\r1
95+
.irp r2,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
96+
.ifc \ruse,%r\r2
97+
\expand \disp,\r1,\r2
98+
.set __decode_fail,0
99+
.endif
100+
.endr
101+
.endif
102+
.endr
103+
.if __decode_fail == 1
104+
.error "__DECODE_DRR failed"
105+
.endif
106+
.endm
107+
108+
.macro __THUNK_EX_BR reg,ruse
109+
# Be very careful when adding instructions to this macro!
110+
# The ALTERNATIVE replacement code has a .+10 which targets
111+
# the "br \reg" after the code has been patched.
112+
#ifdef CONFIG_HAVE_MARCH_Z10_FEATURES
113+
exrl 0,555f
114+
j .
115+
#else
116+
.ifc \reg,%r1
117+
ALTERNATIVE "ex %r0,_LC_BR_R1", ".insn ril,0xc60000000000,0,.+10", 35
118+
j .
119+
.else
120+
larl \ruse,555f
121+
ex 0,0(\ruse)
122+
j .
123+
.endif
124+
#endif
125+
555: br \reg
126+
.endm
127+
128+
.macro __THUNK_EX_BC disp,reg,ruse
129+
#ifdef CONFIG_HAVE_MARCH_Z10_FEATURES
130+
exrl 0,556f
131+
j .
132+
#else
133+
larl \ruse,556f
134+
ex 0,0(\ruse)
135+
j .
136+
#endif
137+
556: b \disp(\reg)
138+
.endm
139+
140+
.macro GEN_BR_THUNK reg,ruse=%r1
141+
__DECODE_RR __THUNK_PROLOG_BR,\reg,\ruse
142+
__THUNK_EX_BR \reg,\ruse
143+
__THUNK_EPILOG
144+
.endm
145+
146+
.macro GEN_B_THUNK disp,reg,ruse=%r1
147+
__DECODE_DRR __THUNK_PROLOG_BC,\disp,\reg,\ruse
148+
__THUNK_EX_BC \disp,\reg,\ruse
149+
__THUNK_EPILOG
150+
.endm
151+
152+
.macro BR_EX reg,ruse=%r1
153+
557: __DECODE_RR __THUNK_BR,\reg,\ruse
154+
.pushsection .s390_indirect_branches,"a",@progbits
155+
.long 557b-.
156+
.popsection
157+
.endm
158+
159+
.macro B_EX disp,reg,ruse=%r1
160+
558: __DECODE_DRR __THUNK_BC,\disp,\reg,\ruse
161+
.pushsection .s390_indirect_branches,"a",@progbits
162+
.long 558b-.
163+
.popsection
164+
.endm
165+
166+
.macro BASR_EX rsave,rtarget,ruse=%r1
167+
559: __DECODE_RRR __THUNK_BRASL,\rsave,\rtarget,\ruse
168+
.pushsection .s390_indirect_branches,"a",@progbits
169+
.long 559b-.
170+
.popsection
171+
.endm
172+
173+
#else
174+
.macro GEN_BR_THUNK reg,ruse=%r1
175+
.endm
176+
177+
.macro GEN_B_THUNK disp,reg,ruse=%r1
178+
.endm
179+
180+
.macro BR_EX reg,ruse=%r1
181+
br \reg
182+
.endm
183+
184+
.macro B_EX disp,reg,ruse=%r1
185+
b \disp(\reg)
186+
.endm
187+
188+
.macro BASR_EX rsave,rtarget,ruse=%r1
189+
basr \rsave,\rtarget
190+
.endm
191+
#endif
192+
193+
#endif /* __ASSEMBLY__ */
194+
195+
#endif /* _ASM_S390_NOSPEC_ASM_H */

‎arch/s390/kernel/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ obj-y += nospec-branch.o
6363

6464
extra-y += head.o head64.o vmlinux.lds
6565

66+
obj-$(CONFIG_SYSFS) += nospec-sysfs.o
6667
CFLAGS_REMOVE_nospec-branch.o += $(CC_FLAGS_EXPOLINE)
6768

6869
obj-$(CONFIG_MODULES) += module.o

‎arch/s390/kernel/asm-offsets.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ int main(void)
177177
OFFSET(__LC_PREEMPT_COUNT, lowcore, preempt_count);
178178
OFFSET(__LC_GMAP, lowcore, gmap);
179179
OFFSET(__LC_PASTE, lowcore, paste);
180+
OFFSET(__LC_BR_R1, lowcore, br_r1_trampoline);
180181
/* software defined ABI-relevant lowcore locations 0xe00 - 0xe20 */
181182
OFFSET(__LC_DUMP_REIPL, lowcore, ipib);
182183
/* hardware defined lowcore locations 0x1000 - 0x18ff */

0 commit comments

Comments
 (0)