Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.4 commit in: /
Date: Sun, 25 Feb 2018 15:46:34
Message-Id: 1519573574.fffd611ef3a232075303cabed9e60a230583a1a9.mpagano@gentoo
1 commit: fffd611ef3a232075303cabed9e60a230583a1a9
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 25 15:46:14 2018 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 25 15:46:14 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=fffd611e
7
8 Linux patch 4.4.118
9
10 0000_README | 4 +
11 1117_linux-4.4.118.patch | 9661 ++++++++++++++++++++++++++++++++++++++++++++++
12 2 files changed, 9665 insertions(+)
13
14 diff --git a/0000_README b/0000_README
15 index 2d08c4f..94125fa 100644
16 --- a/0000_README
17 +++ b/0000_README
18 @@ -511,6 +511,10 @@ Patch: 1116_linux-4.4.117.patch
19 From: http://www.kernel.org
20 Desc: Linux 4.4.117
21
22 +Patch: 1117_linux-4.4.118.patch
23 +From: http://www.kernel.org
24 +Desc: Linux 4.4.118
25 +
26 Patch: 1500_XATTR_USER_PREFIX.patch
27 From: https://bugs.gentoo.org/show_bug.cgi?id=470644
28 Desc: Support for namespace user.pax.* on tmpfs.
29
30 diff --git a/1117_linux-4.4.118.patch b/1117_linux-4.4.118.patch
31 new file mode 100644
32 index 0000000..6f05ed0
33 --- /dev/null
34 +++ b/1117_linux-4.4.118.patch
35 @@ -0,0 +1,9661 @@
36 +diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
37 +index 22a4688dc0c8..f53ef1ac3122 100644
38 +--- a/Documentation/kernel-parameters.txt
39 ++++ b/Documentation/kernel-parameters.txt
40 +@@ -2565,8 +2565,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
41 + norandmaps Don't use address space randomization. Equivalent to
42 + echo 0 > /proc/sys/kernel/randomize_va_space
43 +
44 +- noreplace-paravirt [X86,IA-64,PV_OPS] Don't patch paravirt_ops
45 +-
46 + noreplace-smp [X86-32,SMP] Don't replace SMP instructions
47 + with UP alternatives
48 +
49 +diff --git a/Documentation/speculation.txt b/Documentation/speculation.txt
50 +new file mode 100644
51 +index 000000000000..e9e6cbae2841
52 +--- /dev/null
53 ++++ b/Documentation/speculation.txt
54 +@@ -0,0 +1,90 @@
55 ++This document explains potential effects of speculation, and how undesirable
56 ++effects can be mitigated portably using common APIs.
57 ++
58 ++===========
59 ++Speculation
60 ++===========
61 ++
62 ++To improve performance and minimize average latencies, many contemporary CPUs
63 ++employ speculative execution techniques such as branch prediction, performing
64 ++work which may be discarded at a later stage.
65 ++
66 ++Typically speculative execution cannot be observed from architectural state,
67 ++such as the contents of registers. However, in some cases it is possible to
68 ++observe its impact on microarchitectural state, such as the presence or
69 ++absence of data in caches. Such state may form side-channels which can be
70 ++observed to extract secret information.
71 ++
72 ++For example, in the presence of branch prediction, it is possible for bounds
73 ++checks to be ignored by code which is speculatively executed. Consider the
74 ++following code:
75 ++
76 ++ int load_array(int *array, unsigned int index)
77 ++ {
78 ++ if (index >= MAX_ARRAY_ELEMS)
79 ++ return 0;
80 ++ else
81 ++ return array[index];
82 ++ }
83 ++
84 ++Which, on arm64, may be compiled to an assembly sequence such as:
85 ++
86 ++ CMP <index>, #MAX_ARRAY_ELEMS
87 ++ B.LT less
88 ++ MOV <returnval>, #0
89 ++ RET
90 ++ less:
91 ++ LDR <returnval>, [<array>, <index>]
92 ++ RET
93 ++
94 ++It is possible that a CPU mis-predicts the conditional branch, and
95 ++speculatively loads array[index], even if index >= MAX_ARRAY_ELEMS. This
96 ++value will subsequently be discarded, but the speculated load may affect
97 ++microarchitectural state which can be subsequently measured.
98 ++
99 ++More complex sequences involving multiple dependent memory accesses may
100 ++result in sensitive information being leaked. Consider the following
101 ++code, building on the prior example:
102 ++
103 ++ int load_dependent_arrays(int *arr1, int *arr2, int index)
104 ++ {
105 ++ int val1, val2,
106 ++
107 ++ val1 = load_array(arr1, index);
108 ++ val2 = load_array(arr2, val1);
109 ++
110 ++ return val2;
111 ++ }
112 ++
113 ++Under speculation, the first call to load_array() may return the value
114 ++of an out-of-bounds address, while the second call will influence
115 ++microarchitectural state dependent on this value. This may provide an
116 ++arbitrary read primitive.
117 ++
118 ++====================================
119 ++Mitigating speculation side-channels
120 ++====================================
121 ++
122 ++The kernel provides a generic API to ensure that bounds checks are
123 ++respected even under speculation. Architectures which are affected by
124 ++speculation-based side-channels are expected to implement these
125 ++primitives.
126 ++
127 ++The array_index_nospec() helper in <linux/nospec.h> can be used to
128 ++prevent information from being leaked via side-channels.
129 ++
130 ++A call to array_index_nospec(index, size) returns a sanitized index
131 ++value that is bounded to [0, size) even under cpu speculation
132 ++conditions.
133 ++
134 ++This can be used to protect the earlier load_array() example:
135 ++
136 ++ int load_array(int *array, unsigned int index)
137 ++ {
138 ++ if (index >= MAX_ARRAY_ELEMS)
139 ++ return 0;
140 ++ else {
141 ++ index = array_index_nospec(index, MAX_ARRAY_ELEMS);
142 ++ return array[index];
143 ++ }
144 ++ }
145 +diff --git a/Makefile b/Makefile
146 +index 9f53ba1835ad..1e01148744f3 100644
147 +--- a/Makefile
148 ++++ b/Makefile
149 +@@ -1,6 +1,6 @@
150 + VERSION = 4
151 + PATCHLEVEL = 4
152 +-SUBLEVEL = 117
153 ++SUBLEVEL = 118
154 + EXTRAVERSION =
155 + NAME = Blurry Fish Butt
156 +
157 +@@ -87,10 +87,12 @@ endif
158 + ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4
159 + ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
160 + quiet=silent_
161 ++ tools_silent=s
162 + endif
163 + else # make-3.8x
164 + ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
165 + quiet=silent_
166 ++ tools_silent=-s
167 + endif
168 + endif
169 +
170 +@@ -1523,11 +1525,11 @@ image_name:
171 + # Clear a bunch of variables before executing the submake
172 + tools/: FORCE
173 + $(Q)mkdir -p $(objtree)/tools
174 +- $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(shell cd $(objtree) && /bin/pwd) subdir=tools -C $(src)/tools/
175 ++ $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(shell cd $(objtree) && /bin/pwd) subdir=tools -C $(src)/tools/
176 +
177 + tools/%: FORCE
178 + $(Q)mkdir -p $(objtree)/tools
179 +- $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(shell cd $(objtree) && /bin/pwd) subdir=tools -C $(src)/tools/ $*
180 ++ $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(shell cd $(objtree) && /bin/pwd) subdir=tools -C $(src)/tools/ $*
181 +
182 + # Single targets
183 + # ---------------------------------------------------------------------------
184 +diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi
185 +index de8791a4d131..3ef1d5a26389 100644
186 +--- a/arch/arm/boot/dts/am4372.dtsi
187 ++++ b/arch/arm/boot/dts/am4372.dtsi
188 +@@ -807,7 +807,8 @@
189 + reg = <0x48038000 0x2000>,
190 + <0x46000000 0x400000>;
191 + reg-names = "mpu", "dat";
192 +- interrupts = <80>, <81>;
193 ++ interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>,
194 ++ <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>;
195 + interrupt-names = "tx", "rx";
196 + status = "disabled";
197 + dmas = <&edma 8>,
198 +@@ -821,7 +822,8 @@
199 + reg = <0x4803C000 0x2000>,
200 + <0x46400000 0x400000>;
201 + reg-names = "mpu", "dat";
202 +- interrupts = <82>, <83>;
203 ++ interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>,
204 ++ <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>;
205 + interrupt-names = "tx", "rx";
206 + status = "disabled";
207 + dmas = <&edma 10>,
208 +diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
209 +index 5a206c100ce2..8a5628c4b135 100644
210 +--- a/arch/arm/boot/dts/omap4.dtsi
211 ++++ b/arch/arm/boot/dts/omap4.dtsi
212 +@@ -844,14 +844,12 @@
213 + usbhsohci: ohci@4a064800 {
214 + compatible = "ti,ohci-omap3";
215 + reg = <0x4a064800 0x400>;
216 +- interrupt-parent = <&gic>;
217 + interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
218 + };
219 +
220 + usbhsehci: ehci@4a064c00 {
221 + compatible = "ti,ehci-omap";
222 + reg = <0x4a064c00 0x400>;
223 +- interrupt-parent = <&gic>;
224 + interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
225 + };
226 + };
227 +diff --git a/arch/arm/mach-omap2/omap-secure.c b/arch/arm/mach-omap2/omap-secure.c
228 +index 5ac122e88f67..9ff92050053c 100644
229 +--- a/arch/arm/mach-omap2/omap-secure.c
230 ++++ b/arch/arm/mach-omap2/omap-secure.c
231 +@@ -73,6 +73,25 @@ phys_addr_t omap_secure_ram_mempool_base(void)
232 + return omap_secure_memblock_base;
233 + }
234 +
235 ++u32 omap3_save_secure_ram(void __iomem *addr, int size)
236 ++{
237 ++ u32 ret;
238 ++ u32 param[5];
239 ++
240 ++ if (size != OMAP3_SAVE_SECURE_RAM_SZ)
241 ++ return OMAP3_SAVE_SECURE_RAM_SZ;
242 ++
243 ++ param[0] = 4; /* Number of arguments */
244 ++ param[1] = __pa(addr); /* Physical address for saving */
245 ++ param[2] = 0;
246 ++ param[3] = 1;
247 ++ param[4] = 1;
248 ++
249 ++ ret = save_secure_ram_context(__pa(param));
250 ++
251 ++ return ret;
252 ++}
253 ++
254 + /**
255 + * rx51_secure_dispatcher: Routine to dispatch secure PPA API calls
256 + * @idx: The PPA API index
257 +diff --git a/arch/arm/mach-omap2/omap-secure.h b/arch/arm/mach-omap2/omap-secure.h
258 +index af2851fbcdf0..ab6ce2597a88 100644
259 +--- a/arch/arm/mach-omap2/omap-secure.h
260 ++++ b/arch/arm/mach-omap2/omap-secure.h
261 +@@ -31,6 +31,8 @@
262 + /* Maximum Secure memory storage size */
263 + #define OMAP_SECURE_RAM_STORAGE (88 * SZ_1K)
264 +
265 ++#define OMAP3_SAVE_SECURE_RAM_SZ 0x803F
266 ++
267 + /* Secure low power HAL API index */
268 + #define OMAP4_HAL_SAVESECURERAM_INDEX 0x1a
269 + #define OMAP4_HAL_SAVEHW_INDEX 0x1b
270 +@@ -64,6 +66,8 @@ extern u32 omap_smc2(u32 id, u32 falg, u32 pargs);
271 + extern u32 omap_smc3(u32 id, u32 process, u32 flag, u32 pargs);
272 + extern phys_addr_t omap_secure_ram_mempool_base(void);
273 + extern int omap_secure_ram_reserve_memblock(void);
274 ++extern u32 save_secure_ram_context(u32 args_pa);
275 ++extern u32 omap3_save_secure_ram(void __iomem *save_regs, int size);
276 +
277 + extern u32 rx51_secure_dispatcher(u32 idx, u32 process, u32 flag, u32 nargs,
278 + u32 arg1, u32 arg2, u32 arg3, u32 arg4);
279 +diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
280 +index b668719b9b25..8e30772cfe32 100644
281 +--- a/arch/arm/mach-omap2/pm.h
282 ++++ b/arch/arm/mach-omap2/pm.h
283 +@@ -81,10 +81,6 @@ extern unsigned int omap3_do_wfi_sz;
284 + /* ... and its pointer from SRAM after copy */
285 + extern void (*omap3_do_wfi_sram)(void);
286 +
287 +-/* save_secure_ram_context function pointer and size, for copy to SRAM */
288 +-extern int save_secure_ram_context(u32 *addr);
289 +-extern unsigned int save_secure_ram_context_sz;
290 +-
291 + extern void omap3_save_scratchpad_contents(void);
292 +
293 + #define PM_RTA_ERRATUM_i608 (1 << 0)
294 +diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
295 +index 2dbd3785ee6f..181da202f981 100644
296 +--- a/arch/arm/mach-omap2/pm34xx.c
297 ++++ b/arch/arm/mach-omap2/pm34xx.c
298 +@@ -48,6 +48,7 @@
299 + #include "prm3xxx.h"
300 + #include "pm.h"
301 + #include "sdrc.h"
302 ++#include "omap-secure.h"
303 + #include "sram.h"
304 + #include "control.h"
305 + #include "vc.h"
306 +@@ -66,7 +67,6 @@ struct power_state {
307 +
308 + static LIST_HEAD(pwrst_list);
309 +
310 +-static int (*_omap_save_secure_sram)(u32 *addr);
311 + void (*omap3_do_wfi_sram)(void);
312 +
313 + static struct powerdomain *mpu_pwrdm, *neon_pwrdm;
314 +@@ -121,8 +121,8 @@ static void omap3_save_secure_ram_context(void)
315 + * will hang the system.
316 + */
317 + pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON);
318 +- ret = _omap_save_secure_sram((u32 *)(unsigned long)
319 +- __pa(omap3_secure_ram_storage));
320 ++ ret = omap3_save_secure_ram(omap3_secure_ram_storage,
321 ++ OMAP3_SAVE_SECURE_RAM_SZ);
322 + pwrdm_set_next_pwrst(mpu_pwrdm, mpu_next_state);
323 + /* Following is for error tracking, it should not happen */
324 + if (ret) {
325 +@@ -431,15 +431,10 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)
326 + *
327 + * The minimum set of functions is pushed to SRAM for execution:
328 + * - omap3_do_wfi for erratum i581 WA,
329 +- * - save_secure_ram_context for security extensions.
330 + */
331 + void omap_push_sram_idle(void)
332 + {
333 + omap3_do_wfi_sram = omap_sram_push(omap3_do_wfi, omap3_do_wfi_sz);
334 +-
335 +- if (omap_type() != OMAP2_DEVICE_TYPE_GP)
336 +- _omap_save_secure_sram = omap_sram_push(save_secure_ram_context,
337 +- save_secure_ram_context_sz);
338 + }
339 +
340 + static void __init pm_errata_configure(void)
341 +@@ -551,7 +546,7 @@ int __init omap3_pm_init(void)
342 + clkdm_add_wkdep(neon_clkdm, mpu_clkdm);
343 + if (omap_type() != OMAP2_DEVICE_TYPE_GP) {
344 + omap3_secure_ram_storage =
345 +- kmalloc(0x803F, GFP_KERNEL);
346 ++ kmalloc(OMAP3_SAVE_SECURE_RAM_SZ, GFP_KERNEL);
347 + if (!omap3_secure_ram_storage)
348 + pr_err("Memory allocation failed when allocating for secure sram context\n");
349 +
350 +diff --git a/arch/arm/mach-omap2/prm33xx.c b/arch/arm/mach-omap2/prm33xx.c
351 +index dcb5001d77da..973bcd754e1c 100644
352 +--- a/arch/arm/mach-omap2/prm33xx.c
353 ++++ b/arch/arm/mach-omap2/prm33xx.c
354 +@@ -176,17 +176,6 @@ static int am33xx_pwrdm_read_pwrst(struct powerdomain *pwrdm)
355 + return v;
356 + }
357 +
358 +-static int am33xx_pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
359 +-{
360 +- u32 v;
361 +-
362 +- v = am33xx_prm_read_reg(pwrdm->prcm_offs, pwrdm->pwrstst_offs);
363 +- v &= AM33XX_LASTPOWERSTATEENTERED_MASK;
364 +- v >>= AM33XX_LASTPOWERSTATEENTERED_SHIFT;
365 +-
366 +- return v;
367 +-}
368 +-
369 + static int am33xx_pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm)
370 + {
371 + am33xx_prm_rmw_reg_bits(AM33XX_LOWPOWERSTATECHANGE_MASK,
372 +@@ -357,7 +346,6 @@ struct pwrdm_ops am33xx_pwrdm_operations = {
373 + .pwrdm_set_next_pwrst = am33xx_pwrdm_set_next_pwrst,
374 + .pwrdm_read_next_pwrst = am33xx_pwrdm_read_next_pwrst,
375 + .pwrdm_read_pwrst = am33xx_pwrdm_read_pwrst,
376 +- .pwrdm_read_prev_pwrst = am33xx_pwrdm_read_prev_pwrst,
377 + .pwrdm_set_logic_retst = am33xx_pwrdm_set_logic_retst,
378 + .pwrdm_read_logic_pwrst = am33xx_pwrdm_read_logic_pwrst,
379 + .pwrdm_read_logic_retst = am33xx_pwrdm_read_logic_retst,
380 +diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S
381 +index 1b9f0520dea9..3e0d802c59da 100644
382 +--- a/arch/arm/mach-omap2/sleep34xx.S
383 ++++ b/arch/arm/mach-omap2/sleep34xx.S
384 +@@ -93,20 +93,13 @@ ENTRY(enable_omap3630_toggle_l2_on_restore)
385 + ENDPROC(enable_omap3630_toggle_l2_on_restore)
386 +
387 + /*
388 +- * Function to call rom code to save secure ram context. This gets
389 +- * relocated to SRAM, so it can be all in .data section. Otherwise
390 +- * we need to initialize api_params separately.
391 ++ * Function to call rom code to save secure ram context.
392 ++ *
393 ++ * r0 = physical address of the parameters
394 + */
395 +- .data
396 +- .align 3
397 + ENTRY(save_secure_ram_context)
398 + stmfd sp!, {r4 - r11, lr} @ save registers on stack
399 +- adr r3, api_params @ r3 points to parameters
400 +- str r0, [r3,#0x4] @ r0 has sdram address
401 +- ldr r12, high_mask
402 +- and r3, r3, r12
403 +- ldr r12, sram_phy_addr_mask
404 +- orr r3, r3, r12
405 ++ mov r3, r0 @ physical address of parameters
406 + mov r0, #25 @ set service ID for PPA
407 + mov r12, r0 @ copy secure service ID in r12
408 + mov r1, #0 @ set task id for ROM code in r1
409 +@@ -120,18 +113,7 @@ ENTRY(save_secure_ram_context)
410 + nop
411 + nop
412 + ldmfd sp!, {r4 - r11, pc}
413 +- .align
414 +-sram_phy_addr_mask:
415 +- .word SRAM_BASE_P
416 +-high_mask:
417 +- .word 0xffff
418 +-api_params:
419 +- .word 0x4, 0x0, 0x0, 0x1, 0x1
420 + ENDPROC(save_secure_ram_context)
421 +-ENTRY(save_secure_ram_context_sz)
422 +- .word . - save_secure_ram_context
423 +-
424 +- .text
425 +
426 + /*
427 + * ======================
428 +diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
429 +index 0fa4c5f8b1be..2d43357d4a0a 100644
430 +--- a/arch/arm/mach-tegra/Kconfig
431 ++++ b/arch/arm/mach-tegra/Kconfig
432 +@@ -12,8 +12,6 @@ menuconfig ARCH_TEGRA
433 + select ARCH_HAS_RESET_CONTROLLER
434 + select RESET_CONTROLLER
435 + select SOC_BUS
436 +- select USB_ULPI if USB_PHY
437 +- select USB_ULPI_VIEWPORT if USB_PHY
438 + help
439 + This enables support for NVIDIA Tegra based systems.
440 +
441 +diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
442 +index 83af36d9439f..02c08671553e 100644
443 +--- a/arch/arm64/Kconfig
444 ++++ b/arch/arm64/Kconfig
445 +@@ -785,7 +785,7 @@ source "fs/Kconfig.binfmt"
446 + config COMPAT
447 + bool "Kernel support for 32-bit EL0"
448 + depends on ARM64_4K_PAGES || EXPERT
449 +- select COMPAT_BINFMT_ELF
450 ++ select COMPAT_BINFMT_ELF if BINFMT_ELF
451 + select HAVE_UID16
452 + select OLD_SIGSUSPEND3
453 + select COMPAT_OLD_SIGACTION
454 +diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
455 +index 4043c35962cc..5edb50772c11 100644
456 +--- a/arch/arm64/Kconfig.platforms
457 ++++ b/arch/arm64/Kconfig.platforms
458 +@@ -90,8 +90,6 @@ config ARCH_TEGRA_132_SOC
459 + bool "NVIDIA Tegra132 SoC"
460 + depends on ARCH_TEGRA
461 + select PINCTRL_TEGRA124
462 +- select USB_ULPI if USB_PHY
463 +- select USB_ULPI_VIEWPORT if USB_PHY
464 + help
465 + Enable support for NVIDIA Tegra132 SoC, based on the Denver
466 + ARMv8 CPU. The Tegra132 SoC is similar to the Tegra124 SoC,
467 +diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
468 +index 4dd5f93d0303..7f42b646d528 100644
469 +--- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi
470 ++++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
471 +@@ -54,6 +54,7 @@
472 + reg = <0x000>;
473 + enable-method = "psci";
474 + cpu-idle-states = <&CPU_SLEEP_0>;
475 ++ #cooling-cells = <2>;
476 + };
477 +
478 + cpu1: cpu@1 {
479 +@@ -70,6 +71,7 @@
480 + reg = <0x100>;
481 + enable-method = "psci";
482 + cpu-idle-states = <&CPU_SLEEP_0>;
483 ++ #cooling-cells = <2>;
484 + };
485 +
486 + cpu3: cpu@101 {
487 +diff --git a/arch/arm64/include/asm/bug.h b/arch/arm64/include/asm/bug.h
488 +index 4a748ce9ba1a..ac6382b25add 100644
489 +--- a/arch/arm64/include/asm/bug.h
490 ++++ b/arch/arm64/include/asm/bug.h
491 +@@ -20,9 +20,6 @@
492 +
493 + #include <asm/debug-monitors.h>
494 +
495 +-#ifdef CONFIG_GENERIC_BUG
496 +-#define HAVE_ARCH_BUG
497 +-
498 + #ifdef CONFIG_DEBUG_BUGVERBOSE
499 + #define _BUGVERBOSE_LOCATION(file, line) __BUGVERBOSE_LOCATION(file, line)
500 + #define __BUGVERBOSE_LOCATION(file, line) \
501 +@@ -36,28 +33,36 @@
502 + #define _BUGVERBOSE_LOCATION(file, line)
503 + #endif
504 +
505 +-#define _BUG_FLAGS(flags) __BUG_FLAGS(flags)
506 ++#ifdef CONFIG_GENERIC_BUG
507 +
508 +-#define __BUG_FLAGS(flags) asm volatile ( \
509 ++#define __BUG_ENTRY(flags) \
510 + ".pushsection __bug_table,\"a\"\n\t" \
511 + ".align 2\n\t" \
512 + "0: .long 1f - 0b\n\t" \
513 + _BUGVERBOSE_LOCATION(__FILE__, __LINE__) \
514 + ".short " #flags "\n\t" \
515 + ".popsection\n" \
516 +- \
517 +- "1: brk %[imm]" \
518 +- :: [imm] "i" (BUG_BRK_IMM) \
519 +-)
520 ++ "1: "
521 ++#else
522 ++#define __BUG_ENTRY(flags) ""
523 ++#endif
524 ++
525 ++#define __BUG_FLAGS(flags) \
526 ++ asm volatile ( \
527 ++ __BUG_ENTRY(flags) \
528 ++ "brk %[imm]" :: [imm] "i" (BUG_BRK_IMM) \
529 ++ );
530 +
531 +-#define BUG() do { \
532 +- _BUG_FLAGS(0); \
533 +- unreachable(); \
534 ++
535 ++#define BUG() do { \
536 ++ __BUG_FLAGS(0); \
537 ++ unreachable(); \
538 + } while (0)
539 +
540 +-#define __WARN_TAINT(taint) _BUG_FLAGS(BUGFLAG_TAINT(taint))
541 ++#define __WARN_TAINT(taint) \
542 ++ __BUG_FLAGS(BUGFLAG_TAINT(taint))
543 +
544 +-#endif /* ! CONFIG_GENERIC_BUG */
545 ++#define HAVE_ARCH_BUG
546 +
547 + #include <asm-generic/bug.h>
548 +
549 +diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
550 +index b2ab164a8094..4eba7c00ea1f 100644
551 +--- a/arch/powerpc/perf/core-book3s.c
552 ++++ b/arch/powerpc/perf/core-book3s.c
553 +@@ -1381,7 +1381,7 @@ static int collect_events(struct perf_event *group, int max_count,
554 + int n = 0;
555 + struct perf_event *event;
556 +
557 +- if (!is_software_event(group)) {
558 ++ if (group->pmu->task_ctx_nr == perf_hw_context) {
559 + if (n >= max_count)
560 + return -1;
561 + ctrs[n] = group;
562 +@@ -1389,7 +1389,7 @@ static int collect_events(struct perf_event *group, int max_count,
563 + events[n++] = group->hw.config;
564 + }
565 + list_for_each_entry(event, &group->sibling_list, group_entry) {
566 +- if (!is_software_event(event) &&
567 ++ if (event->pmu->task_ctx_nr == perf_hw_context &&
568 + event->state != PERF_EVENT_STATE_OFF) {
569 + if (n >= max_count)
570 + return -1;
571 +diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
572 +index 2db93042f2f3..bb6aab2fa7f5 100644
573 +--- a/arch/x86/Kconfig
574 ++++ b/arch/x86/Kconfig
575 +@@ -1009,7 +1009,7 @@ config X86_MCE_THRESHOLD
576 + def_bool y
577 +
578 + config X86_MCE_INJECT
579 +- depends on X86_MCE
580 ++ depends on X86_MCE && X86_LOCAL_APIC
581 + tristate "Machine check injector support"
582 + ---help---
583 + Provide support for injecting machine checks for testing purposes.
584 +diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
585 +index 137dfa96aa14..da00fe1f48f4 100644
586 +--- a/arch/x86/Kconfig.debug
587 ++++ b/arch/x86/Kconfig.debug
588 +@@ -391,6 +391,7 @@ config X86_DEBUG_FPU
589 +
590 + config PUNIT_ATOM_DEBUG
591 + tristate "ATOM Punit debug driver"
592 ++ depends on PCI
593 + select DEBUG_FS
594 + select IOSF_MBI
595 + ---help---
596 +diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
597 +index c0cc2a6be0bf..6da2cd0897f3 100644
598 +--- a/arch/x86/boot/Makefile
599 ++++ b/arch/x86/boot/Makefile
600 +@@ -64,12 +64,13 @@ GCOV_PROFILE := n
601 + $(obj)/bzImage: asflags-y := $(SVGA_MODE)
602 +
603 + quiet_cmd_image = BUILD $@
604 ++silent_redirect_image = >/dev/null
605 + cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \
606 +- $(obj)/zoffset.h $@
607 ++ $(obj)/zoffset.h $@ $($(quiet)redirect_image)
608 +
609 + $(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE
610 + $(call if_changed,image)
611 +- @echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
612 ++ @$(kecho) 'Kernel: $@ is ready' ' (#'`cat .version`')'
613 +
614 + OBJCOPYFLAGS_vmlinux.bin := -O binary -R .note -R .comment -S
615 + $(obj)/vmlinux.bin: $(obj)/compressed/vmlinux FORCE
616 +diff --git a/arch/x86/crypto/twofish-x86_64-asm_64-3way.S b/arch/x86/crypto/twofish-x86_64-asm_64-3way.S
617 +index 1c3b7ceb36d2..e7273a606a07 100644
618 +--- a/arch/x86/crypto/twofish-x86_64-asm_64-3way.S
619 ++++ b/arch/x86/crypto/twofish-x86_64-asm_64-3way.S
620 +@@ -55,29 +55,31 @@
621 + #define RAB1bl %bl
622 + #define RAB2bl %cl
623 +
624 ++#define CD0 0x0(%rsp)
625 ++#define CD1 0x8(%rsp)
626 ++#define CD2 0x10(%rsp)
627 ++
628 ++# used only before/after all rounds
629 + #define RCD0 %r8
630 + #define RCD1 %r9
631 + #define RCD2 %r10
632 +
633 +-#define RCD0d %r8d
634 +-#define RCD1d %r9d
635 +-#define RCD2d %r10d
636 +-
637 +-#define RX0 %rbp
638 +-#define RX1 %r11
639 +-#define RX2 %r12
640 ++# used only during rounds
641 ++#define RX0 %r8
642 ++#define RX1 %r9
643 ++#define RX2 %r10
644 +
645 +-#define RX0d %ebp
646 +-#define RX1d %r11d
647 +-#define RX2d %r12d
648 ++#define RX0d %r8d
649 ++#define RX1d %r9d
650 ++#define RX2d %r10d
651 +
652 +-#define RY0 %r13
653 +-#define RY1 %r14
654 +-#define RY2 %r15
655 ++#define RY0 %r11
656 ++#define RY1 %r12
657 ++#define RY2 %r13
658 +
659 +-#define RY0d %r13d
660 +-#define RY1d %r14d
661 +-#define RY2d %r15d
662 ++#define RY0d %r11d
663 ++#define RY1d %r12d
664 ++#define RY2d %r13d
665 +
666 + #define RT0 %rdx
667 + #define RT1 %rsi
668 +@@ -85,6 +87,8 @@
669 + #define RT0d %edx
670 + #define RT1d %esi
671 +
672 ++#define RT1bl %sil
673 ++
674 + #define do16bit_ror(rot, op1, op2, T0, T1, tmp1, tmp2, ab, dst) \
675 + movzbl ab ## bl, tmp2 ## d; \
676 + movzbl ab ## bh, tmp1 ## d; \
677 +@@ -92,6 +96,11 @@
678 + op1##l T0(CTX, tmp2, 4), dst ## d; \
679 + op2##l T1(CTX, tmp1, 4), dst ## d;
680 +
681 ++#define swap_ab_with_cd(ab, cd, tmp) \
682 ++ movq cd, tmp; \
683 ++ movq ab, cd; \
684 ++ movq tmp, ab;
685 ++
686 + /*
687 + * Combined G1 & G2 function. Reordered with help of rotates to have moves
688 + * at begining.
689 +@@ -110,15 +119,15 @@
690 + /* G1,2 && G2,2 */ \
691 + do16bit_ror(32, xor, xor, Tx2, Tx3, RT0, RT1, ab ## 0, x ## 0); \
692 + do16bit_ror(16, xor, xor, Ty3, Ty0, RT0, RT1, ab ## 0, y ## 0); \
693 +- xchgq cd ## 0, ab ## 0; \
694 ++ swap_ab_with_cd(ab ## 0, cd ## 0, RT0); \
695 + \
696 + do16bit_ror(32, xor, xor, Tx2, Tx3, RT0, RT1, ab ## 1, x ## 1); \
697 + do16bit_ror(16, xor, xor, Ty3, Ty0, RT0, RT1, ab ## 1, y ## 1); \
698 +- xchgq cd ## 1, ab ## 1; \
699 ++ swap_ab_with_cd(ab ## 1, cd ## 1, RT0); \
700 + \
701 + do16bit_ror(32, xor, xor, Tx2, Tx3, RT0, RT1, ab ## 2, x ## 2); \
702 + do16bit_ror(16, xor, xor, Ty3, Ty0, RT0, RT1, ab ## 2, y ## 2); \
703 +- xchgq cd ## 2, ab ## 2;
704 ++ swap_ab_with_cd(ab ## 2, cd ## 2, RT0);
705 +
706 + #define enc_round_end(ab, x, y, n) \
707 + addl y ## d, x ## d; \
708 +@@ -168,6 +177,16 @@
709 + decrypt_round3(ba, dc, (n*2)+1); \
710 + decrypt_round3(ba, dc, (n*2));
711 +
712 ++#define push_cd() \
713 ++ pushq RCD2; \
714 ++ pushq RCD1; \
715 ++ pushq RCD0;
716 ++
717 ++#define pop_cd() \
718 ++ popq RCD0; \
719 ++ popq RCD1; \
720 ++ popq RCD2;
721 ++
722 + #define inpack3(in, n, xy, m) \
723 + movq 4*(n)(in), xy ## 0; \
724 + xorq w+4*m(CTX), xy ## 0; \
725 +@@ -223,11 +242,8 @@ ENTRY(__twofish_enc_blk_3way)
726 + * %rdx: src, RIO
727 + * %rcx: bool, if true: xor output
728 + */
729 +- pushq %r15;
730 +- pushq %r14;
731 + pushq %r13;
732 + pushq %r12;
733 +- pushq %rbp;
734 + pushq %rbx;
735 +
736 + pushq %rcx; /* bool xor */
737 +@@ -235,40 +251,36 @@ ENTRY(__twofish_enc_blk_3way)
738 +
739 + inpack_enc3();
740 +
741 +- encrypt_cycle3(RAB, RCD, 0);
742 +- encrypt_cycle3(RAB, RCD, 1);
743 +- encrypt_cycle3(RAB, RCD, 2);
744 +- encrypt_cycle3(RAB, RCD, 3);
745 +- encrypt_cycle3(RAB, RCD, 4);
746 +- encrypt_cycle3(RAB, RCD, 5);
747 +- encrypt_cycle3(RAB, RCD, 6);
748 +- encrypt_cycle3(RAB, RCD, 7);
749 ++ push_cd();
750 ++ encrypt_cycle3(RAB, CD, 0);
751 ++ encrypt_cycle3(RAB, CD, 1);
752 ++ encrypt_cycle3(RAB, CD, 2);
753 ++ encrypt_cycle3(RAB, CD, 3);
754 ++ encrypt_cycle3(RAB, CD, 4);
755 ++ encrypt_cycle3(RAB, CD, 5);
756 ++ encrypt_cycle3(RAB, CD, 6);
757 ++ encrypt_cycle3(RAB, CD, 7);
758 ++ pop_cd();
759 +
760 + popq RIO; /* dst */
761 +- popq %rbp; /* bool xor */
762 ++ popq RT1; /* bool xor */
763 +
764 +- testb %bpl, %bpl;
765 ++ testb RT1bl, RT1bl;
766 + jnz .L__enc_xor3;
767 +
768 + outunpack_enc3(mov);
769 +
770 + popq %rbx;
771 +- popq %rbp;
772 + popq %r12;
773 + popq %r13;
774 +- popq %r14;
775 +- popq %r15;
776 + ret;
777 +
778 + .L__enc_xor3:
779 + outunpack_enc3(xor);
780 +
781 + popq %rbx;
782 +- popq %rbp;
783 + popq %r12;
784 + popq %r13;
785 +- popq %r14;
786 +- popq %r15;
787 + ret;
788 + ENDPROC(__twofish_enc_blk_3way)
789 +
790 +@@ -278,35 +290,31 @@ ENTRY(twofish_dec_blk_3way)
791 + * %rsi: dst
792 + * %rdx: src, RIO
793 + */
794 +- pushq %r15;
795 +- pushq %r14;
796 + pushq %r13;
797 + pushq %r12;
798 +- pushq %rbp;
799 + pushq %rbx;
800 +
801 + pushq %rsi; /* dst */
802 +
803 + inpack_dec3();
804 +
805 +- decrypt_cycle3(RAB, RCD, 7);
806 +- decrypt_cycle3(RAB, RCD, 6);
807 +- decrypt_cycle3(RAB, RCD, 5);
808 +- decrypt_cycle3(RAB, RCD, 4);
809 +- decrypt_cycle3(RAB, RCD, 3);
810 +- decrypt_cycle3(RAB, RCD, 2);
811 +- decrypt_cycle3(RAB, RCD, 1);
812 +- decrypt_cycle3(RAB, RCD, 0);
813 ++ push_cd();
814 ++ decrypt_cycle3(RAB, CD, 7);
815 ++ decrypt_cycle3(RAB, CD, 6);
816 ++ decrypt_cycle3(RAB, CD, 5);
817 ++ decrypt_cycle3(RAB, CD, 4);
818 ++ decrypt_cycle3(RAB, CD, 3);
819 ++ decrypt_cycle3(RAB, CD, 2);
820 ++ decrypt_cycle3(RAB, CD, 1);
821 ++ decrypt_cycle3(RAB, CD, 0);
822 ++ pop_cd();
823 +
824 + popq RIO; /* dst */
825 +
826 + outunpack_dec3();
827 +
828 + popq %rbx;
829 +- popq %rbp;
830 + popq %r12;
831 + popq %r13;
832 +- popq %r14;
833 +- popq %r15;
834 + ret;
835 + ENDPROC(twofish_dec_blk_3way)
836 +diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c
837 +index 1a4477cedc49..b5eb1cca70a0 100644
838 +--- a/arch/x86/entry/common.c
839 ++++ b/arch/x86/entry/common.c
840 +@@ -20,6 +20,7 @@
841 + #include <linux/export.h>
842 + #include <linux/context_tracking.h>
843 + #include <linux/user-return-notifier.h>
844 ++#include <linux/nospec.h>
845 + #include <linux/uprobes.h>
846 +
847 + #include <asm/desc.h>
848 +@@ -381,6 +382,7 @@ __always_inline void do_syscall_32_irqs_on(struct pt_regs *regs)
849 + }
850 +
851 + if (likely(nr < IA32_NR_syscalls)) {
852 ++ nr = array_index_nospec(nr, IA32_NR_syscalls);
853 + /*
854 + * It's possible that a 32-bit syscall implementation
855 + * takes a 64-bit parameter but nonetheless assumes that
856 +diff --git a/arch/x86/include/asm/asm-prototypes.h b/arch/x86/include/asm/asm-prototypes.h
857 +index b15aa4083dfd..5a25ada75aeb 100644
858 +--- a/arch/x86/include/asm/asm-prototypes.h
859 ++++ b/arch/x86/include/asm/asm-prototypes.h
860 +@@ -37,5 +37,4 @@ INDIRECT_THUNK(dx)
861 + INDIRECT_THUNK(si)
862 + INDIRECT_THUNK(di)
863 + INDIRECT_THUNK(bp)
864 +-INDIRECT_THUNK(sp)
865 + #endif /* CONFIG_RETPOLINE */
866 +diff --git a/arch/x86/include/asm/barrier.h b/arch/x86/include/asm/barrier.h
867 +index 0681d2532527..814ef83c6720 100644
868 +--- a/arch/x86/include/asm/barrier.h
869 ++++ b/arch/x86/include/asm/barrier.h
870 +@@ -24,6 +24,34 @@
871 + #define wmb() asm volatile("sfence" ::: "memory")
872 + #endif
873 +
874 ++/**
875 ++ * array_index_mask_nospec() - generate a mask that is ~0UL when the
876 ++ * bounds check succeeds and 0 otherwise
877 ++ * @index: array element index
878 ++ * @size: number of elements in array
879 ++ *
880 ++ * Returns:
881 ++ * 0 - (index < size)
882 ++ */
883 ++static inline unsigned long array_index_mask_nospec(unsigned long index,
884 ++ unsigned long size)
885 ++{
886 ++ unsigned long mask;
887 ++
888 ++ asm ("cmp %1,%2; sbb %0,%0;"
889 ++ :"=r" (mask)
890 ++ :"r"(size),"r" (index)
891 ++ :"cc");
892 ++ return mask;
893 ++}
894 ++
895 ++/* Override the default implementation from linux/nospec.h. */
896 ++#define array_index_mask_nospec array_index_mask_nospec
897 ++
898 ++/* Prevent speculative execution past this barrier. */
899 ++#define barrier_nospec() alternative_2("", "mfence", X86_FEATURE_MFENCE_RDTSC, \
900 ++ "lfence", X86_FEATURE_LFENCE_RDTSC)
901 ++
902 + #ifdef CONFIG_X86_PPRO_FENCE
903 + #define dma_rmb() rmb()
904 + #else
905 +diff --git a/arch/x86/include/asm/microcode_amd.h b/arch/x86/include/asm/microcode_amd.h
906 +index adfc847a395e..fb163f02ebb1 100644
907 +--- a/arch/x86/include/asm/microcode_amd.h
908 ++++ b/arch/x86/include/asm/microcode_amd.h
909 +@@ -59,7 +59,6 @@ static inline u16 find_equiv_id(struct equiv_cpu_entry *equiv_cpu_table,
910 +
911 + extern int __apply_microcode_amd(struct microcode_amd *mc_amd);
912 + extern int apply_microcode_amd(int cpu);
913 +-extern enum ucode_state load_microcode_amd(int cpu, u8 family, const u8 *data, size_t size);
914 +
915 + #define PATCH_MAX_SIZE PAGE_SIZE
916 + extern u8 amd_ucode_patch[PATCH_MAX_SIZE];
917 +diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h
918 +index 77d8b284e4a7..5a10ac8c131e 100644
919 +--- a/arch/x86/include/asm/msr.h
920 ++++ b/arch/x86/include/asm/msr.h
921 +@@ -147,8 +147,7 @@ static __always_inline unsigned long long rdtsc_ordered(void)
922 + * that some other imaginary CPU is updating continuously with a
923 + * time stamp.
924 + */
925 +- alternative_2("", "mfence", X86_FEATURE_MFENCE_RDTSC,
926 +- "lfence", X86_FEATURE_LFENCE_RDTSC);
927 ++ barrier_nospec();
928 + return rdtsc();
929 + }
930 +
931 +diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h
932 +index 492370b9b35b..66094a0473a8 100644
933 +--- a/arch/x86/include/asm/nospec-branch.h
934 ++++ b/arch/x86/include/asm/nospec-branch.h
935 +@@ -1,7 +1,7 @@
936 + /* SPDX-License-Identifier: GPL-2.0 */
937 +
938 +-#ifndef __NOSPEC_BRANCH_H__
939 +-#define __NOSPEC_BRANCH_H__
940 ++#ifndef _ASM_X86_NOSPEC_BRANCH_H_
941 ++#define _ASM_X86_NOSPEC_BRANCH_H_
942 +
943 + #include <asm/alternative.h>
944 + #include <asm/alternative-asm.h>
945 +@@ -178,7 +178,7 @@ extern char __indirect_thunk_end[];
946 + * On VMEXIT we must ensure that no RSB predictions learned in the guest
947 + * can be followed in the host, by overwriting the RSB completely. Both
948 + * retpoline and IBRS mitigations for Spectre v2 need this; only on future
949 +- * CPUs with IBRS_ATT *might* it be avoided.
950 ++ * CPUs with IBRS_ALL *might* it be avoided.
951 + */
952 + static inline void vmexit_fill_RSB(void)
953 + {
954 +@@ -195,4 +195,4 @@ static inline void vmexit_fill_RSB(void)
955 + }
956 +
957 + #endif /* __ASSEMBLY__ */
958 +-#endif /* __NOSPEC_BRANCH_H__ */
959 ++#endif /* _ASM_X86_NOSPEC_BRANCH_H_ */
960 +diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h
961 +index 14c63c7e8337..6b6e16d813b9 100644
962 +--- a/arch/x86/include/asm/vmx.h
963 ++++ b/arch/x86/include/asm/vmx.h
964 +@@ -400,10 +400,11 @@ enum vmcs_field {
965 + #define IDENTITY_PAGETABLE_PRIVATE_MEMSLOT (KVM_USER_MEM_SLOTS + 2)
966 +
967 + #define VMX_NR_VPIDS (1 << 16)
968 ++#define VMX_VPID_EXTENT_INDIVIDUAL_ADDR 0
969 + #define VMX_VPID_EXTENT_SINGLE_CONTEXT 1
970 + #define VMX_VPID_EXTENT_ALL_CONTEXT 2
971 ++#define VMX_VPID_EXTENT_SINGLE_NON_GLOBAL 3
972 +
973 +-#define VMX_EPT_EXTENT_INDIVIDUAL_ADDR 0
974 + #define VMX_EPT_EXTENT_CONTEXT 1
975 + #define VMX_EPT_EXTENT_GLOBAL 2
976 + #define VMX_EPT_EXTENT_SHIFT 24
977 +@@ -420,8 +421,10 @@ enum vmcs_field {
978 + #define VMX_EPT_EXTENT_GLOBAL_BIT (1ull << 26)
979 +
980 + #define VMX_VPID_INVVPID_BIT (1ull << 0) /* (32 - 32) */
981 ++#define VMX_VPID_EXTENT_INDIVIDUAL_ADDR_BIT (1ull << 8) /* (40 - 32) */
982 + #define VMX_VPID_EXTENT_SINGLE_CONTEXT_BIT (1ull << 9) /* (41 - 32) */
983 + #define VMX_VPID_EXTENT_GLOBAL_CONTEXT_BIT (1ull << 10) /* (42 - 32) */
984 ++#define VMX_VPID_EXTENT_SINGLE_NON_GLOBAL_BIT (1ull << 11) /* (43 - 32) */
985 +
986 + #define VMX_EPT_DEFAULT_GAW 3
987 + #define VMX_EPT_MAX_GAW 0x4
988 +diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
989 +index d6f375f1b928..89829c3d5a74 100644
990 +--- a/arch/x86/kernel/alternative.c
991 ++++ b/arch/x86/kernel/alternative.c
992 +@@ -45,17 +45,6 @@ static int __init setup_noreplace_smp(char *str)
993 + }
994 + __setup("noreplace-smp", setup_noreplace_smp);
995 +
996 +-#ifdef CONFIG_PARAVIRT
997 +-static int __initdata_or_module noreplace_paravirt = 0;
998 +-
999 +-static int __init setup_noreplace_paravirt(char *str)
1000 +-{
1001 +- noreplace_paravirt = 1;
1002 +- return 1;
1003 +-}
1004 +-__setup("noreplace-paravirt", setup_noreplace_paravirt);
1005 +-#endif
1006 +-
1007 + #define DPRINTK(fmt, args...) \
1008 + do { \
1009 + if (debug_alternative) \
1010 +@@ -587,9 +576,6 @@ void __init_or_module apply_paravirt(struct paravirt_patch_site *start,
1011 + struct paravirt_patch_site *p;
1012 + char insnbuf[MAX_PATCH_LEN];
1013 +
1014 +- if (noreplace_paravirt)
1015 +- return;
1016 +-
1017 + for (p = start; p < end; p++) {
1018 + unsigned int used;
1019 +
1020 +diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
1021 +index 8cacf62ec458..ecaf7c9baf75 100644
1022 +--- a/arch/x86/kernel/cpu/bugs.c
1023 ++++ b/arch/x86/kernel/cpu/bugs.c
1024 +@@ -10,6 +10,7 @@
1025 + #include <linux/init.h>
1026 + #include <linux/utsname.h>
1027 + #include <linux/cpu.h>
1028 ++#include <linux/module.h>
1029 +
1030 + #include <asm/nospec-branch.h>
1031 + #include <asm/cmdline.h>
1032 +@@ -89,20 +90,42 @@ static const char *spectre_v2_strings[] = {
1033 + };
1034 +
1035 + #undef pr_fmt
1036 +-#define pr_fmt(fmt) "Spectre V2 mitigation: " fmt
1037 ++#define pr_fmt(fmt) "Spectre V2 : " fmt
1038 +
1039 + static enum spectre_v2_mitigation spectre_v2_enabled = SPECTRE_V2_NONE;
1040 +
1041 ++
1042 ++#ifdef RETPOLINE
1043 ++static bool spectre_v2_bad_module;
1044 ++
1045 ++bool retpoline_module_ok(bool has_retpoline)
1046 ++{
1047 ++ if (spectre_v2_enabled == SPECTRE_V2_NONE || has_retpoline)
1048 ++ return true;
1049 ++
1050 ++ pr_err("System may be vulnerable to spectre v2\n");
1051 ++ spectre_v2_bad_module = true;
1052 ++ return false;
1053 ++}
1054 ++
1055 ++static inline const char *spectre_v2_module_string(void)
1056 ++{
1057 ++ return spectre_v2_bad_module ? " - vulnerable module loaded" : "";
1058 ++}
1059 ++#else
1060 ++static inline const char *spectre_v2_module_string(void) { return ""; }
1061 ++#endif
1062 ++
1063 + static void __init spec2_print_if_insecure(const char *reason)
1064 + {
1065 + if (boot_cpu_has_bug(X86_BUG_SPECTRE_V2))
1066 +- pr_info("%s\n", reason);
1067 ++ pr_info("%s selected on command line.\n", reason);
1068 + }
1069 +
1070 + static void __init spec2_print_if_secure(const char *reason)
1071 + {
1072 + if (!boot_cpu_has_bug(X86_BUG_SPECTRE_V2))
1073 +- pr_info("%s\n", reason);
1074 ++ pr_info("%s selected on command line.\n", reason);
1075 + }
1076 +
1077 + static inline bool retp_compiler(void)
1078 +@@ -117,42 +140,68 @@ static inline bool match_option(const char *arg, int arglen, const char *opt)
1079 + return len == arglen && !strncmp(arg, opt, len);
1080 + }
1081 +
1082 ++static const struct {
1083 ++ const char *option;
1084 ++ enum spectre_v2_mitigation_cmd cmd;
1085 ++ bool secure;
1086 ++} mitigation_options[] = {
1087 ++ { "off", SPECTRE_V2_CMD_NONE, false },
1088 ++ { "on", SPECTRE_V2_CMD_FORCE, true },
1089 ++ { "retpoline", SPECTRE_V2_CMD_RETPOLINE, false },
1090 ++ { "retpoline,amd", SPECTRE_V2_CMD_RETPOLINE_AMD, false },
1091 ++ { "retpoline,generic", SPECTRE_V2_CMD_RETPOLINE_GENERIC, false },
1092 ++ { "auto", SPECTRE_V2_CMD_AUTO, false },
1093 ++};
1094 ++
1095 + static enum spectre_v2_mitigation_cmd __init spectre_v2_parse_cmdline(void)
1096 + {
1097 + char arg[20];
1098 +- int ret;
1099 +-
1100 +- ret = cmdline_find_option(boot_command_line, "spectre_v2", arg,
1101 +- sizeof(arg));
1102 +- if (ret > 0) {
1103 +- if (match_option(arg, ret, "off")) {
1104 +- goto disable;
1105 +- } else if (match_option(arg, ret, "on")) {
1106 +- spec2_print_if_secure("force enabled on command line.");
1107 +- return SPECTRE_V2_CMD_FORCE;
1108 +- } else if (match_option(arg, ret, "retpoline")) {
1109 +- spec2_print_if_insecure("retpoline selected on command line.");
1110 +- return SPECTRE_V2_CMD_RETPOLINE;
1111 +- } else if (match_option(arg, ret, "retpoline,amd")) {
1112 +- if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) {
1113 +- pr_err("retpoline,amd selected but CPU is not AMD. Switching to AUTO select\n");
1114 +- return SPECTRE_V2_CMD_AUTO;
1115 +- }
1116 +- spec2_print_if_insecure("AMD retpoline selected on command line.");
1117 +- return SPECTRE_V2_CMD_RETPOLINE_AMD;
1118 +- } else if (match_option(arg, ret, "retpoline,generic")) {
1119 +- spec2_print_if_insecure("generic retpoline selected on command line.");
1120 +- return SPECTRE_V2_CMD_RETPOLINE_GENERIC;
1121 +- } else if (match_option(arg, ret, "auto")) {
1122 ++ int ret, i;
1123 ++ enum spectre_v2_mitigation_cmd cmd = SPECTRE_V2_CMD_AUTO;
1124 ++
1125 ++ if (cmdline_find_option_bool(boot_command_line, "nospectre_v2"))
1126 ++ return SPECTRE_V2_CMD_NONE;
1127 ++ else {
1128 ++ ret = cmdline_find_option(boot_command_line, "spectre_v2", arg,
1129 ++ sizeof(arg));
1130 ++ if (ret < 0)
1131 ++ return SPECTRE_V2_CMD_AUTO;
1132 ++
1133 ++ for (i = 0; i < ARRAY_SIZE(mitigation_options); i++) {
1134 ++ if (!match_option(arg, ret, mitigation_options[i].option))
1135 ++ continue;
1136 ++ cmd = mitigation_options[i].cmd;
1137 ++ break;
1138 ++ }
1139 ++
1140 ++ if (i >= ARRAY_SIZE(mitigation_options)) {
1141 ++ pr_err("unknown option (%s). Switching to AUTO select\n",
1142 ++ mitigation_options[i].option);
1143 + return SPECTRE_V2_CMD_AUTO;
1144 + }
1145 + }
1146 +
1147 +- if (!cmdline_find_option_bool(boot_command_line, "nospectre_v2"))
1148 ++ if ((cmd == SPECTRE_V2_CMD_RETPOLINE ||
1149 ++ cmd == SPECTRE_V2_CMD_RETPOLINE_AMD ||
1150 ++ cmd == SPECTRE_V2_CMD_RETPOLINE_GENERIC) &&
1151 ++ !IS_ENABLED(CONFIG_RETPOLINE)) {
1152 ++ pr_err("%s selected but not compiled in. Switching to AUTO select\n",
1153 ++ mitigation_options[i].option);
1154 + return SPECTRE_V2_CMD_AUTO;
1155 +-disable:
1156 +- spec2_print_if_insecure("disabled on command line.");
1157 +- return SPECTRE_V2_CMD_NONE;
1158 ++ }
1159 ++
1160 ++ if (cmd == SPECTRE_V2_CMD_RETPOLINE_AMD &&
1161 ++ boot_cpu_data.x86_vendor != X86_VENDOR_AMD) {
1162 ++ pr_err("retpoline,amd selected but CPU is not AMD. Switching to AUTO select\n");
1163 ++ return SPECTRE_V2_CMD_AUTO;
1164 ++ }
1165 ++
1166 ++ if (mitigation_options[i].secure)
1167 ++ spec2_print_if_secure(mitigation_options[i].option);
1168 ++ else
1169 ++ spec2_print_if_insecure(mitigation_options[i].option);
1170 ++
1171 ++ return cmd;
1172 + }
1173 +
1174 + /* Check for Skylake-like CPUs (for RSB handling) */
1175 +@@ -190,10 +239,10 @@ static void __init spectre_v2_select_mitigation(void)
1176 + return;
1177 +
1178 + case SPECTRE_V2_CMD_FORCE:
1179 +- /* FALLTRHU */
1180 + case SPECTRE_V2_CMD_AUTO:
1181 +- goto retpoline_auto;
1182 +-
1183 ++ if (IS_ENABLED(CONFIG_RETPOLINE))
1184 ++ goto retpoline_auto;
1185 ++ break;
1186 + case SPECTRE_V2_CMD_RETPOLINE_AMD:
1187 + if (IS_ENABLED(CONFIG_RETPOLINE))
1188 + goto retpoline_amd;
1189 +@@ -268,7 +317,7 @@ ssize_t cpu_show_spectre_v1(struct device *dev,
1190 + {
1191 + if (!boot_cpu_has_bug(X86_BUG_SPECTRE_V1))
1192 + return sprintf(buf, "Not affected\n");
1193 +- return sprintf(buf, "Vulnerable\n");
1194 ++ return sprintf(buf, "Mitigation: __user pointer sanitization\n");
1195 + }
1196 +
1197 + ssize_t cpu_show_spectre_v2(struct device *dev,
1198 +@@ -277,6 +326,7 @@ ssize_t cpu_show_spectre_v2(struct device *dev,
1199 + if (!boot_cpu_has_bug(X86_BUG_SPECTRE_V2))
1200 + return sprintf(buf, "Not affected\n");
1201 +
1202 +- return sprintf(buf, "%s\n", spectre_v2_strings[spectre_v2_enabled]);
1203 ++ return sprintf(buf, "%s%s\n", spectre_v2_strings[spectre_v2_enabled],
1204 ++ spectre_v2_module_string());
1205 + }
1206 + #endif
1207 +diff --git a/arch/x86/kernel/cpu/mcheck/mce-inject.c b/arch/x86/kernel/cpu/mcheck/mce-inject.c
1208 +index 4cfba4371a71..101bfae369e1 100644
1209 +--- a/arch/x86/kernel/cpu/mcheck/mce-inject.c
1210 ++++ b/arch/x86/kernel/cpu/mcheck/mce-inject.c
1211 +@@ -152,7 +152,6 @@ static void raise_mce(struct mce *m)
1212 + if (context == MCJ_CTX_RANDOM)
1213 + return;
1214 +
1215 +-#ifdef CONFIG_X86_LOCAL_APIC
1216 + if (m->inject_flags & (MCJ_IRQ_BROADCAST | MCJ_NMI_BROADCAST)) {
1217 + unsigned long start;
1218 + int cpu;
1219 +@@ -193,9 +192,7 @@ static void raise_mce(struct mce *m)
1220 + raise_local();
1221 + put_cpu();
1222 + put_online_cpus();
1223 +- } else
1224 +-#endif
1225 +- {
1226 ++ } else {
1227 + preempt_disable();
1228 + raise_local();
1229 + preempt_enable();
1230 +diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c
1231 +index 2a0f44d225fe..6da6f9cd6d2d 100644
1232 +--- a/arch/x86/kernel/cpu/microcode/amd.c
1233 ++++ b/arch/x86/kernel/cpu/microcode/amd.c
1234 +@@ -131,6 +131,9 @@ static size_t compute_container_size(u8 *data, u32 total_size)
1235 + return size;
1236 + }
1237 +
1238 ++static enum ucode_state
1239 ++load_microcode_amd(bool save, u8 family, const u8 *data, size_t size);
1240 ++
1241 + /*
1242 + * Early load occurs before we can vmalloc(). So we look for the microcode
1243 + * patch container file in initrd, traverse equivalent cpu table, look for a
1244 +@@ -438,7 +441,7 @@ int __init save_microcode_in_initrd_amd(void)
1245 + eax = cpuid_eax(0x00000001);
1246 + eax = ((eax >> 8) & 0xf) + ((eax >> 20) & 0xff);
1247 +
1248 +- ret = load_microcode_amd(smp_processor_id(), eax, container, container_size);
1249 ++ ret = load_microcode_amd(true, eax, container, container_size);
1250 + if (ret != UCODE_OK)
1251 + retval = -EINVAL;
1252 +
1253 +@@ -854,7 +857,8 @@ static enum ucode_state __load_microcode_amd(u8 family, const u8 *data,
1254 + return UCODE_OK;
1255 + }
1256 +
1257 +-enum ucode_state load_microcode_amd(int cpu, u8 family, const u8 *data, size_t size)
1258 ++static enum ucode_state
1259 ++load_microcode_amd(bool save, u8 family, const u8 *data, size_t size)
1260 + {
1261 + enum ucode_state ret;
1262 +
1263 +@@ -868,8 +872,8 @@ enum ucode_state load_microcode_amd(int cpu, u8 family, const u8 *data, size_t s
1264 +
1265 + #ifdef CONFIG_X86_32
1266 + /* save BSP's matching patch for early load */
1267 +- if (cpu_data(cpu).cpu_index == boot_cpu_data.cpu_index) {
1268 +- struct ucode_patch *p = find_patch(cpu);
1269 ++ if (save) {
1270 ++ struct ucode_patch *p = find_patch(0);
1271 + if (p) {
1272 + memset(amd_ucode_patch, 0, PATCH_MAX_SIZE);
1273 + memcpy(amd_ucode_patch, p->data, min_t(u32, ksize(p->data),
1274 +@@ -901,11 +905,12 @@ static enum ucode_state request_microcode_amd(int cpu, struct device *device,
1275 + {
1276 + char fw_name[36] = "amd-ucode/microcode_amd.bin";
1277 + struct cpuinfo_x86 *c = &cpu_data(cpu);
1278 ++ bool bsp = c->cpu_index == boot_cpu_data.cpu_index;
1279 + enum ucode_state ret = UCODE_NFOUND;
1280 + const struct firmware *fw;
1281 +
1282 + /* reload ucode container only on the boot cpu */
1283 +- if (!refresh_fw || c->cpu_index != boot_cpu_data.cpu_index)
1284 ++ if (!refresh_fw || !bsp)
1285 + return UCODE_OK;
1286 +
1287 + if (c->x86 >= 0x15)
1288 +@@ -922,7 +927,7 @@ static enum ucode_state request_microcode_amd(int cpu, struct device *device,
1289 + goto fw_release;
1290 + }
1291 +
1292 +- ret = load_microcode_amd(cpu, c->x86, fw->data, fw->size);
1293 ++ ret = load_microcode_amd(bsp, c->x86, fw->data, fw->size);
1294 +
1295 + fw_release:
1296 + release_firmware(fw);
1297 +diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
1298 +index 5b2f2306fbcc..b52a8d08ab36 100644
1299 +--- a/arch/x86/kernel/cpu/perf_event.c
1300 ++++ b/arch/x86/kernel/cpu/perf_event.c
1301 +@@ -188,8 +188,8 @@ static void release_pmc_hardware(void) {}
1302 +
1303 + static bool check_hw_exists(void)
1304 + {
1305 +- u64 val, val_fail, val_new= ~0;
1306 +- int i, reg, reg_fail, ret = 0;
1307 ++ u64 val, val_fail = -1, val_new= ~0;
1308 ++ int i, reg, reg_fail = -1, ret = 0;
1309 + int bios_fail = 0;
1310 + int reg_safe = -1;
1311 +
1312 +diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
1313 +index 8f1a3f443f7d..70284d38fdc2 100644
1314 +--- a/arch/x86/kernel/head_32.S
1315 ++++ b/arch/x86/kernel/head_32.S
1316 +@@ -669,14 +669,17 @@ __PAGE_ALIGNED_BSS
1317 + initial_pg_pmd:
1318 + .fill 1024*KPMDS,4,0
1319 + #else
1320 +-ENTRY(initial_page_table)
1321 ++.globl initial_page_table
1322 ++initial_page_table:
1323 + .fill 1024,4,0
1324 + #endif
1325 + initial_pg_fixmap:
1326 + .fill 1024,4,0
1327 +-ENTRY(empty_zero_page)
1328 ++.globl empty_zero_page
1329 ++empty_zero_page:
1330 + .fill 4096,1,0
1331 +-ENTRY(swapper_pg_dir)
1332 ++.globl swapper_pg_dir
1333 ++swapper_pg_dir:
1334 + .fill 1024,4,0
1335 +
1336 + /*
1337 +diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig
1338 +index 639a6e34500c..53b7f53f6207 100644
1339 +--- a/arch/x86/kvm/Kconfig
1340 ++++ b/arch/x86/kvm/Kconfig
1341 +@@ -22,7 +22,8 @@ config KVM
1342 + depends on HAVE_KVM
1343 + depends on HIGH_RES_TIMERS
1344 + # for TASKSTATS/TASK_DELAY_ACCT:
1345 +- depends on NET
1346 ++ depends on NET && MULTIUSER
1347 ++ depends on X86_LOCAL_APIC
1348 + select PREEMPT_NOTIFIERS
1349 + select MMU_NOTIFIER
1350 + select ANON_INODES
1351 +diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
1352 +index e4eb1d2bf849..8864fec63a20 100644
1353 +--- a/arch/x86/kvm/emulate.c
1354 ++++ b/arch/x86/kvm/emulate.c
1355 +@@ -26,6 +26,7 @@
1356 + #include <asm/kvm_emulate.h>
1357 + #include <linux/stringify.h>
1358 + #include <asm/debugreg.h>
1359 ++#include <asm/nospec-branch.h>
1360 +
1361 + #include "x86.h"
1362 + #include "tss.h"
1363 +@@ -1000,8 +1001,8 @@ static u8 test_cc(unsigned int condition, unsigned long flags)
1364 + void (*fop)(void) = (void *)em_setcc + 4 * (condition & 0xf);
1365 +
1366 + flags = (flags & EFLAGS_MASK) | X86_EFLAGS_IF;
1367 +- asm("push %[flags]; popf; call *%[fastop]"
1368 +- : "=a"(rc) : [fastop]"r"(fop), [flags]"r"(flags));
1369 ++ asm("push %[flags]; popf; " CALL_NOSPEC
1370 ++ : "=a"(rc) : [thunk_target]"r"(fop), [flags]"r"(flags));
1371 + return rc;
1372 + }
1373 +
1374 +@@ -5297,9 +5298,9 @@ static int fastop(struct x86_emulate_ctxt *ctxt, void (*fop)(struct fastop *))
1375 + ulong flags = (ctxt->eflags & EFLAGS_MASK) | X86_EFLAGS_IF;
1376 + if (!(ctxt->d & ByteOp))
1377 + fop += __ffs(ctxt->dst.bytes) * FASTOP_SIZE;
1378 +- asm("push %[flags]; popf; call *%[fastop]; pushf; pop %[flags]\n"
1379 ++ asm("push %[flags]; popf; " CALL_NOSPEC "; pushf; pop %[flags]\n"
1380 + : "+a"(ctxt->dst.val), "+d"(ctxt->src.val), [flags]"+D"(flags),
1381 +- [fastop]"+S"(fop)
1382 ++ [thunk_target]"+S"(fop)
1383 + : "c"(ctxt->src2.val));
1384 + ctxt->eflags = (ctxt->eflags & ~EFLAGS_MASK) | (flags & EFLAGS_MASK);
1385 + if (!fop) /* exception is returned in fop variable */
1386 +diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
1387 +index 2a1a8737015b..849517805eef 100644
1388 +--- a/arch/x86/kvm/vmx.c
1389 ++++ b/arch/x86/kvm/vmx.c
1390 +@@ -32,6 +32,7 @@
1391 + #include <linux/slab.h>
1392 + #include <linux/tboot.h>
1393 + #include <linux/hrtimer.h>
1394 ++#include <linux/nospec.h>
1395 + #include "kvm_cache_regs.h"
1396 + #include "x86.h"
1397 +
1398 +@@ -125,6 +126,12 @@ module_param_named(pml, enable_pml, bool, S_IRUGO);
1399 +
1400 + #define VMX_MISC_EMULATED_PREEMPTION_TIMER_RATE 5
1401 +
1402 ++#define VMX_VPID_EXTENT_SUPPORTED_MASK \
1403 ++ (VMX_VPID_EXTENT_INDIVIDUAL_ADDR_BIT | \
1404 ++ VMX_VPID_EXTENT_SINGLE_CONTEXT_BIT | \
1405 ++ VMX_VPID_EXTENT_GLOBAL_CONTEXT_BIT | \
1406 ++ VMX_VPID_EXTENT_SINGLE_NON_GLOBAL_BIT)
1407 ++
1408 + /*
1409 + * These 2 parameters are used to config the controls for Pause-Loop Exiting:
1410 + * ple_gap: upper bound on the amount of time between two successive
1411 +@@ -827,21 +834,18 @@ static const unsigned short vmcs_field_to_offset_table[] = {
1412 +
1413 + static inline short vmcs_field_to_offset(unsigned long field)
1414 + {
1415 +- BUILD_BUG_ON(ARRAY_SIZE(vmcs_field_to_offset_table) > SHRT_MAX);
1416 ++ const size_t size = ARRAY_SIZE(vmcs_field_to_offset_table);
1417 ++ unsigned short offset;
1418 +
1419 +- if (field >= ARRAY_SIZE(vmcs_field_to_offset_table))
1420 ++ BUILD_BUG_ON(size > SHRT_MAX);
1421 ++ if (field >= size)
1422 + return -ENOENT;
1423 +
1424 +- /*
1425 +- * FIXME: Mitigation for CVE-2017-5753. To be replaced with a
1426 +- * generic mechanism.
1427 +- */
1428 +- asm("lfence");
1429 +-
1430 +- if (vmcs_field_to_offset_table[field] == 0)
1431 ++ field = array_index_nospec(field, size);
1432 ++ offset = vmcs_field_to_offset_table[field];
1433 ++ if (offset == 0)
1434 + return -ENOENT;
1435 +-
1436 +- return vmcs_field_to_offset_table[field];
1437 ++ return offset;
1438 + }
1439 +
1440 + static inline struct vmcs12 *get_vmcs12(struct kvm_vcpu *vcpu)
1441 +@@ -2659,8 +2663,7 @@ static void nested_vmx_setup_ctls_msrs(struct vcpu_vmx *vmx)
1442 + */
1443 + if (enable_vpid)
1444 + vmx->nested.nested_vmx_vpid_caps = VMX_VPID_INVVPID_BIT |
1445 +- VMX_VPID_EXTENT_SINGLE_CONTEXT_BIT |
1446 +- VMX_VPID_EXTENT_GLOBAL_CONTEXT_BIT;
1447 ++ VMX_VPID_EXTENT_SUPPORTED_MASK;
1448 + else
1449 + vmx->nested.nested_vmx_vpid_caps = 0;
1450 +
1451 +@@ -4514,7 +4517,7 @@ static int vmx_cpu_uses_apicv(struct kvm_vcpu *vcpu)
1452 + return enable_apicv && lapic_in_kernel(vcpu);
1453 + }
1454 +
1455 +-static int vmx_complete_nested_posted_interrupt(struct kvm_vcpu *vcpu)
1456 ++static void vmx_complete_nested_posted_interrupt(struct kvm_vcpu *vcpu)
1457 + {
1458 + struct vcpu_vmx *vmx = to_vmx(vcpu);
1459 + int max_irr;
1460 +@@ -4525,19 +4528,15 @@ static int vmx_complete_nested_posted_interrupt(struct kvm_vcpu *vcpu)
1461 + vmx->nested.pi_pending) {
1462 + vmx->nested.pi_pending = false;
1463 + if (!pi_test_and_clear_on(vmx->nested.pi_desc))
1464 +- return 0;
1465 ++ return;
1466 +
1467 + max_irr = find_last_bit(
1468 + (unsigned long *)vmx->nested.pi_desc->pir, 256);
1469 +
1470 + if (max_irr == 256)
1471 +- return 0;
1472 ++ return;
1473 +
1474 + vapic_page = kmap(vmx->nested.virtual_apic_page);
1475 +- if (!vapic_page) {
1476 +- WARN_ON(1);
1477 +- return -ENOMEM;
1478 +- }
1479 + __kvm_apic_update_irr(vmx->nested.pi_desc->pir, vapic_page);
1480 + kunmap(vmx->nested.virtual_apic_page);
1481 +
1482 +@@ -4548,7 +4547,6 @@ static int vmx_complete_nested_posted_interrupt(struct kvm_vcpu *vcpu)
1483 + vmcs_write16(GUEST_INTR_STATUS, status);
1484 + }
1485 + }
1486 +- return 0;
1487 + }
1488 +
1489 + static inline bool kvm_vcpu_trigger_posted_interrupt(struct kvm_vcpu *vcpu)
1490 +@@ -7368,7 +7366,7 @@ static int handle_invept(struct kvm_vcpu *vcpu)
1491 +
1492 + types = (vmx->nested.nested_vmx_ept_caps >> VMX_EPT_EXTENT_SHIFT) & 6;
1493 +
1494 +- if (!(types & (1UL << type))) {
1495 ++ if (type >= 32 || !(types & (1 << type))) {
1496 + nested_vmx_failValid(vcpu,
1497 + VMXERR_INVALID_OPERAND_TO_INVEPT_INVVPID);
1498 + skip_emulated_instruction(vcpu);
1499 +@@ -7425,9 +7423,10 @@ static int handle_invvpid(struct kvm_vcpu *vcpu)
1500 + vmx_instruction_info = vmcs_read32(VMX_INSTRUCTION_INFO);
1501 + type = kvm_register_readl(vcpu, (vmx_instruction_info >> 28) & 0xf);
1502 +
1503 +- types = (vmx->nested.nested_vmx_vpid_caps >> 8) & 0x7;
1504 ++ types = (vmx->nested.nested_vmx_vpid_caps &
1505 ++ VMX_VPID_EXTENT_SUPPORTED_MASK) >> 8;
1506 +
1507 +- if (!(types & (1UL << type))) {
1508 ++ if (type >= 32 || !(types & (1 << type))) {
1509 + nested_vmx_failValid(vcpu,
1510 + VMXERR_INVALID_OPERAND_TO_INVEPT_INVVPID);
1511 + skip_emulated_instruction(vcpu);
1512 +@@ -7447,21 +7446,27 @@ static int handle_invvpid(struct kvm_vcpu *vcpu)
1513 + }
1514 +
1515 + switch (type) {
1516 ++ case VMX_VPID_EXTENT_INDIVIDUAL_ADDR:
1517 + case VMX_VPID_EXTENT_SINGLE_CONTEXT:
1518 +- /*
1519 +- * Old versions of KVM use the single-context version so we
1520 +- * have to support it; just treat it the same as all-context.
1521 +- */
1522 ++ case VMX_VPID_EXTENT_SINGLE_NON_GLOBAL:
1523 ++ if (!vpid) {
1524 ++ nested_vmx_failValid(vcpu,
1525 ++ VMXERR_INVALID_OPERAND_TO_INVEPT_INVVPID);
1526 ++ skip_emulated_instruction(vcpu);
1527 ++ return 1;
1528 ++ }
1529 ++ break;
1530 + case VMX_VPID_EXTENT_ALL_CONTEXT:
1531 +- __vmx_flush_tlb(vcpu, to_vmx(vcpu)->nested.vpid02);
1532 +- nested_vmx_succeed(vcpu);
1533 + break;
1534 + default:
1535 +- /* Trap individual address invalidation invvpid calls */
1536 +- BUG_ON(1);
1537 +- break;
1538 ++ WARN_ON_ONCE(1);
1539 ++ skip_emulated_instruction(vcpu);
1540 ++ return 1;
1541 + }
1542 +
1543 ++ __vmx_flush_tlb(vcpu, vmx->nested.vpid02);
1544 ++ nested_vmx_succeed(vcpu);
1545 ++
1546 + skip_emulated_instruction(vcpu);
1547 + return 1;
1548 + }
1549 +@@ -8377,13 +8382,13 @@ static void vmx_handle_external_intr(struct kvm_vcpu *vcpu)
1550 + "pushf\n\t"
1551 + "orl $0x200, (%%" _ASM_SP ")\n\t"
1552 + __ASM_SIZE(push) " $%c[cs]\n\t"
1553 +- "call *%[entry]\n\t"
1554 ++ CALL_NOSPEC
1555 + :
1556 + #ifdef CONFIG_X86_64
1557 + [sp]"=&r"(tmp)
1558 + #endif
1559 + :
1560 +- [entry]"r"(entry),
1561 ++ THUNK_TARGET(entry),
1562 + [ss]"i"(__KERNEL_DS),
1563 + [cs]"i"(__KERNEL_CS)
1564 + );
1565 +@@ -9240,11 +9245,6 @@ static inline bool nested_vmx_merge_msr_bitmap(struct kvm_vcpu *vcpu,
1566 + return false;
1567 + }
1568 + msr_bitmap = (unsigned long *)kmap(page);
1569 +- if (!msr_bitmap) {
1570 +- nested_release_page_clean(page);
1571 +- WARN_ON(1);
1572 +- return false;
1573 +- }
1574 +
1575 + if (nested_cpu_has_virt_x2apic_mode(vmcs12)) {
1576 + if (nested_cpu_has_apic_reg_virt(vmcs12))
1577 +@@ -10166,7 +10166,8 @@ static int vmx_check_nested_events(struct kvm_vcpu *vcpu, bool external_intr)
1578 + return 0;
1579 + }
1580 +
1581 +- return vmx_complete_nested_posted_interrupt(vcpu);
1582 ++ vmx_complete_nested_posted_interrupt(vcpu);
1583 ++ return 0;
1584 + }
1585 +
1586 + static u32 vmx_get_preemption_timer_value(struct kvm_vcpu *vcpu)
1587 +diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
1588 +index 3900d34980de..f37f0c72b22a 100644
1589 +--- a/arch/x86/kvm/x86.c
1590 ++++ b/arch/x86/kvm/x86.c
1591 +@@ -2755,6 +2755,12 @@ void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)
1592 + kvm_x86_ops->vcpu_put(vcpu);
1593 + kvm_put_guest_fpu(vcpu);
1594 + vcpu->arch.last_host_tsc = rdtsc();
1595 ++ /*
1596 ++ * If userspace has set any breakpoints or watchpoints, dr6 is restored
1597 ++ * on every vmexit, but if not, we might have a stale dr6 from the
1598 ++ * guest. do_debug expects dr6 to be cleared after it runs, do the same.
1599 ++ */
1600 ++ set_debugreg(0, 6);
1601 + }
1602 +
1603 + static int kvm_vcpu_ioctl_get_lapic(struct kvm_vcpu *vcpu,
1604 +@@ -8204,6 +8210,13 @@ static int apf_put_user(struct kvm_vcpu *vcpu, u32 val)
1605 + sizeof(val));
1606 + }
1607 +
1608 ++static int apf_get_user(struct kvm_vcpu *vcpu, u32 *val)
1609 ++{
1610 ++
1611 ++ return kvm_read_guest_cached(vcpu->kvm, &vcpu->arch.apf.data, val,
1612 ++ sizeof(u32));
1613 ++}
1614 ++
1615 + void kvm_arch_async_page_not_present(struct kvm_vcpu *vcpu,
1616 + struct kvm_async_pf *work)
1617 + {
1618 +@@ -8230,6 +8243,7 @@ void kvm_arch_async_page_present(struct kvm_vcpu *vcpu,
1619 + struct kvm_async_pf *work)
1620 + {
1621 + struct x86_exception fault;
1622 ++ u32 val;
1623 +
1624 + if (work->wakeup_all)
1625 + work->arch.token = ~0; /* broadcast wakeup */
1626 +@@ -8237,14 +8251,24 @@ void kvm_arch_async_page_present(struct kvm_vcpu *vcpu,
1627 + kvm_del_async_pf_gfn(vcpu, work->arch.gfn);
1628 + trace_kvm_async_pf_ready(work->arch.token, work->gva);
1629 +
1630 +- if ((vcpu->arch.apf.msr_val & KVM_ASYNC_PF_ENABLED) &&
1631 +- !apf_put_user(vcpu, KVM_PV_REASON_PAGE_READY)) {
1632 +- fault.vector = PF_VECTOR;
1633 +- fault.error_code_valid = true;
1634 +- fault.error_code = 0;
1635 +- fault.nested_page_fault = false;
1636 +- fault.address = work->arch.token;
1637 +- kvm_inject_page_fault(vcpu, &fault);
1638 ++ if (vcpu->arch.apf.msr_val & KVM_ASYNC_PF_ENABLED &&
1639 ++ !apf_get_user(vcpu, &val)) {
1640 ++ if (val == KVM_PV_REASON_PAGE_NOT_PRESENT &&
1641 ++ vcpu->arch.exception.pending &&
1642 ++ vcpu->arch.exception.nr == PF_VECTOR &&
1643 ++ !apf_put_user(vcpu, 0)) {
1644 ++ vcpu->arch.exception.pending = false;
1645 ++ vcpu->arch.exception.nr = 0;
1646 ++ vcpu->arch.exception.has_error_code = false;
1647 ++ vcpu->arch.exception.error_code = 0;
1648 ++ } else if (!apf_put_user(vcpu, KVM_PV_REASON_PAGE_READY)) {
1649 ++ fault.vector = PF_VECTOR;
1650 ++ fault.error_code_valid = true;
1651 ++ fault.error_code = 0;
1652 ++ fault.nested_page_fault = false;
1653 ++ fault.address = work->arch.token;
1654 ++ kvm_inject_page_fault(vcpu, &fault);
1655 ++ }
1656 + }
1657 + vcpu->arch.apf.halted = false;
1658 + vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE;
1659 +diff --git a/arch/x86/lib/getuser.S b/arch/x86/lib/getuser.S
1660 +index 46668cda4ffd..490b2ee4e4bb 100644
1661 +--- a/arch/x86/lib/getuser.S
1662 ++++ b/arch/x86/lib/getuser.S
1663 +@@ -38,6 +38,8 @@ ENTRY(__get_user_1)
1664 + GET_THREAD_INFO(%_ASM_DX)
1665 + cmp TI_addr_limit(%_ASM_DX),%_ASM_AX
1666 + jae bad_get_user
1667 ++ sbb %_ASM_DX, %_ASM_DX /* array_index_mask_nospec() */
1668 ++ and %_ASM_DX, %_ASM_AX
1669 + ASM_STAC
1670 + 1: movzbl (%_ASM_AX),%edx
1671 + xor %eax,%eax
1672 +@@ -51,6 +53,8 @@ ENTRY(__get_user_2)
1673 + GET_THREAD_INFO(%_ASM_DX)
1674 + cmp TI_addr_limit(%_ASM_DX),%_ASM_AX
1675 + jae bad_get_user
1676 ++ sbb %_ASM_DX, %_ASM_DX /* array_index_mask_nospec() */
1677 ++ and %_ASM_DX, %_ASM_AX
1678 + ASM_STAC
1679 + 2: movzwl -1(%_ASM_AX),%edx
1680 + xor %eax,%eax
1681 +@@ -64,6 +68,8 @@ ENTRY(__get_user_4)
1682 + GET_THREAD_INFO(%_ASM_DX)
1683 + cmp TI_addr_limit(%_ASM_DX),%_ASM_AX
1684 + jae bad_get_user
1685 ++ sbb %_ASM_DX, %_ASM_DX /* array_index_mask_nospec() */
1686 ++ and %_ASM_DX, %_ASM_AX
1687 + ASM_STAC
1688 + 3: movl -3(%_ASM_AX),%edx
1689 + xor %eax,%eax
1690 +@@ -78,6 +84,8 @@ ENTRY(__get_user_8)
1691 + GET_THREAD_INFO(%_ASM_DX)
1692 + cmp TI_addr_limit(%_ASM_DX),%_ASM_AX
1693 + jae bad_get_user
1694 ++ sbb %_ASM_DX, %_ASM_DX /* array_index_mask_nospec() */
1695 ++ and %_ASM_DX, %_ASM_AX
1696 + ASM_STAC
1697 + 4: movq -7(%_ASM_AX),%rdx
1698 + xor %eax,%eax
1699 +@@ -89,6 +97,8 @@ ENTRY(__get_user_8)
1700 + GET_THREAD_INFO(%_ASM_DX)
1701 + cmp TI_addr_limit(%_ASM_DX),%_ASM_AX
1702 + jae bad_get_user_8
1703 ++ sbb %_ASM_DX, %_ASM_DX /* array_index_mask_nospec() */
1704 ++ and %_ASM_DX, %_ASM_AX
1705 + ASM_STAC
1706 + 4: movl -7(%_ASM_AX),%edx
1707 + 5: movl -3(%_ASM_AX),%ecx
1708 +diff --git a/arch/x86/lib/retpoline.S b/arch/x86/lib/retpoline.S
1709 +index e611a124c442..3d06b482ebc7 100644
1710 +--- a/arch/x86/lib/retpoline.S
1711 ++++ b/arch/x86/lib/retpoline.S
1712 +@@ -36,7 +36,6 @@ GENERATE_THUNK(_ASM_DX)
1713 + GENERATE_THUNK(_ASM_SI)
1714 + GENERATE_THUNK(_ASM_DI)
1715 + GENERATE_THUNK(_ASM_BP)
1716 +-GENERATE_THUNK(_ASM_SP)
1717 + #ifdef CONFIG_64BIT
1718 + GENERATE_THUNK(r8)
1719 + GENERATE_THUNK(r9)
1720 +diff --git a/arch/x86/math-emu/Makefile b/arch/x86/math-emu/Makefile
1721 +index 9b0c63b60302..1b2dac174321 100644
1722 +--- a/arch/x86/math-emu/Makefile
1723 ++++ b/arch/x86/math-emu/Makefile
1724 +@@ -5,8 +5,8 @@
1725 + #DEBUG = -DDEBUGGING
1726 + DEBUG =
1727 + PARANOID = -DPARANOID
1728 +-EXTRA_CFLAGS := $(PARANOID) $(DEBUG) -fno-builtin $(MATH_EMULATION)
1729 +-EXTRA_AFLAGS := $(PARANOID)
1730 ++ccflags-y += $(PARANOID) $(DEBUG) -fno-builtin $(MATH_EMULATION)
1731 ++asflags-y += $(PARANOID)
1732 +
1733 + # From 'C' language sources:
1734 + C_OBJS =fpu_entry.o errors.o \
1735 +diff --git a/arch/x86/math-emu/reg_compare.c b/arch/x86/math-emu/reg_compare.c
1736 +index b77360fdbf4a..19b33b50adfa 100644
1737 +--- a/arch/x86/math-emu/reg_compare.c
1738 ++++ b/arch/x86/math-emu/reg_compare.c
1739 +@@ -168,7 +168,7 @@ static int compare(FPU_REG const *b, int tagb)
1740 + /* This function requires that st(0) is not empty */
1741 + int FPU_compare_st_data(FPU_REG const *loaded_data, u_char loaded_tag)
1742 + {
1743 +- int f = 0, c;
1744 ++ int f, c;
1745 +
1746 + c = compare(loaded_data, loaded_tag);
1747 +
1748 +@@ -189,12 +189,12 @@ int FPU_compare_st_data(FPU_REG const *loaded_data, u_char loaded_tag)
1749 + case COMP_No_Comp:
1750 + f = SW_C3 | SW_C2 | SW_C0;
1751 + break;
1752 +-#ifdef PARANOID
1753 + default:
1754 ++#ifdef PARANOID
1755 + EXCEPTION(EX_INTERNAL | 0x121);
1756 ++#endif /* PARANOID */
1757 + f = SW_C3 | SW_C2 | SW_C0;
1758 + break;
1759 +-#endif /* PARANOID */
1760 + }
1761 + setcc(f);
1762 + if (c & COMP_Denormal) {
1763 +@@ -205,7 +205,7 @@ int FPU_compare_st_data(FPU_REG const *loaded_data, u_char loaded_tag)
1764 +
1765 + static int compare_st_st(int nr)
1766 + {
1767 +- int f = 0, c;
1768 ++ int f, c;
1769 + FPU_REG *st_ptr;
1770 +
1771 + if (!NOT_EMPTY(0) || !NOT_EMPTY(nr)) {
1772 +@@ -235,12 +235,12 @@ static int compare_st_st(int nr)
1773 + case COMP_No_Comp:
1774 + f = SW_C3 | SW_C2 | SW_C0;
1775 + break;
1776 +-#ifdef PARANOID
1777 + default:
1778 ++#ifdef PARANOID
1779 + EXCEPTION(EX_INTERNAL | 0x122);
1780 ++#endif /* PARANOID */
1781 + f = SW_C3 | SW_C2 | SW_C0;
1782 + break;
1783 +-#endif /* PARANOID */
1784 + }
1785 + setcc(f);
1786 + if (c & COMP_Denormal) {
1787 +@@ -283,12 +283,12 @@ static int compare_i_st_st(int nr)
1788 + case COMP_No_Comp:
1789 + f = X86_EFLAGS_ZF | X86_EFLAGS_PF | X86_EFLAGS_CF;
1790 + break;
1791 +-#ifdef PARANOID
1792 + default:
1793 ++#ifdef PARANOID
1794 + EXCEPTION(EX_INTERNAL | 0x122);
1795 ++#endif /* PARANOID */
1796 + f = 0;
1797 + break;
1798 +-#endif /* PARANOID */
1799 + }
1800 + FPU_EFLAGS = (FPU_EFLAGS & ~(X86_EFLAGS_ZF | X86_EFLAGS_PF | X86_EFLAGS_CF)) | f;
1801 + if (c & COMP_Denormal) {
1802 +diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
1803 +index b9c78f3bcd67..53ab3f367472 100644
1804 +--- a/arch/x86/mm/ioremap.c
1805 ++++ b/arch/x86/mm/ioremap.c
1806 +@@ -348,11 +348,11 @@ void iounmap(volatile void __iomem *addr)
1807 + (void __force *)addr < phys_to_virt(ISA_END_ADDRESS))
1808 + return;
1809 +
1810 ++ mmiotrace_iounmap(addr);
1811 ++
1812 + addr = (volatile void __iomem *)
1813 + (PAGE_MASK & (unsigned long __force)addr);
1814 +
1815 +- mmiotrace_iounmap(addr);
1816 +-
1817 + /* Use the vm area unlocked, assuming the caller
1818 + ensures there isn't another iounmap for the same address
1819 + in parallel. Reuse of the virtual address is prevented by
1820 +diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c
1821 +index ddb2244b06a1..76604c8a2a48 100644
1822 +--- a/arch/x86/mm/kmmio.c
1823 ++++ b/arch/x86/mm/kmmio.c
1824 +@@ -434,17 +434,18 @@ int register_kmmio_probe(struct kmmio_probe *p)
1825 + unsigned long flags;
1826 + int ret = 0;
1827 + unsigned long size = 0;
1828 ++ unsigned long addr = p->addr & PAGE_MASK;
1829 + const unsigned long size_lim = p->len + (p->addr & ~PAGE_MASK);
1830 + unsigned int l;
1831 + pte_t *pte;
1832 +
1833 + spin_lock_irqsave(&kmmio_lock, flags);
1834 +- if (get_kmmio_probe(p->addr)) {
1835 ++ if (get_kmmio_probe(addr)) {
1836 + ret = -EEXIST;
1837 + goto out;
1838 + }
1839 +
1840 +- pte = lookup_address(p->addr, &l);
1841 ++ pte = lookup_address(addr, &l);
1842 + if (!pte) {
1843 + ret = -EINVAL;
1844 + goto out;
1845 +@@ -453,7 +454,7 @@ int register_kmmio_probe(struct kmmio_probe *p)
1846 + kmmio_count++;
1847 + list_add_rcu(&p->list, &kmmio_probes);
1848 + while (size < size_lim) {
1849 +- if (add_kmmio_fault_page(p->addr + size))
1850 ++ if (add_kmmio_fault_page(addr + size))
1851 + pr_err("Unable to set page fault.\n");
1852 + size += page_level_size(l);
1853 + }
1854 +@@ -527,19 +528,20 @@ void unregister_kmmio_probe(struct kmmio_probe *p)
1855 + {
1856 + unsigned long flags;
1857 + unsigned long size = 0;
1858 ++ unsigned long addr = p->addr & PAGE_MASK;
1859 + const unsigned long size_lim = p->len + (p->addr & ~PAGE_MASK);
1860 + struct kmmio_fault_page *release_list = NULL;
1861 + struct kmmio_delayed_release *drelease;
1862 + unsigned int l;
1863 + pte_t *pte;
1864 +
1865 +- pte = lookup_address(p->addr, &l);
1866 ++ pte = lookup_address(addr, &l);
1867 + if (!pte)
1868 + return;
1869 +
1870 + spin_lock_irqsave(&kmmio_lock, flags);
1871 + while (size < size_lim) {
1872 +- release_kmmio_fault_page(p->addr + size, &release_list);
1873 ++ release_kmmio_fault_page(addr + size, &release_list);
1874 + size += page_level_size(l);
1875 + }
1876 + list_del_rcu(&p->list);
1877 +diff --git a/arch/x86/platform/olpc/olpc-xo15-sci.c b/arch/x86/platform/olpc/olpc-xo15-sci.c
1878 +index 55130846ac87..c0533fbc39e3 100644
1879 +--- a/arch/x86/platform/olpc/olpc-xo15-sci.c
1880 ++++ b/arch/x86/platform/olpc/olpc-xo15-sci.c
1881 +@@ -196,6 +196,7 @@ static int xo15_sci_remove(struct acpi_device *device)
1882 + return 0;
1883 + }
1884 +
1885 ++#ifdef CONFIG_PM_SLEEP
1886 + static int xo15_sci_resume(struct device *dev)
1887 + {
1888 + /* Enable all EC events */
1889 +@@ -207,6 +208,7 @@ static int xo15_sci_resume(struct device *dev)
1890 +
1891 + return 0;
1892 + }
1893 ++#endif
1894 +
1895 + static SIMPLE_DEV_PM_OPS(xo15_sci_pm, NULL, xo15_sci_resume);
1896 +
1897 +diff --git a/certs/Makefile b/certs/Makefile
1898 +index 28ac694dd11a..2773c4afa24c 100644
1899 +--- a/certs/Makefile
1900 ++++ b/certs/Makefile
1901 +@@ -36,29 +36,34 @@ ifndef CONFIG_MODULE_SIG_HASH
1902 + $(error Could not determine digest type to use from kernel config)
1903 + endif
1904 +
1905 ++redirect_openssl = 2>&1
1906 ++quiet_redirect_openssl = 2>&1
1907 ++silent_redirect_openssl = 2>/dev/null
1908 ++
1909 + # We do it this way rather than having a boolean option for enabling an
1910 + # external private key, because 'make randconfig' might enable such a
1911 + # boolean option and we unfortunately can't make it depend on !RANDCONFIG.
1912 + ifeq ($(CONFIG_MODULE_SIG_KEY),"certs/signing_key.pem")
1913 + $(obj)/signing_key.pem: $(obj)/x509.genkey
1914 +- @echo "###"
1915 +- @echo "### Now generating an X.509 key pair to be used for signing modules."
1916 +- @echo "###"
1917 +- @echo "### If this takes a long time, you might wish to run rngd in the"
1918 +- @echo "### background to keep the supply of entropy topped up. It"
1919 +- @echo "### needs to be run as root, and uses a hardware random"
1920 +- @echo "### number generator if one is available."
1921 +- @echo "###"
1922 +- openssl req -new -nodes -utf8 -$(CONFIG_MODULE_SIG_HASH) -days 36500 \
1923 ++ @$(kecho) "###"
1924 ++ @$(kecho) "### Now generating an X.509 key pair to be used for signing modules."
1925 ++ @$(kecho) "###"
1926 ++ @$(kecho) "### If this takes a long time, you might wish to run rngd in the"
1927 ++ @$(kecho) "### background to keep the supply of entropy topped up. It"
1928 ++ @$(kecho) "### needs to be run as root, and uses a hardware random"
1929 ++ @$(kecho) "### number generator if one is available."
1930 ++ @$(kecho) "###"
1931 ++ $(Q)openssl req -new -nodes -utf8 -$(CONFIG_MODULE_SIG_HASH) -days 36500 \
1932 + -batch -x509 -config $(obj)/x509.genkey \
1933 + -outform PEM -out $(obj)/signing_key.pem \
1934 +- -keyout $(obj)/signing_key.pem 2>&1
1935 +- @echo "###"
1936 +- @echo "### Key pair generated."
1937 +- @echo "###"
1938 ++ -keyout $(obj)/signing_key.pem \
1939 ++ $($(quiet)redirect_openssl)
1940 ++ @$(kecho) "###"
1941 ++ @$(kecho) "### Key pair generated."
1942 ++ @$(kecho) "###"
1943 +
1944 + $(obj)/x509.genkey:
1945 +- @echo Generating X.509 key generation config
1946 ++ @$(kecho) Generating X.509 key generation config
1947 + @echo >$@ "[ req ]"
1948 + @echo >>$@ "default_bits = 4096"
1949 + @echo >>$@ "distinguished_name = req_distinguished_name"
1950 +diff --git a/drivers/Makefile b/drivers/Makefile
1951 +index 098997f2cc3a..f42a74ebc1be 100644
1952 +--- a/drivers/Makefile
1953 ++++ b/drivers/Makefile
1954 +@@ -96,6 +96,7 @@ obj-$(CONFIG_TC) += tc/
1955 + obj-$(CONFIG_UWB) += uwb/
1956 + obj-$(CONFIG_USB_PHY) += usb/
1957 + obj-$(CONFIG_USB) += usb/
1958 ++obj-$(CONFIG_USB_SUPPORT) += usb/
1959 + obj-$(CONFIG_PCI) += usb/
1960 + obj-$(CONFIG_USB_GADGET) += usb/
1961 + obj-$(CONFIG_OF) += usb/
1962 +diff --git a/drivers/android/binder.c b/drivers/android/binder.c
1963 +index 5531f020e561..55613f6f7c0e 100644
1964 +--- a/drivers/android/binder.c
1965 ++++ b/drivers/android/binder.c
1966 +@@ -2622,6 +2622,8 @@ static unsigned int binder_poll(struct file *filp,
1967 + binder_lock(__func__);
1968 +
1969 + thread = binder_get_thread(proc);
1970 ++ if (!thread)
1971 ++ return POLLERR;
1972 +
1973 + wait_for_proc_work = thread->transaction_stack == NULL &&
1974 + list_empty(&thread->todo) && thread->return_error == BR_OK;
1975 +diff --git a/drivers/char/hw_random/exynos-rng.c b/drivers/char/hw_random/exynos-rng.c
1976 +index 7845a38b6604..7ba0ae060d61 100644
1977 +--- a/drivers/char/hw_random/exynos-rng.c
1978 ++++ b/drivers/char/hw_random/exynos-rng.c
1979 +@@ -155,8 +155,7 @@ static int exynos_rng_probe(struct platform_device *pdev)
1980 + return ret;
1981 + }
1982 +
1983 +-#ifdef CONFIG_PM
1984 +-static int exynos_rng_runtime_suspend(struct device *dev)
1985 ++static int __maybe_unused exynos_rng_runtime_suspend(struct device *dev)
1986 + {
1987 + struct platform_device *pdev = to_platform_device(dev);
1988 + struct exynos_rng *exynos_rng = platform_get_drvdata(pdev);
1989 +@@ -166,7 +165,7 @@ static int exynos_rng_runtime_suspend(struct device *dev)
1990 + return 0;
1991 + }
1992 +
1993 +-static int exynos_rng_runtime_resume(struct device *dev)
1994 ++static int __maybe_unused exynos_rng_runtime_resume(struct device *dev)
1995 + {
1996 + struct platform_device *pdev = to_platform_device(dev);
1997 + struct exynos_rng *exynos_rng = platform_get_drvdata(pdev);
1998 +@@ -174,12 +173,12 @@ static int exynos_rng_runtime_resume(struct device *dev)
1999 + return clk_prepare_enable(exynos_rng->clk);
2000 + }
2001 +
2002 +-static int exynos_rng_suspend(struct device *dev)
2003 ++static int __maybe_unused exynos_rng_suspend(struct device *dev)
2004 + {
2005 + return pm_runtime_force_suspend(dev);
2006 + }
2007 +
2008 +-static int exynos_rng_resume(struct device *dev)
2009 ++static int __maybe_unused exynos_rng_resume(struct device *dev)
2010 + {
2011 + struct platform_device *pdev = to_platform_device(dev);
2012 + struct exynos_rng *exynos_rng = platform_get_drvdata(pdev);
2013 +@@ -191,7 +190,6 @@ static int exynos_rng_resume(struct device *dev)
2014 +
2015 + return exynos_rng_configure(exynos_rng);
2016 + }
2017 +-#endif
2018 +
2019 + static const struct dev_pm_ops exynos_rng_pm_ops = {
2020 + SET_SYSTEM_SLEEP_PM_OPS(exynos_rng_suspend, exynos_rng_resume)
2021 +diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c
2022 +index fd39893079d5..45ea8957a73a 100644
2023 +--- a/drivers/crypto/s5p-sss.c
2024 ++++ b/drivers/crypto/s5p-sss.c
2025 +@@ -401,16 +401,21 @@ static void s5p_aes_crypt_start(struct s5p_aes_dev *dev, unsigned long mode)
2026 + uint32_t aes_control;
2027 + int err;
2028 + unsigned long flags;
2029 ++ u8 *iv;
2030 +
2031 + aes_control = SSS_AES_KEY_CHANGE_MODE;
2032 + if (mode & FLAGS_AES_DECRYPT)
2033 + aes_control |= SSS_AES_MODE_DECRYPT;
2034 +
2035 +- if ((mode & FLAGS_AES_MODE_MASK) == FLAGS_AES_CBC)
2036 ++ if ((mode & FLAGS_AES_MODE_MASK) == FLAGS_AES_CBC) {
2037 + aes_control |= SSS_AES_CHAIN_MODE_CBC;
2038 +- else if ((mode & FLAGS_AES_MODE_MASK) == FLAGS_AES_CTR)
2039 ++ iv = req->info;
2040 ++ } else if ((mode & FLAGS_AES_MODE_MASK) == FLAGS_AES_CTR) {
2041 + aes_control |= SSS_AES_CHAIN_MODE_CTR;
2042 +-
2043 ++ iv = req->info;
2044 ++ } else {
2045 ++ iv = NULL; /* AES_ECB */
2046 ++ }
2047 + if (dev->ctx->keylen == AES_KEYSIZE_192)
2048 + aes_control |= SSS_AES_KEY_SIZE_192;
2049 + else if (dev->ctx->keylen == AES_KEYSIZE_256)
2050 +@@ -440,7 +445,7 @@ static void s5p_aes_crypt_start(struct s5p_aes_dev *dev, unsigned long mode)
2051 + goto outdata_error;
2052 +
2053 + SSS_AES_WRITE(dev, AES_CONTROL, aes_control);
2054 +- s5p_set_aes(dev, dev->ctx->aes_key, req->info, dev->ctx->keylen);
2055 ++ s5p_set_aes(dev, dev->ctx->aes_key, iv, dev->ctx->keylen);
2056 +
2057 + s5p_set_dma_indata(dev, req->src);
2058 + s5p_set_dma_outdata(dev, req->dst);
2059 +diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
2060 +index 53d22eb73b56..be26f625bb3e 100644
2061 +--- a/drivers/dma/at_hdmac.c
2062 ++++ b/drivers/dma/at_hdmac.c
2063 +@@ -716,7 +716,7 @@ atc_prep_dma_interleaved(struct dma_chan *chan,
2064 + unsigned long flags)
2065 + {
2066 + struct at_dma_chan *atchan = to_at_dma_chan(chan);
2067 +- struct data_chunk *first = xt->sgl;
2068 ++ struct data_chunk *first;
2069 + struct at_desc *desc = NULL;
2070 + size_t xfer_count;
2071 + unsigned int dwidth;
2072 +@@ -728,6 +728,8 @@ atc_prep_dma_interleaved(struct dma_chan *chan,
2073 + if (unlikely(!xt || xt->numf != 1 || !xt->frame_size))
2074 + return NULL;
2075 +
2076 ++ first = xt->sgl;
2077 ++
2078 + dev_info(chan2dev(chan),
2079 + "%s: src=%pad, dest=%pad, numf=%d, frame_size=%d, flags=0x%lx\n",
2080 + __func__, &xt->src_start, &xt->dst_start, xt->numf,
2081 +diff --git a/drivers/dma/dma-jz4740.c b/drivers/dma/dma-jz4740.c
2082 +index 7638b24ce8d0..35fc58f4bf4b 100644
2083 +--- a/drivers/dma/dma-jz4740.c
2084 ++++ b/drivers/dma/dma-jz4740.c
2085 +@@ -557,7 +557,7 @@ static int jz4740_dma_probe(struct platform_device *pdev)
2086 +
2087 + ret = dma_async_device_register(dd);
2088 + if (ret)
2089 +- return ret;
2090 ++ goto err_clk;
2091 +
2092 + irq = platform_get_irq(pdev, 0);
2093 + ret = request_irq(irq, jz4740_dma_irq, 0, dev_name(&pdev->dev), dmadev);
2094 +@@ -570,6 +570,8 @@ static int jz4740_dma_probe(struct platform_device *pdev)
2095 +
2096 + err_unregister:
2097 + dma_async_device_unregister(dd);
2098 ++err_clk:
2099 ++ clk_disable_unprepare(dmadev->clk);
2100 + return ret;
2101 + }
2102 +
2103 +diff --git a/drivers/dma/ioat/init.c b/drivers/dma/ioat/init.c
2104 +index abb75ebd65ea..ac8c28968422 100644
2105 +--- a/drivers/dma/ioat/init.c
2106 ++++ b/drivers/dma/ioat/init.c
2107 +@@ -395,7 +395,7 @@ static int ioat_dma_self_test(struct ioatdma_device *ioat_dma)
2108 + if (memcmp(src, dest, IOAT_TEST_SIZE)) {
2109 + dev_err(dev, "Self-test copy failed compare, disabling\n");
2110 + err = -ENODEV;
2111 +- goto free_resources;
2112 ++ goto unmap_dma;
2113 + }
2114 +
2115 + unmap_dma:
2116 +diff --git a/drivers/dma/zx296702_dma.c b/drivers/dma/zx296702_dma.c
2117 +index 6059d81e701a..8e55403847b2 100644
2118 +--- a/drivers/dma/zx296702_dma.c
2119 ++++ b/drivers/dma/zx296702_dma.c
2120 +@@ -26,7 +26,7 @@
2121 +
2122 + #define DRIVER_NAME "zx-dma"
2123 + #define DMA_ALIGN 4
2124 +-#define DMA_MAX_SIZE (0x10000 - PAGE_SIZE)
2125 ++#define DMA_MAX_SIZE (0x10000 - 512)
2126 + #define LLI_BLOCK_SIZE (4 * PAGE_SIZE)
2127 +
2128 + #define REG_ZX_SRC_ADDR 0x00
2129 +diff --git a/drivers/gpio/gpio-intel-mid.c b/drivers/gpio/gpio-intel-mid.c
2130 +index c50e930d97d3..297121acc57d 100644
2131 +--- a/drivers/gpio/gpio-intel-mid.c
2132 ++++ b/drivers/gpio/gpio-intel-mid.c
2133 +@@ -326,7 +326,7 @@ static void intel_mid_irq_init_hw(struct intel_mid_gpio *priv)
2134 + }
2135 + }
2136 +
2137 +-static int intel_gpio_runtime_idle(struct device *dev)
2138 ++static int __maybe_unused intel_gpio_runtime_idle(struct device *dev)
2139 + {
2140 + int err = pm_schedule_suspend(dev, 500);
2141 + return err ?: -EBUSY;
2142 +diff --git a/drivers/gpio/gpio-xgene.c b/drivers/gpio/gpio-xgene.c
2143 +index 18a8182d4fec..7f1f32324504 100644
2144 +--- a/drivers/gpio/gpio-xgene.c
2145 ++++ b/drivers/gpio/gpio-xgene.c
2146 +@@ -42,9 +42,7 @@ struct xgene_gpio {
2147 + struct gpio_chip chip;
2148 + void __iomem *base;
2149 + spinlock_t lock;
2150 +-#ifdef CONFIG_PM
2151 + u32 set_dr_val[XGENE_MAX_GPIO_BANKS];
2152 +-#endif
2153 + };
2154 +
2155 + static inline struct xgene_gpio *to_xgene_gpio(struct gpio_chip *chip)
2156 +@@ -132,8 +130,7 @@ static int xgene_gpio_dir_out(struct gpio_chip *gc,
2157 + return 0;
2158 + }
2159 +
2160 +-#ifdef CONFIG_PM
2161 +-static int xgene_gpio_suspend(struct device *dev)
2162 ++static __maybe_unused int xgene_gpio_suspend(struct device *dev)
2163 + {
2164 + struct xgene_gpio *gpio = dev_get_drvdata(dev);
2165 + unsigned long bank_offset;
2166 +@@ -146,7 +143,7 @@ static int xgene_gpio_suspend(struct device *dev)
2167 + return 0;
2168 + }
2169 +
2170 +-static int xgene_gpio_resume(struct device *dev)
2171 ++static __maybe_unused int xgene_gpio_resume(struct device *dev)
2172 + {
2173 + struct xgene_gpio *gpio = dev_get_drvdata(dev);
2174 + unsigned long bank_offset;
2175 +@@ -160,10 +157,6 @@ static int xgene_gpio_resume(struct device *dev)
2176 + }
2177 +
2178 + static SIMPLE_DEV_PM_OPS(xgene_gpio_pm, xgene_gpio_suspend, xgene_gpio_resume);
2179 +-#define XGENE_GPIO_PM_OPS (&xgene_gpio_pm)
2180 +-#else
2181 +-#define XGENE_GPIO_PM_OPS NULL
2182 +-#endif
2183 +
2184 + static int xgene_gpio_probe(struct platform_device *pdev)
2185 + {
2186 +@@ -230,7 +223,7 @@ static struct platform_driver xgene_gpio_driver = {
2187 + .driver = {
2188 + .name = "xgene-gpio",
2189 + .of_match_table = xgene_gpio_of_match,
2190 +- .pm = XGENE_GPIO_PM_OPS,
2191 ++ .pm = &xgene_gpio_pm,
2192 + },
2193 + .probe = xgene_gpio_probe,
2194 + .remove = xgene_gpio_remove,
2195 +diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c
2196 +index cebcab560626..5d68189176cc 100644
2197 +--- a/drivers/gpu/drm/armada/armada_crtc.c
2198 ++++ b/drivers/gpu/drm/armada/armada_crtc.c
2199 +@@ -1182,17 +1182,13 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev,
2200 +
2201 + ret = devm_request_irq(dev, irq, armada_drm_irq, 0, "armada_drm_crtc",
2202 + dcrtc);
2203 +- if (ret < 0) {
2204 +- kfree(dcrtc);
2205 +- return ret;
2206 +- }
2207 ++ if (ret < 0)
2208 ++ goto err_crtc;
2209 +
2210 + if (dcrtc->variant->init) {
2211 + ret = dcrtc->variant->init(dcrtc, dev);
2212 +- if (ret) {
2213 +- kfree(dcrtc);
2214 +- return ret;
2215 +- }
2216 ++ if (ret)
2217 ++ goto err_crtc;
2218 + }
2219 +
2220 + /* Ensure AXI pipeline is enabled */
2221 +@@ -1203,13 +1199,15 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev,
2222 + dcrtc->crtc.port = port;
2223 +
2224 + primary = kzalloc(sizeof(*primary), GFP_KERNEL);
2225 +- if (!primary)
2226 +- return -ENOMEM;
2227 ++ if (!primary) {
2228 ++ ret = -ENOMEM;
2229 ++ goto err_crtc;
2230 ++ }
2231 +
2232 + ret = armada_drm_plane_init(primary);
2233 + if (ret) {
2234 + kfree(primary);
2235 +- return ret;
2236 ++ goto err_crtc;
2237 + }
2238 +
2239 + ret = drm_universal_plane_init(drm, &primary->base, 0,
2240 +@@ -1219,7 +1217,7 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev,
2241 + DRM_PLANE_TYPE_PRIMARY);
2242 + if (ret) {
2243 + kfree(primary);
2244 +- return ret;
2245 ++ goto err_crtc;
2246 + }
2247 +
2248 + ret = drm_crtc_init_with_planes(drm, &dcrtc->crtc, &primary->base, NULL,
2249 +@@ -1238,6 +1236,9 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev,
2250 +
2251 + err_crtc_init:
2252 + primary->base.funcs->destroy(&primary->base);
2253 ++err_crtc:
2254 ++ kfree(dcrtc);
2255 ++
2256 + return ret;
2257 + }
2258 +
2259 +diff --git a/drivers/gpu/drm/drm_modeset_lock.c b/drivers/gpu/drm/drm_modeset_lock.c
2260 +index 6675b1428410..c257de351cfa 100644
2261 +--- a/drivers/gpu/drm/drm_modeset_lock.c
2262 ++++ b/drivers/gpu/drm/drm_modeset_lock.c
2263 +@@ -69,7 +69,7 @@ void drm_modeset_lock_all(struct drm_device *dev)
2264 + struct drm_modeset_acquire_ctx *ctx;
2265 + int ret;
2266 +
2267 +- ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
2268 ++ ctx = kzalloc(sizeof(*ctx), GFP_KERNEL | __GFP_NOFAIL);
2269 + if (WARN_ON(!ctx))
2270 + return;
2271 +
2272 +diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_dpi.c b/drivers/gpu/drm/gma500/mdfld_dsi_dpi.c
2273 +index d4813e03f5ee..00275c3856ce 100644
2274 +--- a/drivers/gpu/drm/gma500/mdfld_dsi_dpi.c
2275 ++++ b/drivers/gpu/drm/gma500/mdfld_dsi_dpi.c
2276 +@@ -821,14 +821,18 @@ void mdfld_dsi_dpi_mode_set(struct drm_encoder *encoder,
2277 + struct drm_device *dev = dsi_config->dev;
2278 + struct drm_psb_private *dev_priv = dev->dev_private;
2279 + int pipe = mdfld_dsi_encoder_get_pipe(dsi_encoder);
2280 +-
2281 + u32 pipeconf_reg = PIPEACONF;
2282 + u32 dspcntr_reg = DSPACNTR;
2283 ++ u32 pipeconf, dspcntr;
2284 +
2285 +- u32 pipeconf = dev_priv->pipeconf[pipe];
2286 +- u32 dspcntr = dev_priv->dspcntr[pipe];
2287 + u32 mipi = MIPI_PORT_EN | PASS_FROM_SPHY_TO_AFE | SEL_FLOPPED_HSTX;
2288 +
2289 ++ if (WARN_ON(pipe < 0))
2290 ++ return;
2291 ++
2292 ++ pipeconf = dev_priv->pipeconf[pipe];
2293 ++ dspcntr = dev_priv->dspcntr[pipe];
2294 ++
2295 + if (pipe) {
2296 + pipeconf_reg = PIPECCONF;
2297 + dspcntr_reg = DSPCCNTR;
2298 +diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_output.c b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
2299 +index 89f705c3a5eb..910a2f253990 100644
2300 +--- a/drivers/gpu/drm/gma500/mdfld_dsi_output.c
2301 ++++ b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
2302 +@@ -382,16 +382,6 @@ static int mdfld_dsi_connector_mode_valid(struct drm_connector *connector,
2303 + return MODE_OK;
2304 + }
2305 +
2306 +-static void mdfld_dsi_connector_dpms(struct drm_connector *connector, int mode)
2307 +-{
2308 +- if (mode == connector->dpms)
2309 +- return;
2310 +-
2311 +- /*first, execute dpms*/
2312 +-
2313 +- drm_helper_connector_dpms(connector, mode);
2314 +-}
2315 +-
2316 + static struct drm_encoder *mdfld_dsi_connector_best_encoder(
2317 + struct drm_connector *connector)
2318 + {
2319 +@@ -404,7 +394,7 @@ static struct drm_encoder *mdfld_dsi_connector_best_encoder(
2320 +
2321 + /*DSI connector funcs*/
2322 + static const struct drm_connector_funcs mdfld_dsi_connector_funcs = {
2323 +- .dpms = /*drm_helper_connector_dpms*/mdfld_dsi_connector_dpms,
2324 ++ .dpms = drm_helper_connector_dpms,
2325 + .save = mdfld_dsi_connector_save,
2326 + .restore = mdfld_dsi_connector_restore,
2327 + .detect = mdfld_dsi_connector_detect,
2328 +diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
2329 +index a0865c49ec83..495c279da200 100644
2330 +--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
2331 ++++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
2332 +@@ -370,7 +370,7 @@ validate_init(struct nouveau_channel *chan, struct drm_file *file_priv,
2333 + struct nouveau_cli *cli = nouveau_cli(file_priv);
2334 + struct drm_device *dev = chan->drm->dev;
2335 + int trycnt = 0;
2336 +- int ret, i;
2337 ++ int ret = -EINVAL, i;
2338 + struct nouveau_bo *res_bo = NULL;
2339 + LIST_HEAD(gart_list);
2340 + LIST_HEAD(vram_list);
2341 +diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c
2342 +index 67cebb23c940..aa04fb0159a7 100644
2343 +--- a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c
2344 ++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c
2345 +@@ -293,13 +293,10 @@ static int vmw_cmdbuf_header_submit(struct vmw_cmdbuf_header *header)
2346 + struct vmw_cmdbuf_man *man = header->man;
2347 + u32 val;
2348 +
2349 +- if (sizeof(header->handle) > 4)
2350 +- val = (header->handle >> 32);
2351 +- else
2352 +- val = 0;
2353 ++ val = upper_32_bits(header->handle);
2354 + vmw_write(man->dev_priv, SVGA_REG_COMMAND_HIGH, val);
2355 +
2356 +- val = (header->handle & 0xFFFFFFFFULL);
2357 ++ val = lower_32_bits(header->handle);
2358 + val |= header->cb_context & SVGA_CB_CONTEXT_MASK;
2359 + vmw_write(man->dev_priv, SVGA_REG_COMMAND_LOW, val);
2360 +
2361 +diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c
2362 +index d415a804fd26..9a8976a79b29 100644
2363 +--- a/drivers/hv/hv.c
2364 ++++ b/drivers/hv/hv.c
2365 +@@ -195,9 +195,7 @@ int hv_init(void)
2366 + {
2367 + int max_leaf;
2368 + union hv_x64_msr_hypercall_contents hypercall_msr;
2369 +- union hv_x64_msr_hypercall_contents tsc_msr;
2370 + void *virtaddr = NULL;
2371 +- void *va_tsc = NULL;
2372 +
2373 + memset(hv_context.synic_event_page, 0, sizeof(void *) * NR_CPUS);
2374 + memset(hv_context.synic_message_page, 0,
2375 +@@ -243,6 +241,9 @@ int hv_init(void)
2376 +
2377 + #ifdef CONFIG_X86_64
2378 + if (ms_hyperv.features & HV_X64_MSR_REFERENCE_TSC_AVAILABLE) {
2379 ++ union hv_x64_msr_hypercall_contents tsc_msr;
2380 ++ void *va_tsc;
2381 ++
2382 + va_tsc = __vmalloc(PAGE_SIZE, GFP_KERNEL, PAGE_KERNEL);
2383 + if (!va_tsc)
2384 + goto cleanup;
2385 +diff --git a/drivers/i2c/i2c-boardinfo.c b/drivers/i2c/i2c-boardinfo.c
2386 +index 90e322959303..42c25aed671d 100644
2387 +--- a/drivers/i2c/i2c-boardinfo.c
2388 ++++ b/drivers/i2c/i2c-boardinfo.c
2389 +@@ -56,9 +56,7 @@ EXPORT_SYMBOL_GPL(__i2c_first_dynamic_bus_num);
2390 + * The board info passed can safely be __initdata, but be careful of embedded
2391 + * pointers (for platform_data, functions, etc) since that won't be copied.
2392 + */
2393 +-int __init
2394 +-i2c_register_board_info(int busnum,
2395 +- struct i2c_board_info const *info, unsigned len)
2396 ++int i2c_register_board_info(int busnum, struct i2c_board_info const *info, unsigned len)
2397 + {
2398 + int status;
2399 +
2400 +diff --git a/drivers/idle/Kconfig b/drivers/idle/Kconfig
2401 +index 4732dfc15447..331adc509f3a 100644
2402 +--- a/drivers/idle/Kconfig
2403 ++++ b/drivers/idle/Kconfig
2404 +@@ -17,6 +17,7 @@ config I7300_IDLE_IOAT_CHANNEL
2405 +
2406 + config I7300_IDLE
2407 + tristate "Intel chipset idle memory power saving driver"
2408 ++ depends on PCI
2409 + select I7300_IDLE_IOAT_CHANNEL
2410 + help
2411 + Enable memory power savings when idle with certain Intel server
2412 +diff --git a/drivers/iio/adc/axp288_adc.c b/drivers/iio/adc/axp288_adc.c
2413 +index f684fe31f832..64799ad7ebad 100644
2414 +--- a/drivers/iio/adc/axp288_adc.c
2415 ++++ b/drivers/iio/adc/axp288_adc.c
2416 +@@ -44,7 +44,7 @@ struct axp288_adc_info {
2417 + struct regmap *regmap;
2418 + };
2419 +
2420 +-static const struct iio_chan_spec const axp288_adc_channels[] = {
2421 ++static const struct iio_chan_spec axp288_adc_channels[] = {
2422 + {
2423 + .indexed = 1,
2424 + .type = IIO_TEMP,
2425 +diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
2426 +index e354358db77b..b6c9a370a38b 100644
2427 +--- a/drivers/infiniband/core/cma.c
2428 ++++ b/drivers/infiniband/core/cma.c
2429 +@@ -626,6 +626,7 @@ struct rdma_cm_id *rdma_create_id(struct net *net,
2430 + INIT_LIST_HEAD(&id_priv->mc_list);
2431 + get_random_bytes(&id_priv->seq_num, sizeof id_priv->seq_num);
2432 + id_priv->id.route.addr.dev_addr.net = get_net(net);
2433 ++ id_priv->seq_num &= 0x00ffffff;
2434 +
2435 + return &id_priv->id;
2436 + }
2437 +diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c
2438 +index 58fce1742b8d..337b1a5eb41c 100644
2439 +--- a/drivers/infiniband/hw/cxgb4/device.c
2440 ++++ b/drivers/infiniband/hw/cxgb4/device.c
2441 +@@ -809,10 +809,9 @@ static int c4iw_rdev_open(struct c4iw_rdev *rdev)
2442 + rdev->lldi.vr->qp.size,
2443 + rdev->lldi.vr->cq.start,
2444 + rdev->lldi.vr->cq.size);
2445 +- PDBG("udb len 0x%x udb base %p db_reg %p gts_reg %p "
2446 ++ PDBG("udb %pR db_reg %p gts_reg %p "
2447 + "qpmask 0x%x cqmask 0x%x\n",
2448 +- (unsigned)pci_resource_len(rdev->lldi.pdev, 2),
2449 +- (void *)pci_resource_start(rdev->lldi.pdev, 2),
2450 ++ &rdev->lldi.pdev->resource[2],
2451 + rdev->lldi.db_reg, rdev->lldi.gts_reg,
2452 + rdev->qpmask, rdev->cqmask);
2453 +
2454 +diff --git a/drivers/input/keyboard/tca8418_keypad.c b/drivers/input/keyboard/tca8418_keypad.c
2455 +index 9002298698fc..3048ef3e3e16 100644
2456 +--- a/drivers/input/keyboard/tca8418_keypad.c
2457 ++++ b/drivers/input/keyboard/tca8418_keypad.c
2458 +@@ -164,11 +164,18 @@ static void tca8418_read_keypad(struct tca8418_keypad *keypad_data)
2459 + int error, col, row;
2460 + u8 reg, state, code;
2461 +
2462 +- /* Initial read of the key event FIFO */
2463 +- error = tca8418_read_byte(keypad_data, REG_KEY_EVENT_A, &reg);
2464 ++ do {
2465 ++ error = tca8418_read_byte(keypad_data, REG_KEY_EVENT_A, &reg);
2466 ++ if (error < 0) {
2467 ++ dev_err(&keypad_data->client->dev,
2468 ++ "unable to read REG_KEY_EVENT_A\n");
2469 ++ break;
2470 ++ }
2471 ++
2472 ++ /* Assume that key code 0 signifies empty FIFO */
2473 ++ if (reg <= 0)
2474 ++ break;
2475 +
2476 +- /* Assume that key code 0 signifies empty FIFO */
2477 +- while (error >= 0 && reg > 0) {
2478 + state = reg & KEY_EVENT_VALUE;
2479 + code = reg & KEY_EVENT_CODE;
2480 +
2481 +@@ -184,11 +191,7 @@ static void tca8418_read_keypad(struct tca8418_keypad *keypad_data)
2482 +
2483 + /* Read for next loop */
2484 + error = tca8418_read_byte(keypad_data, REG_KEY_EVENT_A, &reg);
2485 +- }
2486 +-
2487 +- if (error < 0)
2488 +- dev_err(&keypad_data->client->dev,
2489 +- "unable to read REG_KEY_EVENT_A\n");
2490 ++ } while (1);
2491 +
2492 + input_sync(input);
2493 + }
2494 +diff --git a/drivers/isdn/hardware/eicon/message.c b/drivers/isdn/hardware/eicon/message.c
2495 +index 7b4ddf0a39ec..2d28530b7e82 100644
2496 +--- a/drivers/isdn/hardware/eicon/message.c
2497 ++++ b/drivers/isdn/hardware/eicon/message.c
2498 +@@ -147,7 +147,7 @@ static word plci_remove_check(PLCI *);
2499 + static void listen_check(DIVA_CAPI_ADAPTER *);
2500 + static byte AddInfo(byte **, byte **, byte *, byte *);
2501 + static byte getChannel(API_PARSE *);
2502 +-static void IndParse(PLCI *, word *, byte **, byte);
2503 ++static void IndParse(PLCI *, const word *, byte **, byte);
2504 + static byte ie_compare(byte *, byte *);
2505 + static word find_cip(DIVA_CAPI_ADAPTER *, byte *, byte *);
2506 + static word CPN_filter_ok(byte *cpn, DIVA_CAPI_ADAPTER *, word);
2507 +@@ -4860,7 +4860,7 @@ static void sig_ind(PLCI *plci)
2508 + /* included before the ESC_MSGTYPE and MAXPARMSIDS has to be incremented */
2509 + /* SMSG is situated at the end because its 0 (for compatibility reasons */
2510 + /* (see Info_Mask Bit 4, first IE. then the message type) */
2511 +- word parms_id[] =
2512 ++ static const word parms_id[] =
2513 + {MAXPARMSIDS, CPN, 0xff, DSA, OSA, BC, LLC, HLC, ESC_CAUSE, DSP, DT, CHA,
2514 + UUI, CONG_RR, CONG_RNR, ESC_CHI, KEY, CHI, CAU, ESC_LAW,
2515 + RDN, RDX, CONN_NR, RIN, NI, CAI, ESC_CR,
2516 +@@ -4868,12 +4868,12 @@ static void sig_ind(PLCI *plci)
2517 + /* 14 FTY repl by ESC_CHI */
2518 + /* 18 PI repl by ESC_LAW */
2519 + /* removed OAD changed to 0xff for future use, OAD is multiIE now */
2520 +- word multi_fac_id[] = {1, FTY};
2521 +- word multi_pi_id[] = {1, PI};
2522 +- word multi_CiPN_id[] = {1, OAD};
2523 +- word multi_ssext_id[] = {1, ESC_SSEXT};
2524 ++ static const word multi_fac_id[] = {1, FTY};
2525 ++ static const word multi_pi_id[] = {1, PI};
2526 ++ static const word multi_CiPN_id[] = {1, OAD};
2527 ++ static const word multi_ssext_id[] = {1, ESC_SSEXT};
2528 +
2529 +- word multi_vswitch_id[] = {1, ESC_VSWITCH};
2530 ++ static const word multi_vswitch_id[] = {1, ESC_VSWITCH};
2531 +
2532 + byte *cau;
2533 + word ncci;
2534 +@@ -8926,7 +8926,7 @@ static void listen_check(DIVA_CAPI_ADAPTER *a)
2535 + /* functions for all parameters sent in INDs */
2536 + /*------------------------------------------------------------------*/
2537 +
2538 +-static void IndParse(PLCI *plci, word *parms_id, byte **parms, byte multiIEsize)
2539 ++static void IndParse(PLCI *plci, const word *parms_id, byte **parms, byte multiIEsize)
2540 + {
2541 + word ploc; /* points to current location within packet */
2542 + byte w;
2543 +diff --git a/drivers/isdn/icn/icn.c b/drivers/isdn/icn/icn.c
2544 +index 358a574d9e8b..46d957c34be1 100644
2545 +--- a/drivers/isdn/icn/icn.c
2546 ++++ b/drivers/isdn/icn/icn.c
2547 +@@ -718,7 +718,7 @@ icn_sendbuf(int channel, int ack, struct sk_buff *skb, icn_card *card)
2548 + return 0;
2549 + if (card->sndcount[channel] > ICN_MAX_SQUEUE)
2550 + return 0;
2551 +-#warning TODO test headroom or use skb->nb to flag ACK
2552 ++ /* TODO test headroom or use skb->nb to flag ACK */
2553 + nskb = skb_clone(skb, GFP_ATOMIC);
2554 + if (nskb) {
2555 + /* Push ACK flag as one
2556 +diff --git a/drivers/isdn/sc/init.c b/drivers/isdn/sc/init.c
2557 +index 3597ef47b28a..09fc129ef2fa 100644
2558 +--- a/drivers/isdn/sc/init.c
2559 ++++ b/drivers/isdn/sc/init.c
2560 +@@ -441,6 +441,7 @@ static int identify_board(unsigned long rambase, unsigned int iobase)
2561 + RspMessage rcvmsg;
2562 + ReqMessage sndmsg;
2563 + HWConfig_pl hwci;
2564 ++ void __iomem *rambase_sig = (void __iomem *)rambase + SIG_OFFSET;
2565 + int x;
2566 +
2567 + pr_debug("Attempting to identify adapter @ 0x%lx io 0x%x\n",
2568 +@@ -481,7 +482,7 @@ static int identify_board(unsigned long rambase, unsigned int iobase)
2569 + */
2570 + outb(PRI_BASEPG_VAL, pgport);
2571 + msleep_interruptible(1000);
2572 +- sig = readl(rambase + SIG_OFFSET);
2573 ++ sig = readl(rambase_sig);
2574 + pr_debug("Looking for a signature, got 0x%lx\n", sig);
2575 + if (sig == SIGNATURE)
2576 + return PRI_BOARD;
2577 +@@ -491,7 +492,7 @@ static int identify_board(unsigned long rambase, unsigned int iobase)
2578 + */
2579 + outb(BRI_BASEPG_VAL, pgport);
2580 + msleep_interruptible(1000);
2581 +- sig = readl(rambase + SIG_OFFSET);
2582 ++ sig = readl(rambase_sig);
2583 + pr_debug("Looking for a signature, got 0x%lx\n", sig);
2584 + if (sig == SIGNATURE)
2585 + return BRI_BOARD;
2586 +@@ -501,7 +502,7 @@ static int identify_board(unsigned long rambase, unsigned int iobase)
2587 + /*
2588 + * Try to spot a card
2589 + */
2590 +- sig = readl(rambase + SIG_OFFSET);
2591 ++ sig = readl(rambase_sig);
2592 + pr_debug("Looking for a signature, got 0x%lx\n", sig);
2593 + if (sig != SIGNATURE)
2594 + return -1;
2595 +diff --git a/drivers/md/md.c b/drivers/md/md.c
2596 +index 0a856cb181e9..62c3328e2a1d 100644
2597 +--- a/drivers/md/md.c
2598 ++++ b/drivers/md/md.c
2599 +@@ -1028,8 +1028,9 @@ static int super_90_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor
2600 + * (not needed for Linear and RAID0 as metadata doesn't
2601 + * record this size)
2602 + */
2603 +- if (rdev->sectors >= (2ULL << 32) && sb->level >= 1)
2604 +- rdev->sectors = (2ULL << 32) - 2;
2605 ++ if (IS_ENABLED(CONFIG_LBDAF) && (u64)rdev->sectors >= (2ULL << 32) &&
2606 ++ sb->level >= 1)
2607 ++ rdev->sectors = (sector_t)(2ULL << 32) - 2;
2608 +
2609 + if (rdev->sectors < ((sector_t)sb->size) * 2 && sb->level >= 1)
2610 + /* "this cannot possibly happen" ... */
2611 +@@ -1322,8 +1323,9 @@ super_90_rdev_size_change(struct md_rdev *rdev, sector_t num_sectors)
2612 + /* Limit to 4TB as metadata cannot record more than that.
2613 + * 4TB == 2^32 KB, or 2*2^32 sectors.
2614 + */
2615 +- if (num_sectors >= (2ULL << 32) && rdev->mddev->level >= 1)
2616 +- num_sectors = (2ULL << 32) - 2;
2617 ++ if (IS_ENABLED(CONFIG_LBDAF) && (u64)num_sectors >= (2ULL << 32) &&
2618 ++ rdev->mddev->level >= 1)
2619 ++ num_sectors = (sector_t)(2ULL << 32) - 2;
2620 + md_super_write(rdev->mddev, rdev, rdev->sb_start, rdev->sb_size,
2621 + rdev->sb_page);
2622 + md_super_wait(rdev->mddev);
2623 +diff --git a/drivers/media/common/b2c2/flexcop-fe-tuner.c b/drivers/media/common/b2c2/flexcop-fe-tuner.c
2624 +index 9c59f4306883..f5956402fc69 100644
2625 +--- a/drivers/media/common/b2c2/flexcop-fe-tuner.c
2626 ++++ b/drivers/media/common/b2c2/flexcop-fe-tuner.c
2627 +@@ -38,7 +38,7 @@ static int flexcop_fe_request_firmware(struct dvb_frontend *fe,
2628 + #endif
2629 +
2630 + /* lnb control */
2631 +-#if FE_SUPPORTED(MT312) || FE_SUPPORTED(STV0299)
2632 ++#if (FE_SUPPORTED(MT312) || FE_SUPPORTED(STV0299)) && FE_SUPPORTED(PLL)
2633 + static int flexcop_set_voltage(struct dvb_frontend *fe,
2634 + enum fe_sec_voltage voltage)
2635 + {
2636 +@@ -68,7 +68,7 @@ static int flexcop_set_voltage(struct dvb_frontend *fe,
2637 + #endif
2638 +
2639 + #if FE_SUPPORTED(S5H1420) || FE_SUPPORTED(STV0299) || FE_SUPPORTED(MT312)
2640 +-static int flexcop_sleep(struct dvb_frontend* fe)
2641 ++static int __maybe_unused flexcop_sleep(struct dvb_frontend* fe)
2642 + {
2643 + struct flexcop_device *fc = fe->dvb->priv;
2644 + if (fc->fe_sleep)
2645 +diff --git a/drivers/media/i2c/s5k6aa.c b/drivers/media/i2c/s5k6aa.c
2646 +index d0ad6a25bdab..5ac2babe123b 100644
2647 +--- a/drivers/media/i2c/s5k6aa.c
2648 ++++ b/drivers/media/i2c/s5k6aa.c
2649 +@@ -421,6 +421,7 @@ static int s5k6aa_set_ahb_address(struct i2c_client *client)
2650 +
2651 + /**
2652 + * s5k6aa_configure_pixel_clock - apply ISP main clock/PLL configuration
2653 ++ * @s5k6aa: pointer to &struct s5k6aa describing the device
2654 + *
2655 + * Configure the internal ISP PLL for the required output frequency.
2656 + * Locking: called with s5k6aa.lock mutex held.
2657 +@@ -669,6 +670,7 @@ static int s5k6aa_set_input_params(struct s5k6aa *s5k6aa)
2658 +
2659 + /**
2660 + * s5k6aa_configure_video_bus - configure the video output interface
2661 ++ * @s5k6aa: pointer to &struct s5k6aa describing the device
2662 + * @bus_type: video bus type: parallel or MIPI-CSI
2663 + * @nlanes: number of MIPI lanes to be used (MIPI-CSI only)
2664 + *
2665 +@@ -724,6 +726,8 @@ static int s5k6aa_new_config_sync(struct i2c_client *client, int timeout,
2666 +
2667 + /**
2668 + * s5k6aa_set_prev_config - write user preview register set
2669 ++ * @s5k6aa: pointer to &struct s5k6aa describing the device
2670 ++ * @preset: s5kaa preset to be applied
2671 + *
2672 + * Configure output resolution and color fromat, pixel clock
2673 + * frequency range, device frame rate type and frame period range.
2674 +@@ -777,6 +781,7 @@ static int s5k6aa_set_prev_config(struct s5k6aa *s5k6aa,
2675 +
2676 + /**
2677 + * s5k6aa_initialize_isp - basic ISP MCU initialization
2678 ++ * @sd: pointer to V4L2 sub-device descriptor
2679 + *
2680 + * Configure AHB addresses for registers read/write; configure PLLs for
2681 + * required output pixel clock. The ISP power supply needs to be already
2682 +diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c
2683 +index 9ef5baaf8646..ea2777e1ee10 100644
2684 +--- a/drivers/media/i2c/tc358743.c
2685 ++++ b/drivers/media/i2c/tc358743.c
2686 +@@ -197,57 +197,61 @@ static void i2c_wr(struct v4l2_subdev *sd, u16 reg, u8 *values, u32 n)
2687 + }
2688 + }
2689 +
2690 +-static u8 i2c_rd8(struct v4l2_subdev *sd, u16 reg)
2691 ++static noinline u32 i2c_rdreg(struct v4l2_subdev *sd, u16 reg, u32 n)
2692 + {
2693 +- u8 val;
2694 ++ __le32 val = 0;
2695 +
2696 +- i2c_rd(sd, reg, &val, 1);
2697 ++ i2c_rd(sd, reg, (u8 __force *)&val, n);
2698 +
2699 +- return val;
2700 ++ return le32_to_cpu(val);
2701 ++}
2702 ++
2703 ++static noinline void i2c_wrreg(struct v4l2_subdev *sd, u16 reg, u32 val, u32 n)
2704 ++{
2705 ++ __le32 raw = cpu_to_le32(val);
2706 ++
2707 ++ i2c_wr(sd, reg, (u8 __force *)&raw, n);
2708 ++}
2709 ++
2710 ++static u8 i2c_rd8(struct v4l2_subdev *sd, u16 reg)
2711 ++{
2712 ++ return i2c_rdreg(sd, reg, 1);
2713 + }
2714 +
2715 + static void i2c_wr8(struct v4l2_subdev *sd, u16 reg, u8 val)
2716 + {
2717 +- i2c_wr(sd, reg, &val, 1);
2718 ++ i2c_wrreg(sd, reg, val, 1);
2719 + }
2720 +
2721 + static void i2c_wr8_and_or(struct v4l2_subdev *sd, u16 reg,
2722 + u8 mask, u8 val)
2723 + {
2724 +- i2c_wr8(sd, reg, (i2c_rd8(sd, reg) & mask) | val);
2725 ++ i2c_wrreg(sd, reg, (i2c_rdreg(sd, reg, 2) & mask) | val, 2);
2726 + }
2727 +
2728 + static u16 i2c_rd16(struct v4l2_subdev *sd, u16 reg)
2729 + {
2730 +- u16 val;
2731 +-
2732 +- i2c_rd(sd, reg, (u8 *)&val, 2);
2733 +-
2734 +- return val;
2735 ++ return i2c_rdreg(sd, reg, 2);
2736 + }
2737 +
2738 + static void i2c_wr16(struct v4l2_subdev *sd, u16 reg, u16 val)
2739 + {
2740 +- i2c_wr(sd, reg, (u8 *)&val, 2);
2741 ++ i2c_wrreg(sd, reg, val, 2);
2742 + }
2743 +
2744 + static void i2c_wr16_and_or(struct v4l2_subdev *sd, u16 reg, u16 mask, u16 val)
2745 + {
2746 +- i2c_wr16(sd, reg, (i2c_rd16(sd, reg) & mask) | val);
2747 ++ i2c_wrreg(sd, reg, (i2c_rdreg(sd, reg, 2) & mask) | val, 2);
2748 + }
2749 +
2750 + static u32 i2c_rd32(struct v4l2_subdev *sd, u16 reg)
2751 + {
2752 +- u32 val;
2753 +-
2754 +- i2c_rd(sd, reg, (u8 *)&val, 4);
2755 +-
2756 +- return val;
2757 ++ return i2c_rdreg(sd, reg, 4);
2758 + }
2759 +
2760 + static void i2c_wr32(struct v4l2_subdev *sd, u16 reg, u32 val)
2761 + {
2762 +- i2c_wr(sd, reg, (u8 *)&val, 4);
2763 ++ i2c_wrreg(sd, reg, val, 4);
2764 + }
2765 +
2766 + /* --------------- STATUS --------------- */
2767 +@@ -1240,7 +1244,7 @@ static int tc358743_g_register(struct v4l2_subdev *sd,
2768 +
2769 + reg->size = tc358743_get_reg_size(reg->reg);
2770 +
2771 +- i2c_rd(sd, reg->reg, (u8 *)&reg->val, reg->size);
2772 ++ reg->val = i2c_rdreg(sd, reg->reg, reg->size);
2773 +
2774 + return 0;
2775 + }
2776 +@@ -1266,7 +1270,7 @@ static int tc358743_s_register(struct v4l2_subdev *sd,
2777 + reg->reg == BCAPS)
2778 + return 0;
2779 +
2780 +- i2c_wr(sd, (u16)reg->reg, (u8 *)&reg->val,
2781 ++ i2c_wrreg(sd, (u16)reg->reg, reg->val,
2782 + tc358743_get_reg_size(reg->reg));
2783 +
2784 + return 0;
2785 +diff --git a/drivers/media/usb/em28xx/Kconfig b/drivers/media/usb/em28xx/Kconfig
2786 +index e382210c4ada..75323f5efd0f 100644
2787 +--- a/drivers/media/usb/em28xx/Kconfig
2788 ++++ b/drivers/media/usb/em28xx/Kconfig
2789 +@@ -11,7 +11,7 @@ config VIDEO_EM28XX_V4L2
2790 + select VIDEO_SAA711X if MEDIA_SUBDRV_AUTOSELECT
2791 + select VIDEO_TVP5150 if MEDIA_SUBDRV_AUTOSELECT
2792 + select VIDEO_MSP3400 if MEDIA_SUBDRV_AUTOSELECT
2793 +- select VIDEO_MT9V011 if MEDIA_SUBDRV_AUTOSELECT
2794 ++ select VIDEO_MT9V011 if MEDIA_SUBDRV_AUTOSELECT && MEDIA_CAMERA_SUPPORT
2795 +
2796 + ---help---
2797 + This is a video4linux driver for Empia 28xx based TV cards.
2798 +diff --git a/drivers/media/usb/go7007/Kconfig b/drivers/media/usb/go7007/Kconfig
2799 +index 95a3af644a92..af1d02430931 100644
2800 +--- a/drivers/media/usb/go7007/Kconfig
2801 ++++ b/drivers/media/usb/go7007/Kconfig
2802 +@@ -11,7 +11,7 @@ config VIDEO_GO7007
2803 + select VIDEO_TW2804 if MEDIA_SUBDRV_AUTOSELECT
2804 + select VIDEO_TW9903 if MEDIA_SUBDRV_AUTOSELECT
2805 + select VIDEO_TW9906 if MEDIA_SUBDRV_AUTOSELECT
2806 +- select VIDEO_OV7640 if MEDIA_SUBDRV_AUTOSELECT
2807 ++ select VIDEO_OV7640 if MEDIA_SUBDRV_AUTOSELECT && MEDIA_CAMERA_SUPPORT
2808 + select VIDEO_UDA1342 if MEDIA_SUBDRV_AUTOSELECT
2809 + ---help---
2810 + This is a video4linux driver for the WIS GO7007 MPEG
2811 +diff --git a/drivers/media/usb/hdpvr/hdpvr-core.c b/drivers/media/usb/hdpvr/hdpvr-core.c
2812 +index 3fc64197b4e6..08f0ca7aa012 100644
2813 +--- a/drivers/media/usb/hdpvr/hdpvr-core.c
2814 ++++ b/drivers/media/usb/hdpvr/hdpvr-core.c
2815 +@@ -273,7 +273,9 @@ static int hdpvr_probe(struct usb_interface *interface,
2816 + struct hdpvr_device *dev;
2817 + struct usb_host_interface *iface_desc;
2818 + struct usb_endpoint_descriptor *endpoint;
2819 ++#if IS_ENABLED(CONFIG_I2C)
2820 + struct i2c_client *client;
2821 ++#endif
2822 + size_t buffer_size;
2823 + int i;
2824 + int retval = -ENOMEM;
2825 +diff --git a/drivers/media/usb/pwc/pwc-if.c b/drivers/media/usb/pwc/pwc-if.c
2826 +index 58f23bcfe94e..299750e56916 100644
2827 +--- a/drivers/media/usb/pwc/pwc-if.c
2828 ++++ b/drivers/media/usb/pwc/pwc-if.c
2829 +@@ -1119,8 +1119,10 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
2830 +
2831 + return 0;
2832 +
2833 ++#ifdef CONFIG_USB_PWC_INPUT_EVDEV
2834 + err_video_unreg:
2835 + video_unregister_device(&pdev->vdev);
2836 ++#endif
2837 + err_unregister_v4l2_dev:
2838 + v4l2_device_unregister(&pdev->v4l2_dev);
2839 + err_free_controls:
2840 +diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig
2841 +index 9beece00869b..29b3436d0910 100644
2842 +--- a/drivers/media/v4l2-core/Kconfig
2843 ++++ b/drivers/media/v4l2-core/Kconfig
2844 +@@ -37,7 +37,6 @@ config VIDEO_PCI_SKELETON
2845 + # Used by drivers that need tuner.ko
2846 + config VIDEO_TUNER
2847 + tristate
2848 +- depends on MEDIA_TUNER
2849 +
2850 + # Used by drivers that need v4l2-mem2mem.ko
2851 + config V4L2_MEM2MEM_DEV
2852 +diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
2853 +index 5dcc0313c38a..207370d68c17 100644
2854 +--- a/drivers/message/fusion/mptbase.c
2855 ++++ b/drivers/message/fusion/mptbase.c
2856 +@@ -6848,6 +6848,7 @@ mpt_print_ioc_summary(MPT_ADAPTER *ioc, char *buffer, int *size, int len, int sh
2857 + *size = y;
2858 + }
2859 +
2860 ++#ifdef CONFIG_PROC_FS
2861 + static void seq_mpt_print_ioc_summary(MPT_ADAPTER *ioc, struct seq_file *m, int showlan)
2862 + {
2863 + char expVer[32];
2864 +@@ -6879,6 +6880,7 @@ static void seq_mpt_print_ioc_summary(MPT_ADAPTER *ioc, struct seq_file *m, int
2865 +
2866 + seq_putc(m, '\n');
2867 + }
2868 ++#endif
2869 +
2870 + /**
2871 + * mpt_set_taskmgmt_in_progress_flag - set flags associated with task management
2872 +diff --git a/drivers/mtd/chips/Kconfig b/drivers/mtd/chips/Kconfig
2873 +index 8a25adced79f..bbfa1f129266 100644
2874 +--- a/drivers/mtd/chips/Kconfig
2875 ++++ b/drivers/mtd/chips/Kconfig
2876 +@@ -67,6 +67,10 @@ endchoice
2877 + config MTD_CFI_GEOMETRY
2878 + bool "Specific CFI Flash geometry selection"
2879 + depends on MTD_CFI_ADV_OPTIONS
2880 ++ select MTD_MAP_BANK_WIDTH_1 if !(MTD_MAP_BANK_WIDTH_2 || \
2881 ++ MTD_MAP_BANK_WIDTH_4 || MTD_MAP_BANK_WIDTH_8 || \
2882 ++ MTD_MAP_BANK_WIDTH_16 || MTD_MAP_BANK_WIDTH_32)
2883 ++ select MTD_CFI_I1 if !(MTD_CFI_I2 || MTD_CFI_I4 || MTD_CFI_I8)
2884 + help
2885 + This option does not affect the code directly, but will enable
2886 + some other configuration options which would allow you to reduce
2887 +diff --git a/drivers/mtd/maps/ck804xrom.c b/drivers/mtd/maps/ck804xrom.c
2888 +index 0455166f05fa..4f206a99164c 100644
2889 +--- a/drivers/mtd/maps/ck804xrom.c
2890 ++++ b/drivers/mtd/maps/ck804xrom.c
2891 +@@ -112,8 +112,8 @@ static void ck804xrom_cleanup(struct ck804xrom_window *window)
2892 + }
2893 +
2894 +
2895 +-static int ck804xrom_init_one(struct pci_dev *pdev,
2896 +- const struct pci_device_id *ent)
2897 ++static int __init ck804xrom_init_one(struct pci_dev *pdev,
2898 ++ const struct pci_device_id *ent)
2899 + {
2900 + static char *rom_probe_types[] = { "cfi_probe", "jedec_probe", NULL };
2901 + u8 byte;
2902 +diff --git a/drivers/mtd/maps/esb2rom.c b/drivers/mtd/maps/esb2rom.c
2903 +index 76ed651b515b..9646b0766ce0 100644
2904 +--- a/drivers/mtd/maps/esb2rom.c
2905 ++++ b/drivers/mtd/maps/esb2rom.c
2906 +@@ -144,8 +144,8 @@ static void esb2rom_cleanup(struct esb2rom_window *window)
2907 + pci_dev_put(window->pdev);
2908 + }
2909 +
2910 +-static int esb2rom_init_one(struct pci_dev *pdev,
2911 +- const struct pci_device_id *ent)
2912 ++static int __init esb2rom_init_one(struct pci_dev *pdev,
2913 ++ const struct pci_device_id *ent)
2914 + {
2915 + static char *rom_probe_types[] = { "cfi_probe", "jedec_probe", NULL };
2916 + struct esb2rom_window *window = &esb2rom_window;
2917 +diff --git a/drivers/mtd/maps/ichxrom.c b/drivers/mtd/maps/ichxrom.c
2918 +index 8636bba42200..976d42f63aef 100644
2919 +--- a/drivers/mtd/maps/ichxrom.c
2920 ++++ b/drivers/mtd/maps/ichxrom.c
2921 +@@ -57,10 +57,12 @@ static void ichxrom_cleanup(struct ichxrom_window *window)
2922 + {
2923 + struct ichxrom_map_info *map, *scratch;
2924 + u16 word;
2925 ++ int ret;
2926 +
2927 + /* Disable writes through the rom window */
2928 +- pci_read_config_word(window->pdev, BIOS_CNTL, &word);
2929 +- pci_write_config_word(window->pdev, BIOS_CNTL, word & ~1);
2930 ++ ret = pci_read_config_word(window->pdev, BIOS_CNTL, &word);
2931 ++ if (!ret)
2932 ++ pci_write_config_word(window->pdev, BIOS_CNTL, word & ~1);
2933 + pci_dev_put(window->pdev);
2934 +
2935 + /* Free all of the mtd devices */
2936 +@@ -84,8 +86,8 @@ static void ichxrom_cleanup(struct ichxrom_window *window)
2937 + }
2938 +
2939 +
2940 +-static int ichxrom_init_one(struct pci_dev *pdev,
2941 +- const struct pci_device_id *ent)
2942 ++static int __init ichxrom_init_one(struct pci_dev *pdev,
2943 ++ const struct pci_device_id *ent)
2944 + {
2945 + static char *rom_probe_types[] = { "cfi_probe", "jedec_probe", NULL };
2946 + struct ichxrom_window *window = &ichxrom_window;
2947 +diff --git a/drivers/mtd/nand/sh_flctl.c b/drivers/mtd/nand/sh_flctl.c
2948 +index bcba1a924c75..1f2785ee909f 100644
2949 +--- a/drivers/mtd/nand/sh_flctl.c
2950 ++++ b/drivers/mtd/nand/sh_flctl.c
2951 +@@ -160,7 +160,7 @@ static void flctl_setup_dma(struct sh_flctl *flctl)
2952 +
2953 + memset(&cfg, 0, sizeof(cfg));
2954 + cfg.direction = DMA_MEM_TO_DEV;
2955 +- cfg.dst_addr = (dma_addr_t)FLDTFIFO(flctl);
2956 ++ cfg.dst_addr = flctl->fifo;
2957 + cfg.src_addr = 0;
2958 + ret = dmaengine_slave_config(flctl->chan_fifo0_tx, &cfg);
2959 + if (ret < 0)
2960 +@@ -176,7 +176,7 @@ static void flctl_setup_dma(struct sh_flctl *flctl)
2961 +
2962 + cfg.direction = DMA_DEV_TO_MEM;
2963 + cfg.dst_addr = 0;
2964 +- cfg.src_addr = (dma_addr_t)FLDTFIFO(flctl);
2965 ++ cfg.src_addr = flctl->fifo;
2966 + ret = dmaengine_slave_config(flctl->chan_fifo0_rx, &cfg);
2967 + if (ret < 0)
2968 + goto err;
2969 +@@ -1096,6 +1096,7 @@ static int flctl_probe(struct platform_device *pdev)
2970 + flctl->reg = devm_ioremap_resource(&pdev->dev, res);
2971 + if (IS_ERR(flctl->reg))
2972 + return PTR_ERR(flctl->reg);
2973 ++ flctl->fifo = res->start + 0x24; /* FLDTFIFO */
2974 +
2975 + irq = platform_get_irq(pdev, 0);
2976 + if (irq < 0) {
2977 +diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
2978 +index f184fb5bd110..5116aec3c174 100644
2979 +--- a/drivers/net/Kconfig
2980 ++++ b/drivers/net/Kconfig
2981 +@@ -411,6 +411,9 @@ config XEN_NETDEV_BACKEND
2982 + config VMXNET3
2983 + tristate "VMware VMXNET3 ethernet driver"
2984 + depends on PCI && INET
2985 ++ depends on !(PAGE_SIZE_64KB || ARM64_64K_PAGES || \
2986 ++ IA64_PAGE_SIZE_64KB || MICROBLAZE_64K_PAGES || \
2987 ++ PARISC_PAGE_SIZE_64KB || PPC_64K_PAGES)
2988 + help
2989 + This driver supports VMware's vmxnet3 virtual ethernet NIC.
2990 + To compile this driver as a module, choose M here: the
2991 +diff --git a/drivers/net/ethernet/3com/3c509.c b/drivers/net/ethernet/3com/3c509.c
2992 +index 4547a1b8b958..7677c745fb30 100644
2993 +--- a/drivers/net/ethernet/3com/3c509.c
2994 ++++ b/drivers/net/ethernet/3com/3c509.c
2995 +@@ -562,7 +562,7 @@ static void el3_common_remove (struct net_device *dev)
2996 + }
2997 +
2998 + #ifdef CONFIG_EISA
2999 +-static int __init el3_eisa_probe (struct device *device)
3000 ++static int el3_eisa_probe(struct device *device)
3001 + {
3002 + short i;
3003 + int ioaddr, irq, if_port;
3004 +diff --git a/drivers/net/ethernet/3com/3c59x.c b/drivers/net/ethernet/3com/3c59x.c
3005 +index 2839af00f20c..1c5f3b273e6a 100644
3006 +--- a/drivers/net/ethernet/3com/3c59x.c
3007 ++++ b/drivers/net/ethernet/3com/3c59x.c
3008 +@@ -907,7 +907,7 @@ static struct eisa_device_id vortex_eisa_ids[] = {
3009 + };
3010 + MODULE_DEVICE_TABLE(eisa, vortex_eisa_ids);
3011 +
3012 +-static int __init vortex_eisa_probe(struct device *device)
3013 ++static int vortex_eisa_probe(struct device *device)
3014 + {
3015 + void __iomem *ioaddr;
3016 + struct eisa_device *edev;
3017 +diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-main.c b/drivers/net/ethernet/amd/xgbe/xgbe-main.c
3018 +index 618d952c2984..2ef4b4e884ae 100644
3019 +--- a/drivers/net/ethernet/amd/xgbe/xgbe-main.c
3020 ++++ b/drivers/net/ethernet/amd/xgbe/xgbe-main.c
3021 +@@ -829,7 +829,7 @@ static int xgbe_remove(struct platform_device *pdev)
3022 + return 0;
3023 + }
3024 +
3025 +-#ifdef CONFIG_PM
3026 ++#ifdef CONFIG_PM_SLEEP
3027 + static int xgbe_suspend(struct device *dev)
3028 + {
3029 + struct net_device *netdev = dev_get_drvdata(dev);
3030 +@@ -868,7 +868,7 @@ static int xgbe_resume(struct device *dev)
3031 +
3032 + return ret;
3033 + }
3034 +-#endif /* CONFIG_PM */
3035 ++#endif /* CONFIG_PM_SLEEP */
3036 +
3037 + #ifdef CONFIG_ACPI
3038 + static const struct acpi_device_id xgbe_acpi_match[] = {
3039 +diff --git a/drivers/net/ethernet/dec/tulip/de4x5.c b/drivers/net/ethernet/dec/tulip/de4x5.c
3040 +index 8966f3159bb2..3acde3b9b767 100644
3041 +--- a/drivers/net/ethernet/dec/tulip/de4x5.c
3042 ++++ b/drivers/net/ethernet/dec/tulip/de4x5.c
3043 +@@ -1990,7 +1990,7 @@ SetMulticastFilter(struct net_device *dev)
3044 +
3045 + static u_char de4x5_irq[] = EISA_ALLOWED_IRQ_LIST;
3046 +
3047 +-static int __init de4x5_eisa_probe (struct device *gendev)
3048 ++static int de4x5_eisa_probe(struct device *gendev)
3049 + {
3050 + struct eisa_device *edev;
3051 + u_long iobase;
3052 +diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
3053 +index 7923bfdc9b30..901661149b44 100644
3054 +--- a/drivers/net/ethernet/freescale/gianfar.c
3055 ++++ b/drivers/net/ethernet/freescale/gianfar.c
3056 +@@ -1375,9 +1375,11 @@ static int gfar_probe(struct platform_device *ofdev)
3057 +
3058 + gfar_init_addr_hash_table(priv);
3059 +
3060 +- /* Insert receive time stamps into padding alignment bytes */
3061 ++ /* Insert receive time stamps into padding alignment bytes, and
3062 ++ * plus 2 bytes padding to ensure the cpu alignment.
3063 ++ */
3064 + if (priv->device_flags & FSL_GIANFAR_DEV_HAS_TIMER)
3065 +- priv->padding = 8;
3066 ++ priv->padding = 8 + DEFAULT_PADDING;
3067 +
3068 + if (dev->features & NETIF_F_IP_CSUM ||
3069 + priv->device_flags & FSL_GIANFAR_DEV_HAS_TIMER)
3070 +diff --git a/drivers/net/ethernet/hp/hp100.c b/drivers/net/ethernet/hp/hp100.c
3071 +index ae6e30d39f0f..3daf2d4a7ca0 100644
3072 +--- a/drivers/net/ethernet/hp/hp100.c
3073 ++++ b/drivers/net/ethernet/hp/hp100.c
3074 +@@ -194,7 +194,6 @@ static const char *hp100_isa_tbl[] = {
3075 + };
3076 + #endif
3077 +
3078 +-#ifdef CONFIG_EISA
3079 + static struct eisa_device_id hp100_eisa_tbl[] = {
3080 + { "HWPF180" }, /* HP J2577 rev A */
3081 + { "HWP1920" }, /* HP 27248B */
3082 +@@ -205,9 +204,7 @@ static struct eisa_device_id hp100_eisa_tbl[] = {
3083 + { "" } /* Mandatory final entry ! */
3084 + };
3085 + MODULE_DEVICE_TABLE(eisa, hp100_eisa_tbl);
3086 +-#endif
3087 +
3088 +-#ifdef CONFIG_PCI
3089 + static const struct pci_device_id hp100_pci_tbl[] = {
3090 + {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585A, PCI_ANY_ID, PCI_ANY_ID,},
3091 + {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585B, PCI_ANY_ID, PCI_ANY_ID,},
3092 +@@ -219,7 +216,6 @@ static const struct pci_device_id hp100_pci_tbl[] = {
3093 + {} /* Terminating entry */
3094 + };
3095 + MODULE_DEVICE_TABLE(pci, hp100_pci_tbl);
3096 +-#endif
3097 +
3098 + static int hp100_rx_ratio = HP100_DEFAULT_RX_RATIO;
3099 + static int hp100_priority_tx = HP100_DEFAULT_PRIORITY_TX;
3100 +@@ -2842,8 +2838,7 @@ static void cleanup_dev(struct net_device *d)
3101 + free_netdev(d);
3102 + }
3103 +
3104 +-#ifdef CONFIG_EISA
3105 +-static int __init hp100_eisa_probe (struct device *gendev)
3106 ++static int hp100_eisa_probe(struct device *gendev)
3107 + {
3108 + struct net_device *dev = alloc_etherdev(sizeof(struct hp100_private));
3109 + struct eisa_device *edev = to_eisa_device(gendev);
3110 +@@ -2884,9 +2879,7 @@ static struct eisa_driver hp100_eisa_driver = {
3111 + .remove = hp100_eisa_remove,
3112 + }
3113 + };
3114 +-#endif
3115 +
3116 +-#ifdef CONFIG_PCI
3117 + static int hp100_pci_probe(struct pci_dev *pdev,
3118 + const struct pci_device_id *ent)
3119 + {
3120 +@@ -2955,7 +2948,6 @@ static struct pci_driver hp100_pci_driver = {
3121 + .probe = hp100_pci_probe,
3122 + .remove = hp100_pci_remove,
3123 + };
3124 +-#endif
3125 +
3126 + /*
3127 + * module section
3128 +@@ -3032,23 +3024,17 @@ static int __init hp100_module_init(void)
3129 + err = hp100_isa_init();
3130 + if (err && err != -ENODEV)
3131 + goto out;
3132 +-#ifdef CONFIG_EISA
3133 + err = eisa_driver_register(&hp100_eisa_driver);
3134 + if (err && err != -ENODEV)
3135 + goto out2;
3136 +-#endif
3137 +-#ifdef CONFIG_PCI
3138 + err = pci_register_driver(&hp100_pci_driver);
3139 + if (err && err != -ENODEV)
3140 + goto out3;
3141 +-#endif
3142 + out:
3143 + return err;
3144 + out3:
3145 +-#ifdef CONFIG_EISA
3146 + eisa_driver_unregister (&hp100_eisa_driver);
3147 + out2:
3148 +-#endif
3149 + hp100_isa_cleanup();
3150 + goto out;
3151 + }
3152 +@@ -3057,12 +3043,8 @@ static int __init hp100_module_init(void)
3153 + static void __exit hp100_module_exit(void)
3154 + {
3155 + hp100_isa_cleanup();
3156 +-#ifdef CONFIG_EISA
3157 + eisa_driver_unregister (&hp100_eisa_driver);
3158 +-#endif
3159 +-#ifdef CONFIG_PCI
3160 + pci_unregister_driver (&hp100_pci_driver);
3161 +-#endif
3162 + }
3163 +
3164 + module_init(hp100_module_init)
3165 +diff --git a/drivers/net/ethernet/ti/tlan.c b/drivers/net/ethernet/ti/tlan.c
3166 +index a274cd49afe9..399a89f30826 100644
3167 +--- a/drivers/net/ethernet/ti/tlan.c
3168 ++++ b/drivers/net/ethernet/ti/tlan.c
3169 +@@ -610,8 +610,8 @@ err_out_regions:
3170 + #ifdef CONFIG_PCI
3171 + if (pdev)
3172 + pci_release_regions(pdev);
3173 +-#endif
3174 + err_out:
3175 ++#endif
3176 + if (pdev)
3177 + pci_disable_device(pdev);
3178 + return rc;
3179 +diff --git a/drivers/net/hippi/rrunner.c b/drivers/net/hippi/rrunner.c
3180 +index 95c0b45a68fb..313e006f74fe 100644
3181 +--- a/drivers/net/hippi/rrunner.c
3182 ++++ b/drivers/net/hippi/rrunner.c
3183 +@@ -1381,8 +1381,8 @@ static int rr_close(struct net_device *dev)
3184 + rrpriv->info_dma);
3185 + rrpriv->info = NULL;
3186 +
3187 +- free_irq(pdev->irq, dev);
3188 + spin_unlock_irqrestore(&rrpriv->lock, flags);
3189 ++ free_irq(pdev->irq, dev);
3190 +
3191 + return 0;
3192 + }
3193 +diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c
3194 +index af827faec7fe..8aecea0d5dbf 100644
3195 +--- a/drivers/net/ipvlan/ipvlan_core.c
3196 ++++ b/drivers/net/ipvlan/ipvlan_core.c
3197 +@@ -353,6 +353,7 @@ static int ipvlan_process_v4_outbound(struct sk_buff *skb)
3198 + .flowi4_oif = dev->ifindex,
3199 + .flowi4_tos = RT_TOS(ip4h->tos),
3200 + .flowi4_flags = FLOWI_FLAG_ANYSRC,
3201 ++ .flowi4_mark = skb->mark,
3202 + .daddr = ip4h->daddr,
3203 + .saddr = ip4h->saddr,
3204 + };
3205 +diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig
3206 +index 1f6893ebce16..3a7286256db0 100644
3207 +--- a/drivers/net/usb/Kconfig
3208 ++++ b/drivers/net/usb/Kconfig
3209 +@@ -395,6 +395,10 @@ config USB_NET_RNDIS_HOST
3210 + The protocol specification is incomplete, and is controlled by
3211 + (and for) Microsoft; it isn't an "Open" ecosystem or market.
3212 +
3213 ++config USB_NET_CDC_SUBSET_ENABLE
3214 ++ tristate
3215 ++ depends on USB_NET_CDC_SUBSET
3216 ++
3217 + config USB_NET_CDC_SUBSET
3218 + tristate "Simple USB Network Links (CDC Ethernet subset)"
3219 + depends on USB_USBNET
3220 +@@ -413,6 +417,7 @@ config USB_NET_CDC_SUBSET
3221 + config USB_ALI_M5632
3222 + bool "ALi M5632 based 'USB 2.0 Data Link' cables"
3223 + depends on USB_NET_CDC_SUBSET
3224 ++ select USB_NET_CDC_SUBSET_ENABLE
3225 + help
3226 + Choose this option if you're using a host-to-host cable
3227 + based on this design, which supports USB 2.0 high speed.
3228 +@@ -420,6 +425,7 @@ config USB_ALI_M5632
3229 + config USB_AN2720
3230 + bool "AnchorChips 2720 based cables (Xircom PGUNET, ...)"
3231 + depends on USB_NET_CDC_SUBSET
3232 ++ select USB_NET_CDC_SUBSET_ENABLE
3233 + help
3234 + Choose this option if you're using a host-to-host cable
3235 + based on this design. Note that AnchorChips is now a
3236 +@@ -428,6 +434,7 @@ config USB_AN2720
3237 + config USB_BELKIN
3238 + bool "eTEK based host-to-host cables (Advance, Belkin, ...)"
3239 + depends on USB_NET_CDC_SUBSET
3240 ++ select USB_NET_CDC_SUBSET_ENABLE
3241 + default y
3242 + help
3243 + Choose this option if you're using a host-to-host cable
3244 +@@ -437,6 +444,7 @@ config USB_BELKIN
3245 + config USB_ARMLINUX
3246 + bool "Embedded ARM Linux links (iPaq, ...)"
3247 + depends on USB_NET_CDC_SUBSET
3248 ++ select USB_NET_CDC_SUBSET_ENABLE
3249 + default y
3250 + help
3251 + Choose this option to support the "usb-eth" networking driver
3252 +@@ -454,6 +462,7 @@ config USB_ARMLINUX
3253 + config USB_EPSON2888
3254 + bool "Epson 2888 based firmware (DEVELOPMENT)"
3255 + depends on USB_NET_CDC_SUBSET
3256 ++ select USB_NET_CDC_SUBSET_ENABLE
3257 + help
3258 + Choose this option to support the usb networking links used
3259 + by some sample firmware from Epson.
3260 +@@ -461,6 +470,7 @@ config USB_EPSON2888
3261 + config USB_KC2190
3262 + bool "KT Technology KC2190 based cables (InstaNet)"
3263 + depends on USB_NET_CDC_SUBSET
3264 ++ select USB_NET_CDC_SUBSET_ENABLE
3265 + help
3266 + Choose this option if you're using a host-to-host cable
3267 + with one of these chips.
3268 +diff --git a/drivers/net/usb/Makefile b/drivers/net/usb/Makefile
3269 +index b5f04068dbe4..37fb46aee341 100644
3270 +--- a/drivers/net/usb/Makefile
3271 ++++ b/drivers/net/usb/Makefile
3272 +@@ -23,7 +23,7 @@ obj-$(CONFIG_USB_NET_GL620A) += gl620a.o
3273 + obj-$(CONFIG_USB_NET_NET1080) += net1080.o
3274 + obj-$(CONFIG_USB_NET_PLUSB) += plusb.o
3275 + obj-$(CONFIG_USB_NET_RNDIS_HOST) += rndis_host.o
3276 +-obj-$(CONFIG_USB_NET_CDC_SUBSET) += cdc_subset.o
3277 ++obj-$(CONFIG_USB_NET_CDC_SUBSET_ENABLE) += cdc_subset.o
3278 + obj-$(CONFIG_USB_NET_ZAURUS) += zaurus.o
3279 + obj-$(CONFIG_USB_NET_MCS7830) += mcs7830.o
3280 + obj-$(CONFIG_USB_USBNET) += usbnet.o
3281 +diff --git a/drivers/net/wireless/cw1200/cw1200_spi.c b/drivers/net/wireless/cw1200/cw1200_spi.c
3282 +index a740083634d8..63f95e9c2992 100644
3283 +--- a/drivers/net/wireless/cw1200/cw1200_spi.c
3284 ++++ b/drivers/net/wireless/cw1200/cw1200_spi.c
3285 +@@ -446,8 +446,7 @@ static int cw1200_spi_disconnect(struct spi_device *func)
3286 + return 0;
3287 + }
3288 +
3289 +-#ifdef CONFIG_PM
3290 +-static int cw1200_spi_suspend(struct device *dev)
3291 ++static int __maybe_unused cw1200_spi_suspend(struct device *dev)
3292 + {
3293 + struct hwbus_priv *self = spi_get_drvdata(to_spi_device(dev));
3294 +
3295 +@@ -460,16 +459,12 @@ static int cw1200_spi_suspend(struct device *dev)
3296 +
3297 + static SIMPLE_DEV_PM_OPS(cw1200_pm_ops, cw1200_spi_suspend, NULL);
3298 +
3299 +-#endif
3300 +-
3301 + static struct spi_driver spi_driver = {
3302 + .probe = cw1200_spi_probe,
3303 + .remove = cw1200_spi_disconnect,
3304 + .driver = {
3305 + .name = "cw1200_wlan_spi",
3306 +-#ifdef CONFIG_PM
3307 +- .pm = &cw1200_pm_ops,
3308 +-#endif
3309 ++ .pm = IS_ENABLED(CONFIG_PM) ? &cw1200_pm_ops : NULL,
3310 + },
3311 + };
3312 +
3313 +diff --git a/drivers/net/wireless/cw1200/pm.h b/drivers/net/wireless/cw1200/pm.h
3314 +index 3ed90ff22bb8..534548470ebc 100644
3315 +--- a/drivers/net/wireless/cw1200/pm.h
3316 ++++ b/drivers/net/wireless/cw1200/pm.h
3317 +@@ -31,13 +31,18 @@ int cw1200_pm_init(struct cw1200_pm_state *pm,
3318 + void cw1200_pm_deinit(struct cw1200_pm_state *pm);
3319 + int cw1200_wow_suspend(struct ieee80211_hw *hw,
3320 + struct cfg80211_wowlan *wowlan);
3321 +-int cw1200_wow_resume(struct ieee80211_hw *hw);
3322 + int cw1200_can_suspend(struct cw1200_common *priv);
3323 ++int cw1200_wow_resume(struct ieee80211_hw *hw);
3324 + void cw1200_pm_stay_awake(struct cw1200_pm_state *pm,
3325 + unsigned long tmo);
3326 + #else
3327 + static inline void cw1200_pm_stay_awake(struct cw1200_pm_state *pm,
3328 +- unsigned long tmo) {
3329 ++ unsigned long tmo)
3330 ++{
3331 ++}
3332 ++static inline int cw1200_can_suspend(struct cw1200_common *priv)
3333 ++{
3334 ++ return 0;
3335 + }
3336 + #endif
3337 + #endif
3338 +diff --git a/drivers/net/wireless/cw1200/wsm.c b/drivers/net/wireless/cw1200/wsm.c
3339 +index 9e0ca3048657..3dd46c78c1cc 100644
3340 +--- a/drivers/net/wireless/cw1200/wsm.c
3341 ++++ b/drivers/net/wireless/cw1200/wsm.c
3342 +@@ -379,7 +379,6 @@ static int wsm_multi_tx_confirm(struct cw1200_common *priv,
3343 + {
3344 + int ret;
3345 + int count;
3346 +- int i;
3347 +
3348 + count = WSM_GET32(buf);
3349 + if (WARN_ON(count <= 0))
3350 +@@ -395,11 +394,10 @@ static int wsm_multi_tx_confirm(struct cw1200_common *priv,
3351 + }
3352 +
3353 + cw1200_debug_txed_multi(priv, count);
3354 +- for (i = 0; i < count; ++i) {
3355 ++ do {
3356 + ret = wsm_tx_confirm(priv, buf, link_id);
3357 +- if (ret)
3358 +- return ret;
3359 +- }
3360 ++ } while (!ret && --count);
3361 ++
3362 + return ret;
3363 +
3364 + underflow:
3365 +diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
3366 +index b57cfd965196..7b13962ec9da 100644
3367 +--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
3368 ++++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
3369 +@@ -2488,9 +2488,9 @@ void rtl8821ae_dm_txpower_tracking_callback_thermalmeter(
3370 + for (p = RF90_PATH_A; p < MAX_PATH_NUM_8821A; p++)
3371 + rtldm->swing_idx_ofdm_base[p] = rtldm->swing_idx_ofdm[p];
3372 +
3373 +- RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
3374 +- "pDM_Odm->RFCalibrateInfo.ThermalValue = %d ThermalValue= %d\n",
3375 +- rtldm->thermalvalue, thermal_value);
3376 ++ RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
3377 ++ "pDM_Odm->RFCalibrateInfo.ThermalValue = %d ThermalValue= %d\n",
3378 ++ rtldm->thermalvalue, thermal_value);
3379 + /*Record last Power Tracking Thermal Value*/
3380 + rtldm->thermalvalue = thermal_value;
3381 + }
3382 +diff --git a/drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c b/drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c
3383 +index 1b580ba76453..907d7db3fcee 100644
3384 +--- a/drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c
3385 ++++ b/drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c
3386 +@@ -145,19 +145,19 @@ static const struct sunxi_desc_pin sun9i_a80_pins[] = {
3387 + SUNXI_FUNCTION(0x0, "gpio_in"),
3388 + SUNXI_FUNCTION(0x1, "gpio_out"),
3389 + SUNXI_FUNCTION(0x3, "mcsi"), /* MCLK */
3390 +- SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 14)), /* PB_EINT14 */
3391 ++ SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 14)), /* PB_EINT14 */
3392 + SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 15),
3393 + SUNXI_FUNCTION(0x0, "gpio_in"),
3394 + SUNXI_FUNCTION(0x1, "gpio_out"),
3395 + SUNXI_FUNCTION(0x3, "mcsi"), /* SCK */
3396 + SUNXI_FUNCTION(0x4, "i2c4"), /* SCK */
3397 +- SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 15)), /* PB_EINT15 */
3398 ++ SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 15)), /* PB_EINT15 */
3399 + SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 16),
3400 + SUNXI_FUNCTION(0x0, "gpio_in"),
3401 + SUNXI_FUNCTION(0x1, "gpio_out"),
3402 + SUNXI_FUNCTION(0x3, "mcsi"), /* SDA */
3403 + SUNXI_FUNCTION(0x4, "i2c4"), /* SDA */
3404 +- SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 16)), /* PB_EINT16 */
3405 ++ SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 16)), /* PB_EINT16 */
3406 +
3407 + /* Hole */
3408 + SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 0),
3409 +diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
3410 +index 1089eaa02b00..988ebe9a6b90 100644
3411 +--- a/drivers/platform/x86/Kconfig
3412 ++++ b/drivers/platform/x86/Kconfig
3413 +@@ -95,6 +95,7 @@ config DELL_LAPTOP
3414 + tristate "Dell Laptop Extras"
3415 + depends on X86
3416 + depends on DCDBAS
3417 ++ depends on DMI
3418 + depends on BACKLIGHT_CLASS_DEVICE
3419 + depends on ACPI_VIDEO || ACPI_VIDEO = n
3420 + depends on RFKILL || RFKILL = n
3421 +@@ -110,6 +111,7 @@ config DELL_LAPTOP
3422 + config DELL_WMI
3423 + tristate "Dell WMI extras"
3424 + depends on ACPI_WMI
3425 ++ depends on DMI
3426 + depends on INPUT
3427 + depends on ACPI_VIDEO || ACPI_VIDEO = n
3428 + select INPUT_SPARSEKMAP
3429 +diff --git a/drivers/platform/x86/intel_mid_thermal.c b/drivers/platform/x86/intel_mid_thermal.c
3430 +index 5c768c4627d3..78e1bfee698a 100644
3431 +--- a/drivers/platform/x86/intel_mid_thermal.c
3432 ++++ b/drivers/platform/x86/intel_mid_thermal.c
3433 +@@ -415,6 +415,7 @@ static struct thermal_device_info *initialize_sensor(int index)
3434 + return td_info;
3435 + }
3436 +
3437 ++#ifdef CONFIG_PM_SLEEP
3438 + /**
3439 + * mid_thermal_resume - resume routine
3440 + * @dev: device structure
3441 +@@ -442,6 +443,7 @@ static int mid_thermal_suspend(struct device *dev)
3442 + */
3443 + return configure_adc(0);
3444 + }
3445 ++#endif
3446 +
3447 + static SIMPLE_DEV_PM_OPS(mid_thermal_pm,
3448 + mid_thermal_suspend, mid_thermal_resume);
3449 +diff --git a/drivers/platform/x86/tc1100-wmi.c b/drivers/platform/x86/tc1100-wmi.c
3450 +index 89aa976f0ab2..65b0a4845ddd 100644
3451 +--- a/drivers/platform/x86/tc1100-wmi.c
3452 ++++ b/drivers/platform/x86/tc1100-wmi.c
3453 +@@ -52,7 +52,9 @@ struct tc1100_data {
3454 + u32 jogdial;
3455 + };
3456 +
3457 ++#ifdef CONFIG_PM
3458 + static struct tc1100_data suspend_data;
3459 ++#endif
3460 +
3461 + /* --------------------------------------------------------------------------
3462 + Device Management
3463 +diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
3464 +index 237d7aa73e8c..9f53fb74ae6f 100644
3465 +--- a/drivers/power/Kconfig
3466 ++++ b/drivers/power/Kconfig
3467 +@@ -159,6 +159,7 @@ config BATTERY_SBS
3468 +
3469 + config BATTERY_BQ27XXX
3470 + tristate "BQ27xxx battery driver"
3471 ++ depends on I2C || I2C=n
3472 + help
3473 + Say Y here to enable support for batteries with BQ27xxx (I2C/HDQ) chips.
3474 +
3475 +diff --git a/drivers/power/bq27xxx_battery.c b/drivers/power/bq27xxx_battery.c
3476 +index 880233ce9343..6c3a447f378b 100644
3477 +--- a/drivers/power/bq27xxx_battery.c
3478 ++++ b/drivers/power/bq27xxx_battery.c
3479 +@@ -285,7 +285,7 @@ static u8 bq27421_regs[] = {
3480 + 0x18, /* AP */
3481 + };
3482 +
3483 +-static u8 *bq27xxx_regs[] = {
3484 ++static u8 *bq27xxx_regs[] __maybe_unused = {
3485 + [BQ27000] = bq27000_regs,
3486 + [BQ27010] = bq27010_regs,
3487 + [BQ27500] = bq27500_regs,
3488 +@@ -991,7 +991,7 @@ static void bq27xxx_external_power_changed(struct power_supply *psy)
3489 + schedule_delayed_work(&di->work, 0);
3490 + }
3491 +
3492 +-static int bq27xxx_powersupply_init(struct bq27xxx_device_info *di,
3493 ++static int __maybe_unused bq27xxx_powersupply_init(struct bq27xxx_device_info *di,
3494 + const char *name)
3495 + {
3496 + int ret;
3497 +@@ -1026,7 +1026,7 @@ static int bq27xxx_powersupply_init(struct bq27xxx_device_info *di,
3498 + return 0;
3499 + }
3500 +
3501 +-static void bq27xxx_powersupply_unregister(struct bq27xxx_device_info *di)
3502 ++static void __maybe_unused bq27xxx_powersupply_unregister(struct bq27xxx_device_info *di)
3503 + {
3504 + /*
3505 + * power_supply_unregister call bq27xxx_battery_get_property which
3506 +diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
3507 +index 9083247f55a8..21d174e9ebdb 100644
3508 +--- a/drivers/s390/block/dasd_eckd.c
3509 ++++ b/drivers/s390/block/dasd_eckd.c
3510 +@@ -518,10 +518,12 @@ static int prefix_LRE(struct ccw1 *ccw, struct PFX_eckd_data *pfxdata,
3511 + pfxdata->validity.define_extent = 1;
3512 +
3513 + /* private uid is kept up to date, conf_data may be outdated */
3514 +- if (startpriv->uid.type != UA_BASE_DEVICE) {
3515 ++ if (startpriv->uid.type == UA_BASE_PAV_ALIAS)
3516 + pfxdata->validity.verify_base = 1;
3517 +- if (startpriv->uid.type == UA_HYPER_PAV_ALIAS)
3518 +- pfxdata->validity.hyper_pav = 1;
3519 ++
3520 ++ if (startpriv->uid.type == UA_HYPER_PAV_ALIAS) {
3521 ++ pfxdata->validity.verify_base = 1;
3522 ++ pfxdata->validity.hyper_pav = 1;
3523 + }
3524 +
3525 + /* define extend data (mostly)*/
3526 +@@ -3002,10 +3004,12 @@ static int prepare_itcw(struct itcw *itcw,
3527 + pfxdata.validity.define_extent = 1;
3528 +
3529 + /* private uid is kept up to date, conf_data may be outdated */
3530 +- if (startpriv->uid.type != UA_BASE_DEVICE) {
3531 ++ if (startpriv->uid.type == UA_BASE_PAV_ALIAS)
3532 ++ pfxdata.validity.verify_base = 1;
3533 ++
3534 ++ if (startpriv->uid.type == UA_HYPER_PAV_ALIAS) {
3535 + pfxdata.validity.verify_base = 1;
3536 +- if (startpriv->uid.type == UA_HYPER_PAV_ALIAS)
3537 +- pfxdata.validity.hyper_pav = 1;
3538 ++ pfxdata.validity.hyper_pav = 1;
3539 + }
3540 +
3541 + switch (cmd) {
3542 +diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
3543 +index febbd83e2ecd..24e57e770432 100644
3544 +--- a/drivers/scsi/advansys.c
3545 ++++ b/drivers/scsi/advansys.c
3546 +@@ -6291,18 +6291,17 @@ static uchar AscGetSynPeriodIndex(ASC_DVC_VAR *asc_dvc, uchar syn_time)
3547 + static uchar
3548 + AscMsgOutSDTR(ASC_DVC_VAR *asc_dvc, uchar sdtr_period, uchar sdtr_offset)
3549 + {
3550 +- EXT_MSG sdtr_buf;
3551 +- uchar sdtr_period_index;
3552 +- PortAddr iop_base;
3553 +-
3554 +- iop_base = asc_dvc->iop_base;
3555 +- sdtr_buf.msg_type = EXTENDED_MESSAGE;
3556 +- sdtr_buf.msg_len = MS_SDTR_LEN;
3557 +- sdtr_buf.msg_req = EXTENDED_SDTR;
3558 +- sdtr_buf.xfer_period = sdtr_period;
3559 ++ PortAddr iop_base = asc_dvc->iop_base;
3560 ++ uchar sdtr_period_index = AscGetSynPeriodIndex(asc_dvc, sdtr_period);
3561 ++ EXT_MSG sdtr_buf = {
3562 ++ .msg_type = EXTENDED_MESSAGE,
3563 ++ .msg_len = MS_SDTR_LEN,
3564 ++ .msg_req = EXTENDED_SDTR,
3565 ++ .xfer_period = sdtr_period,
3566 ++ .req_ack_offset = sdtr_offset,
3567 ++ };
3568 + sdtr_offset &= ASC_SYN_MAX_OFFSET;
3569 +- sdtr_buf.req_ack_offset = sdtr_offset;
3570 +- sdtr_period_index = AscGetSynPeriodIndex(asc_dvc, sdtr_period);
3571 ++
3572 + if (sdtr_period_index <= asc_dvc->max_sdtr_index) {
3573 + AscMemWordCopyPtrToLram(iop_base, ASCV_MSGOUT_BEG,
3574 + (uchar *)&sdtr_buf,
3575 +@@ -11030,6 +11029,9 @@ static int advansys_board_found(struct Scsi_Host *shost, unsigned int iop,
3576 + ASC_DBG(2, "AdvInitGetConfig()\n");
3577 +
3578 + ret = AdvInitGetConfig(pdev, shost) ? -ENODEV : 0;
3579 ++#else
3580 ++ share_irq = 0;
3581 ++ ret = -ENODEV;
3582 + #endif /* CONFIG_PCI */
3583 + }
3584 +
3585 +diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
3586 +index d4cda5e9600e..21c8d210c456 100644
3587 +--- a/drivers/scsi/dpt_i2o.c
3588 ++++ b/drivers/scsi/dpt_i2o.c
3589 +@@ -180,11 +180,14 @@ static u8 adpt_read_blink_led(adpt_hba* host)
3590 + *============================================================================
3591 + */
3592 +
3593 ++#ifdef MODULE
3594 + static struct pci_device_id dptids[] = {
3595 + { PCI_DPT_VENDOR_ID, PCI_DPT_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
3596 + { PCI_DPT_VENDOR_ID, PCI_DPT_RAPTOR_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
3597 + { 0, }
3598 + };
3599 ++#endif
3600 ++
3601 + MODULE_DEVICE_TABLE(pci,dptids);
3602 +
3603 + static int adpt_detect(struct scsi_host_template* sht)
3604 +diff --git a/drivers/scsi/fdomain.c b/drivers/scsi/fdomain.c
3605 +index eefe14d453db..b87ab38a4530 100644
3606 +--- a/drivers/scsi/fdomain.c
3607 ++++ b/drivers/scsi/fdomain.c
3608 +@@ -1768,7 +1768,7 @@ struct scsi_host_template fdomain_driver_template = {
3609 + };
3610 +
3611 + #ifndef PCMCIA
3612 +-#ifdef CONFIG_PCI
3613 ++#if defined(CONFIG_PCI) && defined(MODULE)
3614 +
3615 + static struct pci_device_id fdomain_pci_tbl[] = {
3616 + { PCI_VENDOR_ID_FD, PCI_DEVICE_ID_FD_36C70,
3617 +diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c
3618 +index f8d2478b11cc..87e081f8a386 100644
3619 +--- a/drivers/scsi/g_NCR5380.c
3620 ++++ b/drivers/scsi/g_NCR5380.c
3621 +@@ -538,7 +538,10 @@ static inline int NCR5380_pread(struct Scsi_Host *instance, unsigned char *dst,
3622 + printk(KERN_ERR "53C400r: Got 53C80_IRQ start=%d, blocks=%d\n", start, blocks);
3623 + return -1;
3624 + }
3625 +- while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_HOST_BUF_NOT_RDY);
3626 ++ while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_HOST_BUF_NOT_RDY)
3627 ++ {
3628 ++ // FIXME - no timeout
3629 ++ }
3630 +
3631 + #ifndef SCSI_G_NCR5380_MEM
3632 + {
3633 +diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c
3634 +index 6a926bae76b2..7a91cf3ff173 100644
3635 +--- a/drivers/scsi/initio.c
3636 ++++ b/drivers/scsi/initio.c
3637 +@@ -110,11 +110,6 @@
3638 + #define i91u_MAXQUEUE 2
3639 + #define i91u_REVID "Initio INI-9X00U/UW SCSI device driver; Revision: 1.04a"
3640 +
3641 +-#define I950_DEVICE_ID 0x9500 /* Initio's inic-950 product ID */
3642 +-#define I940_DEVICE_ID 0x9400 /* Initio's inic-940 product ID */
3643 +-#define I935_DEVICE_ID 0x9401 /* Initio's inic-935 product ID */
3644 +-#define I920_DEVICE_ID 0x0002 /* Initio's other product ID */
3645 +-
3646 + #ifdef DEBUG_i91u
3647 + static unsigned int i91u_debug = DEBUG_DEFAULT;
3648 + #endif
3649 +@@ -127,17 +122,6 @@ static int setup_debug = 0;
3650 +
3651 + static void i91uSCBPost(u8 * pHcb, u8 * pScb);
3652 +
3653 +-/* PCI Devices supported by this driver */
3654 +-static struct pci_device_id i91u_pci_devices[] = {
3655 +- { PCI_VENDOR_ID_INIT, I950_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
3656 +- { PCI_VENDOR_ID_INIT, I940_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
3657 +- { PCI_VENDOR_ID_INIT, I935_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
3658 +- { PCI_VENDOR_ID_INIT, I920_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
3659 +- { PCI_VENDOR_ID_DOMEX, I920_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
3660 +- { }
3661 +-};
3662 +-MODULE_DEVICE_TABLE(pci, i91u_pci_devices);
3663 +-
3664 + #define DEBUG_INTERRUPT 0
3665 + #define DEBUG_QUEUE 0
3666 + #define DEBUG_STATE 0
3667 +diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c
3668 +index 02360de6b7e0..39285070f3b5 100644
3669 +--- a/drivers/scsi/mvumi.c
3670 ++++ b/drivers/scsi/mvumi.c
3671 +@@ -2629,7 +2629,7 @@ static void mvumi_shutdown(struct pci_dev *pdev)
3672 + mvumi_flush_cache(mhba);
3673 + }
3674 +
3675 +-static int mvumi_suspend(struct pci_dev *pdev, pm_message_t state)
3676 ++static int __maybe_unused mvumi_suspend(struct pci_dev *pdev, pm_message_t state)
3677 + {
3678 + struct mvumi_hba *mhba = NULL;
3679 +
3680 +@@ -2648,7 +2648,7 @@ static int mvumi_suspend(struct pci_dev *pdev, pm_message_t state)
3681 + return 0;
3682 + }
3683 +
3684 +-static int mvumi_resume(struct pci_dev *pdev)
3685 ++static int __maybe_unused mvumi_resume(struct pci_dev *pdev)
3686 + {
3687 + int ret;
3688 + struct mvumi_hba *mhba = NULL;
3689 +diff --git a/drivers/scsi/sim710.c b/drivers/scsi/sim710.c
3690 +index 3b3b56f4a830..82ed99848378 100644
3691 +--- a/drivers/scsi/sim710.c
3692 ++++ b/drivers/scsi/sim710.c
3693 +@@ -176,8 +176,7 @@ static struct eisa_device_id sim710_eisa_ids[] = {
3694 + };
3695 + MODULE_DEVICE_TABLE(eisa, sim710_eisa_ids);
3696 +
3697 +-static __init int
3698 +-sim710_eisa_probe(struct device *dev)
3699 ++static int sim710_eisa_probe(struct device *dev)
3700 + {
3701 + struct eisa_device *edev = to_eisa_device(dev);
3702 + unsigned long io_addr = edev->base_addr;
3703 +diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c
3704 +index 39d7c7c70112..2eea3de5a668 100644
3705 +--- a/drivers/spi/spi-sun4i.c
3706 ++++ b/drivers/spi/spi-sun4i.c
3707 +@@ -458,7 +458,7 @@ err_free_master:
3708 +
3709 + static int sun4i_spi_remove(struct platform_device *pdev)
3710 + {
3711 +- pm_runtime_disable(&pdev->dev);
3712 ++ pm_runtime_force_suspend(&pdev->dev);
3713 +
3714 + return 0;
3715 + }
3716 +diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
3717 +index 5d1e9a0fc389..e2ff6b5b2094 100644
3718 +--- a/drivers/ssb/main.c
3719 ++++ b/drivers/ssb/main.c
3720 +@@ -613,9 +613,10 @@ out:
3721 + return err;
3722 + }
3723 +
3724 +-static int ssb_bus_register(struct ssb_bus *bus,
3725 +- ssb_invariants_func_t get_invariants,
3726 +- unsigned long baseaddr)
3727 ++static int __maybe_unused
3728 ++ssb_bus_register(struct ssb_bus *bus,
3729 ++ ssb_invariants_func_t get_invariants,
3730 ++ unsigned long baseaddr)
3731 + {
3732 + int err;
3733 +
3734 +diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
3735 +index b64327722660..ec31b53ae3a5 100644
3736 +--- a/drivers/staging/android/ashmem.c
3737 ++++ b/drivers/staging/android/ashmem.c
3738 +@@ -704,30 +704,32 @@ static int ashmem_pin_unpin(struct ashmem_area *asma, unsigned long cmd,
3739 + size_t pgstart, pgend;
3740 + int ret = -EINVAL;
3741 +
3742 ++ mutex_lock(&ashmem_mutex);
3743 ++
3744 + if (unlikely(!asma->file))
3745 +- return -EINVAL;
3746 ++ goto out_unlock;
3747 +
3748 +- if (unlikely(copy_from_user(&pin, p, sizeof(pin))))
3749 +- return -EFAULT;
3750 ++ if (unlikely(copy_from_user(&pin, p, sizeof(pin)))) {
3751 ++ ret = -EFAULT;
3752 ++ goto out_unlock;
3753 ++ }
3754 +
3755 + /* per custom, you can pass zero for len to mean "everything onward" */
3756 + if (!pin.len)
3757 + pin.len = PAGE_ALIGN(asma->size) - pin.offset;
3758 +
3759 + if (unlikely((pin.offset | pin.len) & ~PAGE_MASK))
3760 +- return -EINVAL;
3761 ++ goto out_unlock;
3762 +
3763 + if (unlikely(((__u32)-1) - pin.offset < pin.len))
3764 +- return -EINVAL;
3765 ++ goto out_unlock;
3766 +
3767 + if (unlikely(PAGE_ALIGN(asma->size) < pin.offset + pin.len))
3768 +- return -EINVAL;
3769 ++ goto out_unlock;
3770 +
3771 + pgstart = pin.offset / PAGE_SIZE;
3772 + pgend = pgstart + (pin.len / PAGE_SIZE) - 1;
3773 +
3774 +- mutex_lock(&ashmem_mutex);
3775 +-
3776 + switch (cmd) {
3777 + case ASHMEM_PIN:
3778 + ret = ashmem_pin(asma, pgstart, pgend);
3779 +@@ -740,6 +742,7 @@ static int ashmem_pin_unpin(struct ashmem_area *asma, unsigned long cmd,
3780 + break;
3781 + }
3782 +
3783 ++out_unlock:
3784 + mutex_unlock(&ashmem_mutex);
3785 +
3786 + return ret;
3787 +diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
3788 +index abc66908681d..6f032009f93f 100644
3789 +--- a/drivers/staging/iio/adc/ad7192.c
3790 ++++ b/drivers/staging/iio/adc/ad7192.c
3791 +@@ -124,6 +124,8 @@
3792 + #define AD7192_GPOCON_P1DAT BIT(1) /* P1 state */
3793 + #define AD7192_GPOCON_P0DAT BIT(0) /* P0 state */
3794 +
3795 ++#define AD7192_EXT_FREQ_MHZ_MIN 2457600
3796 ++#define AD7192_EXT_FREQ_MHZ_MAX 5120000
3797 + #define AD7192_INT_FREQ_MHZ 4915200
3798 +
3799 + /* NOTE:
3800 +@@ -199,6 +201,12 @@ static int ad7192_calibrate_all(struct ad7192_state *st)
3801 + ARRAY_SIZE(ad7192_calib_arr));
3802 + }
3803 +
3804 ++static inline bool ad7192_valid_external_frequency(u32 freq)
3805 ++{
3806 ++ return (freq >= AD7192_EXT_FREQ_MHZ_MIN &&
3807 ++ freq <= AD7192_EXT_FREQ_MHZ_MAX);
3808 ++}
3809 ++
3810 + static int ad7192_setup(struct ad7192_state *st,
3811 + const struct ad7192_platform_data *pdata)
3812 + {
3813 +@@ -224,17 +232,20 @@ static int ad7192_setup(struct ad7192_state *st,
3814 + id);
3815 +
3816 + switch (pdata->clock_source_sel) {
3817 +- case AD7192_CLK_EXT_MCLK1_2:
3818 +- case AD7192_CLK_EXT_MCLK2:
3819 +- st->mclk = AD7192_INT_FREQ_MHZ;
3820 +- break;
3821 + case AD7192_CLK_INT:
3822 + case AD7192_CLK_INT_CO:
3823 +- if (pdata->ext_clk_hz)
3824 +- st->mclk = pdata->ext_clk_hz;
3825 +- else
3826 +- st->mclk = AD7192_INT_FREQ_MHZ;
3827 ++ st->mclk = AD7192_INT_FREQ_MHZ;
3828 + break;
3829 ++ case AD7192_CLK_EXT_MCLK1_2:
3830 ++ case AD7192_CLK_EXT_MCLK2:
3831 ++ if (ad7192_valid_external_frequency(pdata->ext_clk_hz)) {
3832 ++ st->mclk = pdata->ext_clk_hz;
3833 ++ break;
3834 ++ }
3835 ++ dev_err(&st->sd.spi->dev, "Invalid frequency setting %u\n",
3836 ++ pdata->ext_clk_hz);
3837 ++ ret = -EINVAL;
3838 ++ goto out;
3839 + default:
3840 + ret = -EINVAL;
3841 + goto out;
3842 +diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
3843 +index 824d460911ec..58ccafb97344 100644
3844 +--- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
3845 ++++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
3846 +@@ -1039,7 +1039,6 @@ static int synaptics_rmi4_remove(struct i2c_client *client)
3847 + return 0;
3848 + }
3849 +
3850 +-#ifdef CONFIG_PM
3851 + /**
3852 + * synaptics_rmi4_suspend() - suspend the touch screen controller
3853 + * @dev: pointer to device structure
3854 +@@ -1047,7 +1046,7 @@ static int synaptics_rmi4_remove(struct i2c_client *client)
3855 + * This function is used to suspend the
3856 + * touch panel controller and returns integer
3857 + */
3858 +-static int synaptics_rmi4_suspend(struct device *dev)
3859 ++static int __maybe_unused synaptics_rmi4_suspend(struct device *dev)
3860 + {
3861 + /* Touch sleep mode */
3862 + int retval;
3863 +@@ -1081,7 +1080,7 @@ static int synaptics_rmi4_suspend(struct device *dev)
3864 + * This function is used to resume the touch panel
3865 + * controller and returns integer.
3866 + */
3867 +-static int synaptics_rmi4_resume(struct device *dev)
3868 ++static int __maybe_unused synaptics_rmi4_resume(struct device *dev)
3869 + {
3870 + int retval;
3871 + unsigned char intr_status;
3872 +@@ -1112,8 +1111,6 @@ static int synaptics_rmi4_resume(struct device *dev)
3873 + return 0;
3874 + }
3875 +
3876 +-#endif
3877 +-
3878 + static SIMPLE_DEV_PM_OPS(synaptics_rmi4_dev_pm_ops, synaptics_rmi4_suspend,
3879 + synaptics_rmi4_resume);
3880 +
3881 +diff --git a/drivers/staging/unisys/visorinput/Kconfig b/drivers/staging/unisys/visorinput/Kconfig
3882 +index d83deb4137e8..6baba2795ce7 100644
3883 +--- a/drivers/staging/unisys/visorinput/Kconfig
3884 ++++ b/drivers/staging/unisys/visorinput/Kconfig
3885 +@@ -4,7 +4,7 @@
3886 +
3887 + config UNISYS_VISORINPUT
3888 + tristate "Unisys visorinput driver"
3889 +- depends on UNISYSSPAR && UNISYS_VISORBUS && FB
3890 ++ depends on UNISYSSPAR && UNISYS_VISORBUS && FB && INPUT
3891 + ---help---
3892 + If you say Y here, you will enable the Unisys visorinput driver.
3893 +
3894 +diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h
3895 +index be972afe6e62..bfc3e96d8d25 100644
3896 +--- a/drivers/staging/wilc1000/wilc_wlan_if.h
3897 ++++ b/drivers/staging/wilc1000/wilc_wlan_if.h
3898 +@@ -12,6 +12,7 @@
3899 +
3900 + #include <linux/semaphore.h>
3901 + #include "linux_wlan_common.h"
3902 ++#include <linux/netdevice.h>
3903 +
3904 + /********************************************
3905 + *
3906 +diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
3907 +index a7d30e894cab..c43c942e1f87 100644
3908 +--- a/drivers/target/target_core_user.c
3909 ++++ b/drivers/target/target_core_user.c
3910 +@@ -900,7 +900,7 @@ static int tcmu_configure_device(struct se_device *dev)
3911 + info->version = __stringify(TCMU_MAILBOX_VERSION);
3912 +
3913 + info->mem[0].name = "tcm-user command & data buffer";
3914 +- info->mem[0].addr = (phys_addr_t) udev->mb_addr;
3915 ++ info->mem[0].addr = (phys_addr_t)(uintptr_t)udev->mb_addr;
3916 + info->mem[0].size = TCMU_RING_SIZE;
3917 + info->mem[0].memtype = UIO_MEM_VIRTUAL;
3918 +
3919 +diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
3920 +index 8cc4ac64a91c..4b660b5beb98 100644
3921 +--- a/drivers/thermal/Kconfig
3922 ++++ b/drivers/thermal/Kconfig
3923 +@@ -299,7 +299,7 @@ config X86_PKG_TEMP_THERMAL
3924 +
3925 + config INTEL_SOC_DTS_IOSF_CORE
3926 + tristate
3927 +- depends on X86
3928 ++ depends on X86 && PCI
3929 + select IOSF_MBI
3930 + help
3931 + This is becoming a common feature for Intel SoCs to expose the additional
3932 +@@ -309,7 +309,7 @@ config INTEL_SOC_DTS_IOSF_CORE
3933 +
3934 + config INTEL_SOC_DTS_THERMAL
3935 + tristate "Intel SoCs DTS thermal driver"
3936 +- depends on X86
3937 ++ depends on X86 && PCI
3938 + select INTEL_SOC_DTS_IOSF_CORE
3939 + select THERMAL_WRITABLE_TRIPS
3940 + help
3941 +diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c
3942 +index 534dd9136662..81b35aace9de 100644
3943 +--- a/drivers/thermal/spear_thermal.c
3944 ++++ b/drivers/thermal/spear_thermal.c
3945 +@@ -54,8 +54,7 @@ static struct thermal_zone_device_ops ops = {
3946 + .get_temp = thermal_get_temp,
3947 + };
3948 +
3949 +-#ifdef CONFIG_PM
3950 +-static int spear_thermal_suspend(struct device *dev)
3951 ++static int __maybe_unused spear_thermal_suspend(struct device *dev)
3952 + {
3953 + struct platform_device *pdev = to_platform_device(dev);
3954 + struct thermal_zone_device *spear_thermal = platform_get_drvdata(pdev);
3955 +@@ -72,7 +71,7 @@ static int spear_thermal_suspend(struct device *dev)
3956 + return 0;
3957 + }
3958 +
3959 +-static int spear_thermal_resume(struct device *dev)
3960 ++static int __maybe_unused spear_thermal_resume(struct device *dev)
3961 + {
3962 + struct platform_device *pdev = to_platform_device(dev);
3963 + struct thermal_zone_device *spear_thermal = platform_get_drvdata(pdev);
3964 +@@ -94,7 +93,6 @@ static int spear_thermal_resume(struct device *dev)
3965 +
3966 + return 0;
3967 + }
3968 +-#endif
3969 +
3970 + static SIMPLE_DEV_PM_OPS(spear_thermal_pm_ops, spear_thermal_suspend,
3971 + spear_thermal_resume);
3972 +diff --git a/drivers/tty/Kconfig b/drivers/tty/Kconfig
3973 +index c01f45095877..82c4d2e45319 100644
3974 +--- a/drivers/tty/Kconfig
3975 ++++ b/drivers/tty/Kconfig
3976 +@@ -226,7 +226,7 @@ config CYCLADES
3977 +
3978 + config CYZ_INTR
3979 + bool "Cyclades-Z interrupt mode operation"
3980 +- depends on CYCLADES
3981 ++ depends on CYCLADES && PCI
3982 + help
3983 + The Cyclades-Z family of multiport cards allows 2 (two) driver op
3984 + modes: polling and interrupt. In polling mode, the driver will check
3985 +diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c
3986 +index fa816b7193b6..11725422dacb 100644
3987 +--- a/drivers/tty/hvc/hvc_xen.c
3988 ++++ b/drivers/tty/hvc/hvc_xen.c
3989 +@@ -323,6 +323,7 @@ void xen_console_resume(void)
3990 + }
3991 + }
3992 +
3993 ++#ifdef CONFIG_HVC_XEN_FRONTEND
3994 + static void xencons_disconnect_backend(struct xencons_info *info)
3995 + {
3996 + if (info->irq > 0)
3997 +@@ -363,7 +364,6 @@ static int xen_console_remove(struct xencons_info *info)
3998 + return 0;
3999 + }
4000 +
4001 +-#ifdef CONFIG_HVC_XEN_FRONTEND
4002 + static int xencons_remove(struct xenbus_device *dev)
4003 + {
4004 + return xen_console_remove(dev_get_drvdata(&dev->dev));
4005 +diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig
4006 +index 6412f1455beb..6f4c180aadc1 100644
4007 +--- a/drivers/tty/serial/8250/Kconfig
4008 ++++ b/drivers/tty/serial/8250/Kconfig
4009 +@@ -372,7 +372,7 @@ config SERIAL_8250_MID
4010 + tristate "Support for serial ports on Intel MID platforms"
4011 + depends on SERIAL_8250 && PCI
4012 + select HSU_DMA if SERIAL_8250_DMA
4013 +- select HSU_DMA_PCI if X86_INTEL_MID
4014 ++ select HSU_DMA_PCI if (HSU_DMA && X86_INTEL_MID)
4015 + select RATIONAL
4016 + help
4017 + Selecting this option will enable handling of the extra features
4018 +diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
4019 +index 3bb08870148f..95e72d75e0a0 100644
4020 +--- a/drivers/usb/host/Kconfig
4021 ++++ b/drivers/usb/host/Kconfig
4022 +@@ -220,6 +220,8 @@ config USB_EHCI_TEGRA
4023 + depends on ARCH_TEGRA
4024 + select USB_EHCI_ROOT_HUB_TT
4025 + select USB_PHY
4026 ++ select USB_ULPI
4027 ++ select USB_ULPI_VIEWPORT
4028 + help
4029 + This driver enables support for the internal USB Host Controllers
4030 + found in NVIDIA Tegra SoCs. The controllers are EHCI compliant.
4031 +diff --git a/drivers/usb/musb/ux500_dma.c b/drivers/usb/musb/ux500_dma.c
4032 +index d0b6a1cd7f62..c92a295049ad 100644
4033 +--- a/drivers/usb/musb/ux500_dma.c
4034 ++++ b/drivers/usb/musb/ux500_dma.c
4035 +@@ -207,9 +207,6 @@ static int ux500_dma_channel_program(struct dma_channel *channel,
4036 + BUG_ON(channel->status == MUSB_DMA_STATUS_UNKNOWN ||
4037 + channel->status == MUSB_DMA_STATUS_BUSY);
4038 +
4039 +- if (!ux500_dma_is_compatible(channel, packet_sz, (void *)dma_addr, len))
4040 +- return false;
4041 +-
4042 + channel->status = MUSB_DMA_STATUS_BUSY;
4043 + channel->actual_len = 0;
4044 + ret = ux500_configure_channel(channel, packet_sz, mode, dma_addr, len);
4045 +diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig
4046 +index 22e8ecb6bfbd..7a72bef35acf 100644
4047 +--- a/drivers/usb/phy/Kconfig
4048 ++++ b/drivers/usb/phy/Kconfig
4049 +@@ -140,6 +140,7 @@ config USB_MSM_OTG
4050 + tristate "Qualcomm on-chip USB OTG controller support"
4051 + depends on (USB || USB_GADGET) && (ARCH_QCOM || COMPILE_TEST)
4052 + depends on RESET_CONTROLLER
4053 ++ depends on REGULATOR
4054 + depends on EXTCON
4055 + select USB_PHY
4056 + help
4057 +diff --git a/drivers/usb/usbip/stub_dev.c b/drivers/usb/usbip/stub_dev.c
4058 +index ec38370ffcab..0931f3271119 100644
4059 +--- a/drivers/usb/usbip/stub_dev.c
4060 ++++ b/drivers/usb/usbip/stub_dev.c
4061 +@@ -87,6 +87,7 @@ static ssize_t store_sockfd(struct device *dev, struct device_attribute *attr,
4062 + goto err;
4063 +
4064 + sdev->ud.tcp_socket = socket;
4065 ++ sdev->ud.sockfd = sockfd;
4066 +
4067 + spin_unlock_irq(&sdev->ud.lock);
4068 +
4069 +@@ -186,6 +187,7 @@ static void stub_shutdown_connection(struct usbip_device *ud)
4070 + if (ud->tcp_socket) {
4071 + sockfd_put(ud->tcp_socket);
4072 + ud->tcp_socket = NULL;
4073 ++ ud->sockfd = -1;
4074 + }
4075 +
4076 + /* 3. free used data */
4077 +@@ -280,6 +282,7 @@ static struct stub_device *stub_device_alloc(struct usb_device *udev)
4078 + sdev->ud.status = SDEV_ST_AVAILABLE;
4079 + spin_lock_init(&sdev->ud.lock);
4080 + sdev->ud.tcp_socket = NULL;
4081 ++ sdev->ud.sockfd = -1;
4082 +
4083 + INIT_LIST_HEAD(&sdev->priv_init);
4084 + INIT_LIST_HEAD(&sdev->priv_tx);
4085 +diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c
4086 +index 2d96bfd34138..4d68a1e9e878 100644
4087 +--- a/drivers/usb/usbip/vhci_hcd.c
4088 ++++ b/drivers/usb/usbip/vhci_hcd.c
4089 +@@ -797,6 +797,7 @@ static void vhci_shutdown_connection(struct usbip_device *ud)
4090 + if (vdev->ud.tcp_socket) {
4091 + sockfd_put(vdev->ud.tcp_socket);
4092 + vdev->ud.tcp_socket = NULL;
4093 ++ vdev->ud.sockfd = -1;
4094 + }
4095 + pr_info("release socket\n");
4096 +
4097 +@@ -844,6 +845,7 @@ static void vhci_device_reset(struct usbip_device *ud)
4098 + if (ud->tcp_socket) {
4099 + sockfd_put(ud->tcp_socket);
4100 + ud->tcp_socket = NULL;
4101 ++ ud->sockfd = -1;
4102 + }
4103 + ud->status = VDEV_ST_NULL;
4104 +
4105 +diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
4106 +index f07a0974fda2..3543e3e4cfb5 100644
4107 +--- a/drivers/video/fbdev/Kconfig
4108 ++++ b/drivers/video/fbdev/Kconfig
4109 +@@ -1506,6 +1506,7 @@ config FB_SIS
4110 + select FB_CFB_COPYAREA
4111 + select FB_CFB_IMAGEBLIT
4112 + select FB_BOOT_VESA_SUPPORT if FB_SIS = y
4113 ++ select FB_SIS_300 if !FB_SIS_315
4114 + help
4115 + This is the frame buffer device driver for the SiS 300, 315, 330
4116 + and 340 series as well as XGI V3XT, V5, V8, Z7 graphics chipsets.
4117 +diff --git a/drivers/video/fbdev/auo_k190x.c b/drivers/video/fbdev/auo_k190x.c
4118 +index 8d2499d1cafb..9580374667ba 100644
4119 +--- a/drivers/video/fbdev/auo_k190x.c
4120 ++++ b/drivers/video/fbdev/auo_k190x.c
4121 +@@ -773,9 +773,7 @@ static void auok190x_recover(struct auok190xfb_par *par)
4122 + /*
4123 + * Power-management
4124 + */
4125 +-
4126 +-#ifdef CONFIG_PM
4127 +-static int auok190x_runtime_suspend(struct device *dev)
4128 ++static int __maybe_unused auok190x_runtime_suspend(struct device *dev)
4129 + {
4130 + struct platform_device *pdev = to_platform_device(dev);
4131 + struct fb_info *info = platform_get_drvdata(pdev);
4132 +@@ -822,7 +820,7 @@ finish:
4133 + return 0;
4134 + }
4135 +
4136 +-static int auok190x_runtime_resume(struct device *dev)
4137 ++static int __maybe_unused auok190x_runtime_resume(struct device *dev)
4138 + {
4139 + struct platform_device *pdev = to_platform_device(dev);
4140 + struct fb_info *info = platform_get_drvdata(pdev);
4141 +@@ -856,7 +854,7 @@ static int auok190x_runtime_resume(struct device *dev)
4142 + return 0;
4143 + }
4144 +
4145 +-static int auok190x_suspend(struct device *dev)
4146 ++static int __maybe_unused auok190x_suspend(struct device *dev)
4147 + {
4148 + struct platform_device *pdev = to_platform_device(dev);
4149 + struct fb_info *info = platform_get_drvdata(pdev);
4150 +@@ -896,7 +894,7 @@ static int auok190x_suspend(struct device *dev)
4151 + return 0;
4152 + }
4153 +
4154 +-static int auok190x_resume(struct device *dev)
4155 ++static int __maybe_unused auok190x_resume(struct device *dev)
4156 + {
4157 + struct platform_device *pdev = to_platform_device(dev);
4158 + struct fb_info *info = platform_get_drvdata(pdev);
4159 +@@ -933,7 +931,6 @@ static int auok190x_resume(struct device *dev)
4160 +
4161 + return 0;
4162 + }
4163 +-#endif
4164 +
4165 + const struct dev_pm_ops auok190x_pm = {
4166 + SET_RUNTIME_PM_OPS(auok190x_runtime_suspend, auok190x_runtime_resume,
4167 +diff --git a/drivers/video/fbdev/exynos/s6e8ax0.c b/drivers/video/fbdev/exynos/s6e8ax0.c
4168 +index 95873f26e39c..de2f3e793786 100644
4169 +--- a/drivers/video/fbdev/exynos/s6e8ax0.c
4170 ++++ b/drivers/video/fbdev/exynos/s6e8ax0.c
4171 +@@ -829,8 +829,7 @@ static int s6e8ax0_probe(struct mipi_dsim_lcd_device *dsim_dev)
4172 + return 0;
4173 + }
4174 +
4175 +-#ifdef CONFIG_PM
4176 +-static int s6e8ax0_suspend(struct mipi_dsim_lcd_device *dsim_dev)
4177 ++static int __maybe_unused s6e8ax0_suspend(struct mipi_dsim_lcd_device *dsim_dev)
4178 + {
4179 + struct s6e8ax0 *lcd = dev_get_drvdata(&dsim_dev->dev);
4180 +
4181 +@@ -843,7 +842,7 @@ static int s6e8ax0_suspend(struct mipi_dsim_lcd_device *dsim_dev)
4182 + return 0;
4183 + }
4184 +
4185 +-static int s6e8ax0_resume(struct mipi_dsim_lcd_device *dsim_dev)
4186 ++static int __maybe_unused s6e8ax0_resume(struct mipi_dsim_lcd_device *dsim_dev)
4187 + {
4188 + struct s6e8ax0 *lcd = dev_get_drvdata(&dsim_dev->dev);
4189 +
4190 +@@ -855,10 +854,6 @@ static int s6e8ax0_resume(struct mipi_dsim_lcd_device *dsim_dev)
4191 +
4192 + return 0;
4193 + }
4194 +-#else
4195 +-#define s6e8ax0_suspend NULL
4196 +-#define s6e8ax0_resume NULL
4197 +-#endif
4198 +
4199 + static struct mipi_dsim_lcd_driver s6e8ax0_dsim_ddi_driver = {
4200 + .name = "s6e8ax0",
4201 +@@ -867,8 +862,8 @@ static struct mipi_dsim_lcd_driver s6e8ax0_dsim_ddi_driver = {
4202 + .power_on = s6e8ax0_power_on,
4203 + .set_sequence = s6e8ax0_set_sequence,
4204 + .probe = s6e8ax0_probe,
4205 +- .suspend = s6e8ax0_suspend,
4206 +- .resume = s6e8ax0_resume,
4207 ++ .suspend = IS_ENABLED(CONFIG_PM) ? s6e8ax0_suspend : NULL,
4208 ++ .resume = IS_ENABLED(CONFIG_PM) ? s6e8ax0_resume : NULL,
4209 + };
4210 +
4211 + static int s6e8ax0_init(void)
4212 +diff --git a/drivers/video/fbdev/intelfb/intelfbdrv.c b/drivers/video/fbdev/intelfb/intelfbdrv.c
4213 +index bbec737eef30..bf207444ba0c 100644
4214 +--- a/drivers/video/fbdev/intelfb/intelfbdrv.c
4215 ++++ b/drivers/video/fbdev/intelfb/intelfbdrv.c
4216 +@@ -302,7 +302,7 @@ static __inline__ int get_opt_int(const char *this_opt, const char *name,
4217 + }
4218 +
4219 + static __inline__ int get_opt_bool(const char *this_opt, const char *name,
4220 +- int *ret)
4221 ++ bool *ret)
4222 + {
4223 + if (!ret)
4224 + return 0;
4225 +diff --git a/drivers/video/fbdev/mmp/core.c b/drivers/video/fbdev/mmp/core.c
4226 +index a0f496049db7..3a6bb6561ba0 100644
4227 +--- a/drivers/video/fbdev/mmp/core.c
4228 ++++ b/drivers/video/fbdev/mmp/core.c
4229 +@@ -23,6 +23,7 @@
4230 + #include <linux/slab.h>
4231 + #include <linux/dma-mapping.h>
4232 + #include <linux/export.h>
4233 ++#include <linux/module.h>
4234 + #include <video/mmp_disp.h>
4235 +
4236 + static struct mmp_overlay *path_get_overlay(struct mmp_path *path,
4237 +@@ -249,3 +250,7 @@ void mmp_unregister_path(struct mmp_path *path)
4238 + mutex_unlock(&disp_lock);
4239 + }
4240 + EXPORT_SYMBOL_GPL(mmp_unregister_path);
4241 ++
4242 ++MODULE_AUTHOR("Zhou Zhu <zzhu3@×××××××.com>");
4243 ++MODULE_DESCRIPTION("Marvell MMP display framework");
4244 ++MODULE_LICENSE("GPL");
4245 +diff --git a/drivers/video/fbdev/sis/init301.c b/drivers/video/fbdev/sis/init301.c
4246 +index 295e0dedaf1f..20f7234e809e 100644
4247 +--- a/drivers/video/fbdev/sis/init301.c
4248 ++++ b/drivers/video/fbdev/sis/init301.c
4249 +@@ -2151,17 +2151,15 @@ SiS_GetVCLK2Ptr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned shor
4250 + unsigned short RefreshRateTableIndex)
4251 + {
4252 + unsigned short CRT2Index, VCLKIndex = 0, VCLKIndexGEN = 0, VCLKIndexGENCRT = 0;
4253 +- unsigned short modeflag, resinfo, tempbx;
4254 ++ unsigned short resinfo, tempbx;
4255 + const unsigned char *CHTVVCLKPtr = NULL;
4256 +
4257 + if(ModeNo <= 0x13) {
4258 +- modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
4259 + resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
4260 + CRT2Index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
4261 + VCLKIndexGEN = (SiS_GetRegByte((SiS_Pr->SiS_P3ca+0x02)) >> 2) & 0x03;
4262 + VCLKIndexGENCRT = VCLKIndexGEN;
4263 + } else {
4264 +- modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
4265 + resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
4266 + CRT2Index = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
4267 + VCLKIndexGEN = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
4268 +@@ -7270,7 +7268,7 @@ SiS_ShiftXPos(struct SiS_Private *SiS_Pr, int shift)
4269 + static void
4270 + SiS_SetGroup4_C_ELV(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex)
4271 + {
4272 +- unsigned short temp, temp1, resinfo = 0;
4273 ++ unsigned short temp, temp1;
4274 + unsigned char *ROMAddr = SiS_Pr->VirtualRomBase;
4275 +
4276 + if(!(SiS_Pr->SiS_VBType & VB_SIS30xCLV)) return;
4277 +@@ -7282,10 +7280,6 @@ SiS_SetGroup4_C_ELV(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned
4278 + if(!(ROMAddr[0x61] & 0x04)) return;
4279 + }
4280 +
4281 +- if(ModeNo > 0x13) {
4282 +- resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
4283 +- }
4284 +-
4285 + SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x3a,0x08);
4286 + temp = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x3a);
4287 + if(!(temp & 0x01)) {
4288 +diff --git a/drivers/video/fbdev/sm712fb.c b/drivers/video/fbdev/sm712fb.c
4289 +index 629bfa2d2f51..86ae1d4556fc 100644
4290 +--- a/drivers/video/fbdev/sm712fb.c
4291 ++++ b/drivers/video/fbdev/sm712fb.c
4292 +@@ -28,9 +28,7 @@
4293 + #include <linux/console.h>
4294 + #include <linux/screen_info.h>
4295 +
4296 +-#ifdef CONFIG_PM
4297 + #include <linux/pm.h>
4298 +-#endif
4299 +
4300 + #include "sm712.h"
4301 +
4302 +@@ -1545,8 +1543,7 @@ static void smtcfb_pci_remove(struct pci_dev *pdev)
4303 + pci_disable_device(pdev);
4304 + }
4305 +
4306 +-#ifdef CONFIG_PM
4307 +-static int smtcfb_pci_suspend(struct device *device)
4308 ++static int __maybe_unused smtcfb_pci_suspend(struct device *device)
4309 + {
4310 + struct pci_dev *pdev = to_pci_dev(device);
4311 + struct smtcfb_info *sfb;
4312 +@@ -1569,7 +1566,7 @@ static int smtcfb_pci_suspend(struct device *device)
4313 + return 0;
4314 + }
4315 +
4316 +-static int smtcfb_pci_resume(struct device *device)
4317 ++static int __maybe_unused smtcfb_pci_resume(struct device *device)
4318 + {
4319 + struct pci_dev *pdev = to_pci_dev(device);
4320 + struct smtcfb_info *sfb;
4321 +@@ -1610,20 +1607,13 @@ static int smtcfb_pci_resume(struct device *device)
4322 + }
4323 +
4324 + static SIMPLE_DEV_PM_OPS(sm7xx_pm_ops, smtcfb_pci_suspend, smtcfb_pci_resume);
4325 +-#define SM7XX_PM_OPS (&sm7xx_pm_ops)
4326 +-
4327 +-#else /* !CONFIG_PM */
4328 +-
4329 +-#define SM7XX_PM_OPS NULL
4330 +-
4331 +-#endif /* !CONFIG_PM */
4332 +
4333 + static struct pci_driver smtcfb_driver = {
4334 + .name = "smtcfb",
4335 + .id_table = smtcfb_pci_table,
4336 + .probe = smtcfb_pci_probe,
4337 + .remove = smtcfb_pci_remove,
4338 +- .driver.pm = SM7XX_PM_OPS,
4339 ++ .driver.pm = &sm7xx_pm_ops,
4340 + };
4341 +
4342 + static int __init sm712fb_init(void)
4343 +diff --git a/drivers/video/fbdev/via/viafbdev.c b/drivers/video/fbdev/via/viafbdev.c
4344 +index f9718f012aae..badee04ef496 100644
4345 +--- a/drivers/video/fbdev/via/viafbdev.c
4346 ++++ b/drivers/video/fbdev/via/viafbdev.c
4347 +@@ -1630,16 +1630,14 @@ static void viafb_init_proc(struct viafb_shared *shared)
4348 + }
4349 + static void viafb_remove_proc(struct viafb_shared *shared)
4350 + {
4351 +- struct proc_dir_entry *viafb_entry = shared->proc_entry,
4352 +- *iga1_entry = shared->iga1_proc_entry,
4353 +- *iga2_entry = shared->iga2_proc_entry;
4354 ++ struct proc_dir_entry *viafb_entry = shared->proc_entry;
4355 +
4356 + if (!viafb_entry)
4357 + return;
4358 +
4359 +- remove_proc_entry("output_devices", iga2_entry);
4360 ++ remove_proc_entry("output_devices", shared->iga2_proc_entry);
4361 + remove_proc_entry("iga2", viafb_entry);
4362 +- remove_proc_entry("output_devices", iga1_entry);
4363 ++ remove_proc_entry("output_devices", shared->iga1_proc_entry);
4364 + remove_proc_entry("iga1", viafb_entry);
4365 + remove_proc_entry("supported_output_devices", viafb_entry);
4366 +
4367 +diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
4368 +index 01d15dca940e..7cf26768ea0b 100644
4369 +--- a/drivers/virtio/virtio_balloon.c
4370 ++++ b/drivers/virtio/virtio_balloon.c
4371 +@@ -239,12 +239,14 @@ static void update_balloon_stats(struct virtio_balloon *vb)
4372 + all_vm_events(events);
4373 + si_meminfo(&i);
4374 +
4375 ++#ifdef CONFIG_VM_EVENT_COUNTERS
4376 + update_stat(vb, idx++, VIRTIO_BALLOON_S_SWAP_IN,
4377 + pages_to_bytes(events[PSWPIN]));
4378 + update_stat(vb, idx++, VIRTIO_BALLOON_S_SWAP_OUT,
4379 + pages_to_bytes(events[PSWPOUT]));
4380 + update_stat(vb, idx++, VIRTIO_BALLOON_S_MAJFLT, events[PGMAJFAULT]);
4381 + update_stat(vb, idx++, VIRTIO_BALLOON_S_MINFLT, events[PGFAULT]);
4382 ++#endif
4383 + update_stat(vb, idx++, VIRTIO_BALLOON_S_MEMFREE,
4384 + pages_to_bytes(i.freeram));
4385 + update_stat(vb, idx++, VIRTIO_BALLOON_S_MEMTOT,
4386 +diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
4387 +index 73708acce3ca..3a14948269b1 100644
4388 +--- a/drivers/xen/Kconfig
4389 ++++ b/drivers/xen/Kconfig
4390 +@@ -239,7 +239,7 @@ config XEN_ACPI_HOTPLUG_CPU
4391 +
4392 + config XEN_ACPI_PROCESSOR
4393 + tristate "Xen ACPI processor"
4394 +- depends on XEN && X86 && ACPI_PROCESSOR && CPU_FREQ
4395 ++ depends on XEN && XEN_DOM0 && X86 && ACPI_PROCESSOR && CPU_FREQ
4396 + default m
4397 + help
4398 + This ACPI processor uploads Power Management information to the Xen
4399 +diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
4400 +index 9c3b9d07f341..4e3c889c1876 100644
4401 +--- a/fs/btrfs/ioctl.c
4402 ++++ b/fs/btrfs/ioctl.c
4403 +@@ -2231,7 +2231,7 @@ static noinline int btrfs_search_path_in_tree(struct btrfs_fs_info *info,
4404 + if (!path)
4405 + return -ENOMEM;
4406 +
4407 +- ptr = &name[BTRFS_INO_LOOKUP_PATH_MAX];
4408 ++ ptr = &name[BTRFS_INO_LOOKUP_PATH_MAX - 1];
4409 +
4410 + key.objectid = tree_id;
4411 + key.type = BTRFS_ROOT_ITEM_KEY;
4412 +diff --git a/fs/compat_binfmt_elf.c b/fs/compat_binfmt_elf.c
4413 +index 4d24d17bcfc1..943be5ecfcd9 100644
4414 +--- a/fs/compat_binfmt_elf.c
4415 ++++ b/fs/compat_binfmt_elf.c
4416 +@@ -51,6 +51,7 @@
4417 + #define elf_prstatus compat_elf_prstatus
4418 + #define elf_prpsinfo compat_elf_prpsinfo
4419 +
4420 ++#ifdef CONFIG_ELF_CORE
4421 + /*
4422 + * Compat version of cputime_to_compat_timeval, perhaps this
4423 + * should be an inline in <linux/compat.h>.
4424 +@@ -63,6 +64,7 @@ static void cputime_to_compat_timeval(const cputime_t cputime,
4425 + value->tv_sec = tv.tv_sec;
4426 + value->tv_usec = tv.tv_usec;
4427 + }
4428 ++#endif
4429 +
4430 + #undef cputime_to_timeval
4431 + #define cputime_to_timeval cputime_to_compat_timeval
4432 +diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c
4433 +index 03446c5a3ec1..4e1144512522 100644
4434 +--- a/fs/ncpfs/dir.c
4435 ++++ b/fs/ncpfs/dir.c
4436 +@@ -133,12 +133,11 @@ ncp_hash_dentry(const struct dentry *dentry, struct qstr *this)
4437 + return 0;
4438 +
4439 + if (!ncp_case_sensitive(inode)) {
4440 +- struct super_block *sb = dentry->d_sb;
4441 + struct nls_table *t;
4442 + unsigned long hash;
4443 + int i;
4444 +
4445 +- t = NCP_IO_TABLE(sb);
4446 ++ t = NCP_IO_TABLE(dentry->d_sb);
4447 + hash = init_name_hash();
4448 + for (i=0; i<this->len ; i++)
4449 + hash = partial_name_hash(ncp_tolower(t, this->name[i]),
4450 +diff --git a/fs/reiserfs/lbalance.c b/fs/reiserfs/lbalance.c
4451 +index 249594a821e0..f5cebd70d903 100644
4452 +--- a/fs/reiserfs/lbalance.c
4453 ++++ b/fs/reiserfs/lbalance.c
4454 +@@ -475,7 +475,7 @@ static void leaf_item_bottle(struct buffer_info *dest_bi,
4455 + * 'cpy_bytes'; create new item header;
4456 + * n_ih = new item_header;
4457 + */
4458 +- memcpy(&n_ih, ih, SHORT_KEY_SIZE);
4459 ++ memcpy(&n_ih.ih_key, &ih->ih_key, KEY_SIZE);
4460 +
4461 + /* Endian safe, both le */
4462 + n_ih.ih_version = ih->ih_version;
4463 +diff --git a/fs/reiserfs/reiserfs.h b/fs/reiserfs/reiserfs.h
4464 +index 2adcde137c3f..5dcf3ab83886 100644
4465 +--- a/fs/reiserfs/reiserfs.h
4466 ++++ b/fs/reiserfs/reiserfs.h
4467 +@@ -1326,7 +1326,6 @@ struct cpu_key {
4468 + #define KEY_NOT_FOUND 0
4469 +
4470 + #define KEY_SIZE (sizeof(struct reiserfs_key))
4471 +-#define SHORT_KEY_SIZE (sizeof (__u32) + sizeof (__u32))
4472 +
4473 + /* return values for search_by_key and clones */
4474 + #define ITEM_FOUND 1
4475 +diff --git a/include/linux/device.h b/include/linux/device.h
4476 +index 7075a2485ed3..834000903525 100644
4477 +--- a/include/linux/device.h
4478 ++++ b/include/linux/device.h
4479 +@@ -1272,8 +1272,11 @@ do { \
4480 + dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); \
4481 + } while (0)
4482 + #else
4483 +-#define dev_dbg_ratelimited(dev, fmt, ...) \
4484 +- no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
4485 ++#define dev_dbg_ratelimited(dev, fmt, ...) \
4486 ++do { \
4487 ++ if (0) \
4488 ++ dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); \
4489 ++} while (0)
4490 + #endif
4491 +
4492 + #ifdef VERBOSE_DEBUG
4493 +diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h
4494 +index 5295535b60c6..a7b7a050bfa8 100644
4495 +--- a/include/linux/fdtable.h
4496 ++++ b/include/linux/fdtable.h
4497 +@@ -9,6 +9,7 @@
4498 + #include <linux/compiler.h>
4499 + #include <linux/spinlock.h>
4500 + #include <linux/rcupdate.h>
4501 ++#include <linux/nospec.h>
4502 + #include <linux/types.h>
4503 + #include <linux/init.h>
4504 + #include <linux/fs.h>
4505 +@@ -81,8 +82,10 @@ static inline struct file *__fcheck_files(struct files_struct *files, unsigned i
4506 + {
4507 + struct fdtable *fdt = rcu_dereference_raw(files->fdt);
4508 +
4509 +- if (fd < fdt->max_fds)
4510 ++ if (fd < fdt->max_fds) {
4511 ++ fd = array_index_nospec(fd, fdt->max_fds);
4512 + return rcu_dereference_raw(fdt->fd[fd]);
4513 ++ }
4514 + return NULL;
4515 + }
4516 +
4517 +diff --git a/include/linux/init.h b/include/linux/init.h
4518 +index b449f378f995..5c4a3b7524e0 100644
4519 +--- a/include/linux/init.h
4520 ++++ b/include/linux/init.h
4521 +@@ -4,6 +4,13 @@
4522 + #include <linux/compiler.h>
4523 + #include <linux/types.h>
4524 +
4525 ++/* Built-in __init functions needn't be compiled with retpoline */
4526 ++#if defined(RETPOLINE) && !defined(MODULE)
4527 ++#define __noretpoline __attribute__((indirect_branch("keep")))
4528 ++#else
4529 ++#define __noretpoline
4530 ++#endif
4531 ++
4532 + /* These macros are used to mark some functions or
4533 + * initialized data (doesn't apply to uninitialized data)
4534 + * as `initialization' functions. The kernel can take this
4535 +@@ -39,7 +46,7 @@
4536 +
4537 + /* These are for everybody (although not all archs will actually
4538 + discard it in modules) */
4539 +-#define __init __section(.init.text) __cold notrace
4540 ++#define __init __section(.init.text) __cold notrace __noretpoline
4541 + #define __initdata __section(.init.data)
4542 + #define __initconst __constsection(.init.rodata)
4543 + #define __exitdata __section(.exit.data)
4544 +diff --git a/include/linux/module.h b/include/linux/module.h
4545 +index b229a9961d02..c9f2f85017ad 100644
4546 +--- a/include/linux/module.h
4547 ++++ b/include/linux/module.h
4548 +@@ -789,6 +789,15 @@ static inline void module_bug_finalize(const Elf_Ehdr *hdr,
4549 + static inline void module_bug_cleanup(struct module *mod) {}
4550 + #endif /* CONFIG_GENERIC_BUG */
4551 +
4552 ++#ifdef RETPOLINE
4553 ++extern bool retpoline_module_ok(bool has_retpoline);
4554 ++#else
4555 ++static inline bool retpoline_module_ok(bool has_retpoline)
4556 ++{
4557 ++ return true;
4558 ++}
4559 ++#endif
4560 ++
4561 + #ifdef CONFIG_MODULE_SIG
4562 + static inline bool module_sig_ok(struct module *module)
4563 + {
4564 +diff --git a/include/linux/msi.h b/include/linux/msi.h
4565 +index f0f43ec45ee7..d0d50cf00b4d 100644
4566 +--- a/include/linux/msi.h
4567 ++++ b/include/linux/msi.h
4568 +@@ -17,7 +17,13 @@ struct msi_desc;
4569 + struct pci_dev;
4570 + struct platform_msi_priv_data;
4571 + void __get_cached_msi_msg(struct msi_desc *entry, struct msi_msg *msg);
4572 ++#ifdef CONFIG_GENERIC_MSI_IRQ
4573 + void get_cached_msi_msg(unsigned int irq, struct msi_msg *msg);
4574 ++#else
4575 ++static inline void get_cached_msi_msg(unsigned int irq, struct msi_msg *msg)
4576 ++{
4577 ++}
4578 ++#endif
4579 +
4580 + typedef void (*irq_write_msi_msg_t)(struct msi_desc *desc,
4581 + struct msi_msg *msg);
4582 +@@ -105,18 +111,21 @@ struct msi_desc {
4583 +
4584 + struct pci_dev *msi_desc_to_pci_dev(struct msi_desc *desc);
4585 + void *msi_desc_to_pci_sysdata(struct msi_desc *desc);
4586 ++void pci_write_msi_msg(unsigned int irq, struct msi_msg *msg);
4587 + #else /* CONFIG_PCI_MSI */
4588 + static inline void *msi_desc_to_pci_sysdata(struct msi_desc *desc)
4589 + {
4590 + return NULL;
4591 + }
4592 ++static inline void pci_write_msi_msg(unsigned int irq, struct msi_msg *msg)
4593 ++{
4594 ++}
4595 + #endif /* CONFIG_PCI_MSI */
4596 +
4597 + struct msi_desc *alloc_msi_entry(struct device *dev);
4598 + void free_msi_entry(struct msi_desc *entry);
4599 + void __pci_read_msi_msg(struct msi_desc *entry, struct msi_msg *msg);
4600 + void __pci_write_msi_msg(struct msi_desc *entry, struct msi_msg *msg);
4601 +-void pci_write_msi_msg(unsigned int irq, struct msi_msg *msg);
4602 +
4603 + u32 __pci_msix_desc_mask_irq(struct msi_desc *desc, u32 flag);
4604 + u32 __pci_msi_desc_mask_irq(struct msi_desc *desc, u32 mask, u32 flag);
4605 +diff --git a/include/linux/mtd/sh_flctl.h b/include/linux/mtd/sh_flctl.h
4606 +index 1c28f8879b1c..067b37aff4a1 100644
4607 +--- a/include/linux/mtd/sh_flctl.h
4608 ++++ b/include/linux/mtd/sh_flctl.h
4609 +@@ -148,6 +148,7 @@ struct sh_flctl {
4610 + struct platform_device *pdev;
4611 + struct dev_pm_qos_request pm_qos;
4612 + void __iomem *reg;
4613 ++ resource_size_t fifo;
4614 +
4615 + uint8_t done_buff[2048 + 64]; /* max size 2048 + 64 */
4616 + int read_bytes;
4617 +diff --git a/include/linux/nospec.h b/include/linux/nospec.h
4618 +new file mode 100644
4619 +index 000000000000..b99bced39ac2
4620 +--- /dev/null
4621 ++++ b/include/linux/nospec.h
4622 +@@ -0,0 +1,72 @@
4623 ++// SPDX-License-Identifier: GPL-2.0
4624 ++// Copyright(c) 2018 Linus Torvalds. All rights reserved.
4625 ++// Copyright(c) 2018 Alexei Starovoitov. All rights reserved.
4626 ++// Copyright(c) 2018 Intel Corporation. All rights reserved.
4627 ++
4628 ++#ifndef _LINUX_NOSPEC_H
4629 ++#define _LINUX_NOSPEC_H
4630 ++
4631 ++/**
4632 ++ * array_index_mask_nospec() - generate a ~0 mask when index < size, 0 otherwise
4633 ++ * @index: array element index
4634 ++ * @size: number of elements in array
4635 ++ *
4636 ++ * When @index is out of bounds (@index >= @size), the sign bit will be
4637 ++ * set. Extend the sign bit to all bits and invert, giving a result of
4638 ++ * zero for an out of bounds index, or ~0 if within bounds [0, @size).
4639 ++ */
4640 ++#ifndef array_index_mask_nospec
4641 ++static inline unsigned long array_index_mask_nospec(unsigned long index,
4642 ++ unsigned long size)
4643 ++{
4644 ++ /*
4645 ++ * Warn developers about inappropriate array_index_nospec() usage.
4646 ++ *
4647 ++ * Even if the CPU speculates past the WARN_ONCE branch, the
4648 ++ * sign bit of @index is taken into account when generating the
4649 ++ * mask.
4650 ++ *
4651 ++ * This warning is compiled out when the compiler can infer that
4652 ++ * @index and @size are less than LONG_MAX.
4653 ++ */
4654 ++ if (WARN_ONCE(index > LONG_MAX || size > LONG_MAX,
4655 ++ "array_index_nospec() limited to range of [0, LONG_MAX]\n"))
4656 ++ return 0;
4657 ++
4658 ++ /*
4659 ++ * Always calculate and emit the mask even if the compiler
4660 ++ * thinks the mask is not needed. The compiler does not take
4661 ++ * into account the value of @index under speculation.
4662 ++ */
4663 ++ OPTIMIZER_HIDE_VAR(index);
4664 ++ return ~(long)(index | (size - 1UL - index)) >> (BITS_PER_LONG - 1);
4665 ++}
4666 ++#endif
4667 ++
4668 ++/*
4669 ++ * array_index_nospec - sanitize an array index after a bounds check
4670 ++ *
4671 ++ * For a code sequence like:
4672 ++ *
4673 ++ * if (index < size) {
4674 ++ * index = array_index_nospec(index, size);
4675 ++ * val = array[index];
4676 ++ * }
4677 ++ *
4678 ++ * ...if the CPU speculates past the bounds check then
4679 ++ * array_index_nospec() will clamp the index within the range of [0,
4680 ++ * size).
4681 ++ */
4682 ++#define array_index_nospec(index, size) \
4683 ++({ \
4684 ++ typeof(index) _i = (index); \
4685 ++ typeof(size) _s = (size); \
4686 ++ unsigned long _mask = array_index_mask_nospec(_i, _s); \
4687 ++ \
4688 ++ BUILD_BUG_ON(sizeof(_i) > sizeof(long)); \
4689 ++ BUILD_BUG_ON(sizeof(_s) > sizeof(long)); \
4690 ++ \
4691 ++ _i &= _mask; \
4692 ++ _i; \
4693 ++})
4694 ++#endif /* _LINUX_NOSPEC_H */
4695 +diff --git a/include/linux/string.h b/include/linux/string.h
4696 +index aa30789b0f65..98bb781a2eff 100644
4697 +--- a/include/linux/string.h
4698 ++++ b/include/linux/string.h
4699 +@@ -122,6 +122,7 @@ extern char *kstrdup(const char *s, gfp_t gfp);
4700 + extern const char *kstrdup_const(const char *s, gfp_t gfp);
4701 + extern char *kstrndup(const char *s, size_t len, gfp_t gfp);
4702 + extern void *kmemdup(const void *src, size_t len, gfp_t gfp);
4703 ++extern char *kmemdup_nul(const char *s, size_t len, gfp_t gfp);
4704 +
4705 + extern char **argv_split(gfp_t gfp, const char *str, int *argcp);
4706 + extern void argv_free(char **argv);
4707 +diff --git a/include/net/dst_cache.h b/include/net/dst_cache.h
4708 +new file mode 100644
4709 +index 000000000000..151accae708b
4710 +--- /dev/null
4711 ++++ b/include/net/dst_cache.h
4712 +@@ -0,0 +1,97 @@
4713 ++#ifndef _NET_DST_CACHE_H
4714 ++#define _NET_DST_CACHE_H
4715 ++
4716 ++#include <linux/jiffies.h>
4717 ++#include <net/dst.h>
4718 ++#if IS_ENABLED(CONFIG_IPV6)
4719 ++#include <net/ip6_fib.h>
4720 ++#endif
4721 ++
4722 ++struct dst_cache {
4723 ++ struct dst_cache_pcpu __percpu *cache;
4724 ++ unsigned long reset_ts;
4725 ++};
4726 ++
4727 ++/**
4728 ++ * dst_cache_get - perform cache lookup
4729 ++ * @dst_cache: the cache
4730 ++ *
4731 ++ * The caller should use dst_cache_get_ip4() if it need to retrieve the
4732 ++ * source address to be used when xmitting to the cached dst.
4733 ++ * local BH must be disabled.
4734 ++ */
4735 ++struct dst_entry *dst_cache_get(struct dst_cache *dst_cache);
4736 ++
4737 ++/**
4738 ++ * dst_cache_get_ip4 - perform cache lookup and fetch ipv4 source address
4739 ++ * @dst_cache: the cache
4740 ++ * @saddr: return value for the retrieved source address
4741 ++ *
4742 ++ * local BH must be disabled.
4743 ++ */
4744 ++struct rtable *dst_cache_get_ip4(struct dst_cache *dst_cache, __be32 *saddr);
4745 ++
4746 ++/**
4747 ++ * dst_cache_set_ip4 - store the ipv4 dst into the cache
4748 ++ * @dst_cache: the cache
4749 ++ * @dst: the entry to be cached
4750 ++ * @saddr: the source address to be stored inside the cache
4751 ++ *
4752 ++ * local BH must be disabled.
4753 ++ */
4754 ++void dst_cache_set_ip4(struct dst_cache *dst_cache, struct dst_entry *dst,
4755 ++ __be32 saddr);
4756 ++
4757 ++#if IS_ENABLED(CONFIG_IPV6)
4758 ++
4759 ++/**
4760 ++ * dst_cache_set_ip6 - store the ipv6 dst into the cache
4761 ++ * @dst_cache: the cache
4762 ++ * @dst: the entry to be cached
4763 ++ * @saddr: the source address to be stored inside the cache
4764 ++ *
4765 ++ * local BH must be disabled.
4766 ++ */
4767 ++void dst_cache_set_ip6(struct dst_cache *dst_cache, struct dst_entry *dst,
4768 ++ const struct in6_addr *addr);
4769 ++
4770 ++/**
4771 ++ * dst_cache_get_ip6 - perform cache lookup and fetch ipv6 source address
4772 ++ * @dst_cache: the cache
4773 ++ * @saddr: return value for the retrieved source address
4774 ++ *
4775 ++ * local BH must be disabled.
4776 ++ */
4777 ++struct dst_entry *dst_cache_get_ip6(struct dst_cache *dst_cache,
4778 ++ struct in6_addr *saddr);
4779 ++#endif
4780 ++
4781 ++/**
4782 ++ * dst_cache_reset - invalidate the cache contents
4783 ++ * @dst_cache: the cache
4784 ++ *
4785 ++ * This do not free the cached dst to avoid races and contentions.
4786 ++ * the dst will be freed on later cache lookup.
4787 ++ */
4788 ++static inline void dst_cache_reset(struct dst_cache *dst_cache)
4789 ++{
4790 ++ dst_cache->reset_ts = jiffies;
4791 ++}
4792 ++
4793 ++/**
4794 ++ * dst_cache_init - initialize the cache, allocating the required storage
4795 ++ * @dst_cache: the cache
4796 ++ * @gfp: allocation flags
4797 ++ */
4798 ++int dst_cache_init(struct dst_cache *dst_cache, gfp_t gfp);
4799 ++
4800 ++/**
4801 ++ * dst_cache_destroy - empty the cache and free the allocated storage
4802 ++ * @dst_cache: the cache
4803 ++ *
4804 ++ * No synchronization is enforced: it must be called only when the cache
4805 ++ * is unsed.
4806 ++ */
4807 ++void dst_cache_destroy(struct dst_cache *dst_cache);
4808 ++
4809 ++#endif
4810 +diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h
4811 +index 9c2c044153f6..d143c8480681 100644
4812 +--- a/include/net/ip6_tunnel.h
4813 ++++ b/include/net/ip6_tunnel.h
4814 +@@ -5,6 +5,8 @@
4815 + #include <linux/netdevice.h>
4816 + #include <linux/if_tunnel.h>
4817 + #include <linux/ip6_tunnel.h>
4818 ++#include <net/ip_tunnels.h>
4819 ++#include <net/dst_cache.h>
4820 +
4821 + #define IP6TUNNEL_ERR_TIMEO (30*HZ)
4822 +
4823 +@@ -32,12 +34,6 @@ struct __ip6_tnl_parm {
4824 + __be32 o_key;
4825 + };
4826 +
4827 +-struct ip6_tnl_dst {
4828 +- seqlock_t lock;
4829 +- struct dst_entry __rcu *dst;
4830 +- u32 cookie;
4831 +-};
4832 +-
4833 + /* IPv6 tunnel */
4834 + struct ip6_tnl {
4835 + struct ip6_tnl __rcu *next; /* next tunnel in list */
4836 +@@ -45,7 +41,7 @@ struct ip6_tnl {
4837 + struct net *net; /* netns for packet i/o */
4838 + struct __ip6_tnl_parm parms; /* tunnel configuration parameters */
4839 + struct flowi fl; /* flowi template for xmit */
4840 +- struct ip6_tnl_dst __percpu *dst_cache; /* cached dst */
4841 ++ struct dst_cache dst_cache; /* cached dst */
4842 +
4843 + int err_count;
4844 + unsigned long err_time;
4845 +@@ -65,11 +61,6 @@ struct ipv6_tlv_tnl_enc_lim {
4846 + __u8 encap_limit; /* tunnel encapsulation limit */
4847 + } __packed;
4848 +
4849 +-struct dst_entry *ip6_tnl_dst_get(struct ip6_tnl *t);
4850 +-int ip6_tnl_dst_init(struct ip6_tnl *t);
4851 +-void ip6_tnl_dst_destroy(struct ip6_tnl *t);
4852 +-void ip6_tnl_dst_reset(struct ip6_tnl *t);
4853 +-void ip6_tnl_dst_set(struct ip6_tnl *t, struct dst_entry *dst);
4854 + int ip6_tnl_rcv_ctl(struct ip6_tnl *t, const struct in6_addr *laddr,
4855 + const struct in6_addr *raddr);
4856 + int ip6_tnl_xmit_ctl(struct ip6_tnl *t, const struct in6_addr *laddr,
4857 +diff --git a/include/net/netlink.h b/include/net/netlink.h
4858 +index 0e3172751755..5ffaea4665f8 100644
4859 +--- a/include/net/netlink.h
4860 ++++ b/include/net/netlink.h
4861 +@@ -745,7 +745,10 @@ static inline int nla_parse_nested(struct nlattr *tb[], int maxtype,
4862 + */
4863 + static inline int nla_put_u8(struct sk_buff *skb, int attrtype, u8 value)
4864 + {
4865 +- return nla_put(skb, attrtype, sizeof(u8), &value);
4866 ++ /* temporary variables to work around GCC PR81715 with asan-stack=1 */
4867 ++ u8 tmp = value;
4868 ++
4869 ++ return nla_put(skb, attrtype, sizeof(u8), &tmp);
4870 + }
4871 +
4872 + /**
4873 +@@ -756,7 +759,9 @@ static inline int nla_put_u8(struct sk_buff *skb, int attrtype, u8 value)
4874 + */
4875 + static inline int nla_put_u16(struct sk_buff *skb, int attrtype, u16 value)
4876 + {
4877 +- return nla_put(skb, attrtype, sizeof(u16), &value);
4878 ++ u16 tmp = value;
4879 ++
4880 ++ return nla_put(skb, attrtype, sizeof(u16), &tmp);
4881 + }
4882 +
4883 + /**
4884 +@@ -767,7 +772,9 @@ static inline int nla_put_u16(struct sk_buff *skb, int attrtype, u16 value)
4885 + */
4886 + static inline int nla_put_be16(struct sk_buff *skb, int attrtype, __be16 value)
4887 + {
4888 +- return nla_put(skb, attrtype, sizeof(__be16), &value);
4889 ++ __be16 tmp = value;
4890 ++
4891 ++ return nla_put(skb, attrtype, sizeof(__be16), &tmp);
4892 + }
4893 +
4894 + /**
4895 +@@ -778,7 +785,9 @@ static inline int nla_put_be16(struct sk_buff *skb, int attrtype, __be16 value)
4896 + */
4897 + static inline int nla_put_net16(struct sk_buff *skb, int attrtype, __be16 value)
4898 + {
4899 +- return nla_put_be16(skb, attrtype | NLA_F_NET_BYTEORDER, value);
4900 ++ __be16 tmp = value;
4901 ++
4902 ++ return nla_put_be16(skb, attrtype | NLA_F_NET_BYTEORDER, tmp);
4903 + }
4904 +
4905 + /**
4906 +@@ -789,7 +798,9 @@ static inline int nla_put_net16(struct sk_buff *skb, int attrtype, __be16 value)
4907 + */
4908 + static inline int nla_put_le16(struct sk_buff *skb, int attrtype, __le16 value)
4909 + {
4910 +- return nla_put(skb, attrtype, sizeof(__le16), &value);
4911 ++ __le16 tmp = value;
4912 ++
4913 ++ return nla_put(skb, attrtype, sizeof(__le16), &tmp);
4914 + }
4915 +
4916 + /**
4917 +@@ -800,7 +811,9 @@ static inline int nla_put_le16(struct sk_buff *skb, int attrtype, __le16 value)
4918 + */
4919 + static inline int nla_put_u32(struct sk_buff *skb, int attrtype, u32 value)
4920 + {
4921 +- return nla_put(skb, attrtype, sizeof(u32), &value);
4922 ++ u32 tmp = value;
4923 ++
4924 ++ return nla_put(skb, attrtype, sizeof(u32), &tmp);
4925 + }
4926 +
4927 + /**
4928 +@@ -811,7 +824,9 @@ static inline int nla_put_u32(struct sk_buff *skb, int attrtype, u32 value)
4929 + */
4930 + static inline int nla_put_be32(struct sk_buff *skb, int attrtype, __be32 value)
4931 + {
4932 +- return nla_put(skb, attrtype, sizeof(__be32), &value);
4933 ++ __be32 tmp = value;
4934 ++
4935 ++ return nla_put(skb, attrtype, sizeof(__be32), &tmp);
4936 + }
4937 +
4938 + /**
4939 +@@ -822,7 +837,9 @@ static inline int nla_put_be32(struct sk_buff *skb, int attrtype, __be32 value)
4940 + */
4941 + static inline int nla_put_net32(struct sk_buff *skb, int attrtype, __be32 value)
4942 + {
4943 +- return nla_put_be32(skb, attrtype | NLA_F_NET_BYTEORDER, value);
4944 ++ __be32 tmp = value;
4945 ++
4946 ++ return nla_put_be32(skb, attrtype | NLA_F_NET_BYTEORDER, tmp);
4947 + }
4948 +
4949 + /**
4950 +@@ -833,7 +850,9 @@ static inline int nla_put_net32(struct sk_buff *skb, int attrtype, __be32 value)
4951 + */
4952 + static inline int nla_put_le32(struct sk_buff *skb, int attrtype, __le32 value)
4953 + {
4954 +- return nla_put(skb, attrtype, sizeof(__le32), &value);
4955 ++ __le32 tmp = value;
4956 ++
4957 ++ return nla_put(skb, attrtype, sizeof(__le32), &tmp);
4958 + }
4959 +
4960 + /**
4961 +@@ -844,7 +863,9 @@ static inline int nla_put_le32(struct sk_buff *skb, int attrtype, __le32 value)
4962 + */
4963 + static inline int nla_put_u64(struct sk_buff *skb, int attrtype, u64 value)
4964 + {
4965 +- return nla_put(skb, attrtype, sizeof(u64), &value);
4966 ++ u64 tmp = value;
4967 ++
4968 ++ return nla_put(skb, attrtype, sizeof(u64), &tmp);
4969 + }
4970 +
4971 + /**
4972 +@@ -855,7 +876,9 @@ static inline int nla_put_u64(struct sk_buff *skb, int attrtype, u64 value)
4973 + */
4974 + static inline int nla_put_be64(struct sk_buff *skb, int attrtype, __be64 value)
4975 + {
4976 +- return nla_put(skb, attrtype, sizeof(__be64), &value);
4977 ++ __be64 tmp = value;
4978 ++
4979 ++ return nla_put(skb, attrtype, sizeof(__be64), &tmp);
4980 + }
4981 +
4982 + /**
4983 +@@ -866,7 +889,9 @@ static inline int nla_put_be64(struct sk_buff *skb, int attrtype, __be64 value)
4984 + */
4985 + static inline int nla_put_net64(struct sk_buff *skb, int attrtype, __be64 value)
4986 + {
4987 +- return nla_put_be64(skb, attrtype | NLA_F_NET_BYTEORDER, value);
4988 ++ __be64 tmp = value;
4989 ++
4990 ++ return nla_put_be64(skb, attrtype | NLA_F_NET_BYTEORDER, tmp);
4991 + }
4992 +
4993 + /**
4994 +@@ -877,7 +902,9 @@ static inline int nla_put_net64(struct sk_buff *skb, int attrtype, __be64 value)
4995 + */
4996 + static inline int nla_put_le64(struct sk_buff *skb, int attrtype, __le64 value)
4997 + {
4998 +- return nla_put(skb, attrtype, sizeof(__le64), &value);
4999 ++ __le64 tmp = value;
5000 ++
5001 ++ return nla_put(skb, attrtype, sizeof(__le64), &tmp);
5002 + }
5003 +
5004 + /**
5005 +@@ -888,7 +915,9 @@ static inline int nla_put_le64(struct sk_buff *skb, int attrtype, __le64 value)
5006 + */
5007 + static inline int nla_put_s8(struct sk_buff *skb, int attrtype, s8 value)
5008 + {
5009 +- return nla_put(skb, attrtype, sizeof(s8), &value);
5010 ++ s8 tmp = value;
5011 ++
5012 ++ return nla_put(skb, attrtype, sizeof(s8), &tmp);
5013 + }
5014 +
5015 + /**
5016 +@@ -899,7 +928,9 @@ static inline int nla_put_s8(struct sk_buff *skb, int attrtype, s8 value)
5017 + */
5018 + static inline int nla_put_s16(struct sk_buff *skb, int attrtype, s16 value)
5019 + {
5020 +- return nla_put(skb, attrtype, sizeof(s16), &value);
5021 ++ s16 tmp = value;
5022 ++
5023 ++ return nla_put(skb, attrtype, sizeof(s16), &tmp);
5024 + }
5025 +
5026 + /**
5027 +@@ -910,7 +941,9 @@ static inline int nla_put_s16(struct sk_buff *skb, int attrtype, s16 value)
5028 + */
5029 + static inline int nla_put_s32(struct sk_buff *skb, int attrtype, s32 value)
5030 + {
5031 +- return nla_put(skb, attrtype, sizeof(s32), &value);
5032 ++ s32 tmp = value;
5033 ++
5034 ++ return nla_put(skb, attrtype, sizeof(s32), &tmp);
5035 + }
5036 +
5037 + /**
5038 +@@ -921,7 +954,9 @@ static inline int nla_put_s32(struct sk_buff *skb, int attrtype, s32 value)
5039 + */
5040 + static inline int nla_put_s64(struct sk_buff *skb, int attrtype, s64 value)
5041 + {
5042 +- return nla_put(skb, attrtype, sizeof(s64), &value);
5043 ++ s64 tmp = value;
5044 ++
5045 ++ return nla_put(skb, attrtype, sizeof(s64), &tmp);
5046 + }
5047 +
5048 + /**
5049 +@@ -969,7 +1004,9 @@ static inline int nla_put_msecs(struct sk_buff *skb, int attrtype,
5050 + static inline int nla_put_in_addr(struct sk_buff *skb, int attrtype,
5051 + __be32 addr)
5052 + {
5053 +- return nla_put_be32(skb, attrtype, addr);
5054 ++ __be32 tmp = addr;
5055 ++
5056 ++ return nla_put_be32(skb, attrtype, tmp);
5057 + }
5058 +
5059 + /**
5060 +diff --git a/include/net/red.h b/include/net/red.h
5061 +index 76e0b5f922c6..3618cdfec884 100644
5062 +--- a/include/net/red.h
5063 ++++ b/include/net/red.h
5064 +@@ -167,6 +167,17 @@ static inline void red_set_vars(struct red_vars *v)
5065 + v->qcount = -1;
5066 + }
5067 +
5068 ++static inline bool red_check_params(u32 qth_min, u32 qth_max, u8 Wlog)
5069 ++{
5070 ++ if (fls(qth_min) + Wlog > 32)
5071 ++ return false;
5072 ++ if (fls(qth_max) + Wlog > 32)
5073 ++ return false;
5074 ++ if (qth_max < qth_min)
5075 ++ return false;
5076 ++ return true;
5077 ++}
5078 ++
5079 + static inline void red_set_parms(struct red_parms *p,
5080 + u32 qth_min, u32 qth_max, u8 Wlog, u8 Plog,
5081 + u8 Scell_log, u8 *stab, u32 max_P)
5082 +@@ -178,7 +189,7 @@ static inline void red_set_parms(struct red_parms *p,
5083 + p->qth_max = qth_max << Wlog;
5084 + p->Wlog = Wlog;
5085 + p->Plog = Plog;
5086 +- if (delta < 0)
5087 ++ if (delta <= 0)
5088 + delta = 1;
5089 + p->qth_delta = delta;
5090 + if (!max_P) {
5091 +diff --git a/include/trace/events/clk.h b/include/trace/events/clk.h
5092 +index 758607226bfd..2cd449328aee 100644
5093 +--- a/include/trace/events/clk.h
5094 ++++ b/include/trace/events/clk.h
5095 +@@ -134,12 +134,12 @@ DECLARE_EVENT_CLASS(clk_parent,
5096 +
5097 + TP_STRUCT__entry(
5098 + __string( name, core->name )
5099 +- __string( pname, parent->name )
5100 ++ __string( pname, parent ? parent->name : "none" )
5101 + ),
5102 +
5103 + TP_fast_assign(
5104 + __assign_str(name, core->name);
5105 +- __assign_str(pname, parent->name);
5106 ++ __assign_str(pname, parent ? parent->name : "none");
5107 + ),
5108 +
5109 + TP_printk("%s %s", __get_str(name), __get_str(pname))
5110 +diff --git a/kernel/module.c b/kernel/module.c
5111 +index 0a56098d3738..aa81f41f2b19 100644
5112 +--- a/kernel/module.c
5113 ++++ b/kernel/module.c
5114 +@@ -2869,6 +2869,15 @@ static struct module *setup_load_info(struct load_info *info, int flags)
5115 + return mod;
5116 + }
5117 +
5118 ++static void check_modinfo_retpoline(struct module *mod, struct load_info *info)
5119 ++{
5120 ++ if (retpoline_module_ok(get_modinfo(info, "retpoline")))
5121 ++ return;
5122 ++
5123 ++ pr_warn("%s: loading module not compiled with retpoline compiler.\n",
5124 ++ mod->name);
5125 ++}
5126 ++
5127 + static int check_modinfo(struct module *mod, struct load_info *info, int flags)
5128 + {
5129 + const char *modmagic = get_modinfo(info, "vermagic");
5130 +@@ -2895,6 +2904,8 @@ static int check_modinfo(struct module *mod, struct load_info *info, int flags)
5131 + add_taint_module(mod, TAINT_OOT_MODULE, LOCKDEP_STILL_OK);
5132 + }
5133 +
5134 ++ check_modinfo_retpoline(mod, info);
5135 ++
5136 + if (get_modinfo(info, "staging")) {
5137 + add_taint_module(mod, TAINT_CRAP, LOCKDEP_STILL_OK);
5138 + pr_warn("%s: module is from the staging directory, the quality "
5139 +diff --git a/kernel/profile.c b/kernel/profile.c
5140 +index 99513e1160e5..9cd8e18e6f18 100644
5141 +--- a/kernel/profile.c
5142 ++++ b/kernel/profile.c
5143 +@@ -44,7 +44,7 @@ int prof_on __read_mostly;
5144 + EXPORT_SYMBOL_GPL(prof_on);
5145 +
5146 + static cpumask_var_t prof_cpu_mask;
5147 +-#ifdef CONFIG_SMP
5148 ++#if defined(CONFIG_SMP) && defined(CONFIG_PROC_FS)
5149 + static DEFINE_PER_CPU(struct profile_hit *[2], cpu_profile_hits);
5150 + static DEFINE_PER_CPU(int, cpu_profile_flip);
5151 + static DEFINE_MUTEX(profile_flip_mutex);
5152 +@@ -201,7 +201,7 @@ int profile_event_unregister(enum profile_type type, struct notifier_block *n)
5153 + }
5154 + EXPORT_SYMBOL_GPL(profile_event_unregister);
5155 +
5156 +-#ifdef CONFIG_SMP
5157 ++#if defined(CONFIG_SMP) && defined(CONFIG_PROC_FS)
5158 + /*
5159 + * Each cpu has a pair of open-addressed hashtables for pending
5160 + * profile hits. read_profile() IPI's all cpus to request them
5161 +diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
5162 +index a990824c8604..7ab5eafea8b2 100644
5163 +--- a/kernel/trace/blktrace.c
5164 ++++ b/kernel/trace/blktrace.c
5165 +@@ -57,7 +57,8 @@ static struct tracer_flags blk_tracer_flags = {
5166 + };
5167 +
5168 + /* Global reference count of probes */
5169 +-static atomic_t blk_probes_ref = ATOMIC_INIT(0);
5170 ++static DEFINE_MUTEX(blk_probe_mutex);
5171 ++static int blk_probes_ref;
5172 +
5173 + static void blk_register_tracepoints(void);
5174 + static void blk_unregister_tracepoints(void);
5175 +@@ -300,11 +301,26 @@ static void blk_trace_free(struct blk_trace *bt)
5176 + kfree(bt);
5177 + }
5178 +
5179 ++static void get_probe_ref(void)
5180 ++{
5181 ++ mutex_lock(&blk_probe_mutex);
5182 ++ if (++blk_probes_ref == 1)
5183 ++ blk_register_tracepoints();
5184 ++ mutex_unlock(&blk_probe_mutex);
5185 ++}
5186 ++
5187 ++static void put_probe_ref(void)
5188 ++{
5189 ++ mutex_lock(&blk_probe_mutex);
5190 ++ if (!--blk_probes_ref)
5191 ++ blk_unregister_tracepoints();
5192 ++ mutex_unlock(&blk_probe_mutex);
5193 ++}
5194 ++
5195 + static void blk_trace_cleanup(struct blk_trace *bt)
5196 + {
5197 + blk_trace_free(bt);
5198 +- if (atomic_dec_and_test(&blk_probes_ref))
5199 +- blk_unregister_tracepoints();
5200 ++ put_probe_ref();
5201 + }
5202 +
5203 + int blk_trace_remove(struct request_queue *q)
5204 +@@ -522,8 +538,7 @@ int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
5205 + if (cmpxchg(&q->blk_trace, NULL, bt))
5206 + goto err;
5207 +
5208 +- if (atomic_inc_return(&blk_probes_ref) == 1)
5209 +- blk_register_tracepoints();
5210 ++ get_probe_ref();
5211 +
5212 + return 0;
5213 + err:
5214 +@@ -1466,9 +1481,7 @@ static int blk_trace_remove_queue(struct request_queue *q)
5215 + if (bt == NULL)
5216 + return -EINVAL;
5217 +
5218 +- if (atomic_dec_and_test(&blk_probes_ref))
5219 +- blk_unregister_tracepoints();
5220 +-
5221 ++ put_probe_ref();
5222 + blk_trace_free(bt);
5223 + return 0;
5224 + }
5225 +@@ -1499,8 +1512,7 @@ static int blk_trace_setup_queue(struct request_queue *q,
5226 + if (cmpxchg(&q->blk_trace, NULL, bt))
5227 + goto free_bt;
5228 +
5229 +- if (atomic_inc_return(&blk_probes_ref) == 1)
5230 +- blk_register_tracepoints();
5231 ++ get_probe_ref();
5232 + return 0;
5233 +
5234 + free_bt:
5235 +diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
5236 +index b53b375e14bd..f0602beeba26 100644
5237 +--- a/lib/Kconfig.debug
5238 ++++ b/lib/Kconfig.debug
5239 +@@ -197,7 +197,7 @@ config ENABLE_MUST_CHECK
5240 + config FRAME_WARN
5241 + int "Warn for stack frames larger than (needs gcc 4.4)"
5242 + range 0 8192
5243 +- default 0 if KASAN
5244 ++ default 2048 if GCC_PLUGIN_LATENT_ENTROPY
5245 + default 1024 if !64BIT
5246 + default 2048 if 64BIT
5247 + help
5248 +diff --git a/lib/oid_registry.c b/lib/oid_registry.c
5249 +index 318f382a010d..150e04d70303 100644
5250 +--- a/lib/oid_registry.c
5251 ++++ b/lib/oid_registry.c
5252 +@@ -116,7 +116,7 @@ int sprint_oid(const void *data, size_t datasize, char *buffer, size_t bufsize)
5253 + int count;
5254 +
5255 + if (v >= end)
5256 +- return -EBADMSG;
5257 ++ goto bad;
5258 +
5259 + n = *v++;
5260 + ret = count = snprintf(buffer, bufsize, "%u.%u", n / 40, n % 40);
5261 +@@ -134,7 +134,7 @@ int sprint_oid(const void *data, size_t datasize, char *buffer, size_t bufsize)
5262 + num = n & 0x7f;
5263 + do {
5264 + if (v >= end)
5265 +- return -EBADMSG;
5266 ++ goto bad;
5267 + n = *v++;
5268 + num <<= 7;
5269 + num |= n & 0x7f;
5270 +@@ -148,6 +148,10 @@ int sprint_oid(const void *data, size_t datasize, char *buffer, size_t bufsize)
5271 + }
5272 +
5273 + return ret;
5274 ++
5275 ++bad:
5276 ++ snprintf(buffer, bufsize, "(bad)");
5277 ++ return -EBADMSG;
5278 + }
5279 + EXPORT_SYMBOL_GPL(sprint_oid);
5280 +
5281 +diff --git a/mm/early_ioremap.c b/mm/early_ioremap.c
5282 +index 6d5717bd7197..57540de2b44c 100644
5283 +--- a/mm/early_ioremap.c
5284 ++++ b/mm/early_ioremap.c
5285 +@@ -103,7 +103,7 @@ __early_ioremap(resource_size_t phys_addr, unsigned long size, pgprot_t prot)
5286 + enum fixed_addresses idx;
5287 + int i, slot;
5288 +
5289 +- WARN_ON(system_state != SYSTEM_BOOTING);
5290 ++ WARN_ON(system_state >= SYSTEM_RUNNING);
5291 +
5292 + slot = -1;
5293 + for (i = 0; i < FIX_BTMAPS_SLOTS; i++) {
5294 +diff --git a/mm/util.c b/mm/util.c
5295 +index d5259b62f8d7..818bbae84721 100644
5296 +--- a/mm/util.c
5297 ++++ b/mm/util.c
5298 +@@ -80,6 +80,8 @@ EXPORT_SYMBOL(kstrdup_const);
5299 + * @s: the string to duplicate
5300 + * @max: read at most @max chars from @s
5301 + * @gfp: the GFP mask used in the kmalloc() call when allocating memory
5302 ++ *
5303 ++ * Note: Use kmemdup_nul() instead if the size is known exactly.
5304 + */
5305 + char *kstrndup(const char *s, size_t max, gfp_t gfp)
5306 + {
5307 +@@ -117,6 +119,28 @@ void *kmemdup(const void *src, size_t len, gfp_t gfp)
5308 + }
5309 + EXPORT_SYMBOL(kmemdup);
5310 +
5311 ++/**
5312 ++ * kmemdup_nul - Create a NUL-terminated string from unterminated data
5313 ++ * @s: The data to stringify
5314 ++ * @len: The size of the data
5315 ++ * @gfp: the GFP mask used in the kmalloc() call when allocating memory
5316 ++ */
5317 ++char *kmemdup_nul(const char *s, size_t len, gfp_t gfp)
5318 ++{
5319 ++ char *buf;
5320 ++
5321 ++ if (!s)
5322 ++ return NULL;
5323 ++
5324 ++ buf = kmalloc_track_caller(len + 1, gfp);
5325 ++ if (buf) {
5326 ++ memcpy(buf, s, len);
5327 ++ buf[len] = '\0';
5328 ++ }
5329 ++ return buf;
5330 ++}
5331 ++EXPORT_SYMBOL(kmemdup_nul);
5332 ++
5333 + /**
5334 + * memdup_user - duplicate memory region from user space
5335 + *
5336 +diff --git a/mm/vmscan.c b/mm/vmscan.c
5337 +index 440c2df9be82..930f7c67a9c1 100644
5338 +--- a/mm/vmscan.c
5339 ++++ b/mm/vmscan.c
5340 +@@ -254,10 +254,13 @@ EXPORT_SYMBOL(register_shrinker);
5341 + */
5342 + void unregister_shrinker(struct shrinker *shrinker)
5343 + {
5344 ++ if (!shrinker->nr_deferred)
5345 ++ return;
5346 + down_write(&shrinker_rwsem);
5347 + list_del(&shrinker->list);
5348 + up_write(&shrinker_rwsem);
5349 + kfree(shrinker->nr_deferred);
5350 ++ shrinker->nr_deferred = NULL;
5351 + }
5352 + EXPORT_SYMBOL(unregister_shrinker);
5353 +
5354 +diff --git a/net/Kconfig b/net/Kconfig
5355 +index 6d94140beacc..129b9fcbf1d0 100644
5356 +--- a/net/Kconfig
5357 ++++ b/net/Kconfig
5358 +@@ -383,6 +383,10 @@ config LWTUNNEL
5359 + weight tunnel endpoint. Tunnel encapsulation parameters are stored
5360 + with light weight tunnel state associated with fib routes.
5361 +
5362 ++config DST_CACHE
5363 ++ bool
5364 ++ default n
5365 ++
5366 + endif # if NET
5367 +
5368 + # Used by archs to tell that they support BPF_JIT
5369 +diff --git a/net/core/Makefile b/net/core/Makefile
5370 +index 086b01fbe1bd..0d8ad4d0261b 100644
5371 +--- a/net/core/Makefile
5372 ++++ b/net/core/Makefile
5373 +@@ -24,3 +24,4 @@ obj-$(CONFIG_NET_PTP_CLASSIFY) += ptp_classifier.o
5374 + obj-$(CONFIG_CGROUP_NET_PRIO) += netprio_cgroup.o
5375 + obj-$(CONFIG_CGROUP_NET_CLASSID) += netclassid_cgroup.o
5376 + obj-$(CONFIG_LWTUNNEL) += lwtunnel.o
5377 ++obj-$(CONFIG_DST_CACHE) += dst_cache.o
5378 +diff --git a/net/core/dev.c b/net/core/dev.c
5379 +index cb58ba15d51e..389807c1c36f 100644
5380 +--- a/net/core/dev.c
5381 ++++ b/net/core/dev.c
5382 +@@ -2598,7 +2598,7 @@ struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
5383 +
5384 + segs = skb_mac_gso_segment(skb, features);
5385 +
5386 +- if (unlikely(skb_needs_check(skb, tx_path)))
5387 ++ if (unlikely(skb_needs_check(skb, tx_path) && !IS_ERR(segs)))
5388 + skb_warn_bad_offload(skb);
5389 +
5390 + return segs;
5391 +diff --git a/net/core/dst_cache.c b/net/core/dst_cache.c
5392 +new file mode 100644
5393 +index 000000000000..554d36449231
5394 +--- /dev/null
5395 ++++ b/net/core/dst_cache.c
5396 +@@ -0,0 +1,168 @@
5397 ++/*
5398 ++ * net/core/dst_cache.c - dst entry cache
5399 ++ *
5400 ++ * Copyright (c) 2016 Paolo Abeni <pabeni@××××××.com>
5401 ++ *
5402 ++ * This program is free software; you can redistribute it and/or modify
5403 ++ * it under the terms of the GNU General Public License as published by
5404 ++ * the Free Software Foundation; either version 2 of the License, or
5405 ++ * (at your option) any later version.
5406 ++ */
5407 ++
5408 ++#include <linux/kernel.h>
5409 ++#include <linux/percpu.h>
5410 ++#include <net/dst_cache.h>
5411 ++#include <net/route.h>
5412 ++#if IS_ENABLED(CONFIG_IPV6)
5413 ++#include <net/ip6_fib.h>
5414 ++#endif
5415 ++#include <uapi/linux/in.h>
5416 ++
5417 ++struct dst_cache_pcpu {
5418 ++ unsigned long refresh_ts;
5419 ++ struct dst_entry *dst;
5420 ++ u32 cookie;
5421 ++ union {
5422 ++ struct in_addr in_saddr;
5423 ++ struct in6_addr in6_saddr;
5424 ++ };
5425 ++};
5426 ++
5427 ++static void dst_cache_per_cpu_dst_set(struct dst_cache_pcpu *dst_cache,
5428 ++ struct dst_entry *dst, u32 cookie)
5429 ++{
5430 ++ dst_release(dst_cache->dst);
5431 ++ if (dst)
5432 ++ dst_hold(dst);
5433 ++
5434 ++ dst_cache->cookie = cookie;
5435 ++ dst_cache->dst = dst;
5436 ++}
5437 ++
5438 ++static struct dst_entry *dst_cache_per_cpu_get(struct dst_cache *dst_cache,
5439 ++ struct dst_cache_pcpu *idst)
5440 ++{
5441 ++ struct dst_entry *dst;
5442 ++
5443 ++ dst = idst->dst;
5444 ++ if (!dst)
5445 ++ goto fail;
5446 ++
5447 ++ /* the cache already hold a dst reference; it can't go away */
5448 ++ dst_hold(dst);
5449 ++
5450 ++ if (unlikely(!time_after(idst->refresh_ts, dst_cache->reset_ts) ||
5451 ++ (dst->obsolete && !dst->ops->check(dst, idst->cookie)))) {
5452 ++ dst_cache_per_cpu_dst_set(idst, NULL, 0);
5453 ++ dst_release(dst);
5454 ++ goto fail;
5455 ++ }
5456 ++ return dst;
5457 ++
5458 ++fail:
5459 ++ idst->refresh_ts = jiffies;
5460 ++ return NULL;
5461 ++}
5462 ++
5463 ++struct dst_entry *dst_cache_get(struct dst_cache *dst_cache)
5464 ++{
5465 ++ if (!dst_cache->cache)
5466 ++ return NULL;
5467 ++
5468 ++ return dst_cache_per_cpu_get(dst_cache, this_cpu_ptr(dst_cache->cache));
5469 ++}
5470 ++EXPORT_SYMBOL_GPL(dst_cache_get);
5471 ++
5472 ++struct rtable *dst_cache_get_ip4(struct dst_cache *dst_cache, __be32 *saddr)
5473 ++{
5474 ++ struct dst_cache_pcpu *idst;
5475 ++ struct dst_entry *dst;
5476 ++
5477 ++ if (!dst_cache->cache)
5478 ++ return NULL;
5479 ++
5480 ++ idst = this_cpu_ptr(dst_cache->cache);
5481 ++ dst = dst_cache_per_cpu_get(dst_cache, idst);
5482 ++ if (!dst)
5483 ++ return NULL;
5484 ++
5485 ++ *saddr = idst->in_saddr.s_addr;
5486 ++ return container_of(dst, struct rtable, dst);
5487 ++}
5488 ++EXPORT_SYMBOL_GPL(dst_cache_get_ip4);
5489 ++
5490 ++void dst_cache_set_ip4(struct dst_cache *dst_cache, struct dst_entry *dst,
5491 ++ __be32 saddr)
5492 ++{
5493 ++ struct dst_cache_pcpu *idst;
5494 ++
5495 ++ if (!dst_cache->cache)
5496 ++ return;
5497 ++
5498 ++ idst = this_cpu_ptr(dst_cache->cache);
5499 ++ dst_cache_per_cpu_dst_set(idst, dst, 0);
5500 ++ idst->in_saddr.s_addr = saddr;
5501 ++}
5502 ++EXPORT_SYMBOL_GPL(dst_cache_set_ip4);
5503 ++
5504 ++#if IS_ENABLED(CONFIG_IPV6)
5505 ++void dst_cache_set_ip6(struct dst_cache *dst_cache, struct dst_entry *dst,
5506 ++ const struct in6_addr *addr)
5507 ++{
5508 ++ struct dst_cache_pcpu *idst;
5509 ++
5510 ++ if (!dst_cache->cache)
5511 ++ return;
5512 ++
5513 ++ idst = this_cpu_ptr(dst_cache->cache);
5514 ++ dst_cache_per_cpu_dst_set(this_cpu_ptr(dst_cache->cache), dst,
5515 ++ rt6_get_cookie((struct rt6_info *)dst));
5516 ++ idst->in6_saddr = *addr;
5517 ++}
5518 ++EXPORT_SYMBOL_GPL(dst_cache_set_ip6);
5519 ++
5520 ++struct dst_entry *dst_cache_get_ip6(struct dst_cache *dst_cache,
5521 ++ struct in6_addr *saddr)
5522 ++{
5523 ++ struct dst_cache_pcpu *idst;
5524 ++ struct dst_entry *dst;
5525 ++
5526 ++ if (!dst_cache->cache)
5527 ++ return NULL;
5528 ++
5529 ++ idst = this_cpu_ptr(dst_cache->cache);
5530 ++ dst = dst_cache_per_cpu_get(dst_cache, idst);
5531 ++ if (!dst)
5532 ++ return NULL;
5533 ++
5534 ++ *saddr = idst->in6_saddr;
5535 ++ return dst;
5536 ++}
5537 ++EXPORT_SYMBOL_GPL(dst_cache_get_ip6);
5538 ++#endif
5539 ++
5540 ++int dst_cache_init(struct dst_cache *dst_cache, gfp_t gfp)
5541 ++{
5542 ++ dst_cache->cache = alloc_percpu_gfp(struct dst_cache_pcpu,
5543 ++ gfp | __GFP_ZERO);
5544 ++ if (!dst_cache->cache)
5545 ++ return -ENOMEM;
5546 ++
5547 ++ dst_cache_reset(dst_cache);
5548 ++ return 0;
5549 ++}
5550 ++EXPORT_SYMBOL_GPL(dst_cache_init);
5551 ++
5552 ++void dst_cache_destroy(struct dst_cache *dst_cache)
5553 ++{
5554 ++ int i;
5555 ++
5556 ++ if (!dst_cache->cache)
5557 ++ return;
5558 ++
5559 ++ for_each_possible_cpu(i)
5560 ++ dst_release(per_cpu_ptr(dst_cache->cache, i)->dst);
5561 ++
5562 ++ free_percpu(dst_cache->cache);
5563 ++}
5564 ++EXPORT_SYMBOL_GPL(dst_cache_destroy);
5565 +diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
5566 +index 13d6b1a6e0fc..9d8fcdefefc0 100644
5567 +--- a/net/decnet/af_decnet.c
5568 ++++ b/net/decnet/af_decnet.c
5569 +@@ -1337,6 +1337,12 @@ static int dn_setsockopt(struct socket *sock, int level, int optname, char __use
5570 + lock_sock(sk);
5571 + err = __dn_setsockopt(sock, level, optname, optval, optlen, 0);
5572 + release_sock(sk);
5573 ++#ifdef CONFIG_NETFILTER
5574 ++ /* we need to exclude all possible ENOPROTOOPTs except default case */
5575 ++ if (err == -ENOPROTOOPT && optname != DSO_LINKINFO &&
5576 ++ optname != DSO_STREAM && optname != DSO_SEQPACKET)
5577 ++ err = nf_setsockopt(sk, PF_DECnet, optname, optval, optlen);
5578 ++#endif
5579 +
5580 + return err;
5581 + }
5582 +@@ -1444,15 +1450,6 @@ static int __dn_setsockopt(struct socket *sock, int level,int optname, char __us
5583 + dn_nsp_send_disc(sk, 0x38, 0, sk->sk_allocation);
5584 + break;
5585 +
5586 +- default:
5587 +-#ifdef CONFIG_NETFILTER
5588 +- return nf_setsockopt(sk, PF_DECnet, optname, optval, optlen);
5589 +-#endif
5590 +- case DSO_LINKINFO:
5591 +- case DSO_STREAM:
5592 +- case DSO_SEQPACKET:
5593 +- return -ENOPROTOOPT;
5594 +-
5595 + case DSO_MAXWINDOW:
5596 + if (optlen != sizeof(unsigned long))
5597 + return -EINVAL;
5598 +@@ -1500,6 +1497,12 @@ static int __dn_setsockopt(struct socket *sock, int level,int optname, char __us
5599 + return -EINVAL;
5600 + scp->info_loc = u.info;
5601 + break;
5602 ++
5603 ++ case DSO_LINKINFO:
5604 ++ case DSO_STREAM:
5605 ++ case DSO_SEQPACKET:
5606 ++ default:
5607 ++ return -ENOPROTOOPT;
5608 + }
5609 +
5610 + return 0;
5611 +@@ -1513,6 +1516,20 @@ static int dn_getsockopt(struct socket *sock, int level, int optname, char __use
5612 + lock_sock(sk);
5613 + err = __dn_getsockopt(sock, level, optname, optval, optlen, 0);
5614 + release_sock(sk);
5615 ++#ifdef CONFIG_NETFILTER
5616 ++ if (err == -ENOPROTOOPT && optname != DSO_STREAM &&
5617 ++ optname != DSO_SEQPACKET && optname != DSO_CONACCEPT &&
5618 ++ optname != DSO_CONREJECT) {
5619 ++ int len;
5620 ++
5621 ++ if (get_user(len, optlen))
5622 ++ return -EFAULT;
5623 ++
5624 ++ err = nf_getsockopt(sk, PF_DECnet, optname, optval, &len);
5625 ++ if (err >= 0)
5626 ++ err = put_user(len, optlen);
5627 ++ }
5628 ++#endif
5629 +
5630 + return err;
5631 + }
5632 +@@ -1578,26 +1595,6 @@ static int __dn_getsockopt(struct socket *sock, int level,int optname, char __us
5633 + r_data = &link;
5634 + break;
5635 +
5636 +- default:
5637 +-#ifdef CONFIG_NETFILTER
5638 +- {
5639 +- int ret, len;
5640 +-
5641 +- if (get_user(len, optlen))
5642 +- return -EFAULT;
5643 +-
5644 +- ret = nf_getsockopt(sk, PF_DECnet, optname, optval, &len);
5645 +- if (ret >= 0)
5646 +- ret = put_user(len, optlen);
5647 +- return ret;
5648 +- }
5649 +-#endif
5650 +- case DSO_STREAM:
5651 +- case DSO_SEQPACKET:
5652 +- case DSO_CONACCEPT:
5653 +- case DSO_CONREJECT:
5654 +- return -ENOPROTOOPT;
5655 +-
5656 + case DSO_MAXWINDOW:
5657 + if (r_len > sizeof(unsigned long))
5658 + r_len = sizeof(unsigned long);
5659 +@@ -1629,6 +1626,13 @@ static int __dn_getsockopt(struct socket *sock, int level,int optname, char __us
5660 + r_len = sizeof(unsigned char);
5661 + r_data = &scp->info_rem;
5662 + break;
5663 ++
5664 ++ case DSO_STREAM:
5665 ++ case DSO_SEQPACKET:
5666 ++ case DSO_CONACCEPT:
5667 ++ case DSO_CONREJECT:
5668 ++ default:
5669 ++ return -ENOPROTOOPT;
5670 + }
5671 +
5672 + if (r_data) {
5673 +diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
5674 +index 097a1243c16c..3a819d2cc04b 100644
5675 +--- a/net/ipv4/ip_sockglue.c
5676 ++++ b/net/ipv4/ip_sockglue.c
5677 +@@ -1221,11 +1221,8 @@ int ip_setsockopt(struct sock *sk, int level,
5678 + if (err == -ENOPROTOOPT && optname != IP_HDRINCL &&
5679 + optname != IP_IPSEC_POLICY &&
5680 + optname != IP_XFRM_POLICY &&
5681 +- !ip_mroute_opt(optname)) {
5682 +- lock_sock(sk);
5683 ++ !ip_mroute_opt(optname))
5684 + err = nf_setsockopt(sk, PF_INET, optname, optval, optlen);
5685 +- release_sock(sk);
5686 +- }
5687 + #endif
5688 + return err;
5689 + }
5690 +@@ -1250,12 +1247,9 @@ int compat_ip_setsockopt(struct sock *sk, int level, int optname,
5691 + if (err == -ENOPROTOOPT && optname != IP_HDRINCL &&
5692 + optname != IP_IPSEC_POLICY &&
5693 + optname != IP_XFRM_POLICY &&
5694 +- !ip_mroute_opt(optname)) {
5695 +- lock_sock(sk);
5696 +- err = compat_nf_setsockopt(sk, PF_INET, optname,
5697 +- optval, optlen);
5698 +- release_sock(sk);
5699 +- }
5700 ++ !ip_mroute_opt(optname))
5701 ++ err = compat_nf_setsockopt(sk, PF_INET, optname, optval,
5702 ++ optlen);
5703 + #endif
5704 + return err;
5705 + }
5706 +diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
5707 +index 0bc7412d9e14..9d6b9c4c5f82 100644
5708 +--- a/net/ipv4/ipconfig.c
5709 ++++ b/net/ipv4/ipconfig.c
5710 +@@ -152,7 +152,11 @@ static char dhcp_client_identifier[253] __initdata;
5711 +
5712 + /* Persistent data: */
5713 +
5714 ++#ifdef IPCONFIG_DYNAMIC
5715 + static int ic_proto_used; /* Protocol used, if any */
5716 ++#else
5717 ++#define ic_proto_used 0
5718 ++#endif
5719 + static __be32 ic_nameservers[CONF_NAMESERVERS_MAX]; /* DNS Server IP addresses */
5720 + static u8 ic_domain[64]; /* DNS (not NIS) domain name */
5721 +
5722 +diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
5723 +index 4a9e6db9df8d..16599bae11dd 100644
5724 +--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
5725 ++++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
5726 +@@ -365,7 +365,7 @@ static int clusterip_tg_check(const struct xt_tgchk_param *par)
5727 + struct ipt_clusterip_tgt_info *cipinfo = par->targinfo;
5728 + const struct ipt_entry *e = par->entryinfo;
5729 + struct clusterip_config *config;
5730 +- int ret;
5731 ++ int ret, i;
5732 +
5733 + if (par->nft_compat) {
5734 + pr_err("cannot use CLUSTERIP target from nftables compat\n");
5735 +@@ -384,8 +384,18 @@ static int clusterip_tg_check(const struct xt_tgchk_param *par)
5736 + pr_info("Please specify destination IP\n");
5737 + return -EINVAL;
5738 + }
5739 +-
5740 +- /* FIXME: further sanity checks */
5741 ++ if (cipinfo->num_local_nodes > ARRAY_SIZE(cipinfo->local_nodes)) {
5742 ++ pr_info("bad num_local_nodes %u\n", cipinfo->num_local_nodes);
5743 ++ return -EINVAL;
5744 ++ }
5745 ++ for (i = 0; i < cipinfo->num_local_nodes; i++) {
5746 ++ if (cipinfo->local_nodes[i] - 1 >=
5747 ++ sizeof(config->local_nodes) * 8) {
5748 ++ pr_info("bad local_nodes[%d] %u\n",
5749 ++ i, cipinfo->local_nodes[i]);
5750 ++ return -EINVAL;
5751 ++ }
5752 ++ }
5753 +
5754 + config = clusterip_config_find_get(par->net, e->ip.dst.s_addr, 1);
5755 + if (!config) {
5756 +diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
5757 +index 6a20195a3a2a..3fe8c951f427 100644
5758 +--- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
5759 ++++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
5760 +@@ -259,15 +259,19 @@ getorigdst(struct sock *sk, int optval, void __user *user, int *len)
5761 + struct nf_conntrack_tuple tuple;
5762 +
5763 + memset(&tuple, 0, sizeof(tuple));
5764 ++
5765 ++ lock_sock(sk);
5766 + tuple.src.u3.ip = inet->inet_rcv_saddr;
5767 + tuple.src.u.tcp.port = inet->inet_sport;
5768 + tuple.dst.u3.ip = inet->inet_daddr;
5769 + tuple.dst.u.tcp.port = inet->inet_dport;
5770 + tuple.src.l3num = PF_INET;
5771 + tuple.dst.protonum = sk->sk_protocol;
5772 ++ release_sock(sk);
5773 +
5774 + /* We only do TCP and SCTP at the moment: is there a better way? */
5775 +- if (sk->sk_protocol != IPPROTO_TCP && sk->sk_protocol != IPPROTO_SCTP) {
5776 ++ if (tuple.dst.protonum != IPPROTO_TCP &&
5777 ++ tuple.dst.protonum != IPPROTO_SCTP) {
5778 + pr_debug("SO_ORIGINAL_DST: Not a TCP/SCTP socket\n");
5779 + return -ENOPROTOOPT;
5780 + }
5781 +diff --git a/net/ipv6/Kconfig b/net/ipv6/Kconfig
5782 +index 983bb999738c..851d5c9e3ecc 100644
5783 +--- a/net/ipv6/Kconfig
5784 ++++ b/net/ipv6/Kconfig
5785 +@@ -205,6 +205,7 @@ config IPV6_NDISC_NODETYPE
5786 + config IPV6_TUNNEL
5787 + tristate "IPv6: IP-in-IPv6 tunnel (RFC2473)"
5788 + select INET6_TUNNEL
5789 ++ select DST_CACHE
5790 + ---help---
5791 + Support for IPv6-in-IPv6 and IPv4-in-IPv6 tunnels described in
5792 + RFC 2473.
5793 +diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
5794 +index c878cbf65485..9ada1095c1cd 100644
5795 +--- a/net/ipv6/ip6_gre.c
5796 ++++ b/net/ipv6/ip6_gre.c
5797 +@@ -362,7 +362,7 @@ static void ip6gre_tunnel_uninit(struct net_device *dev)
5798 + struct ip6gre_net *ign = net_generic(t->net, ip6gre_net_id);
5799 +
5800 + ip6gre_tunnel_unlink(ign, t);
5801 +- ip6_tnl_dst_reset(t);
5802 ++ dst_cache_reset(&t->dst_cache);
5803 + dev_put(dev);
5804 + }
5805 +
5806 +@@ -640,7 +640,7 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb,
5807 + }
5808 +
5809 + if (!fl6->flowi6_mark)
5810 +- dst = ip6_tnl_dst_get(tunnel);
5811 ++ dst = dst_cache_get(&tunnel->dst_cache);
5812 +
5813 + if (!dst) {
5814 + dst = ip6_route_output(net, NULL, fl6);
5815 +@@ -709,7 +709,7 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb,
5816 + }
5817 +
5818 + if (!fl6->flowi6_mark && ndst)
5819 +- ip6_tnl_dst_set(tunnel, ndst);
5820 ++ dst_cache_set_ip6(&tunnel->dst_cache, ndst, &fl6->saddr);
5821 + skb_dst_set(skb, dst);
5822 +
5823 + proto = NEXTHDR_GRE;
5824 +@@ -1017,7 +1017,7 @@ static int ip6gre_tnl_change(struct ip6_tnl *t,
5825 + t->parms.o_key = p->o_key;
5826 + t->parms.i_flags = p->i_flags;
5827 + t->parms.o_flags = p->o_flags;
5828 +- ip6_tnl_dst_reset(t);
5829 ++ dst_cache_reset(&t->dst_cache);
5830 + ip6gre_tnl_link_config(t, set_mtu);
5831 + return 0;
5832 + }
5833 +@@ -1228,7 +1228,7 @@ static void ip6gre_dev_free(struct net_device *dev)
5834 + {
5835 + struct ip6_tnl *t = netdev_priv(dev);
5836 +
5837 +- ip6_tnl_dst_destroy(t);
5838 ++ dst_cache_destroy(&t->dst_cache);
5839 + free_percpu(dev->tstats);
5840 + free_netdev(dev);
5841 + }
5842 +@@ -1266,7 +1266,7 @@ static int ip6gre_tunnel_init_common(struct net_device *dev)
5843 + if (!dev->tstats)
5844 + return -ENOMEM;
5845 +
5846 +- ret = ip6_tnl_dst_init(tunnel);
5847 ++ ret = dst_cache_init(&tunnel->dst_cache, GFP_KERNEL);
5848 + if (ret) {
5849 + free_percpu(dev->tstats);
5850 + dev->tstats = NULL;
5851 +diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
5852 +index a7170a23ab0b..946c2d015b94 100644
5853 +--- a/net/ipv6/ip6_tunnel.c
5854 ++++ b/net/ipv6/ip6_tunnel.c
5855 +@@ -122,97 +122,6 @@ static struct net_device_stats *ip6_get_stats(struct net_device *dev)
5856 + return &dev->stats;
5857 + }
5858 +
5859 +-/*
5860 +- * Locking : hash tables are protected by RCU and RTNL
5861 +- */
5862 +-
5863 +-static void ip6_tnl_per_cpu_dst_set(struct ip6_tnl_dst *idst,
5864 +- struct dst_entry *dst)
5865 +-{
5866 +- write_seqlock_bh(&idst->lock);
5867 +- dst_release(rcu_dereference_protected(
5868 +- idst->dst,
5869 +- lockdep_is_held(&idst->lock.lock)));
5870 +- if (dst) {
5871 +- dst_hold(dst);
5872 +- idst->cookie = rt6_get_cookie((struct rt6_info *)dst);
5873 +- } else {
5874 +- idst->cookie = 0;
5875 +- }
5876 +- rcu_assign_pointer(idst->dst, dst);
5877 +- write_sequnlock_bh(&idst->lock);
5878 +-}
5879 +-
5880 +-struct dst_entry *ip6_tnl_dst_get(struct ip6_tnl *t)
5881 +-{
5882 +- struct ip6_tnl_dst *idst;
5883 +- struct dst_entry *dst;
5884 +- unsigned int seq;
5885 +- u32 cookie;
5886 +-
5887 +- idst = raw_cpu_ptr(t->dst_cache);
5888 +-
5889 +- rcu_read_lock();
5890 +- do {
5891 +- seq = read_seqbegin(&idst->lock);
5892 +- dst = rcu_dereference(idst->dst);
5893 +- cookie = idst->cookie;
5894 +- } while (read_seqretry(&idst->lock, seq));
5895 +-
5896 +- if (dst && !atomic_inc_not_zero(&dst->__refcnt))
5897 +- dst = NULL;
5898 +- rcu_read_unlock();
5899 +-
5900 +- if (dst && dst->obsolete && !dst->ops->check(dst, cookie)) {
5901 +- ip6_tnl_per_cpu_dst_set(idst, NULL);
5902 +- dst_release(dst);
5903 +- dst = NULL;
5904 +- }
5905 +- return dst;
5906 +-}
5907 +-EXPORT_SYMBOL_GPL(ip6_tnl_dst_get);
5908 +-
5909 +-void ip6_tnl_dst_reset(struct ip6_tnl *t)
5910 +-{
5911 +- int i;
5912 +-
5913 +- for_each_possible_cpu(i)
5914 +- ip6_tnl_per_cpu_dst_set(per_cpu_ptr(t->dst_cache, i), NULL);
5915 +-}
5916 +-EXPORT_SYMBOL_GPL(ip6_tnl_dst_reset);
5917 +-
5918 +-void ip6_tnl_dst_set(struct ip6_tnl *t, struct dst_entry *dst)
5919 +-{
5920 +- ip6_tnl_per_cpu_dst_set(raw_cpu_ptr(t->dst_cache), dst);
5921 +-
5922 +-}
5923 +-EXPORT_SYMBOL_GPL(ip6_tnl_dst_set);
5924 +-
5925 +-void ip6_tnl_dst_destroy(struct ip6_tnl *t)
5926 +-{
5927 +- if (!t->dst_cache)
5928 +- return;
5929 +-
5930 +- ip6_tnl_dst_reset(t);
5931 +- free_percpu(t->dst_cache);
5932 +-}
5933 +-EXPORT_SYMBOL_GPL(ip6_tnl_dst_destroy);
5934 +-
5935 +-int ip6_tnl_dst_init(struct ip6_tnl *t)
5936 +-{
5937 +- int i;
5938 +-
5939 +- t->dst_cache = alloc_percpu(struct ip6_tnl_dst);
5940 +- if (!t->dst_cache)
5941 +- return -ENOMEM;
5942 +-
5943 +- for_each_possible_cpu(i)
5944 +- seqlock_init(&per_cpu_ptr(t->dst_cache, i)->lock);
5945 +-
5946 +- return 0;
5947 +-}
5948 +-EXPORT_SYMBOL_GPL(ip6_tnl_dst_init);
5949 +-
5950 + /**
5951 + * ip6_tnl_lookup - fetch tunnel matching the end-point addresses
5952 + * @remote: the address of the tunnel exit-point
5953 +@@ -331,7 +240,7 @@ static void ip6_dev_free(struct net_device *dev)
5954 + {
5955 + struct ip6_tnl *t = netdev_priv(dev);
5956 +
5957 +- ip6_tnl_dst_destroy(t);
5958 ++ dst_cache_destroy(&t->dst_cache);
5959 + free_percpu(dev->tstats);
5960 + free_netdev(dev);
5961 + }
5962 +@@ -464,7 +373,7 @@ ip6_tnl_dev_uninit(struct net_device *dev)
5963 + RCU_INIT_POINTER(ip6n->tnls_wc[0], NULL);
5964 + else
5965 + ip6_tnl_unlink(ip6n, t);
5966 +- ip6_tnl_dst_reset(t);
5967 ++ dst_cache_reset(&t->dst_cache);
5968 + dev_put(dev);
5969 + }
5970 +
5971 +@@ -1053,7 +962,6 @@ static int ip6_tnl_xmit2(struct sk_buff *skb,
5972 + struct ipv6_tel_txoption opt;
5973 + struct dst_entry *dst = NULL, *ndst = NULL;
5974 + struct net_device *tdev;
5975 +- bool use_cache = false;
5976 + int mtu;
5977 + unsigned int max_headroom = sizeof(struct ipv6hdr);
5978 + u8 proto;
5979 +@@ -1061,39 +969,28 @@ static int ip6_tnl_xmit2(struct sk_buff *skb,
5980 +
5981 + /* NBMA tunnel */
5982 + if (ipv6_addr_any(&t->parms.raddr)) {
5983 +- if (skb->protocol == htons(ETH_P_IPV6)) {
5984 +- struct in6_addr *addr6;
5985 +- struct neighbour *neigh;
5986 +- int addr_type;
5987 +-
5988 +- if (!skb_dst(skb))
5989 +- goto tx_err_link_failure;
5990 ++ struct in6_addr *addr6;
5991 ++ struct neighbour *neigh;
5992 ++ int addr_type;
5993 +
5994 +- neigh = dst_neigh_lookup(skb_dst(skb),
5995 +- &ipv6_hdr(skb)->daddr);
5996 +- if (!neigh)
5997 +- goto tx_err_link_failure;
5998 ++ if (!skb_dst(skb))
5999 ++ goto tx_err_link_failure;
6000 +
6001 +- addr6 = (struct in6_addr *)&neigh->primary_key;
6002 +- addr_type = ipv6_addr_type(addr6);
6003 ++ neigh = dst_neigh_lookup(skb_dst(skb),
6004 ++ &ipv6_hdr(skb)->daddr);
6005 ++ if (!neigh)
6006 ++ goto tx_err_link_failure;
6007 +
6008 +- if (addr_type == IPV6_ADDR_ANY)
6009 +- addr6 = &ipv6_hdr(skb)->daddr;
6010 ++ addr6 = (struct in6_addr *)&neigh->primary_key;
6011 ++ addr_type = ipv6_addr_type(addr6);
6012 +
6013 +- memcpy(&fl6->daddr, addr6, sizeof(fl6->daddr));
6014 +- neigh_release(neigh);
6015 +- }
6016 +- } else if (t->parms.proto != 0 && !(t->parms.flags &
6017 +- (IP6_TNL_F_USE_ORIG_TCLASS |
6018 +- IP6_TNL_F_USE_ORIG_FWMARK))) {
6019 +- /* enable the cache only if neither the outer protocol nor the
6020 +- * routing decision depends on the current inner header value
6021 +- */
6022 +- use_cache = true;
6023 +- }
6024 ++ if (addr_type == IPV6_ADDR_ANY)
6025 ++ addr6 = &ipv6_hdr(skb)->daddr;
6026 +
6027 +- if (use_cache)
6028 +- dst = ip6_tnl_dst_get(t);
6029 ++ memcpy(&fl6->daddr, addr6, sizeof(fl6->daddr));
6030 ++ neigh_release(neigh);
6031 ++ } else if (!fl6->flowi6_mark)
6032 ++ dst = dst_cache_get(&t->dst_cache);
6033 +
6034 + if (!ip6_tnl_xmit_ctl(t, &fl6->saddr, &fl6->daddr))
6035 + goto tx_err_link_failure;
6036 +@@ -1156,8 +1053,8 @@ static int ip6_tnl_xmit2(struct sk_buff *skb,
6037 + skb = new_skb;
6038 + }
6039 +
6040 +- if (use_cache && ndst)
6041 +- ip6_tnl_dst_set(t, ndst);
6042 ++ if (!fl6->flowi6_mark && ndst)
6043 ++ dst_cache_set_ip6(&t->dst_cache, ndst, &fl6->saddr);
6044 + skb_dst_set(skb, dst);
6045 +
6046 + skb->transport_header = skb->network_header;
6047 +@@ -1392,7 +1289,7 @@ ip6_tnl_change(struct ip6_tnl *t, const struct __ip6_tnl_parm *p)
6048 + t->parms.flowinfo = p->flowinfo;
6049 + t->parms.link = p->link;
6050 + t->parms.proto = p->proto;
6051 +- ip6_tnl_dst_reset(t);
6052 ++ dst_cache_reset(&t->dst_cache);
6053 + ip6_tnl_link_config(t);
6054 + return 0;
6055 + }
6056 +@@ -1663,7 +1560,7 @@ ip6_tnl_dev_init_gen(struct net_device *dev)
6057 + if (!dev->tstats)
6058 + return -ENOMEM;
6059 +
6060 +- ret = ip6_tnl_dst_init(t);
6061 ++ ret = dst_cache_init(&t->dst_cache, GFP_KERNEL);
6062 + if (ret) {
6063 + free_percpu(dev->tstats);
6064 + dev->tstats = NULL;
6065 +diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c
6066 +index 24dfc2de0165..d7105422bc63 100644
6067 +--- a/net/ipv6/ip6_vti.c
6068 ++++ b/net/ipv6/ip6_vti.c
6069 +@@ -645,7 +645,7 @@ vti6_tnl_change(struct ip6_tnl *t, const struct __ip6_tnl_parm *p)
6070 + t->parms.i_key = p->i_key;
6071 + t->parms.o_key = p->o_key;
6072 + t->parms.proto = p->proto;
6073 +- ip6_tnl_dst_reset(t);
6074 ++ dst_cache_reset(&t->dst_cache);
6075 + vti6_link_config(t);
6076 + return 0;
6077 + }
6078 +diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
6079 +index 9011176c8387..ede9d0e20538 100644
6080 +--- a/net/ipv6/ipv6_sockglue.c
6081 ++++ b/net/ipv6/ipv6_sockglue.c
6082 +@@ -905,12 +905,8 @@ int ipv6_setsockopt(struct sock *sk, int level, int optname,
6083 + #ifdef CONFIG_NETFILTER
6084 + /* we need to exclude all possible ENOPROTOOPTs except default case */
6085 + if (err == -ENOPROTOOPT && optname != IPV6_IPSEC_POLICY &&
6086 +- optname != IPV6_XFRM_POLICY) {
6087 +- lock_sock(sk);
6088 +- err = nf_setsockopt(sk, PF_INET6, optname, optval,
6089 +- optlen);
6090 +- release_sock(sk);
6091 +- }
6092 ++ optname != IPV6_XFRM_POLICY)
6093 ++ err = nf_setsockopt(sk, PF_INET6, optname, optval, optlen);
6094 + #endif
6095 + return err;
6096 + }
6097 +@@ -940,12 +936,9 @@ int compat_ipv6_setsockopt(struct sock *sk, int level, int optname,
6098 + #ifdef CONFIG_NETFILTER
6099 + /* we need to exclude all possible ENOPROTOOPTs except default case */
6100 + if (err == -ENOPROTOOPT && optname != IPV6_IPSEC_POLICY &&
6101 +- optname != IPV6_XFRM_POLICY) {
6102 +- lock_sock(sk);
6103 +- err = compat_nf_setsockopt(sk, PF_INET6, optname,
6104 +- optval, optlen);
6105 +- release_sock(sk);
6106 +- }
6107 ++ optname != IPV6_XFRM_POLICY)
6108 ++ err = compat_nf_setsockopt(sk, PF_INET6, optname, optval,
6109 ++ optlen);
6110 + #endif
6111 + return err;
6112 + }
6113 +diff --git a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
6114 +index 1aa5848764a7..aa051d9d4a96 100644
6115 +--- a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
6116 ++++ b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
6117 +@@ -226,20 +226,27 @@ static struct nf_hook_ops ipv6_conntrack_ops[] __read_mostly = {
6118 + static int
6119 + ipv6_getorigdst(struct sock *sk, int optval, void __user *user, int *len)
6120 + {
6121 +- const struct inet_sock *inet = inet_sk(sk);
6122 ++ struct nf_conntrack_tuple tuple = { .src.l3num = NFPROTO_IPV6 };
6123 + const struct ipv6_pinfo *inet6 = inet6_sk(sk);
6124 ++ const struct inet_sock *inet = inet_sk(sk);
6125 + const struct nf_conntrack_tuple_hash *h;
6126 + struct sockaddr_in6 sin6;
6127 +- struct nf_conntrack_tuple tuple = { .src.l3num = NFPROTO_IPV6 };
6128 + struct nf_conn *ct;
6129 ++ __be32 flow_label;
6130 ++ int bound_dev_if;
6131 +
6132 ++ lock_sock(sk);
6133 + tuple.src.u3.in6 = sk->sk_v6_rcv_saddr;
6134 + tuple.src.u.tcp.port = inet->inet_sport;
6135 + tuple.dst.u3.in6 = sk->sk_v6_daddr;
6136 + tuple.dst.u.tcp.port = inet->inet_dport;
6137 + tuple.dst.protonum = sk->sk_protocol;
6138 ++ bound_dev_if = sk->sk_bound_dev_if;
6139 ++ flow_label = inet6->flow_label;
6140 ++ release_sock(sk);
6141 +
6142 +- if (sk->sk_protocol != IPPROTO_TCP && sk->sk_protocol != IPPROTO_SCTP)
6143 ++ if (tuple.dst.protonum != IPPROTO_TCP &&
6144 ++ tuple.dst.protonum != IPPROTO_SCTP)
6145 + return -ENOPROTOOPT;
6146 +
6147 + if (*len < 0 || (unsigned int) *len < sizeof(sin6))
6148 +@@ -257,14 +264,13 @@ ipv6_getorigdst(struct sock *sk, int optval, void __user *user, int *len)
6149 +
6150 + sin6.sin6_family = AF_INET6;
6151 + sin6.sin6_port = ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.u.tcp.port;
6152 +- sin6.sin6_flowinfo = inet6->flow_label & IPV6_FLOWINFO_MASK;
6153 ++ sin6.sin6_flowinfo = flow_label & IPV6_FLOWINFO_MASK;
6154 + memcpy(&sin6.sin6_addr,
6155 + &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.u3.in6,
6156 + sizeof(sin6.sin6_addr));
6157 +
6158 + nf_ct_put(ct);
6159 +- sin6.sin6_scope_id = ipv6_iface_scope_id(&sin6.sin6_addr,
6160 +- sk->sk_bound_dev_if);
6161 ++ sin6.sin6_scope_id = ipv6_iface_scope_id(&sin6.sin6_addr, bound_dev_if);
6162 + return copy_to_user(user, &sin6, sizeof(sin6)) ? -EFAULT : 0;
6163 + }
6164 +
6165 +diff --git a/net/netfilter/ipvs/ip_vs_app.c b/net/netfilter/ipvs/ip_vs_app.c
6166 +index 0328f7250693..299edc6add5a 100644
6167 +--- a/net/netfilter/ipvs/ip_vs_app.c
6168 ++++ b/net/netfilter/ipvs/ip_vs_app.c
6169 +@@ -605,17 +605,13 @@ static const struct file_operations ip_vs_app_fops = {
6170 +
6171 + int __net_init ip_vs_app_net_init(struct netns_ipvs *ipvs)
6172 + {
6173 +- struct net *net = ipvs->net;
6174 +-
6175 + INIT_LIST_HEAD(&ipvs->app_list);
6176 +- proc_create("ip_vs_app", 0, net->proc_net, &ip_vs_app_fops);
6177 ++ proc_create("ip_vs_app", 0, ipvs->net->proc_net, &ip_vs_app_fops);
6178 + return 0;
6179 + }
6180 +
6181 + void __net_exit ip_vs_app_net_cleanup(struct netns_ipvs *ipvs)
6182 + {
6183 +- struct net *net = ipvs->net;
6184 +-
6185 + unregister_ip_vs_app(ipvs, NULL /* all */);
6186 +- remove_proc_entry("ip_vs_app", net->proc_net);
6187 ++ remove_proc_entry("ip_vs_app", ipvs->net->proc_net);
6188 + }
6189 +diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
6190 +index 2c937c16dc27..2f0e4f61c40f 100644
6191 +--- a/net/netfilter/ipvs/ip_vs_ctl.c
6192 ++++ b/net/netfilter/ipvs/ip_vs_ctl.c
6193 +@@ -3951,7 +3951,6 @@ static struct notifier_block ip_vs_dst_notifier = {
6194 +
6195 + int __net_init ip_vs_control_net_init(struct netns_ipvs *ipvs)
6196 + {
6197 +- struct net *net = ipvs->net;
6198 + int i, idx;
6199 +
6200 + /* Initialize rs_table */
6201 +@@ -3978,9 +3977,9 @@ int __net_init ip_vs_control_net_init(struct netns_ipvs *ipvs)
6202 +
6203 + spin_lock_init(&ipvs->tot_stats.lock);
6204 +
6205 +- proc_create("ip_vs", 0, net->proc_net, &ip_vs_info_fops);
6206 +- proc_create("ip_vs_stats", 0, net->proc_net, &ip_vs_stats_fops);
6207 +- proc_create("ip_vs_stats_percpu", 0, net->proc_net,
6208 ++ proc_create("ip_vs", 0, ipvs->net->proc_net, &ip_vs_info_fops);
6209 ++ proc_create("ip_vs_stats", 0, ipvs->net->proc_net, &ip_vs_stats_fops);
6210 ++ proc_create("ip_vs_stats_percpu", 0, ipvs->net->proc_net,
6211 + &ip_vs_stats_percpu_fops);
6212 +
6213 + if (ip_vs_control_net_init_sysctl(ipvs))
6214 +@@ -3995,13 +3994,11 @@ err:
6215 +
6216 + void __net_exit ip_vs_control_net_cleanup(struct netns_ipvs *ipvs)
6217 + {
6218 +- struct net *net = ipvs->net;
6219 +-
6220 + ip_vs_trash_cleanup(ipvs);
6221 + ip_vs_control_net_cleanup_sysctl(ipvs);
6222 +- remove_proc_entry("ip_vs_stats_percpu", net->proc_net);
6223 +- remove_proc_entry("ip_vs_stats", net->proc_net);
6224 +- remove_proc_entry("ip_vs", net->proc_net);
6225 ++ remove_proc_entry("ip_vs_stats_percpu", ipvs->net->proc_net);
6226 ++ remove_proc_entry("ip_vs_stats", ipvs->net->proc_net);
6227 ++ remove_proc_entry("ip_vs", ipvs->net->proc_net);
6228 + free_percpu(ipvs->tot_stats.cpustats);
6229 + }
6230 +
6231 +diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
6232 +index 7b42b0ad3f9b..5b52dd3feb7d 100644
6233 +--- a/net/netfilter/x_tables.c
6234 ++++ b/net/netfilter/x_tables.c
6235 +@@ -38,8 +38,6 @@ MODULE_LICENSE("GPL");
6236 + MODULE_AUTHOR("Harald Welte <laforge@×××××××××.org>");
6237 + MODULE_DESCRIPTION("{ip,ip6,arp,eb}_tables backend module");
6238 +
6239 +-#define SMP_ALIGN(x) (((x) + SMP_CACHE_BYTES-1) & ~(SMP_CACHE_BYTES-1))
6240 +-
6241 + struct compat_delta {
6242 + unsigned int offset; /* offset in kernel */
6243 + int delta; /* delta in 32bit user land */
6244 +@@ -208,6 +206,9 @@ xt_request_find_match(uint8_t nfproto, const char *name, uint8_t revision)
6245 + {
6246 + struct xt_match *match;
6247 +
6248 ++ if (strnlen(name, XT_EXTENSION_MAXNAMELEN) == XT_EXTENSION_MAXNAMELEN)
6249 ++ return ERR_PTR(-EINVAL);
6250 ++
6251 + match = xt_find_match(nfproto, name, revision);
6252 + if (IS_ERR(match)) {
6253 + request_module("%st_%s", xt_prefix[nfproto], name);
6254 +@@ -250,6 +251,9 @@ struct xt_target *xt_request_find_target(u8 af, const char *name, u8 revision)
6255 + {
6256 + struct xt_target *target;
6257 +
6258 ++ if (strnlen(name, XT_EXTENSION_MAXNAMELEN) == XT_EXTENSION_MAXNAMELEN)
6259 ++ return ERR_PTR(-EINVAL);
6260 ++
6261 + target = xt_find_target(af, name, revision);
6262 + if (IS_ERR(target)) {
6263 + request_module("%st_%s", xt_prefix[af], name);
6264 +@@ -954,7 +958,7 @@ struct xt_table_info *xt_alloc_table_info(unsigned int size)
6265 + return NULL;
6266 +
6267 + /* Pedantry: prevent them from hitting BUG() in vmalloc.c --RR */
6268 +- if ((SMP_ALIGN(size) >> PAGE_SHIFT) + 2 > totalram_pages)
6269 ++ if ((size >> PAGE_SHIFT) + 2 > totalram_pages)
6270 + return NULL;
6271 +
6272 + if (sz <= (PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER))
6273 +diff --git a/net/netfilter/xt_RATEEST.c b/net/netfilter/xt_RATEEST.c
6274 +index 604df6fae6fc..0be96f8475f7 100644
6275 +--- a/net/netfilter/xt_RATEEST.c
6276 ++++ b/net/netfilter/xt_RATEEST.c
6277 +@@ -40,23 +40,31 @@ static void xt_rateest_hash_insert(struct xt_rateest *est)
6278 + hlist_add_head(&est->list, &rateest_hash[h]);
6279 + }
6280 +
6281 +-struct xt_rateest *xt_rateest_lookup(const char *name)
6282 ++static struct xt_rateest *__xt_rateest_lookup(const char *name)
6283 + {
6284 + struct xt_rateest *est;
6285 + unsigned int h;
6286 +
6287 + h = xt_rateest_hash(name);
6288 +- mutex_lock(&xt_rateest_mutex);
6289 + hlist_for_each_entry(est, &rateest_hash[h], list) {
6290 + if (strcmp(est->name, name) == 0) {
6291 + est->refcnt++;
6292 +- mutex_unlock(&xt_rateest_mutex);
6293 + return est;
6294 + }
6295 + }
6296 +- mutex_unlock(&xt_rateest_mutex);
6297 ++
6298 + return NULL;
6299 + }
6300 ++
6301 ++struct xt_rateest *xt_rateest_lookup(const char *name)
6302 ++{
6303 ++ struct xt_rateest *est;
6304 ++
6305 ++ mutex_lock(&xt_rateest_mutex);
6306 ++ est = __xt_rateest_lookup(name);
6307 ++ mutex_unlock(&xt_rateest_mutex);
6308 ++ return est;
6309 ++}
6310 + EXPORT_SYMBOL_GPL(xt_rateest_lookup);
6311 +
6312 + void xt_rateest_put(struct xt_rateest *est)
6313 +@@ -104,8 +112,10 @@ static int xt_rateest_tg_checkentry(const struct xt_tgchk_param *par)
6314 + rnd_inited = true;
6315 + }
6316 +
6317 +- est = xt_rateest_lookup(info->name);
6318 ++ mutex_lock(&xt_rateest_mutex);
6319 ++ est = __xt_rateest_lookup(info->name);
6320 + if (est) {
6321 ++ mutex_unlock(&xt_rateest_mutex);
6322 + /*
6323 + * If estimator parameters are specified, they must match the
6324 + * existing estimator.
6325 +@@ -143,11 +153,13 @@ static int xt_rateest_tg_checkentry(const struct xt_tgchk_param *par)
6326 +
6327 + info->est = est;
6328 + xt_rateest_hash_insert(est);
6329 ++ mutex_unlock(&xt_rateest_mutex);
6330 + return 0;
6331 +
6332 + err2:
6333 + kfree(est);
6334 + err1:
6335 ++ mutex_unlock(&xt_rateest_mutex);
6336 + return ret;
6337 + }
6338 +
6339 +diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c
6340 +index 0a08c860eee4..e8dcf94a23c8 100644
6341 +--- a/net/sched/sch_choke.c
6342 ++++ b/net/sched/sch_choke.c
6343 +@@ -438,6 +438,9 @@ static int choke_change(struct Qdisc *sch, struct nlattr *opt)
6344 +
6345 + ctl = nla_data(tb[TCA_CHOKE_PARMS]);
6346 +
6347 ++ if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog))
6348 ++ return -EINVAL;
6349 ++
6350 + if (ctl->limit > CHOKE_MAX_QUEUE)
6351 + return -EINVAL;
6352 +
6353 +diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c
6354 +index 80105109f756..f9e8deeeac96 100644
6355 +--- a/net/sched/sch_gred.c
6356 ++++ b/net/sched/sch_gred.c
6357 +@@ -389,6 +389,9 @@ static inline int gred_change_vq(struct Qdisc *sch, int dp,
6358 + struct gred_sched *table = qdisc_priv(sch);
6359 + struct gred_sched_data *q = table->tab[dp];
6360 +
6361 ++ if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog))
6362 ++ return -EINVAL;
6363 ++
6364 + if (!q) {
6365 + table->tab[dp] = q = *prealloc;
6366 + *prealloc = NULL;
6367 +diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c
6368 +index 8c0508c0e287..0505b8408c8b 100644
6369 +--- a/net/sched/sch_red.c
6370 ++++ b/net/sched/sch_red.c
6371 +@@ -199,6 +199,8 @@ static int red_change(struct Qdisc *sch, struct nlattr *opt)
6372 + max_P = tb[TCA_RED_MAX_P] ? nla_get_u32(tb[TCA_RED_MAX_P]) : 0;
6373 +
6374 + ctl = nla_data(tb[TCA_RED_PARMS]);
6375 ++ if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog))
6376 ++ return -EINVAL;
6377 +
6378 + if (ctl->limit > 0) {
6379 + child = fifo_create_dflt(sch, &bfifo_qdisc_ops, ctl->limit);
6380 +diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
6381 +index 3f2c3eed04da..8b8c084b32cd 100644
6382 +--- a/net/sched/sch_sfq.c
6383 ++++ b/net/sched/sch_sfq.c
6384 +@@ -633,6 +633,9 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt)
6385 + if (ctl->divisor &&
6386 + (!is_power_of_2(ctl->divisor) || ctl->divisor > 65536))
6387 + return -EINVAL;
6388 ++ if (ctl_v1 && !red_check_params(ctl_v1->qth_min, ctl_v1->qth_max,
6389 ++ ctl_v1->Wlog))
6390 ++ return -EINVAL;
6391 + if (ctl_v1 && ctl_v1->qth_min) {
6392 + p = kmalloc(sizeof(*p), GFP_KERNEL);
6393 + if (!p)
6394 +diff --git a/net/wireless/core.c b/net/wireless/core.c
6395 +index 8f0bac7e03c4..eeaf83acba1b 100644
6396 +--- a/net/wireless/core.c
6397 ++++ b/net/wireless/core.c
6398 +@@ -390,6 +390,8 @@ struct wiphy *wiphy_new_nm(const struct cfg80211_ops *ops, int sizeof_priv,
6399 + if (rv)
6400 + goto use_default_name;
6401 + } else {
6402 ++ int rv;
6403 ++
6404 + use_default_name:
6405 + /* NOTE: This is *probably* safe w/out holding rtnl because of
6406 + * the restrictions on phy names. Probably this call could
6407 +@@ -397,7 +399,11 @@ use_default_name:
6408 + * phyX. But, might should add some locking and check return
6409 + * value, and use a different name if this one exists?
6410 + */
6411 +- dev_set_name(&rdev->wiphy.dev, PHY_NAME "%d", rdev->wiphy_idx);
6412 ++ rv = dev_set_name(&rdev->wiphy.dev, PHY_NAME "%d", rdev->wiphy_idx);
6413 ++ if (rv < 0) {
6414 ++ kfree(rdev);
6415 ++ return NULL;
6416 ++ }
6417 + }
6418 +
6419 + INIT_LIST_HEAD(&rdev->wdev_list);
6420 +diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
6421 +index 7950506395a8..b0b58d1565c2 100644
6422 +--- a/net/wireless/nl80211.c
6423 ++++ b/net/wireless/nl80211.c
6424 +@@ -16,6 +16,7 @@
6425 + #include <linux/nl80211.h>
6426 + #include <linux/rtnetlink.h>
6427 + #include <linux/netlink.h>
6428 ++#include <linux/nospec.h>
6429 + #include <linux/etherdevice.h>
6430 + #include <net/net_namespace.h>
6431 + #include <net/genetlink.h>
6432 +@@ -1879,20 +1880,22 @@ static const struct nla_policy txq_params_policy[NL80211_TXQ_ATTR_MAX + 1] = {
6433 + static int parse_txq_params(struct nlattr *tb[],
6434 + struct ieee80211_txq_params *txq_params)
6435 + {
6436 ++ u8 ac;
6437 ++
6438 + if (!tb[NL80211_TXQ_ATTR_AC] || !tb[NL80211_TXQ_ATTR_TXOP] ||
6439 + !tb[NL80211_TXQ_ATTR_CWMIN] || !tb[NL80211_TXQ_ATTR_CWMAX] ||
6440 + !tb[NL80211_TXQ_ATTR_AIFS])
6441 + return -EINVAL;
6442 +
6443 +- txq_params->ac = nla_get_u8(tb[NL80211_TXQ_ATTR_AC]);
6444 ++ ac = nla_get_u8(tb[NL80211_TXQ_ATTR_AC]);
6445 + txq_params->txop = nla_get_u16(tb[NL80211_TXQ_ATTR_TXOP]);
6446 + txq_params->cwmin = nla_get_u16(tb[NL80211_TXQ_ATTR_CWMIN]);
6447 + txq_params->cwmax = nla_get_u16(tb[NL80211_TXQ_ATTR_CWMAX]);
6448 + txq_params->aifs = nla_get_u8(tb[NL80211_TXQ_ATTR_AIFS]);
6449 +
6450 +- if (txq_params->ac >= NL80211_NUM_ACS)
6451 ++ if (ac >= NL80211_NUM_ACS)
6452 + return -EINVAL;
6453 +-
6454 ++ txq_params->ac = array_index_nospec(ac, NL80211_NUM_ACS);
6455 + return 0;
6456 + }
6457 +
6458 +diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
6459 +index 22df3b51e905..4b09a9eaa35f 100644
6460 +--- a/net/xfrm/xfrm_policy.c
6461 ++++ b/net/xfrm/xfrm_policy.c
6462 +@@ -1225,9 +1225,15 @@ static struct xfrm_policy *xfrm_sk_policy_lookup(const struct sock *sk, int dir,
6463 + read_lock_bh(&net->xfrm.xfrm_policy_lock);
6464 + pol = rcu_dereference(sk->sk_policy[dir]);
6465 + if (pol != NULL) {
6466 +- bool match = xfrm_selector_match(&pol->selector, fl, family);
6467 ++ bool match;
6468 + int err = 0;
6469 +
6470 ++ if (pol->family != family) {
6471 ++ pol = NULL;
6472 ++ goto out;
6473 ++ }
6474 ++
6475 ++ match = xfrm_selector_match(&pol->selector, fl, family);
6476 + if (match) {
6477 + if ((sk->sk_mark & pol->mark.m) != pol->mark.v) {
6478 + pol = NULL;
6479 +diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
6480 +index 76944a4839a5..fa856a07e40b 100644
6481 +--- a/net/xfrm/xfrm_user.c
6482 ++++ b/net/xfrm/xfrm_user.c
6483 +@@ -1376,11 +1376,14 @@ static void copy_templates(struct xfrm_policy *xp, struct xfrm_user_tmpl *ut,
6484 +
6485 + static int validate_tmpl(int nr, struct xfrm_user_tmpl *ut, u16 family)
6486 + {
6487 ++ u16 prev_family;
6488 + int i;
6489 +
6490 + if (nr > XFRM_MAX_DEPTH)
6491 + return -EINVAL;
6492 +
6493 ++ prev_family = family;
6494 ++
6495 + for (i = 0; i < nr; i++) {
6496 + /* We never validated the ut->family value, so many
6497 + * applications simply leave it at zero. The check was
6498 +@@ -1392,6 +1395,12 @@ static int validate_tmpl(int nr, struct xfrm_user_tmpl *ut, u16 family)
6499 + if (!ut[i].family)
6500 + ut[i].family = family;
6501 +
6502 ++ if ((ut[i].mode == XFRM_MODE_TRANSPORT) &&
6503 ++ (ut[i].family != prev_family))
6504 ++ return -EINVAL;
6505 ++
6506 ++ prev_family = ut[i].family;
6507 ++
6508 + switch (ut[i].family) {
6509 + case AF_INET:
6510 + break;
6511 +@@ -1402,6 +1411,21 @@ static int validate_tmpl(int nr, struct xfrm_user_tmpl *ut, u16 family)
6512 + default:
6513 + return -EINVAL;
6514 + }
6515 ++
6516 ++ switch (ut[i].id.proto) {
6517 ++ case IPPROTO_AH:
6518 ++ case IPPROTO_ESP:
6519 ++ case IPPROTO_COMP:
6520 ++#if IS_ENABLED(CONFIG_IPV6)
6521 ++ case IPPROTO_ROUTING:
6522 ++ case IPPROTO_DSTOPTS:
6523 ++#endif
6524 ++ case IPSEC_PROTO_ANY:
6525 ++ break;
6526 ++ default:
6527 ++ return -EINVAL;
6528 ++ }
6529 ++
6530 + }
6531 +
6532 + return 0;
6533 +diff --git a/scripts/genksyms/parse.tab.c_shipped b/scripts/genksyms/parse.tab.c_shipped
6534 +index 99950b5afb0d..632f6d66982d 100644
6535 +--- a/scripts/genksyms/parse.tab.c_shipped
6536 ++++ b/scripts/genksyms/parse.tab.c_shipped
6537 +@@ -1,19 +1,19 @@
6538 +-/* A Bison parser, made by GNU Bison 2.7. */
6539 ++/* A Bison parser, made by GNU Bison 3.0.4. */
6540 +
6541 + /* Bison implementation for Yacc-like parsers in C
6542 +-
6543 +- Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
6544 +-
6545 ++
6546 ++ Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
6547 ++
6548 + This program is free software: you can redistribute it and/or modify
6549 + it under the terms of the GNU General Public License as published by
6550 + the Free Software Foundation, either version 3 of the License, or
6551 + (at your option) any later version.
6552 +-
6553 ++
6554 + This program is distributed in the hope that it will be useful,
6555 + but WITHOUT ANY WARRANTY; without even the implied warranty of
6556 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6557 + GNU General Public License for more details.
6558 +-
6559 ++
6560 + You should have received a copy of the GNU General Public License
6561 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
6562 +
6563 +@@ -26,7 +26,7 @@
6564 + special exception, which will cause the skeleton and the resulting
6565 + Bison output files to be licensed under the GNU General Public
6566 + License without this special exception.
6567 +-
6568 ++
6569 + This special exception was added by the Free Software Foundation in
6570 + version 2.2 of Bison. */
6571 +
6572 +@@ -44,7 +44,7 @@
6573 + #define YYBISON 1
6574 +
6575 + /* Bison version. */
6576 +-#define YYBISON_VERSION "2.7"
6577 ++#define YYBISON_VERSION "3.0.4"
6578 +
6579 + /* Skeleton name. */
6580 + #define YYSKELETON_NAME "yacc.c"
6581 +@@ -62,7 +62,7 @@
6582 +
6583 +
6584 + /* Copy the first part of user declarations. */
6585 +-
6586 ++#line 24 "parse.y" /* yacc.c:339 */
6587 +
6588 +
6589 + #include <assert.h>
6590 +@@ -113,13 +113,13 @@ static void record_compound(struct string_list **keyw,
6591 + }
6592 +
6593 +
6594 ++#line 117 "parse.tab.c" /* yacc.c:339 */
6595 +
6596 +-
6597 +-# ifndef YY_NULL
6598 ++# ifndef YY_NULLPTR
6599 + # if defined __cplusplus && 201103L <= __cplusplus
6600 +-# define YY_NULL nullptr
6601 ++# define YY_NULLPTR nullptr
6602 + # else
6603 +-# define YY_NULL 0
6604 ++# define YY_NULLPTR 0
6605 + # endif
6606 + # endif
6607 +
6608 +@@ -131,8 +131,11 @@ static void record_compound(struct string_list **keyw,
6609 + # define YYERROR_VERBOSE 0
6610 + #endif
6611 +
6612 +-
6613 +-/* Enabling traces. */
6614 ++/* In a future release of Bison, this section will be replaced
6615 ++ by #include "parse.tab.h". */
6616 ++#ifndef YY_YY_PARSE_TAB_H_INCLUDED
6617 ++# define YY_YY_PARSE_TAB_H_INCLUDED
6618 ++/* Debug traces. */
6619 + #ifndef YYDEBUG
6620 + # define YYDEBUG 1
6621 + #endif
6622 +@@ -140,86 +143,73 @@ static void record_compound(struct string_list **keyw,
6623 + extern int yydebug;
6624 + #endif
6625 +
6626 +-/* Tokens. */
6627 ++/* Token type. */
6628 + #ifndef YYTOKENTYPE
6629 + # define YYTOKENTYPE
6630 +- /* Put the tokens into the symbol table, so that GDB and other debuggers
6631 +- know about them. */
6632 +- enum yytokentype {
6633 +- ASM_KEYW = 258,
6634 +- ATTRIBUTE_KEYW = 259,
6635 +- AUTO_KEYW = 260,
6636 +- BOOL_KEYW = 261,
6637 +- CHAR_KEYW = 262,
6638 +- CONST_KEYW = 263,
6639 +- DOUBLE_KEYW = 264,
6640 +- ENUM_KEYW = 265,
6641 +- EXTERN_KEYW = 266,
6642 +- EXTENSION_KEYW = 267,
6643 +- FLOAT_KEYW = 268,
6644 +- INLINE_KEYW = 269,
6645 +- INT_KEYW = 270,
6646 +- LONG_KEYW = 271,
6647 +- REGISTER_KEYW = 272,
6648 +- RESTRICT_KEYW = 273,
6649 +- SHORT_KEYW = 274,
6650 +- SIGNED_KEYW = 275,
6651 +- STATIC_KEYW = 276,
6652 +- STRUCT_KEYW = 277,
6653 +- TYPEDEF_KEYW = 278,
6654 +- UNION_KEYW = 279,
6655 +- UNSIGNED_KEYW = 280,
6656 +- VOID_KEYW = 281,
6657 +- VOLATILE_KEYW = 282,
6658 +- TYPEOF_KEYW = 283,
6659 +- EXPORT_SYMBOL_KEYW = 284,
6660 +- ASM_PHRASE = 285,
6661 +- ATTRIBUTE_PHRASE = 286,
6662 +- TYPEOF_PHRASE = 287,
6663 +- BRACE_PHRASE = 288,
6664 +- BRACKET_PHRASE = 289,
6665 +- EXPRESSION_PHRASE = 290,
6666 +- CHAR = 291,
6667 +- DOTS = 292,
6668 +- IDENT = 293,
6669 +- INT = 294,
6670 +- REAL = 295,
6671 +- STRING = 296,
6672 +- TYPE = 297,
6673 +- OTHER = 298,
6674 +- FILENAME = 299
6675 +- };
6676 ++ enum yytokentype
6677 ++ {
6678 ++ ASM_KEYW = 258,
6679 ++ ATTRIBUTE_KEYW = 259,
6680 ++ AUTO_KEYW = 260,
6681 ++ BOOL_KEYW = 261,
6682 ++ CHAR_KEYW = 262,
6683 ++ CONST_KEYW = 263,
6684 ++ DOUBLE_KEYW = 264,
6685 ++ ENUM_KEYW = 265,
6686 ++ EXTERN_KEYW = 266,
6687 ++ EXTENSION_KEYW = 267,
6688 ++ FLOAT_KEYW = 268,
6689 ++ INLINE_KEYW = 269,
6690 ++ INT_KEYW = 270,
6691 ++ LONG_KEYW = 271,
6692 ++ REGISTER_KEYW = 272,
6693 ++ RESTRICT_KEYW = 273,
6694 ++ SHORT_KEYW = 274,
6695 ++ SIGNED_KEYW = 275,
6696 ++ STATIC_KEYW = 276,
6697 ++ STRUCT_KEYW = 277,
6698 ++ TYPEDEF_KEYW = 278,
6699 ++ UNION_KEYW = 279,
6700 ++ UNSIGNED_KEYW = 280,
6701 ++ VOID_KEYW = 281,
6702 ++ VOLATILE_KEYW = 282,
6703 ++ TYPEOF_KEYW = 283,
6704 ++ EXPORT_SYMBOL_KEYW = 284,
6705 ++ ASM_PHRASE = 285,
6706 ++ ATTRIBUTE_PHRASE = 286,
6707 ++ TYPEOF_PHRASE = 287,
6708 ++ BRACE_PHRASE = 288,
6709 ++ BRACKET_PHRASE = 289,
6710 ++ EXPRESSION_PHRASE = 290,
6711 ++ CHAR = 291,
6712 ++ DOTS = 292,
6713 ++ IDENT = 293,
6714 ++ INT = 294,
6715 ++ REAL = 295,
6716 ++ STRING = 296,
6717 ++ TYPE = 297,
6718 ++ OTHER = 298,
6719 ++ FILENAME = 299
6720 ++ };
6721 + #endif
6722 +
6723 +-
6724 ++/* Value type. */
6725 + #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
6726 + typedef int YYSTYPE;
6727 + # define YYSTYPE_IS_TRIVIAL 1
6728 +-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
6729 + # define YYSTYPE_IS_DECLARED 1
6730 + #endif
6731 +
6732 ++
6733 + extern YYSTYPE yylval;
6734 +
6735 +-#ifdef YYPARSE_PARAM
6736 +-#if defined __STDC__ || defined __cplusplus
6737 +-int yyparse (void *YYPARSE_PARAM);
6738 +-#else
6739 +-int yyparse ();
6740 +-#endif
6741 +-#else /* ! YYPARSE_PARAM */
6742 +-#if defined __STDC__ || defined __cplusplus
6743 + int yyparse (void);
6744 +-#else
6745 +-int yyparse ();
6746 +-#endif
6747 +-#endif /* ! YYPARSE_PARAM */
6748 +-
6749 +
6750 ++#endif /* !YY_YY_PARSE_TAB_H_INCLUDED */
6751 +
6752 + /* Copy the second part of user declarations. */
6753 +
6754 +-
6755 ++#line 213 "parse.tab.c" /* yacc.c:358 */
6756 +
6757 + #ifdef short
6758 + # undef short
6759 +@@ -233,11 +223,8 @@ typedef unsigned char yytype_uint8;
6760 +
6761 + #ifdef YYTYPE_INT8
6762 + typedef YYTYPE_INT8 yytype_int8;
6763 +-#elif (defined __STDC__ || defined __C99__FUNC__ \
6764 +- || defined __cplusplus || defined _MSC_VER)
6765 +-typedef signed char yytype_int8;
6766 + #else
6767 +-typedef short int yytype_int8;
6768 ++typedef signed char yytype_int8;
6769 + #endif
6770 +
6771 + #ifdef YYTYPE_UINT16
6772 +@@ -257,8 +244,7 @@ typedef short int yytype_int16;
6773 + # define YYSIZE_T __SIZE_TYPE__
6774 + # elif defined size_t
6775 + # define YYSIZE_T size_t
6776 +-# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
6777 +- || defined __cplusplus || defined _MSC_VER)
6778 ++# elif ! defined YYSIZE_T
6779 + # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
6780 + # define YYSIZE_T size_t
6781 + # else
6782 +@@ -280,6 +266,33 @@ typedef short int yytype_int16;
6783 + # endif
6784 + #endif
6785 +
6786 ++#ifndef YY_ATTRIBUTE
6787 ++# if (defined __GNUC__ \
6788 ++ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
6789 ++ || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
6790 ++# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
6791 ++# else
6792 ++# define YY_ATTRIBUTE(Spec) /* empty */
6793 ++# endif
6794 ++#endif
6795 ++
6796 ++#ifndef YY_ATTRIBUTE_PURE
6797 ++# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
6798 ++#endif
6799 ++
6800 ++#ifndef YY_ATTRIBUTE_UNUSED
6801 ++# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
6802 ++#endif
6803 ++
6804 ++#if !defined _Noreturn \
6805 ++ && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
6806 ++# if defined _MSC_VER && 1200 <= _MSC_VER
6807 ++# define _Noreturn __declspec (noreturn)
6808 ++# else
6809 ++# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
6810 ++# endif
6811 ++#endif
6812 ++
6813 + /* Suppress unused-variable warnings by "using" E. */
6814 + #if ! defined lint || defined __GNUC__
6815 + # define YYUSE(E) ((void) (E))
6816 +@@ -287,24 +300,26 @@ typedef short int yytype_int16;
6817 + # define YYUSE(E) /* empty */
6818 + #endif
6819 +
6820 +-/* Identity function, used to suppress warnings about constant conditions. */
6821 +-#ifndef lint
6822 +-# define YYID(N) (N)
6823 +-#else
6824 +-#if (defined __STDC__ || defined __C99__FUNC__ \
6825 +- || defined __cplusplus || defined _MSC_VER)
6826 +-static int
6827 +-YYID (int yyi)
6828 ++#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
6829 ++/* Suppress an incorrect diagnostic about yylval being uninitialized. */
6830 ++# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
6831 ++ _Pragma ("GCC diagnostic push") \
6832 ++ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
6833 ++ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
6834 ++# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
6835 ++ _Pragma ("GCC diagnostic pop")
6836 + #else
6837 +-static int
6838 +-YYID (yyi)
6839 +- int yyi;
6840 ++# define YY_INITIAL_VALUE(Value) Value
6841 + #endif
6842 +-{
6843 +- return yyi;
6844 +-}
6845 ++#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
6846 ++# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
6847 ++# define YY_IGNORE_MAYBE_UNINITIALIZED_END
6848 ++#endif
6849 ++#ifndef YY_INITIAL_VALUE
6850 ++# define YY_INITIAL_VALUE(Value) /* Nothing. */
6851 + #endif
6852 +
6853 ++
6854 + #if ! defined yyoverflow || YYERROR_VERBOSE
6855 +
6856 + /* The parser invokes alloca or malloc; define the necessary symbols. */
6857 +@@ -322,8 +337,7 @@ YYID (yyi)
6858 + # define alloca _alloca
6859 + # else
6860 + # define YYSTACK_ALLOC alloca
6861 +-# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
6862 +- || defined __cplusplus || defined _MSC_VER)
6863 ++# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
6864 + # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
6865 + /* Use EXIT_SUCCESS as a witness for stdlib.h. */
6866 + # ifndef EXIT_SUCCESS
6867 +@@ -335,8 +349,8 @@ YYID (yyi)
6868 + # endif
6869 +
6870 + # ifdef YYSTACK_ALLOC
6871 +- /* Pacify GCC's `empty if-body' warning. */
6872 +-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
6873 ++ /* Pacify GCC's 'empty if-body' warning. */
6874 ++# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
6875 + # ifndef YYSTACK_ALLOC_MAXIMUM
6876 + /* The OS might guarantee only one guard page at the bottom of the stack,
6877 + and a page size can be as small as 4096 bytes. So we cannot safely
6878 +@@ -352,7 +366,7 @@ YYID (yyi)
6879 + # endif
6880 + # if (defined __cplusplus && ! defined EXIT_SUCCESS \
6881 + && ! ((defined YYMALLOC || defined malloc) \
6882 +- && (defined YYFREE || defined free)))
6883 ++ && (defined YYFREE || defined free)))
6884 + # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
6885 + # ifndef EXIT_SUCCESS
6886 + # define EXIT_SUCCESS 0
6887 +@@ -360,15 +374,13 @@ YYID (yyi)
6888 + # endif
6889 + # ifndef YYMALLOC
6890 + # define YYMALLOC malloc
6891 +-# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
6892 +- || defined __cplusplus || defined _MSC_VER)
6893 ++# if ! defined malloc && ! defined EXIT_SUCCESS
6894 + void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
6895 + # endif
6896 + # endif
6897 + # ifndef YYFREE
6898 + # define YYFREE free
6899 +-# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
6900 +- || defined __cplusplus || defined _MSC_VER)
6901 ++# if ! defined free && ! defined EXIT_SUCCESS
6902 + void free (void *); /* INFRINGES ON USER NAME SPACE */
6903 + # endif
6904 + # endif
6905 +@@ -378,7 +390,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
6906 +
6907 + #if (! defined yyoverflow \
6908 + && (! defined __cplusplus \
6909 +- || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
6910 ++ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
6911 +
6912 + /* A type that is properly aligned for any stack member. */
6913 + union yyalloc
6914 +@@ -403,16 +415,16 @@ union yyalloc
6915 + elements in the stack, and YYPTR gives the new location of the
6916 + stack. Advance YYPTR to a properly aligned location for the next
6917 + stack. */
6918 +-# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
6919 +- do \
6920 +- { \
6921 +- YYSIZE_T yynewbytes; \
6922 +- YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
6923 +- Stack = &yyptr->Stack_alloc; \
6924 +- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
6925 +- yyptr += yynewbytes / sizeof (*yyptr); \
6926 +- } \
6927 +- while (YYID (0))
6928 ++# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
6929 ++ do \
6930 ++ { \
6931 ++ YYSIZE_T yynewbytes; \
6932 ++ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
6933 ++ Stack = &yyptr->Stack_alloc; \
6934 ++ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
6935 ++ yyptr += yynewbytes / sizeof (*yyptr); \
6936 ++ } \
6937 ++ while (0)
6938 +
6939 + #endif
6940 +
6941 +@@ -431,7 +443,7 @@ union yyalloc
6942 + for (yyi = 0; yyi < (Count); yyi++) \
6943 + (Dst)[yyi] = (Src)[yyi]; \
6944 + } \
6945 +- while (YYID (0))
6946 ++ while (0)
6947 + # endif
6948 + # endif
6949 + #endif /* !YYCOPY_NEEDED */
6950 +@@ -439,25 +451,27 @@ union yyalloc
6951 + /* YYFINAL -- State number of the termination state. */
6952 + #define YYFINAL 4
6953 + /* YYLAST -- Last index in YYTABLE. */
6954 +-#define YYLAST 515
6955 ++#define YYLAST 513
6956 +
6957 + /* YYNTOKENS -- Number of terminals. */
6958 + #define YYNTOKENS 54
6959 + /* YYNNTS -- Number of nonterminals. */
6960 + #define YYNNTS 49
6961 + /* YYNRULES -- Number of rules. */
6962 +-#define YYNRULES 133
6963 +-/* YYNRULES -- Number of states. */
6964 +-#define YYNSTATES 188
6965 ++#define YYNRULES 132
6966 ++/* YYNSTATES -- Number of states. */
6967 ++#define YYNSTATES 186
6968 +
6969 +-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
6970 ++/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
6971 ++ by yylex, with out-of-bounds checking. */
6972 + #define YYUNDEFTOK 2
6973 + #define YYMAXUTOK 299
6974 +
6975 +-#define YYTRANSLATE(YYX) \
6976 ++#define YYTRANSLATE(YYX) \
6977 + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
6978 +
6979 +-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
6980 ++/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
6981 ++ as returned by yylex, without out-of-bounds checking. */
6982 + static const yytype_uint8 yytranslate[] =
6983 + {
6984 + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
6985 +@@ -493,69 +507,7 @@ static const yytype_uint8 yytranslate[] =
6986 + };
6987 +
6988 + #if YYDEBUG
6989 +-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
6990 +- YYRHS. */
6991 +-static const yytype_uint16 yyprhs[] =
6992 +-{
6993 +- 0, 0, 3, 5, 8, 9, 12, 13, 18, 19,
6994 +- 23, 25, 27, 29, 31, 34, 37, 41, 42, 44,
6995 +- 46, 50, 55, 56, 58, 60, 63, 65, 67, 69,
6996 +- 71, 73, 75, 77, 79, 81, 86, 88, 91, 94,
6997 +- 97, 101, 105, 109, 112, 115, 118, 120, 122, 124,
6998 +- 126, 128, 130, 132, 134, 136, 138, 140, 143, 144,
6999 +- 146, 148, 151, 153, 155, 157, 159, 162, 164, 166,
7000 +- 168, 173, 178, 181, 185, 189, 192, 194, 196, 198,
7001 +- 203, 208, 211, 215, 219, 222, 224, 228, 229, 231,
7002 +- 233, 237, 240, 243, 245, 246, 248, 250, 255, 260,
7003 +- 263, 267, 271, 275, 276, 278, 281, 285, 289, 290,
7004 +- 292, 294, 297, 301, 304, 305, 307, 309, 313, 316,
7005 +- 319, 321, 324, 325, 328, 332, 337, 339, 343, 345,
7006 +- 349, 352, 353, 355
7007 +-};
7008 +-
7009 +-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
7010 +-static const yytype_int8 yyrhs[] =
7011 +-{
7012 +- 55, 0, -1, 56, -1, 55, 56, -1, -1, 57,
7013 +- 58, -1, -1, 12, 23, 59, 61, -1, -1, 23,
7014 +- 60, 61, -1, 61, -1, 85, -1, 100, -1, 102,
7015 +- -1, 1, 45, -1, 1, 46, -1, 65, 62, 45,
7016 +- -1, -1, 63, -1, 64, -1, 63, 47, 64, -1,
7017 +- 75, 101, 96, 86, -1, -1, 66, -1, 67, -1,
7018 +- 66, 67, -1, 68, -1, 69, -1, 5, -1, 17,
7019 +- -1, 21, -1, 11, -1, 14, -1, 70, -1, 74,
7020 +- -1, 28, 48, 82, 49, -1, 32, -1, 22, 38,
7021 +- -1, 24, 38, -1, 10, 38, -1, 22, 38, 88,
7022 +- -1, 24, 38, 88, -1, 10, 38, 97, -1, 10,
7023 +- 97, -1, 22, 88, -1, 24, 88, -1, 7, -1,
7024 +- 19, -1, 15, -1, 16, -1, 20, -1, 25, -1,
7025 +- 13, -1, 9, -1, 26, -1, 6, -1, 42, -1,
7026 +- 50, 72, -1, -1, 73, -1, 74, -1, 73, 74,
7027 +- -1, 8, -1, 27, -1, 31, -1, 18, -1, 71,
7028 +- 75, -1, 76, -1, 38, -1, 42, -1, 76, 48,
7029 +- 79, 49, -1, 76, 48, 1, 49, -1, 76, 34,
7030 +- -1, 48, 75, 49, -1, 48, 1, 49, -1, 71,
7031 +- 77, -1, 78, -1, 38, -1, 42, -1, 78, 48,
7032 +- 79, 49, -1, 78, 48, 1, 49, -1, 78, 34,
7033 +- -1, 48, 77, 49, -1, 48, 1, 49, -1, 80,
7034 +- 37, -1, 80, -1, 81, 47, 37, -1, -1, 81,
7035 +- -1, 82, -1, 81, 47, 82, -1, 66, 83, -1,
7036 +- 71, 83, -1, 84, -1, -1, 38, -1, 42, -1,
7037 +- 84, 48, 79, 49, -1, 84, 48, 1, 49, -1,
7038 +- 84, 34, -1, 48, 83, 49, -1, 48, 1, 49,
7039 +- -1, 65, 75, 33, -1, -1, 87, -1, 51, 35,
7040 +- -1, 52, 89, 46, -1, 52, 1, 46, -1, -1,
7041 +- 90, -1, 91, -1, 90, 91, -1, 65, 92, 45,
7042 +- -1, 1, 45, -1, -1, 93, -1, 94, -1, 93,
7043 +- 47, 94, -1, 77, 96, -1, 38, 95, -1, 95,
7044 +- -1, 53, 35, -1, -1, 96, 31, -1, 52, 98,
7045 +- 46, -1, 52, 98, 47, 46, -1, 99, -1, 98,
7046 +- 47, 99, -1, 38, -1, 38, 51, 35, -1, 30,
7047 +- 45, -1, -1, 30, -1, 29, 48, 38, 49, 45,
7048 +- -1
7049 +-};
7050 +-
7051 +-/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
7052 ++ /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
7053 + static const yytype_uint16 yyrline[] =
7054 + {
7055 + 0, 124, 124, 125, 129, 129, 135, 135, 137, 137,
7056 +@@ -565,13 +517,13 @@ static const yytype_uint16 yyrline[] =
7057 + 237, 239, 241, 246, 249, 250, 254, 255, 256, 257,
7058 + 258, 259, 260, 261, 262, 263, 264, 268, 273, 274,
7059 + 278, 279, 283, 283, 283, 284, 292, 293, 297, 306,
7060 +- 315, 317, 319, 321, 323, 330, 331, 335, 336, 337,
7061 +- 339, 341, 343, 345, 350, 351, 352, 356, 357, 361,
7062 +- 362, 367, 372, 374, 378, 379, 387, 391, 393, 395,
7063 +- 397, 399, 404, 413, 414, 419, 424, 425, 429, 430,
7064 +- 434, 435, 439, 441, 446, 447, 451, 452, 456, 457,
7065 +- 458, 462, 466, 467, 471, 472, 476, 477, 480, 485,
7066 +- 493, 497, 498, 502
7067 ++ 315, 317, 319, 321, 328, 329, 333, 334, 335, 337,
7068 ++ 339, 341, 343, 348, 349, 350, 354, 355, 359, 360,
7069 ++ 365, 370, 372, 376, 377, 385, 389, 391, 393, 395,
7070 ++ 397, 402, 411, 412, 417, 422, 423, 427, 428, 432,
7071 ++ 433, 437, 439, 444, 445, 449, 450, 454, 455, 456,
7072 ++ 460, 464, 465, 469, 470, 474, 475, 478, 483, 491,
7073 ++ 495, 496, 500
7074 + };
7075 + #endif
7076 +
7077 +@@ -606,13 +558,13 @@ static const char *const yytname[] =
7078 + "member_declarator_list_opt", "member_declarator_list",
7079 + "member_declarator", "member_bitfield_declarator", "attribute_opt",
7080 + "enum_body", "enumerator_list", "enumerator", "asm_definition",
7081 +- "asm_phrase_opt", "export_definition", YY_NULL
7082 ++ "asm_phrase_opt", "export_definition", YY_NULLPTR
7083 + };
7084 + #endif
7085 +
7086 + # ifdef YYPRINT
7087 +-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
7088 +- token YYLEX-NUM. */
7089 ++/* YYTOKNUM[NUM] -- (External) token number corresponding to the
7090 ++ (internal) symbol number NUM (which must be that of a token). */
7091 + static const yytype_uint16 yytoknum[] =
7092 + {
7093 + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
7094 +@@ -624,47 +576,44 @@ static const yytype_uint16 yytoknum[] =
7095 + };
7096 + # endif
7097 +
7098 +-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
7099 +-static const yytype_uint8 yyr1[] =
7100 +-{
7101 +- 0, 54, 55, 55, 57, 56, 59, 58, 60, 58,
7102 +- 58, 58, 58, 58, 58, 58, 61, 62, 62, 63,
7103 +- 63, 64, 65, 65, 66, 66, 67, 67, 68, 68,
7104 +- 68, 68, 68, 69, 69, 69, 69, 69, 69, 69,
7105 +- 69, 69, 69, 69, 69, 69, 70, 70, 70, 70,
7106 +- 70, 70, 70, 70, 70, 70, 70, 71, 72, 72,
7107 +- 73, 73, 74, 74, 74, 74, 75, 75, 76, 76,
7108 +- 76, 76, 76, 76, 76, 77, 77, 78, 78, 78,
7109 +- 78, 78, 78, 78, 79, 79, 79, 80, 80, 81,
7110 +- 81, 82, 83, 83, 84, 84, 84, 84, 84, 84,
7111 +- 84, 84, 85, 86, 86, 87, 88, 88, 89, 89,
7112 +- 90, 90, 91, 91, 92, 92, 93, 93, 94, 94,
7113 +- 94, 95, 96, 96, 97, 97, 98, 98, 99, 99,
7114 +- 100, 101, 101, 102
7115 +-};
7116 ++#define YYPACT_NINF -135
7117 +
7118 +-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
7119 +-static const yytype_uint8 yyr2[] =
7120 ++#define yypact_value_is_default(Yystate) \
7121 ++ (!!((Yystate) == (-135)))
7122 ++
7123 ++#define YYTABLE_NINF -109
7124 ++
7125 ++#define yytable_value_is_error(Yytable_value) \
7126 ++ 0
7127 ++
7128 ++ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
7129 ++ STATE-NUM. */
7130 ++static const yytype_int16 yypact[] =
7131 + {
7132 +- 0, 2, 1, 2, 0, 2, 0, 4, 0, 3,
7133 +- 1, 1, 1, 1, 2, 2, 3, 0, 1, 1,
7134 +- 3, 4, 0, 1, 1, 2, 1, 1, 1, 1,
7135 +- 1, 1, 1, 1, 1, 4, 1, 2, 2, 2,
7136 +- 3, 3, 3, 2, 2, 2, 1, 1, 1, 1,
7137 +- 1, 1, 1, 1, 1, 1, 1, 2, 0, 1,
7138 +- 1, 2, 1, 1, 1, 1, 2, 1, 1, 1,
7139 +- 4, 4, 2, 3, 3, 2, 1, 1, 1, 4,
7140 +- 4, 2, 3, 3, 2, 1, 3, 0, 1, 1,
7141 +- 3, 2, 2, 1, 0, 1, 1, 4, 4, 2,
7142 +- 3, 3, 3, 0, 1, 2, 3, 3, 0, 1,
7143 +- 1, 2, 3, 2, 0, 1, 1, 3, 2, 2,
7144 +- 1, 2, 0, 2, 3, 4, 1, 3, 1, 3,
7145 +- 2, 0, 1, 5
7146 ++ -135, 38, -135, 206, -135, -135, 22, -135, -135, -135,
7147 ++ -135, -135, -24, -135, 20, -135, -135, -135, -135, -135,
7148 ++ -135, -135, -135, -135, -23, -135, 6, -135, -135, -135,
7149 ++ -2, 15, 24, -135, -135, -135, -135, -135, 41, 471,
7150 ++ -135, -135, -135, -135, -135, -135, -135, -135, -135, -135,
7151 ++ 13, 36, -135, -135, 35, 106, -135, 471, 35, -135,
7152 ++ 471, 44, -135, -135, -135, 41, 39, 45, 48, -135,
7153 ++ 41, -10, 25, -135, -135, 47, 34, -135, 471, -135,
7154 ++ 26, -26, 53, 156, -135, -135, 41, -135, 387, 52,
7155 ++ 57, 59, -135, 39, -135, -135, 41, -135, -135, -135,
7156 ++ -135, -135, 252, 67, -135, -21, -135, -135, -135, 51,
7157 ++ -135, 12, 83, 46, -135, 27, 84, 88, -135, -135,
7158 ++ -135, 91, -135, 109, -135, -135, 3, 55, -135, 30,
7159 ++ -135, 95, -135, -135, -135, -20, 92, 93, 108, 96,
7160 ++ -135, -135, -135, -135, -135, 97, -135, 98, -135, -135,
7161 ++ 118, -135, 297, -135, -26, 101, -135, 104, -135, -135,
7162 ++ 342, -135, -135, 120, -135, -135, -135, -135, -135, 433,
7163 ++ -135, -135, 111, 119, -135, -135, -135, 130, 136, -135,
7164 ++ -135, -135, -135, -135, -135, -135
7165 + };
7166 +
7167 +-/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
7168 +- Performed when YYTABLE doesn't specify something else to do. Zero
7169 +- means the default is an error. */
7170 ++ /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
7171 ++ Performed when YYTABLE does not specify something else to do. Zero
7172 ++ means the default is an error. */
7173 + static const yytype_uint8 yydefact[] =
7174 + {
7175 + 4, 4, 2, 0, 1, 3, 0, 28, 55, 46,
7176 +@@ -673,191 +622,158 @@ static const yytype_uint8 yydefact[] =
7177 + 0, 0, 0, 64, 36, 56, 5, 10, 17, 23,
7178 + 24, 26, 27, 33, 34, 11, 12, 13, 14, 15,
7179 + 39, 0, 43, 6, 37, 0, 44, 22, 38, 45,
7180 +- 0, 0, 130, 68, 69, 0, 58, 0, 18, 19,
7181 +- 0, 131, 67, 25, 42, 128, 0, 126, 22, 40,
7182 +- 0, 114, 0, 0, 110, 9, 17, 41, 94, 0,
7183 +- 0, 0, 0, 57, 59, 60, 16, 0, 66, 132,
7184 +- 102, 122, 72, 0, 0, 124, 0, 7, 113, 107,
7185 +- 77, 78, 0, 0, 0, 122, 76, 0, 115, 116,
7186 +- 120, 106, 0, 111, 131, 95, 56, 0, 94, 91,
7187 +- 93, 35, 0, 74, 73, 61, 20, 103, 0, 0,
7188 +- 85, 88, 89, 129, 125, 127, 119, 0, 77, 0,
7189 +- 121, 75, 118, 81, 0, 112, 0, 0, 96, 0,
7190 +- 92, 99, 0, 133, 123, 0, 21, 104, 71, 70,
7191 +- 84, 0, 83, 82, 0, 0, 117, 101, 100, 0,
7192 +- 0, 105, 86, 90, 80, 79, 98, 97
7193 +-};
7194 +-
7195 +-/* YYDEFGOTO[NTERM-NUM]. */
7196 +-static const yytype_int16 yydefgoto[] =
7197 +-{
7198 +- -1, 1, 2, 3, 36, 78, 57, 37, 67, 68,
7199 +- 69, 81, 39, 40, 41, 42, 43, 70, 93, 94,
7200 +- 44, 124, 72, 115, 116, 139, 140, 141, 142, 129,
7201 +- 130, 45, 166, 167, 56, 82, 83, 84, 117, 118,
7202 +- 119, 120, 137, 52, 76, 77, 46, 101, 47
7203 ++ 0, 0, 129, 68, 69, 0, 58, 0, 18, 19,
7204 ++ 0, 130, 67, 25, 42, 127, 0, 125, 22, 40,
7205 ++ 0, 113, 0, 0, 109, 9, 17, 41, 93, 0,
7206 ++ 0, 0, 57, 59, 60, 16, 0, 66, 131, 101,
7207 ++ 121, 72, 0, 0, 123, 0, 7, 112, 106, 76,
7208 ++ 77, 0, 0, 0, 121, 75, 0, 114, 115, 119,
7209 ++ 105, 0, 110, 130, 94, 56, 0, 93, 90, 92,
7210 ++ 35, 0, 73, 61, 20, 102, 0, 0, 84, 87,
7211 ++ 88, 128, 124, 126, 118, 0, 76, 0, 120, 74,
7212 ++ 117, 80, 0, 111, 0, 0, 95, 0, 91, 98,
7213 ++ 0, 132, 122, 0, 21, 103, 71, 70, 83, 0,
7214 ++ 82, 81, 0, 0, 116, 100, 99, 0, 0, 104,
7215 ++ 85, 89, 79, 78, 97, 96
7216 + };
7217 +
7218 +-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
7219 +- STATE-NUM. */
7220 +-#define YYPACT_NINF -92
7221 +-static const yytype_int16 yypact[] =
7222 ++ /* YYPGOTO[NTERM-NUM]. */
7223 ++static const yytype_int16 yypgoto[] =
7224 + {
7225 +- -92, 19, -92, 208, -92, -92, 39, -92, -92, -92,
7226 +- -92, -92, -27, -92, 23, -92, -92, -92, -92, -92,
7227 +- -92, -92, -92, -92, -22, -92, 9, -92, -92, -92,
7228 +- -6, 16, 25, -92, -92, -92, -92, -92, 31, 473,
7229 +- -92, -92, -92, -92, -92, -92, -92, -92, -92, -92,
7230 +- 49, 37, -92, -92, 51, 108, -92, 473, 51, -92,
7231 +- 473, 59, -92, -92, -92, 12, -3, 60, 57, -92,
7232 +- 31, -7, 24, -92, -92, 55, 42, -92, 473, -92,
7233 +- 46, -21, 61, 158, -92, -92, 31, -92, 389, 71,
7234 +- 82, 88, 89, -92, -3, -92, -92, 31, -92, -92,
7235 +- -92, -92, -92, 254, 73, -92, -24, -92, -92, -92,
7236 +- 90, -92, 17, 75, 45, -92, 32, 96, 95, -92,
7237 +- -92, -92, 99, -92, 115, -92, -92, 3, 48, -92,
7238 +- 34, -92, 102, -92, -92, -92, -92, -11, 100, 103,
7239 +- 111, 104, -92, -92, -92, -92, -92, 106, -92, 113,
7240 +- -92, -92, 126, -92, 299, -92, -21, 121, -92, 132,
7241 +- -92, -92, 344, -92, -92, 125, -92, -92, -92, -92,
7242 +- -92, 435, -92, -92, 138, 139, -92, -92, -92, 142,
7243 +- 143, -92, -92, -92, -92, -92, -92, -92
7244 ++ -135, -135, 157, -135, -135, -135, -135, -48, -135, -135,
7245 ++ 90, -1, -60, -33, -135, -135, -135, -78, -135, -135,
7246 ++ -61, -31, -135, -92, -135, -134, -135, -135, -59, -41,
7247 ++ -135, -135, -135, -135, -18, -135, -135, 107, -135, -135,
7248 ++ 37, 80, 78, 143, -135, 94, -135, -135, -135
7249 + };
7250 +
7251 +-/* YYPGOTO[NTERM-NUM]. */
7252 +-static const yytype_int16 yypgoto[] =
7253 ++ /* YYDEFGOTO[NTERM-NUM]. */
7254 ++static const yytype_int16 yydefgoto[] =
7255 + {
7256 +- -92, -92, 192, -92, -92, -92, -92, -47, -92, -92,
7257 +- 97, 0, -60, -32, -92, -92, -92, -79, -92, -92,
7258 +- -58, -26, -92, -38, -92, -91, -92, -92, -59, -28,
7259 +- -92, -92, -92, -92, -20, -92, -92, 112, -92, -92,
7260 +- 41, 91, 83, 149, -92, 101, -92, -92, -92
7261 ++ -1, 1, 2, 3, 36, 78, 57, 37, 67, 68,
7262 ++ 69, 81, 39, 40, 41, 42, 43, 70, 92, 93,
7263 ++ 44, 123, 72, 114, 115, 137, 138, 139, 140, 128,
7264 ++ 129, 45, 164, 165, 56, 82, 83, 84, 116, 117,
7265 ++ 118, 119, 135, 52, 76, 77, 46, 100, 47
7266 + };
7267 +
7268 +-/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
7269 +- positive, shift that token. If negative, reduce the rule which
7270 +- number is the opposite. If YYTABLE_NINF, syntax error. */
7271 +-#define YYTABLE_NINF -110
7272 ++ /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
7273 ++ positive, shift that token. If negative, reduce the rule whose
7274 ++ number is the opposite. If YYTABLE_NINF, syntax error. */
7275 + static const yytype_int16 yytable[] =
7276 + {
7277 +- 88, 89, 114, 38, 157, 10, 59, 73, 95, 128,
7278 +- 85, 50, 71, 91, 75, 20, 54, 110, 147, 4,
7279 +- 164, 111, 144, 99, 29, 51, 100, 112, 33, 66,
7280 +- 55, 107, 113, 114, 79, 114, 135, -94, 87, 92,
7281 +- 165, 125, 60, 88, 98, 158, 53, 58, 128, 128,
7282 +- 63, 127, -94, 66, 64, 148, 73, 86, 102, 111,
7283 +- 65, 55, 66, 175, 61, 112, 153, 66, 161, 63,
7284 +- 62, 180, 103, 64, 149, 75, 151, 114, 86, 65,
7285 +- 154, 66, 162, 148, 48, 49, 125, 111, 105, 106,
7286 +- 158, 108, 109, 112, 88, 66, 127, 90, 66, 159,
7287 +- 160, 51, 88, 55, 97, 96, 104, 121, 143, 80,
7288 +- 150, 88, 183, 7, 8, 9, 10, 11, 12, 13,
7289 +- 131, 15, 16, 17, 18, 19, 20, 21, 22, 23,
7290 +- 24, 132, 26, 27, 28, 29, 30, 133, 134, 33,
7291 +- 34, 155, 156, 113, 108, 99, -22, 163, 170, 168,
7292 +- 35, 171, 169, -22, -108, 172, -22, 164, -22, 122,
7293 +- 181, -22, 173, 7, 8, 9, 10, 11, 12, 13,
7294 +- 177, 15, 16, 17, 18, 19, 20, 21, 22, 23,
7295 +- 24, 178, 26, 27, 28, 29, 30, 184, 185, 33,
7296 +- 34, 186, 187, 5, 136, 123, -22, 176, 152, 74,
7297 +- 35, 146, 0, -22, -109, 0, -22, 145, -22, 6,
7298 +- 0, -22, 0, 7, 8, 9, 10, 11, 12, 13,
7299 +- 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
7300 +- 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
7301 +- 34, 0, 0, 0, 0, 0, -22, 0, 0, 0,
7302 +- 35, 0, 0, -22, 0, 138, -22, 0, -22, 7,
7303 +- 8, 9, 10, 11, 12, 13, 0, 15, 16, 17,
7304 +- 18, 19, 20, 21, 22, 23, 24, 0, 26, 27,
7305 +- 28, 29, 30, 0, 0, 33, 34, 0, 0, 0,
7306 +- 0, -87, 0, 0, 0, 0, 35, 0, 0, 0,
7307 +- 174, 0, 0, -87, 7, 8, 9, 10, 11, 12,
7308 +- 13, 0, 15, 16, 17, 18, 19, 20, 21, 22,
7309 +- 23, 24, 0, 26, 27, 28, 29, 30, 0, 0,
7310 +- 33, 34, 0, 0, 0, 0, -87, 0, 0, 0,
7311 +- 0, 35, 0, 0, 0, 179, 0, 0, -87, 7,
7312 +- 8, 9, 10, 11, 12, 13, 0, 15, 16, 17,
7313 +- 18, 19, 20, 21, 22, 23, 24, 0, 26, 27,
7314 +- 28, 29, 30, 0, 0, 33, 34, 0, 0, 0,
7315 +- 0, -87, 0, 0, 0, 0, 35, 0, 0, 0,
7316 +- 0, 0, 0, -87, 7, 8, 9, 10, 11, 12,
7317 +- 13, 0, 15, 16, 17, 18, 19, 20, 21, 22,
7318 +- 23, 24, 0, 26, 27, 28, 29, 30, 0, 0,
7319 +- 33, 34, 0, 0, 0, 0, 0, 125, 0, 0,
7320 +- 0, 126, 0, 0, 0, 0, 0, 127, 0, 66,
7321 +- 7, 8, 9, 10, 11, 12, 13, 0, 15, 16,
7322 +- 17, 18, 19, 20, 21, 22, 23, 24, 0, 26,
7323 +- 27, 28, 29, 30, 0, 0, 33, 34, 0, 0,
7324 +- 0, 0, 182, 0, 0, 0, 0, 35, 7, 8,
7325 ++ 88, 89, 38, 113, 155, 94, 73, 71, 59, 85,
7326 ++ 127, 162, 109, 145, 50, 54, 110, 75, 173, 147,
7327 ++ 98, 149, 111, 99, 66, 142, 178, 112, 51, 55,
7328 ++ 106, 163, 133, 113, 91, 113, 79, -93, 4, 97,
7329 ++ 87, 124, 88, 53, 58, 156, 60, 10, 127, 127,
7330 ++ 146, 126, -93, 66, 110, 73, 86, 20, 55, 101,
7331 ++ 111, 151, 66, 61, 159, 51, 29, 48, 49, 62,
7332 ++ 33, 107, 108, 102, 75, 152, 113, 86, 160, 63,
7333 ++ 104, 105, 90, 64, 146, 157, 158, 55, 110, 65,
7334 ++ 95, 66, 88, 124, 111, 96, 66, 156, 103, 120,
7335 ++ 88, 130, 141, 126, 112, 66, 131, 80, 132, 88,
7336 ++ 181, 7, 8, 9, 10, 11, 12, 13, 148, 15,
7337 ++ 16, 17, 18, 19, 20, 21, 22, 23, 24, 153,
7338 ++ 26, 27, 28, 29, 30, 154, 107, 33, 34, 98,
7339 ++ 161, 166, 167, 169, -22, 168, 170, 171, 35, 162,
7340 ++ 175, -22, -107, 176, -22, 179, -22, 121, 5, -22,
7341 ++ 182, 7, 8, 9, 10, 11, 12, 13, 183, 15,
7342 ++ 16, 17, 18, 19, 20, 21, 22, 23, 24, 184,
7343 ++ 26, 27, 28, 29, 30, 185, 134, 33, 34, 144,
7344 ++ 122, 174, 150, 74, -22, 0, 0, 0, 35, 143,
7345 ++ 0, -22, -108, 0, -22, 0, -22, 6, 0, -22,
7346 ++ 0, 7, 8, 9, 10, 11, 12, 13, 14, 15,
7347 ++ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
7348 ++ 26, 27, 28, 29, 30, 31, 32, 33, 34, 0,
7349 ++ 0, 0, 0, 0, -22, 0, 0, 0, 35, 0,
7350 ++ 0, -22, 0, 136, -22, 0, -22, 7, 8, 9,
7351 ++ 10, 11, 12, 13, 0, 15, 16, 17, 18, 19,
7352 ++ 20, 21, 22, 23, 24, 0, 26, 27, 28, 29,
7353 ++ 30, 0, 0, 33, 34, 0, 0, 0, 0, -86,
7354 ++ 0, 0, 0, 0, 35, 0, 0, 0, 172, 0,
7355 ++ 0, -86, 7, 8, 9, 10, 11, 12, 13, 0,
7356 ++ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
7357 ++ 0, 26, 27, 28, 29, 30, 0, 0, 33, 34,
7358 ++ 0, 0, 0, 0, -86, 0, 0, 0, 0, 35,
7359 ++ 0, 0, 0, 177, 0, 0, -86, 7, 8, 9,
7360 ++ 10, 11, 12, 13, 0, 15, 16, 17, 18, 19,
7361 ++ 20, 21, 22, 23, 24, 0, 26, 27, 28, 29,
7362 ++ 30, 0, 0, 33, 34, 0, 0, 0, 0, -86,
7363 ++ 0, 0, 0, 0, 35, 0, 0, 0, 0, 0,
7364 ++ 0, -86, 7, 8, 9, 10, 11, 12, 13, 0,
7365 ++ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
7366 ++ 0, 26, 27, 28, 29, 30, 0, 0, 33, 34,
7367 ++ 0, 0, 0, 0, 0, 124, 0, 0, 0, 125,
7368 ++ 0, 0, 0, 0, 0, 126, 0, 66, 7, 8,
7369 + 9, 10, 11, 12, 13, 0, 15, 16, 17, 18,
7370 + 19, 20, 21, 22, 23, 24, 0, 26, 27, 28,
7371 + 29, 30, 0, 0, 33, 34, 0, 0, 0, 0,
7372 +- 0, 0, 0, 0, 0, 35
7373 ++ 180, 0, 0, 0, 0, 35, 7, 8, 9, 10,
7374 ++ 11, 12, 13, 0, 15, 16, 17, 18, 19, 20,
7375 ++ 21, 22, 23, 24, 0, 26, 27, 28, 29, 30,
7376 ++ 0, 0, 33, 34, 0, 0, 0, 0, 0, 0,
7377 ++ 0, 0, 0, 35
7378 + };
7379 +
7380 +-#define yypact_value_is_default(Yystate) \
7381 +- (!!((Yystate) == (-92)))
7382 +-
7383 +-#define yytable_value_is_error(Yytable_value) \
7384 +- YYID (0)
7385 +-
7386 + static const yytype_int16 yycheck[] =
7387 + {
7388 +- 60, 60, 81, 3, 1, 8, 26, 39, 66, 88,
7389 +- 57, 38, 38, 1, 38, 18, 38, 38, 1, 0,
7390 +- 31, 42, 46, 30, 27, 52, 33, 48, 31, 50,
7391 +- 52, 78, 53, 112, 54, 114, 94, 34, 58, 65,
7392 +- 51, 38, 48, 103, 70, 42, 23, 38, 127, 128,
7393 +- 38, 48, 49, 50, 42, 38, 88, 57, 34, 42,
7394 +- 48, 52, 50, 154, 48, 48, 34, 50, 34, 38,
7395 +- 45, 162, 48, 42, 112, 38, 114, 156, 78, 48,
7396 +- 48, 50, 48, 38, 45, 46, 38, 42, 46, 47,
7397 +- 42, 45, 46, 48, 154, 50, 48, 38, 50, 127,
7398 +- 128, 52, 162, 52, 47, 45, 51, 46, 35, 1,
7399 +- 35, 171, 171, 5, 6, 7, 8, 9, 10, 11,
7400 +- 49, 13, 14, 15, 16, 17, 18, 19, 20, 21,
7401 +- 22, 49, 24, 25, 26, 27, 28, 49, 49, 31,
7402 +- 32, 45, 47, 53, 45, 30, 38, 45, 37, 49,
7403 +- 42, 47, 49, 45, 46, 49, 48, 31, 50, 1,
7404 +- 35, 53, 49, 5, 6, 7, 8, 9, 10, 11,
7405 +- 49, 13, 14, 15, 16, 17, 18, 19, 20, 21,
7406 +- 22, 49, 24, 25, 26, 27, 28, 49, 49, 31,
7407 +- 32, 49, 49, 1, 97, 83, 38, 156, 115, 50,
7408 +- 42, 110, -1, 45, 46, -1, 48, 106, 50, 1,
7409 +- -1, 53, -1, 5, 6, 7, 8, 9, 10, 11,
7410 +- 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
7411 +- 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
7412 +- 32, -1, -1, -1, -1, -1, 38, -1, -1, -1,
7413 +- 42, -1, -1, 45, -1, 1, 48, -1, 50, 5,
7414 +- 6, 7, 8, 9, 10, 11, -1, 13, 14, 15,
7415 +- 16, 17, 18, 19, 20, 21, 22, -1, 24, 25,
7416 +- 26, 27, 28, -1, -1, 31, 32, -1, -1, -1,
7417 +- -1, 37, -1, -1, -1, -1, 42, -1, -1, -1,
7418 +- 1, -1, -1, 49, 5, 6, 7, 8, 9, 10,
7419 +- 11, -1, 13, 14, 15, 16, 17, 18, 19, 20,
7420 +- 21, 22, -1, 24, 25, 26, 27, 28, -1, -1,
7421 +- 31, 32, -1, -1, -1, -1, 37, -1, -1, -1,
7422 +- -1, 42, -1, -1, -1, 1, -1, -1, 49, 5,
7423 +- 6, 7, 8, 9, 10, 11, -1, 13, 14, 15,
7424 +- 16, 17, 18, 19, 20, 21, 22, -1, 24, 25,
7425 +- 26, 27, 28, -1, -1, 31, 32, -1, -1, -1,
7426 +- -1, 37, -1, -1, -1, -1, 42, -1, -1, -1,
7427 +- -1, -1, -1, 49, 5, 6, 7, 8, 9, 10,
7428 +- 11, -1, 13, 14, 15, 16, 17, 18, 19, 20,
7429 +- 21, 22, -1, 24, 25, 26, 27, 28, -1, -1,
7430 +- 31, 32, -1, -1, -1, -1, -1, 38, -1, -1,
7431 +- -1, 42, -1, -1, -1, -1, -1, 48, -1, 50,
7432 +- 5, 6, 7, 8, 9, 10, 11, -1, 13, 14,
7433 +- 15, 16, 17, 18, 19, 20, 21, 22, -1, 24,
7434 +- 25, 26, 27, 28, -1, -1, 31, 32, -1, -1,
7435 +- -1, -1, 37, -1, -1, -1, -1, 42, 5, 6,
7436 ++ 60, 60, 3, 81, 1, 66, 39, 38, 26, 57,
7437 ++ 88, 31, 38, 1, 38, 38, 42, 38, 152, 111,
7438 ++ 30, 113, 48, 33, 50, 46, 160, 53, 52, 52,
7439 ++ 78, 51, 93, 111, 65, 113, 54, 34, 0, 70,
7440 ++ 58, 38, 102, 23, 38, 42, 48, 8, 126, 127,
7441 ++ 38, 48, 49, 50, 42, 88, 57, 18, 52, 34,
7442 ++ 48, 34, 50, 48, 34, 52, 27, 45, 46, 45,
7443 ++ 31, 45, 46, 48, 38, 48, 154, 78, 48, 38,
7444 ++ 46, 47, 38, 42, 38, 126, 127, 52, 42, 48,
7445 ++ 45, 50, 152, 38, 48, 47, 50, 42, 51, 46,
7446 ++ 160, 49, 35, 48, 53, 50, 49, 1, 49, 169,
7447 ++ 169, 5, 6, 7, 8, 9, 10, 11, 35, 13,
7448 ++ 14, 15, 16, 17, 18, 19, 20, 21, 22, 45,
7449 ++ 24, 25, 26, 27, 28, 47, 45, 31, 32, 30,
7450 ++ 45, 49, 49, 47, 38, 37, 49, 49, 42, 31,
7451 ++ 49, 45, 46, 49, 48, 35, 50, 1, 1, 53,
7452 ++ 49, 5, 6, 7, 8, 9, 10, 11, 49, 13,
7453 ++ 14, 15, 16, 17, 18, 19, 20, 21, 22, 49,
7454 ++ 24, 25, 26, 27, 28, 49, 96, 31, 32, 109,
7455 ++ 83, 154, 114, 50, 38, -1, -1, -1, 42, 105,
7456 ++ -1, 45, 46, -1, 48, -1, 50, 1, -1, 53,
7457 ++ -1, 5, 6, 7, 8, 9, 10, 11, 12, 13,
7458 ++ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
7459 ++ 24, 25, 26, 27, 28, 29, 30, 31, 32, -1,
7460 ++ -1, -1, -1, -1, 38, -1, -1, -1, 42, -1,
7461 ++ -1, 45, -1, 1, 48, -1, 50, 5, 6, 7,
7462 ++ 8, 9, 10, 11, -1, 13, 14, 15, 16, 17,
7463 ++ 18, 19, 20, 21, 22, -1, 24, 25, 26, 27,
7464 ++ 28, -1, -1, 31, 32, -1, -1, -1, -1, 37,
7465 ++ -1, -1, -1, -1, 42, -1, -1, -1, 1, -1,
7466 ++ -1, 49, 5, 6, 7, 8, 9, 10, 11, -1,
7467 ++ 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
7468 ++ -1, 24, 25, 26, 27, 28, -1, -1, 31, 32,
7469 ++ -1, -1, -1, -1, 37, -1, -1, -1, -1, 42,
7470 ++ -1, -1, -1, 1, -1, -1, 49, 5, 6, 7,
7471 ++ 8, 9, 10, 11, -1, 13, 14, 15, 16, 17,
7472 ++ 18, 19, 20, 21, 22, -1, 24, 25, 26, 27,
7473 ++ 28, -1, -1, 31, 32, -1, -1, -1, -1, 37,
7474 ++ -1, -1, -1, -1, 42, -1, -1, -1, -1, -1,
7475 ++ -1, 49, 5, 6, 7, 8, 9, 10, 11, -1,
7476 ++ 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
7477 ++ -1, 24, 25, 26, 27, 28, -1, -1, 31, 32,
7478 ++ -1, -1, -1, -1, -1, 38, -1, -1, -1, 42,
7479 ++ -1, -1, -1, -1, -1, 48, -1, 50, 5, 6,
7480 + 7, 8, 9, 10, 11, -1, 13, 14, 15, 16,
7481 + 17, 18, 19, 20, 21, 22, -1, 24, 25, 26,
7482 + 27, 28, -1, -1, 31, 32, -1, -1, -1, -1,
7483 +- -1, -1, -1, -1, -1, 42
7484 ++ 37, -1, -1, -1, -1, 42, 5, 6, 7, 8,
7485 ++ 9, 10, 11, -1, 13, 14, 15, 16, 17, 18,
7486 ++ 19, 20, 21, 22, -1, 24, 25, 26, 27, 28,
7487 ++ -1, -1, 31, 32, -1, -1, -1, -1, -1, -1,
7488 ++ -1, -1, -1, 42
7489 + };
7490 +
7491 +-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
7492 +- symbol of state STATE-NUM. */
7493 ++ /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
7494 ++ symbol of state STATE-NUM. */
7495 + static const yytype_uint8 yystos[] =
7496 + {
7497 + 0, 55, 56, 57, 0, 56, 1, 5, 6, 7,
7498 +@@ -869,42 +785,66 @@ static const yytype_uint8 yystos[] =
7499 + 48, 48, 45, 38, 42, 48, 50, 62, 63, 64,
7500 + 71, 75, 76, 67, 97, 38, 98, 99, 59, 88,
7501 + 1, 65, 89, 90, 91, 61, 65, 88, 66, 82,
7502 +- 38, 1, 75, 72, 73, 74, 45, 47, 75, 30,
7503 +- 33, 101, 34, 48, 51, 46, 47, 61, 45, 46,
7504 +- 38, 42, 48, 53, 71, 77, 78, 92, 93, 94,
7505 +- 95, 46, 1, 91, 75, 38, 42, 48, 71, 83,
7506 +- 84, 49, 49, 49, 49, 74, 64, 96, 1, 79,
7507 +- 80, 81, 82, 35, 46, 99, 95, 1, 38, 77,
7508 +- 35, 77, 96, 34, 48, 45, 47, 1, 42, 83,
7509 +- 83, 34, 48, 45, 31, 51, 86, 87, 49, 49,
7510 +- 37, 47, 49, 49, 1, 79, 94, 49, 49, 1,
7511 +- 79, 35, 37, 82, 49, 49, 49, 49
7512 ++ 38, 75, 72, 73, 74, 45, 47, 75, 30, 33,
7513 ++ 101, 34, 48, 51, 46, 47, 61, 45, 46, 38,
7514 ++ 42, 48, 53, 71, 77, 78, 92, 93, 94, 95,
7515 ++ 46, 1, 91, 75, 38, 42, 48, 71, 83, 84,
7516 ++ 49, 49, 49, 74, 64, 96, 1, 79, 80, 81,
7517 ++ 82, 35, 46, 99, 95, 1, 38, 77, 35, 77,
7518 ++ 96, 34, 48, 45, 47, 1, 42, 83, 83, 34,
7519 ++ 48, 45, 31, 51, 86, 87, 49, 49, 37, 47,
7520 ++ 49, 49, 1, 79, 94, 49, 49, 1, 79, 35,
7521 ++ 37, 82, 49, 49, 49, 49
7522 + };
7523 +
7524 +-#define yyerrok (yyerrstatus = 0)
7525 +-#define yyclearin (yychar = YYEMPTY)
7526 +-#define YYEMPTY (-2)
7527 +-#define YYEOF 0
7528 +-
7529 +-#define YYACCEPT goto yyacceptlab
7530 +-#define YYABORT goto yyabortlab
7531 +-#define YYERROR goto yyerrorlab
7532 +-
7533 +-
7534 +-/* Like YYERROR except do call yyerror. This remains here temporarily
7535 +- to ease the transition to the new meaning of YYERROR, for GCC.
7536 +- Once GCC version 2 has supplanted version 1, this can go. However,
7537 +- YYFAIL appears to be in use. Nevertheless, it is formally deprecated
7538 +- in Bison 2.4.2's NEWS entry, where a plan to phase it out is
7539 +- discussed. */
7540 +-
7541 +-#define YYFAIL goto yyerrlab
7542 +-#if defined YYFAIL
7543 +- /* This is here to suppress warnings from the GCC cpp's
7544 +- -Wunused-macros. Normally we don't worry about that warning, but
7545 +- some users do, and we want to make it easy for users to remove
7546 +- YYFAIL uses, which will produce warnings from Bison 2.5. */
7547 +-#endif
7548 ++ /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
7549 ++static const yytype_uint8 yyr1[] =
7550 ++{
7551 ++ 0, 54, 55, 55, 57, 56, 59, 58, 60, 58,
7552 ++ 58, 58, 58, 58, 58, 58, 61, 62, 62, 63,
7553 ++ 63, 64, 65, 65, 66, 66, 67, 67, 68, 68,
7554 ++ 68, 68, 68, 69, 69, 69, 69, 69, 69, 69,
7555 ++ 69, 69, 69, 69, 69, 69, 70, 70, 70, 70,
7556 ++ 70, 70, 70, 70, 70, 70, 70, 71, 72, 72,
7557 ++ 73, 73, 74, 74, 74, 74, 75, 75, 76, 76,
7558 ++ 76, 76, 76, 76, 77, 77, 78, 78, 78, 78,
7559 ++ 78, 78, 78, 79, 79, 79, 80, 80, 81, 81,
7560 ++ 82, 83, 83, 84, 84, 84, 84, 84, 84, 84,
7561 ++ 84, 85, 86, 86, 87, 88, 88, 89, 89, 90,
7562 ++ 90, 91, 91, 92, 92, 93, 93, 94, 94, 94,
7563 ++ 95, 96, 96, 97, 97, 98, 98, 99, 99, 100,
7564 ++ 101, 101, 102
7565 ++};
7566 ++
7567 ++ /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
7568 ++static const yytype_uint8 yyr2[] =
7569 ++{
7570 ++ 0, 2, 1, 2, 0, 2, 0, 4, 0, 3,
7571 ++ 1, 1, 1, 1, 2, 2, 3, 0, 1, 1,
7572 ++ 3, 4, 0, 1, 1, 2, 1, 1, 1, 1,
7573 ++ 1, 1, 1, 1, 1, 4, 1, 2, 2, 2,
7574 ++ 3, 3, 3, 2, 2, 2, 1, 1, 1, 1,
7575 ++ 1, 1, 1, 1, 1, 1, 1, 2, 0, 1,
7576 ++ 1, 2, 1, 1, 1, 1, 2, 1, 1, 1,
7577 ++ 4, 4, 2, 3, 2, 1, 1, 1, 4, 4,
7578 ++ 2, 3, 3, 2, 1, 3, 0, 1, 1, 3,
7579 ++ 2, 2, 1, 0, 1, 1, 4, 4, 2, 3,
7580 ++ 3, 3, 0, 1, 2, 3, 3, 0, 1, 1,
7581 ++ 2, 3, 2, 0, 1, 1, 3, 2, 2, 1,
7582 ++ 2, 0, 2, 3, 4, 1, 3, 1, 3, 2,
7583 ++ 0, 1, 5
7584 ++};
7585 ++
7586 ++
7587 ++#define yyerrok (yyerrstatus = 0)
7588 ++#define yyclearin (yychar = YYEMPTY)
7589 ++#define YYEMPTY (-2)
7590 ++#define YYEOF 0
7591 ++
7592 ++#define YYACCEPT goto yyacceptlab
7593 ++#define YYABORT goto yyabortlab
7594 ++#define YYERROR goto yyerrorlab
7595 ++
7596 +
7597 + #define YYRECOVERING() (!!yyerrstatus)
7598 +
7599 +@@ -921,27 +861,15 @@ do \
7600 + else \
7601 + { \
7602 + yyerror (YY_("syntax error: cannot back up")); \
7603 +- YYERROR; \
7604 +- } \
7605 +-while (YYID (0))
7606 ++ YYERROR; \
7607 ++ } \
7608 ++while (0)
7609 +
7610 + /* Error token number */
7611 +-#define YYTERROR 1
7612 +-#define YYERRCODE 256
7613 ++#define YYTERROR 1
7614 ++#define YYERRCODE 256
7615 +
7616 +
7617 +-/* This macro is provided for backward compatibility. */
7618 +-#ifndef YY_LOCATION_PRINT
7619 +-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
7620 +-#endif
7621 +-
7622 +-
7623 +-/* YYLEX -- calling `yylex' with the right arguments. */
7624 +-#ifdef YYLEX_PARAM
7625 +-# define YYLEX yylex (YYLEX_PARAM)
7626 +-#else
7627 +-# define YYLEX yylex ()
7628 +-#endif
7629 +
7630 + /* Enable debugging if requested. */
7631 + #if YYDEBUG
7632 +@@ -951,40 +879,36 @@ while (YYID (0))
7633 + # define YYFPRINTF fprintf
7634 + # endif
7635 +
7636 +-# define YYDPRINTF(Args) \
7637 +-do { \
7638 +- if (yydebug) \
7639 +- YYFPRINTF Args; \
7640 +-} while (YYID (0))
7641 ++# define YYDPRINTF(Args) \
7642 ++do { \
7643 ++ if (yydebug) \
7644 ++ YYFPRINTF Args; \
7645 ++} while (0)
7646 ++
7647 ++/* This macro is provided for backward compatibility. */
7648 ++#ifndef YY_LOCATION_PRINT
7649 ++# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
7650 ++#endif
7651 ++
7652 +
7653 +-# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
7654 +-do { \
7655 +- if (yydebug) \
7656 +- { \
7657 +- YYFPRINTF (stderr, "%s ", Title); \
7658 +- yy_symbol_print (stderr, \
7659 +- Type, Value); \
7660 +- YYFPRINTF (stderr, "\n"); \
7661 +- } \
7662 +-} while (YYID (0))
7663 ++# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
7664 ++do { \
7665 ++ if (yydebug) \
7666 ++ { \
7667 ++ YYFPRINTF (stderr, "%s ", Title); \
7668 ++ yy_symbol_print (stderr, \
7669 ++ Type, Value); \
7670 ++ YYFPRINTF (stderr, "\n"); \
7671 ++ } \
7672 ++} while (0)
7673 +
7674 +
7675 +-/*--------------------------------.
7676 +-| Print this symbol on YYOUTPUT. |
7677 +-`--------------------------------*/
7678 ++/*----------------------------------------.
7679 ++| Print this symbol's value on YYOUTPUT. |
7680 ++`----------------------------------------*/
7681 +
7682 +-/*ARGSUSED*/
7683 +-#if (defined __STDC__ || defined __C99__FUNC__ \
7684 +- || defined __cplusplus || defined _MSC_VER)
7685 + static void
7686 + yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
7687 +-#else
7688 +-static void
7689 +-yy_symbol_value_print (yyoutput, yytype, yyvaluep)
7690 +- FILE *yyoutput;
7691 +- int yytype;
7692 +- YYSTYPE const * const yyvaluep;
7693 +-#endif
7694 + {
7695 + FILE *yyo = yyoutput;
7696 + YYUSE (yyo);
7697 +@@ -993,14 +917,8 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep)
7698 + # ifdef YYPRINT
7699 + if (yytype < YYNTOKENS)
7700 + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
7701 +-# else
7702 +- YYUSE (yyoutput);
7703 + # endif
7704 +- switch (yytype)
7705 +- {
7706 +- default:
7707 +- break;
7708 +- }
7709 ++ YYUSE (yytype);
7710 + }
7711 +
7712 +
7713 +@@ -1008,22 +926,11 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep)
7714 + | Print this symbol on YYOUTPUT. |
7715 + `--------------------------------*/
7716 +
7717 +-#if (defined __STDC__ || defined __C99__FUNC__ \
7718 +- || defined __cplusplus || defined _MSC_VER)
7719 + static void
7720 + yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
7721 +-#else
7722 +-static void
7723 +-yy_symbol_print (yyoutput, yytype, yyvaluep)
7724 +- FILE *yyoutput;
7725 +- int yytype;
7726 +- YYSTYPE const * const yyvaluep;
7727 +-#endif
7728 + {
7729 +- if (yytype < YYNTOKENS)
7730 +- YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
7731 +- else
7732 +- YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
7733 ++ YYFPRINTF (yyoutput, "%s %s (",
7734 ++ yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
7735 +
7736 + yy_symbol_value_print (yyoutput, yytype, yyvaluep);
7737 + YYFPRINTF (yyoutput, ")");
7738 +@@ -1034,16 +941,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep)
7739 + | TOP (included). |
7740 + `------------------------------------------------------------------*/
7741 +
7742 +-#if (defined __STDC__ || defined __C99__FUNC__ \
7743 +- || defined __cplusplus || defined _MSC_VER)
7744 + static void
7745 + yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
7746 +-#else
7747 +-static void
7748 +-yy_stack_print (yybottom, yytop)
7749 +- yytype_int16 *yybottom;
7750 +- yytype_int16 *yytop;
7751 +-#endif
7752 + {
7753 + YYFPRINTF (stderr, "Stack now");
7754 + for (; yybottom <= yytop; yybottom++)
7755 +@@ -1054,49 +953,42 @@ yy_stack_print (yybottom, yytop)
7756 + YYFPRINTF (stderr, "\n");
7757 + }
7758 +
7759 +-# define YY_STACK_PRINT(Bottom, Top) \
7760 +-do { \
7761 +- if (yydebug) \
7762 +- yy_stack_print ((Bottom), (Top)); \
7763 +-} while (YYID (0))
7764 ++# define YY_STACK_PRINT(Bottom, Top) \
7765 ++do { \
7766 ++ if (yydebug) \
7767 ++ yy_stack_print ((Bottom), (Top)); \
7768 ++} while (0)
7769 +
7770 +
7771 + /*------------------------------------------------.
7772 + | Report that the YYRULE is going to be reduced. |
7773 + `------------------------------------------------*/
7774 +
7775 +-#if (defined __STDC__ || defined __C99__FUNC__ \
7776 +- || defined __cplusplus || defined _MSC_VER)
7777 + static void
7778 +-yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
7779 +-#else
7780 +-static void
7781 +-yy_reduce_print (yyvsp, yyrule)
7782 +- YYSTYPE *yyvsp;
7783 +- int yyrule;
7784 +-#endif
7785 ++yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
7786 + {
7787 ++ unsigned long int yylno = yyrline[yyrule];
7788 + int yynrhs = yyr2[yyrule];
7789 + int yyi;
7790 +- unsigned long int yylno = yyrline[yyrule];
7791 + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
7792 +- yyrule - 1, yylno);
7793 ++ yyrule - 1, yylno);
7794 + /* The symbols being reduced. */
7795 + for (yyi = 0; yyi < yynrhs; yyi++)
7796 + {
7797 + YYFPRINTF (stderr, " $%d = ", yyi + 1);
7798 +- yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
7799 +- &(yyvsp[(yyi + 1) - (yynrhs)])
7800 +- );
7801 ++ yy_symbol_print (stderr,
7802 ++ yystos[yyssp[yyi + 1 - yynrhs]],
7803 ++ &(yyvsp[(yyi + 1) - (yynrhs)])
7804 ++ );
7805 + YYFPRINTF (stderr, "\n");
7806 + }
7807 + }
7808 +
7809 +-# define YY_REDUCE_PRINT(Rule) \
7810 +-do { \
7811 +- if (yydebug) \
7812 +- yy_reduce_print (yyvsp, Rule); \
7813 +-} while (YYID (0))
7814 ++# define YY_REDUCE_PRINT(Rule) \
7815 ++do { \
7816 ++ if (yydebug) \
7817 ++ yy_reduce_print (yyssp, yyvsp, Rule); \
7818 ++} while (0)
7819 +
7820 + /* Nonzero means print parse trace. It is left uninitialized so that
7821 + multiple parsers can coexist. */
7822 +@@ -1110,7 +1002,7 @@ int yydebug;
7823 +
7824 +
7825 + /* YYINITDEPTH -- initial size of the parser's stacks. */
7826 +-#ifndef YYINITDEPTH
7827 ++#ifndef YYINITDEPTH
7828 + # define YYINITDEPTH 200
7829 + #endif
7830 +
7831 +@@ -1133,15 +1025,8 @@ int yydebug;
7832 + # define yystrlen strlen
7833 + # else
7834 + /* Return the length of YYSTR. */
7835 +-#if (defined __STDC__ || defined __C99__FUNC__ \
7836 +- || defined __cplusplus || defined _MSC_VER)
7837 + static YYSIZE_T
7838 + yystrlen (const char *yystr)
7839 +-#else
7840 +-static YYSIZE_T
7841 +-yystrlen (yystr)
7842 +- const char *yystr;
7843 +-#endif
7844 + {
7845 + YYSIZE_T yylen;
7846 + for (yylen = 0; yystr[yylen]; yylen++)
7847 +@@ -1157,16 +1042,8 @@ yystrlen (yystr)
7848 + # else
7849 + /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
7850 + YYDEST. */
7851 +-#if (defined __STDC__ || defined __C99__FUNC__ \
7852 +- || defined __cplusplus || defined _MSC_VER)
7853 + static char *
7854 + yystpcpy (char *yydest, const char *yysrc)
7855 +-#else
7856 +-static char *
7857 +-yystpcpy (yydest, yysrc)
7858 +- char *yydest;
7859 +- const char *yysrc;
7860 +-#endif
7861 + {
7862 + char *yyd = yydest;
7863 + const char *yys = yysrc;
7864 +@@ -1196,27 +1073,27 @@ yytnamerr (char *yyres, const char *yystr)
7865 + char const *yyp = yystr;
7866 +
7867 + for (;;)
7868 +- switch (*++yyp)
7869 +- {
7870 +- case '\'':
7871 +- case ',':
7872 +- goto do_not_strip_quotes;
7873 +-
7874 +- case '\\':
7875 +- if (*++yyp != '\\')
7876 +- goto do_not_strip_quotes;
7877 +- /* Fall through. */
7878 +- default:
7879 +- if (yyres)
7880 +- yyres[yyn] = *yyp;
7881 +- yyn++;
7882 +- break;
7883 +-
7884 +- case '"':
7885 +- if (yyres)
7886 +- yyres[yyn] = '\0';
7887 +- return yyn;
7888 +- }
7889 ++ switch (*++yyp)
7890 ++ {
7891 ++ case '\'':
7892 ++ case ',':
7893 ++ goto do_not_strip_quotes;
7894 ++
7895 ++ case '\\':
7896 ++ if (*++yyp != '\\')
7897 ++ goto do_not_strip_quotes;
7898 ++ /* Fall through. */
7899 ++ default:
7900 ++ if (yyres)
7901 ++ yyres[yyn] = *yyp;
7902 ++ yyn++;
7903 ++ break;
7904 ++
7905 ++ case '"':
7906 ++ if (yyres)
7907 ++ yyres[yyn] = '\0';
7908 ++ return yyn;
7909 ++ }
7910 + do_not_strip_quotes: ;
7911 + }
7912 +
7913 +@@ -1239,11 +1116,11 @@ static int
7914 + yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
7915 + yytype_int16 *yyssp, int yytoken)
7916 + {
7917 +- YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
7918 ++ YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
7919 + YYSIZE_T yysize = yysize0;
7920 + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
7921 + /* Internationalized format string. */
7922 +- const char *yyformat = YY_NULL;
7923 ++ const char *yyformat = YY_NULLPTR;
7924 + /* Arguments of yyformat. */
7925 + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
7926 + /* Number of reported tokens (one for the "unexpected", one per
7927 +@@ -1251,10 +1128,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
7928 + int yycount = 0;
7929 +
7930 + /* There are many possibilities here to consider:
7931 +- - Assume YYFAIL is not used. It's too flawed to consider. See
7932 +- <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
7933 +- for details. YYERROR is fine as it does not invoke this
7934 +- function.
7935 + - If this state is a consistent state with a default action, then
7936 + the only way this function was invoked is if the default action
7937 + is an error action. In that case, don't check for expected
7938 +@@ -1304,7 +1177,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
7939 + }
7940 + yyarg[yycount++] = yytname[yyx];
7941 + {
7942 +- YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
7943 ++ YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
7944 + if (! (yysize <= yysize1
7945 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
7946 + return 2;
7947 +@@ -1371,31 +1244,17 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
7948 + | Release the memory associated to this symbol. |
7949 + `-----------------------------------------------*/
7950 +
7951 +-/*ARGSUSED*/
7952 +-#if (defined __STDC__ || defined __C99__FUNC__ \
7953 +- || defined __cplusplus || defined _MSC_VER)
7954 + static void
7955 + yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
7956 +-#else
7957 +-static void
7958 +-yydestruct (yymsg, yytype, yyvaluep)
7959 +- const char *yymsg;
7960 +- int yytype;
7961 +- YYSTYPE *yyvaluep;
7962 +-#endif
7963 + {
7964 + YYUSE (yyvaluep);
7965 +-
7966 + if (!yymsg)
7967 + yymsg = "Deleting";
7968 + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
7969 +
7970 +- switch (yytype)
7971 +- {
7972 +-
7973 +- default:
7974 +- break;
7975 +- }
7976 ++ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
7977 ++ YYUSE (yytype);
7978 ++ YY_IGNORE_MAYBE_UNINITIALIZED_END
7979 + }
7980 +
7981 +
7982 +@@ -1404,18 +1263,8 @@ yydestruct (yymsg, yytype, yyvaluep)
7983 + /* The lookahead symbol. */
7984 + int yychar;
7985 +
7986 +-
7987 +-#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
7988 +-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
7989 +-# define YY_IGNORE_MAYBE_UNINITIALIZED_END
7990 +-#endif
7991 +-#ifndef YY_INITIAL_VALUE
7992 +-# define YY_INITIAL_VALUE(Value) /* Nothing. */
7993 +-#endif
7994 +-
7995 + /* The semantic value of the lookahead symbol. */
7996 +-YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
7997 +-
7998 ++YYSTYPE yylval;
7999 + /* Number of syntax errors so far. */
8000 + int yynerrs;
8001 +
8002 +@@ -1424,35 +1273,16 @@ int yynerrs;
8003 + | yyparse. |
8004 + `----------*/
8005 +
8006 +-#ifdef YYPARSE_PARAM
8007 +-#if (defined __STDC__ || defined __C99__FUNC__ \
8008 +- || defined __cplusplus || defined _MSC_VER)
8009 +-int
8010 +-yyparse (void *YYPARSE_PARAM)
8011 +-#else
8012 +-int
8013 +-yyparse (YYPARSE_PARAM)
8014 +- void *YYPARSE_PARAM;
8015 +-#endif
8016 +-#else /* ! YYPARSE_PARAM */
8017 +-#if (defined __STDC__ || defined __C99__FUNC__ \
8018 +- || defined __cplusplus || defined _MSC_VER)
8019 + int
8020 + yyparse (void)
8021 +-#else
8022 +-int
8023 +-yyparse ()
8024 +-
8025 +-#endif
8026 +-#endif
8027 + {
8028 + int yystate;
8029 + /* Number of tokens to shift before error messages enabled. */
8030 + int yyerrstatus;
8031 +
8032 + /* The stacks and their tools:
8033 +- `yyss': related to states.
8034 +- `yyvs': related to semantic values.
8035 ++ 'yyss': related to states.
8036 ++ 'yyvs': related to semantic values.
8037 +
8038 + Refer to the stacks through separate pointers, to allow yyoverflow
8039 + to reallocate them elsewhere. */
8040 +@@ -1520,23 +1350,23 @@ yyparse ()
8041 +
8042 + #ifdef yyoverflow
8043 + {
8044 +- /* Give user a chance to reallocate the stack. Use copies of
8045 +- these so that the &'s don't force the real ones into
8046 +- memory. */
8047 +- YYSTYPE *yyvs1 = yyvs;
8048 +- yytype_int16 *yyss1 = yyss;
8049 +-
8050 +- /* Each stack pointer address is followed by the size of the
8051 +- data in use in that stack, in bytes. This used to be a
8052 +- conditional around just the two extra args, but that might
8053 +- be undefined if yyoverflow is a macro. */
8054 +- yyoverflow (YY_("memory exhausted"),
8055 +- &yyss1, yysize * sizeof (*yyssp),
8056 +- &yyvs1, yysize * sizeof (*yyvsp),
8057 +- &yystacksize);
8058 +-
8059 +- yyss = yyss1;
8060 +- yyvs = yyvs1;
8061 ++ /* Give user a chance to reallocate the stack. Use copies of
8062 ++ these so that the &'s don't force the real ones into
8063 ++ memory. */
8064 ++ YYSTYPE *yyvs1 = yyvs;
8065 ++ yytype_int16 *yyss1 = yyss;
8066 ++
8067 ++ /* Each stack pointer address is followed by the size of the
8068 ++ data in use in that stack, in bytes. This used to be a
8069 ++ conditional around just the two extra args, but that might
8070 ++ be undefined if yyoverflow is a macro. */
8071 ++ yyoverflow (YY_("memory exhausted"),
8072 ++ &yyss1, yysize * sizeof (*yyssp),
8073 ++ &yyvs1, yysize * sizeof (*yyvsp),
8074 ++ &yystacksize);
8075 ++
8076 ++ yyss = yyss1;
8077 ++ yyvs = yyvs1;
8078 + }
8079 + #else /* no yyoverflow */
8080 + # ifndef YYSTACK_RELOCATE
8081 +@@ -1544,22 +1374,22 @@ yyparse ()
8082 + # else
8083 + /* Extend the stack our own way. */
8084 + if (YYMAXDEPTH <= yystacksize)
8085 +- goto yyexhaustedlab;
8086 ++ goto yyexhaustedlab;
8087 + yystacksize *= 2;
8088 + if (YYMAXDEPTH < yystacksize)
8089 +- yystacksize = YYMAXDEPTH;
8090 ++ yystacksize = YYMAXDEPTH;
8091 +
8092 + {
8093 +- yytype_int16 *yyss1 = yyss;
8094 +- union yyalloc *yyptr =
8095 +- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
8096 +- if (! yyptr)
8097 +- goto yyexhaustedlab;
8098 +- YYSTACK_RELOCATE (yyss_alloc, yyss);
8099 +- YYSTACK_RELOCATE (yyvs_alloc, yyvs);
8100 ++ yytype_int16 *yyss1 = yyss;
8101 ++ union yyalloc *yyptr =
8102 ++ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
8103 ++ if (! yyptr)
8104 ++ goto yyexhaustedlab;
8105 ++ YYSTACK_RELOCATE (yyss_alloc, yyss);
8106 ++ YYSTACK_RELOCATE (yyvs_alloc, yyvs);
8107 + # undef YYSTACK_RELOCATE
8108 +- if (yyss1 != yyssa)
8109 +- YYSTACK_FREE (yyss1);
8110 ++ if (yyss1 != yyssa)
8111 ++ YYSTACK_FREE (yyss1);
8112 + }
8113 + # endif
8114 + #endif /* no yyoverflow */
8115 +@@ -1568,10 +1398,10 @@ yyparse ()
8116 + yyvsp = yyvs + yysize - 1;
8117 +
8118 + YYDPRINTF ((stderr, "Stack size increased to %lu\n",
8119 +- (unsigned long int) yystacksize));
8120 ++ (unsigned long int) yystacksize));
8121 +
8122 + if (yyss + yystacksize - 1 <= yyssp)
8123 +- YYABORT;
8124 ++ YYABORT;
8125 + }
8126 +
8127 + YYDPRINTF ((stderr, "Entering state %d\n", yystate));
8128 +@@ -1600,7 +1430,7 @@ yybackup:
8129 + if (yychar == YYEMPTY)
8130 + {
8131 + YYDPRINTF ((stderr, "Reading a token: "));
8132 +- yychar = YYLEX;
8133 ++ yychar = yylex ();
8134 + }
8135 +
8136 + if (yychar <= YYEOF)
8137 +@@ -1665,7 +1495,7 @@ yyreduce:
8138 + yylen = yyr2[yyn];
8139 +
8140 + /* If YYLEN is nonzero, implement the default value of the action:
8141 +- `$$ = $1'.
8142 ++ '$$ = $1'.
8143 +
8144 + Otherwise, the following line sets YYVAL to garbage.
8145 + This behavior is undocumented and Bison
8146 +@@ -1679,483 +1509,560 @@ yyreduce:
8147 + switch (yyn)
8148 + {
8149 + case 4:
8150 +-
8151 ++#line 129 "parse.y" /* yacc.c:1646 */
8152 + { is_typedef = 0; is_extern = 0; current_name = NULL; decl_spec = NULL; }
8153 ++#line 1515 "parse.tab.c" /* yacc.c:1646 */
8154 + break;
8155 +
8156 + case 5:
8157 +-
8158 +- { free_list(*(yyvsp[(2) - (2)]), NULL); *(yyvsp[(2) - (2)]) = NULL; }
8159 ++#line 131 "parse.y" /* yacc.c:1646 */
8160 ++ { free_list(*(yyvsp[0]), NULL); *(yyvsp[0]) = NULL; }
8161 ++#line 1521 "parse.tab.c" /* yacc.c:1646 */
8162 + break;
8163 +
8164 + case 6:
8165 +-
8166 ++#line 135 "parse.y" /* yacc.c:1646 */
8167 + { is_typedef = 1; }
8168 ++#line 1527 "parse.tab.c" /* yacc.c:1646 */
8169 + break;
8170 +
8171 + case 7:
8172 +-
8173 +- { (yyval) = (yyvsp[(4) - (4)]); }
8174 ++#line 136 "parse.y" /* yacc.c:1646 */
8175 ++ { (yyval) = (yyvsp[0]); }
8176 ++#line 1533 "parse.tab.c" /* yacc.c:1646 */
8177 + break;
8178 +
8179 + case 8:
8180 +-
8181 ++#line 137 "parse.y" /* yacc.c:1646 */
8182 + { is_typedef = 1; }
8183 ++#line 1539 "parse.tab.c" /* yacc.c:1646 */
8184 + break;
8185 +
8186 + case 9:
8187 +-
8188 +- { (yyval) = (yyvsp[(3) - (3)]); }
8189 ++#line 138 "parse.y" /* yacc.c:1646 */
8190 ++ { (yyval) = (yyvsp[0]); }
8191 ++#line 1545 "parse.tab.c" /* yacc.c:1646 */
8192 + break;
8193 +
8194 + case 14:
8195 +-
8196 +- { (yyval) = (yyvsp[(2) - (2)]); }
8197 ++#line 143 "parse.y" /* yacc.c:1646 */
8198 ++ { (yyval) = (yyvsp[0]); }
8199 ++#line 1551 "parse.tab.c" /* yacc.c:1646 */
8200 + break;
8201 +
8202 + case 15:
8203 +-
8204 +- { (yyval) = (yyvsp[(2) - (2)]); }
8205 ++#line 144 "parse.y" /* yacc.c:1646 */
8206 ++ { (yyval) = (yyvsp[0]); }
8207 ++#line 1557 "parse.tab.c" /* yacc.c:1646 */
8208 + break;
8209 +
8210 + case 16:
8211 +-
8212 ++#line 149 "parse.y" /* yacc.c:1646 */
8213 + { if (current_name) {
8214 +- struct string_list *decl = (*(yyvsp[(3) - (3)]))->next;
8215 +- (*(yyvsp[(3) - (3)]))->next = NULL;
8216 ++ struct string_list *decl = (*(yyvsp[0]))->next;
8217 ++ (*(yyvsp[0]))->next = NULL;
8218 + add_symbol(current_name,
8219 + is_typedef ? SYM_TYPEDEF : SYM_NORMAL,
8220 + decl, is_extern);
8221 + current_name = NULL;
8222 + }
8223 +- (yyval) = (yyvsp[(3) - (3)]);
8224 ++ (yyval) = (yyvsp[0]);
8225 + }
8226 ++#line 1572 "parse.tab.c" /* yacc.c:1646 */
8227 + break;
8228 +
8229 + case 17:
8230 +-
8231 ++#line 162 "parse.y" /* yacc.c:1646 */
8232 + { (yyval) = NULL; }
8233 ++#line 1578 "parse.tab.c" /* yacc.c:1646 */
8234 + break;
8235 +
8236 + case 19:
8237 +-
8238 +- { struct string_list *decl = *(yyvsp[(1) - (1)]);
8239 +- *(yyvsp[(1) - (1)]) = NULL;
8240 ++#line 168 "parse.y" /* yacc.c:1646 */
8241 ++ { struct string_list *decl = *(yyvsp[0]);
8242 ++ *(yyvsp[0]) = NULL;
8243 + add_symbol(current_name,
8244 + is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern);
8245 + current_name = NULL;
8246 +- (yyval) = (yyvsp[(1) - (1)]);
8247 ++ (yyval) = (yyvsp[0]);
8248 + }
8249 ++#line 1590 "parse.tab.c" /* yacc.c:1646 */
8250 + break;
8251 +
8252 + case 20:
8253 +-
8254 +- { struct string_list *decl = *(yyvsp[(3) - (3)]);
8255 +- *(yyvsp[(3) - (3)]) = NULL;
8256 +- free_list(*(yyvsp[(2) - (3)]), NULL);
8257 +- *(yyvsp[(2) - (3)]) = decl_spec;
8258 ++#line 176 "parse.y" /* yacc.c:1646 */
8259 ++ { struct string_list *decl = *(yyvsp[0]);
8260 ++ *(yyvsp[0]) = NULL;
8261 ++ free_list(*(yyvsp[-1]), NULL);
8262 ++ *(yyvsp[-1]) = decl_spec;
8263 + add_symbol(current_name,
8264 + is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern);
8265 + current_name = NULL;
8266 +- (yyval) = (yyvsp[(3) - (3)]);
8267 ++ (yyval) = (yyvsp[0]);
8268 + }
8269 ++#line 1604 "parse.tab.c" /* yacc.c:1646 */
8270 + break;
8271 +
8272 + case 21:
8273 +-
8274 +- { (yyval) = (yyvsp[(4) - (4)]) ? (yyvsp[(4) - (4)]) : (yyvsp[(3) - (4)]) ? (yyvsp[(3) - (4)]) : (yyvsp[(2) - (4)]) ? (yyvsp[(2) - (4)]) : (yyvsp[(1) - (4)]); }
8275 ++#line 189 "parse.y" /* yacc.c:1646 */
8276 ++ { (yyval) = (yyvsp[0]) ? (yyvsp[0]) : (yyvsp[-1]) ? (yyvsp[-1]) : (yyvsp[-2]) ? (yyvsp[-2]) : (yyvsp[-3]); }
8277 ++#line 1610 "parse.tab.c" /* yacc.c:1646 */
8278 + break;
8279 +
8280 + case 22:
8281 +-
8282 ++#line 194 "parse.y" /* yacc.c:1646 */
8283 + { decl_spec = NULL; }
8284 ++#line 1616 "parse.tab.c" /* yacc.c:1646 */
8285 + break;
8286 +
8287 + case 24:
8288 +-
8289 +- { decl_spec = *(yyvsp[(1) - (1)]); }
8290 ++#line 199 "parse.y" /* yacc.c:1646 */
8291 ++ { decl_spec = *(yyvsp[0]); }
8292 ++#line 1622 "parse.tab.c" /* yacc.c:1646 */
8293 + break;
8294 +
8295 + case 25:
8296 +-
8297 +- { decl_spec = *(yyvsp[(2) - (2)]); }
8298 ++#line 200 "parse.y" /* yacc.c:1646 */
8299 ++ { decl_spec = *(yyvsp[0]); }
8300 ++#line 1628 "parse.tab.c" /* yacc.c:1646 */
8301 + break;
8302 +
8303 + case 26:
8304 +-
8305 ++#line 205 "parse.y" /* yacc.c:1646 */
8306 + { /* Version 2 checksumming ignores storage class, as that
8307 + is really irrelevant to the linkage. */
8308 +- remove_node((yyvsp[(1) - (1)]));
8309 +- (yyval) = (yyvsp[(1) - (1)]);
8310 ++ remove_node((yyvsp[0]));
8311 ++ (yyval) = (yyvsp[0]);
8312 + }
8313 ++#line 1638 "parse.tab.c" /* yacc.c:1646 */
8314 + break;
8315 +
8316 + case 31:
8317 +-
8318 +- { is_extern = 1; (yyval) = (yyvsp[(1) - (1)]); }
8319 ++#line 217 "parse.y" /* yacc.c:1646 */
8320 ++ { is_extern = 1; (yyval) = (yyvsp[0]); }
8321 ++#line 1644 "parse.tab.c" /* yacc.c:1646 */
8322 + break;
8323 +
8324 + case 32:
8325 +-
8326 +- { is_extern = 0; (yyval) = (yyvsp[(1) - (1)]); }
8327 ++#line 218 "parse.y" /* yacc.c:1646 */
8328 ++ { is_extern = 0; (yyval) = (yyvsp[0]); }
8329 ++#line 1650 "parse.tab.c" /* yacc.c:1646 */
8330 + break;
8331 +
8332 + case 37:
8333 +-
8334 +- { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_STRUCT; (yyval) = (yyvsp[(2) - (2)]); }
8335 ++#line 230 "parse.y" /* yacc.c:1646 */
8336 ++ { remove_node((yyvsp[-1])); (*(yyvsp[0]))->tag = SYM_STRUCT; (yyval) = (yyvsp[0]); }
8337 ++#line 1656 "parse.tab.c" /* yacc.c:1646 */
8338 + break;
8339 +
8340 + case 38:
8341 +-
8342 +- { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_UNION; (yyval) = (yyvsp[(2) - (2)]); }
8343 ++#line 232 "parse.y" /* yacc.c:1646 */
8344 ++ { remove_node((yyvsp[-1])); (*(yyvsp[0]))->tag = SYM_UNION; (yyval) = (yyvsp[0]); }
8345 ++#line 1662 "parse.tab.c" /* yacc.c:1646 */
8346 + break;
8347 +
8348 + case 39:
8349 +-
8350 +- { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_ENUM; (yyval) = (yyvsp[(2) - (2)]); }
8351 ++#line 234 "parse.y" /* yacc.c:1646 */
8352 ++ { remove_node((yyvsp[-1])); (*(yyvsp[0]))->tag = SYM_ENUM; (yyval) = (yyvsp[0]); }
8353 ++#line 1668 "parse.tab.c" /* yacc.c:1646 */
8354 + break;
8355 +
8356 + case 40:
8357 +-
8358 +- { record_compound((yyvsp[(1) - (3)]), (yyvsp[(2) - (3)]), (yyvsp[(3) - (3)]), SYM_STRUCT); (yyval) = (yyvsp[(3) - (3)]); }
8359 ++#line 238 "parse.y" /* yacc.c:1646 */
8360 ++ { record_compound((yyvsp[-2]), (yyvsp[-1]), (yyvsp[0]), SYM_STRUCT); (yyval) = (yyvsp[0]); }
8361 ++#line 1674 "parse.tab.c" /* yacc.c:1646 */
8362 + break;
8363 +
8364 + case 41:
8365 +-
8366 +- { record_compound((yyvsp[(1) - (3)]), (yyvsp[(2) - (3)]), (yyvsp[(3) - (3)]), SYM_UNION); (yyval) = (yyvsp[(3) - (3)]); }
8367 ++#line 240 "parse.y" /* yacc.c:1646 */
8368 ++ { record_compound((yyvsp[-2]), (yyvsp[-1]), (yyvsp[0]), SYM_UNION); (yyval) = (yyvsp[0]); }
8369 ++#line 1680 "parse.tab.c" /* yacc.c:1646 */
8370 + break;
8371 +
8372 + case 42:
8373 +-
8374 +- { record_compound((yyvsp[(1) - (3)]), (yyvsp[(2) - (3)]), (yyvsp[(3) - (3)]), SYM_ENUM); (yyval) = (yyvsp[(3) - (3)]); }
8375 ++#line 242 "parse.y" /* yacc.c:1646 */
8376 ++ { record_compound((yyvsp[-2]), (yyvsp[-1]), (yyvsp[0]), SYM_ENUM); (yyval) = (yyvsp[0]); }
8377 ++#line 1686 "parse.tab.c" /* yacc.c:1646 */
8378 + break;
8379 +
8380 + case 43:
8381 +-
8382 +- { add_symbol(NULL, SYM_ENUM, NULL, 0); (yyval) = (yyvsp[(2) - (2)]); }
8383 ++#line 247 "parse.y" /* yacc.c:1646 */
8384 ++ { add_symbol(NULL, SYM_ENUM, NULL, 0); (yyval) = (yyvsp[0]); }
8385 ++#line 1692 "parse.tab.c" /* yacc.c:1646 */
8386 + break;
8387 +
8388 + case 44:
8389 +-
8390 +- { (yyval) = (yyvsp[(2) - (2)]); }
8391 ++#line 249 "parse.y" /* yacc.c:1646 */
8392 ++ { (yyval) = (yyvsp[0]); }
8393 ++#line 1698 "parse.tab.c" /* yacc.c:1646 */
8394 + break;
8395 +
8396 + case 45:
8397 +-
8398 +- { (yyval) = (yyvsp[(2) - (2)]); }
8399 ++#line 250 "parse.y" /* yacc.c:1646 */
8400 ++ { (yyval) = (yyvsp[0]); }
8401 ++#line 1704 "parse.tab.c" /* yacc.c:1646 */
8402 + break;
8403 +
8404 + case 56:
8405 +-
8406 +- { (*(yyvsp[(1) - (1)]))->tag = SYM_TYPEDEF; (yyval) = (yyvsp[(1) - (1)]); }
8407 ++#line 264 "parse.y" /* yacc.c:1646 */
8408 ++ { (*(yyvsp[0]))->tag = SYM_TYPEDEF; (yyval) = (yyvsp[0]); }
8409 ++#line 1710 "parse.tab.c" /* yacc.c:1646 */
8410 + break;
8411 +
8412 + case 57:
8413 +-
8414 +- { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); }
8415 ++#line 269 "parse.y" /* yacc.c:1646 */
8416 ++ { (yyval) = (yyvsp[0]) ? (yyvsp[0]) : (yyvsp[-1]); }
8417 ++#line 1716 "parse.tab.c" /* yacc.c:1646 */
8418 + break;
8419 +
8420 + case 58:
8421 +-
8422 ++#line 273 "parse.y" /* yacc.c:1646 */
8423 + { (yyval) = NULL; }
8424 ++#line 1722 "parse.tab.c" /* yacc.c:1646 */
8425 + break;
8426 +
8427 + case 61:
8428 +-
8429 +- { (yyval) = (yyvsp[(2) - (2)]); }
8430 ++#line 279 "parse.y" /* yacc.c:1646 */
8431 ++ { (yyval) = (yyvsp[0]); }
8432 ++#line 1728 "parse.tab.c" /* yacc.c:1646 */
8433 + break;
8434 +
8435 + case 65:
8436 +-
8437 ++#line 285 "parse.y" /* yacc.c:1646 */
8438 + { /* restrict has no effect in prototypes so ignore it */
8439 +- remove_node((yyvsp[(1) - (1)]));
8440 +- (yyval) = (yyvsp[(1) - (1)]);
8441 ++ remove_node((yyvsp[0]));
8442 ++ (yyval) = (yyvsp[0]);
8443 + }
8444 ++#line 1737 "parse.tab.c" /* yacc.c:1646 */
8445 + break;
8446 +
8447 + case 66:
8448 +-
8449 +- { (yyval) = (yyvsp[(2) - (2)]); }
8450 ++#line 292 "parse.y" /* yacc.c:1646 */
8451 ++ { (yyval) = (yyvsp[0]); }
8452 ++#line 1743 "parse.tab.c" /* yacc.c:1646 */
8453 + break;
8454 +
8455 + case 68:
8456 +-
8457 ++#line 298 "parse.y" /* yacc.c:1646 */
8458 + { if (current_name != NULL) {
8459 + error_with_pos("unexpected second declaration name");
8460 + YYERROR;
8461 + } else {
8462 +- current_name = (*(yyvsp[(1) - (1)]))->string;
8463 +- (yyval) = (yyvsp[(1) - (1)]);
8464 ++ current_name = (*(yyvsp[0]))->string;
8465 ++ (yyval) = (yyvsp[0]);
8466 + }
8467 + }
8468 ++#line 1756 "parse.tab.c" /* yacc.c:1646 */
8469 + break;
8470 +
8471 + case 69:
8472 +-
8473 ++#line 307 "parse.y" /* yacc.c:1646 */
8474 + { if (current_name != NULL) {
8475 + error_with_pos("unexpected second declaration name");
8476 + YYERROR;
8477 + } else {
8478 +- current_name = (*(yyvsp[(1) - (1)]))->string;
8479 +- (yyval) = (yyvsp[(1) - (1)]);
8480 ++ current_name = (*(yyvsp[0]))->string;
8481 ++ (yyval) = (yyvsp[0]);
8482 + }
8483 + }
8484 ++#line 1769 "parse.tab.c" /* yacc.c:1646 */
8485 + break;
8486 +
8487 + case 70:
8488 +-
8489 +- { (yyval) = (yyvsp[(4) - (4)]); }
8490 ++#line 316 "parse.y" /* yacc.c:1646 */
8491 ++ { (yyval) = (yyvsp[0]); }
8492 ++#line 1775 "parse.tab.c" /* yacc.c:1646 */
8493 + break;
8494 +
8495 + case 71:
8496 +-
8497 +- { (yyval) = (yyvsp[(4) - (4)]); }
8498 ++#line 318 "parse.y" /* yacc.c:1646 */
8499 ++ { (yyval) = (yyvsp[0]); }
8500 ++#line 1781 "parse.tab.c" /* yacc.c:1646 */
8501 + break;
8502 +
8503 + case 72:
8504 +-
8505 +- { (yyval) = (yyvsp[(2) - (2)]); }
8506 ++#line 320 "parse.y" /* yacc.c:1646 */
8507 ++ { (yyval) = (yyvsp[0]); }
8508 ++#line 1787 "parse.tab.c" /* yacc.c:1646 */
8509 + break;
8510 +
8511 + case 73:
8512 +-
8513 +- { (yyval) = (yyvsp[(3) - (3)]); }
8514 ++#line 322 "parse.y" /* yacc.c:1646 */
8515 ++ { (yyval) = (yyvsp[0]); }
8516 ++#line 1793 "parse.tab.c" /* yacc.c:1646 */
8517 + break;
8518 +
8519 + case 74:
8520 +-
8521 +- { (yyval) = (yyvsp[(3) - (3)]); }
8522 ++#line 328 "parse.y" /* yacc.c:1646 */
8523 ++ { (yyval) = (yyvsp[0]); }
8524 ++#line 1799 "parse.tab.c" /* yacc.c:1646 */
8525 + break;
8526 +
8527 +- case 75:
8528 +-
8529 +- { (yyval) = (yyvsp[(2) - (2)]); }
8530 ++ case 78:
8531 ++#line 336 "parse.y" /* yacc.c:1646 */
8532 ++ { (yyval) = (yyvsp[0]); }
8533 ++#line 1805 "parse.tab.c" /* yacc.c:1646 */
8534 + break;
8535 +
8536 + case 79:
8537 +-
8538 +- { (yyval) = (yyvsp[(4) - (4)]); }
8539 ++#line 338 "parse.y" /* yacc.c:1646 */
8540 ++ { (yyval) = (yyvsp[0]); }
8541 ++#line 1811 "parse.tab.c" /* yacc.c:1646 */
8542 + break;
8543 +
8544 + case 80:
8545 +-
8546 +- { (yyval) = (yyvsp[(4) - (4)]); }
8547 ++#line 340 "parse.y" /* yacc.c:1646 */
8548 ++ { (yyval) = (yyvsp[0]); }
8549 ++#line 1817 "parse.tab.c" /* yacc.c:1646 */
8550 + break;
8551 +
8552 + case 81:
8553 +-
8554 +- { (yyval) = (yyvsp[(2) - (2)]); }
8555 ++#line 342 "parse.y" /* yacc.c:1646 */
8556 ++ { (yyval) = (yyvsp[0]); }
8557 ++#line 1823 "parse.tab.c" /* yacc.c:1646 */
8558 + break;
8559 +
8560 + case 82:
8561 +-
8562 +- { (yyval) = (yyvsp[(3) - (3)]); }
8563 ++#line 344 "parse.y" /* yacc.c:1646 */
8564 ++ { (yyval) = (yyvsp[0]); }
8565 ++#line 1829 "parse.tab.c" /* yacc.c:1646 */
8566 + break;
8567 +
8568 + case 83:
8569 +-
8570 +- { (yyval) = (yyvsp[(3) - (3)]); }
8571 ++#line 348 "parse.y" /* yacc.c:1646 */
8572 ++ { (yyval) = (yyvsp[0]); }
8573 ++#line 1835 "parse.tab.c" /* yacc.c:1646 */
8574 + break;
8575 +
8576 +- case 84:
8577 +-
8578 +- { (yyval) = (yyvsp[(2) - (2)]); }
8579 ++ case 85:
8580 ++#line 350 "parse.y" /* yacc.c:1646 */
8581 ++ { (yyval) = (yyvsp[0]); }
8582 ++#line 1841 "parse.tab.c" /* yacc.c:1646 */
8583 + break;
8584 +
8585 + case 86:
8586 +-
8587 +- { (yyval) = (yyvsp[(3) - (3)]); }
8588 ++#line 354 "parse.y" /* yacc.c:1646 */
8589 ++ { (yyval) = NULL; }
8590 ++#line 1847 "parse.tab.c" /* yacc.c:1646 */
8591 + break;
8592 +
8593 +- case 87:
8594 +-
8595 +- { (yyval) = NULL; }
8596 ++ case 89:
8597 ++#line 361 "parse.y" /* yacc.c:1646 */
8598 ++ { (yyval) = (yyvsp[0]); }
8599 ++#line 1853 "parse.tab.c" /* yacc.c:1646 */
8600 + break;
8601 +
8602 + case 90:
8603 +-
8604 +- { (yyval) = (yyvsp[(3) - (3)]); }
8605 ++#line 366 "parse.y" /* yacc.c:1646 */
8606 ++ { (yyval) = (yyvsp[0]) ? (yyvsp[0]) : (yyvsp[-1]); }
8607 ++#line 1859 "parse.tab.c" /* yacc.c:1646 */
8608 + break;
8609 +
8610 + case 91:
8611 +-
8612 +- { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); }
8613 ++#line 371 "parse.y" /* yacc.c:1646 */
8614 ++ { (yyval) = (yyvsp[0]) ? (yyvsp[0]) : (yyvsp[-1]); }
8615 ++#line 1865 "parse.tab.c" /* yacc.c:1646 */
8616 + break;
8617 +
8618 +- case 92:
8619 +-
8620 +- { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); }
8621 ++ case 93:
8622 ++#line 376 "parse.y" /* yacc.c:1646 */
8623 ++ { (yyval) = NULL; }
8624 ++#line 1871 "parse.tab.c" /* yacc.c:1646 */
8625 + break;
8626 +
8627 + case 94:
8628 +-
8629 +- { (yyval) = NULL; }
8630 ++#line 378 "parse.y" /* yacc.c:1646 */
8631 ++ { /* For version 2 checksums, we don't want to remember
8632 ++ private parameter names. */
8633 ++ remove_node((yyvsp[0]));
8634 ++ (yyval) = (yyvsp[0]);
8635 ++ }
8636 ++#line 1881 "parse.tab.c" /* yacc.c:1646 */
8637 + break;
8638 +
8639 + case 95:
8640 +-
8641 +- { /* For version 2 checksums, we don't want to remember
8642 +- private parameter names. */
8643 +- remove_node((yyvsp[(1) - (1)]));
8644 +- (yyval) = (yyvsp[(1) - (1)]);
8645 ++#line 386 "parse.y" /* yacc.c:1646 */
8646 ++ { remove_node((yyvsp[0]));
8647 ++ (yyval) = (yyvsp[0]);
8648 + }
8649 ++#line 1889 "parse.tab.c" /* yacc.c:1646 */
8650 + break;
8651 +
8652 + case 96:
8653 +-
8654 +- { remove_node((yyvsp[(1) - (1)]));
8655 +- (yyval) = (yyvsp[(1) - (1)]);
8656 +- }
8657 ++#line 390 "parse.y" /* yacc.c:1646 */
8658 ++ { (yyval) = (yyvsp[0]); }
8659 ++#line 1895 "parse.tab.c" /* yacc.c:1646 */
8660 + break;
8661 +
8662 + case 97:
8663 +-
8664 +- { (yyval) = (yyvsp[(4) - (4)]); }
8665 ++#line 392 "parse.y" /* yacc.c:1646 */
8666 ++ { (yyval) = (yyvsp[0]); }
8667 ++#line 1901 "parse.tab.c" /* yacc.c:1646 */
8668 + break;
8669 +
8670 + case 98:
8671 +-
8672 +- { (yyval) = (yyvsp[(4) - (4)]); }
8673 ++#line 394 "parse.y" /* yacc.c:1646 */
8674 ++ { (yyval) = (yyvsp[0]); }
8675 ++#line 1907 "parse.tab.c" /* yacc.c:1646 */
8676 + break;
8677 +
8678 + case 99:
8679 +-
8680 +- { (yyval) = (yyvsp[(2) - (2)]); }
8681 ++#line 396 "parse.y" /* yacc.c:1646 */
8682 ++ { (yyval) = (yyvsp[0]); }
8683 ++#line 1913 "parse.tab.c" /* yacc.c:1646 */
8684 + break;
8685 +
8686 + case 100:
8687 +-
8688 +- { (yyval) = (yyvsp[(3) - (3)]); }
8689 ++#line 398 "parse.y" /* yacc.c:1646 */
8690 ++ { (yyval) = (yyvsp[0]); }
8691 ++#line 1919 "parse.tab.c" /* yacc.c:1646 */
8692 + break;
8693 +
8694 + case 101:
8695 +-
8696 +- { (yyval) = (yyvsp[(3) - (3)]); }
8697 +- break;
8698 +-
8699 +- case 102:
8700 +-
8701 +- { struct string_list *decl = *(yyvsp[(2) - (3)]);
8702 +- *(yyvsp[(2) - (3)]) = NULL;
8703 ++#line 403 "parse.y" /* yacc.c:1646 */
8704 ++ { struct string_list *decl = *(yyvsp[-1]);
8705 ++ *(yyvsp[-1]) = NULL;
8706 + add_symbol(current_name, SYM_NORMAL, decl, is_extern);
8707 +- (yyval) = (yyvsp[(3) - (3)]);
8708 ++ (yyval) = (yyvsp[0]);
8709 + }
8710 ++#line 1929 "parse.tab.c" /* yacc.c:1646 */
8711 + break;
8712 +
8713 +- case 103:
8714 +-
8715 ++ case 102:
8716 ++#line 411 "parse.y" /* yacc.c:1646 */
8717 + { (yyval) = NULL; }
8718 ++#line 1935 "parse.tab.c" /* yacc.c:1646 */
8719 + break;
8720 +
8721 +- case 105:
8722 ++ case 104:
8723 ++#line 418 "parse.y" /* yacc.c:1646 */
8724 ++ { remove_list((yyvsp[0]), &(*(yyvsp[-1]))->next); (yyval) = (yyvsp[0]); }
8725 ++#line 1941 "parse.tab.c" /* yacc.c:1646 */
8726 ++ break;
8727 +
8728 +- { remove_list((yyvsp[(2) - (2)]), &(*(yyvsp[(1) - (2)]))->next); (yyval) = (yyvsp[(2) - (2)]); }
8729 ++ case 105:
8730 ++#line 422 "parse.y" /* yacc.c:1646 */
8731 ++ { (yyval) = (yyvsp[0]); }
8732 ++#line 1947 "parse.tab.c" /* yacc.c:1646 */
8733 + break;
8734 +
8735 + case 106:
8736 +-
8737 +- { (yyval) = (yyvsp[(3) - (3)]); }
8738 ++#line 423 "parse.y" /* yacc.c:1646 */
8739 ++ { (yyval) = (yyvsp[0]); }
8740 ++#line 1953 "parse.tab.c" /* yacc.c:1646 */
8741 + break;
8742 +
8743 + case 107:
8744 +-
8745 +- { (yyval) = (yyvsp[(3) - (3)]); }
8746 ++#line 427 "parse.y" /* yacc.c:1646 */
8747 ++ { (yyval) = NULL; }
8748 ++#line 1959 "parse.tab.c" /* yacc.c:1646 */
8749 + break;
8750 +
8751 +- case 108:
8752 +-
8753 +- { (yyval) = NULL; }
8754 ++ case 110:
8755 ++#line 433 "parse.y" /* yacc.c:1646 */
8756 ++ { (yyval) = (yyvsp[0]); }
8757 ++#line 1965 "parse.tab.c" /* yacc.c:1646 */
8758 + break;
8759 +
8760 + case 111:
8761 +-
8762 +- { (yyval) = (yyvsp[(2) - (2)]); }
8763 ++#line 438 "parse.y" /* yacc.c:1646 */
8764 ++ { (yyval) = (yyvsp[0]); }
8765 ++#line 1971 "parse.tab.c" /* yacc.c:1646 */
8766 + break;
8767 +
8768 + case 112:
8769 +-
8770 +- { (yyval) = (yyvsp[(3) - (3)]); }
8771 ++#line 440 "parse.y" /* yacc.c:1646 */
8772 ++ { (yyval) = (yyvsp[0]); }
8773 ++#line 1977 "parse.tab.c" /* yacc.c:1646 */
8774 + break;
8775 +
8776 + case 113:
8777 +-
8778 +- { (yyval) = (yyvsp[(2) - (2)]); }
8779 ++#line 444 "parse.y" /* yacc.c:1646 */
8780 ++ { (yyval) = NULL; }
8781 ++#line 1983 "parse.tab.c" /* yacc.c:1646 */
8782 + break;
8783 +
8784 +- case 114:
8785 +-
8786 +- { (yyval) = NULL; }
8787 ++ case 116:
8788 ++#line 450 "parse.y" /* yacc.c:1646 */
8789 ++ { (yyval) = (yyvsp[0]); }
8790 ++#line 1989 "parse.tab.c" /* yacc.c:1646 */
8791 + break;
8792 +
8793 + case 117:
8794 +-
8795 +- { (yyval) = (yyvsp[(3) - (3)]); }
8796 ++#line 454 "parse.y" /* yacc.c:1646 */
8797 ++ { (yyval) = (yyvsp[0]) ? (yyvsp[0]) : (yyvsp[-1]); }
8798 ++#line 1995 "parse.tab.c" /* yacc.c:1646 */
8799 + break;
8800 +
8801 + case 118:
8802 +-
8803 +- { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); }
8804 ++#line 455 "parse.y" /* yacc.c:1646 */
8805 ++ { (yyval) = (yyvsp[0]); }
8806 ++#line 2001 "parse.tab.c" /* yacc.c:1646 */
8807 + break;
8808 +
8809 +- case 119:
8810 +-
8811 +- { (yyval) = (yyvsp[(2) - (2)]); }
8812 ++ case 120:
8813 ++#line 460 "parse.y" /* yacc.c:1646 */
8814 ++ { (yyval) = (yyvsp[0]); }
8815 ++#line 2007 "parse.tab.c" /* yacc.c:1646 */
8816 + break;
8817 +
8818 + case 121:
8819 +-
8820 +- { (yyval) = (yyvsp[(2) - (2)]); }
8821 +- break;
8822 +-
8823 +- case 122:
8824 +-
8825 ++#line 464 "parse.y" /* yacc.c:1646 */
8826 + { (yyval) = NULL; }
8827 ++#line 2013 "parse.tab.c" /* yacc.c:1646 */
8828 + break;
8829 +
8830 +- case 124:
8831 +-
8832 +- { (yyval) = (yyvsp[(3) - (3)]); }
8833 ++ case 123:
8834 ++#line 469 "parse.y" /* yacc.c:1646 */
8835 ++ { (yyval) = (yyvsp[0]); }
8836 ++#line 2019 "parse.tab.c" /* yacc.c:1646 */
8837 + break;
8838 +
8839 +- case 125:
8840 +-
8841 +- { (yyval) = (yyvsp[(4) - (4)]); }
8842 ++ case 124:
8843 ++#line 470 "parse.y" /* yacc.c:1646 */
8844 ++ { (yyval) = (yyvsp[0]); }
8845 ++#line 2025 "parse.tab.c" /* yacc.c:1646 */
8846 + break;
8847 +
8848 +- case 128:
8849 +-
8850 ++ case 127:
8851 ++#line 479 "parse.y" /* yacc.c:1646 */
8852 + {
8853 +- const char *name = strdup((*(yyvsp[(1) - (1)]))->string);
8854 ++ const char *name = strdup((*(yyvsp[0]))->string);
8855 + add_symbol(name, SYM_ENUM_CONST, NULL, 0);
8856 + }
8857 ++#line 2034 "parse.tab.c" /* yacc.c:1646 */
8858 + break;
8859 +
8860 +- case 129:
8861 +-
8862 ++ case 128:
8863 ++#line 484 "parse.y" /* yacc.c:1646 */
8864 + {
8865 +- const char *name = strdup((*(yyvsp[(1) - (3)]))->string);
8866 +- struct string_list *expr = copy_list_range(*(yyvsp[(3) - (3)]), *(yyvsp[(2) - (3)]));
8867 ++ const char *name = strdup((*(yyvsp[-2]))->string);
8868 ++ struct string_list *expr = copy_list_range(*(yyvsp[0]), *(yyvsp[-1]));
8869 + add_symbol(name, SYM_ENUM_CONST, expr, 0);
8870 + }
8871 ++#line 2044 "parse.tab.c" /* yacc.c:1646 */
8872 + break;
8873 +
8874 +- case 130:
8875 +-
8876 +- { (yyval) = (yyvsp[(2) - (2)]); }
8877 ++ case 129:
8878 ++#line 491 "parse.y" /* yacc.c:1646 */
8879 ++ { (yyval) = (yyvsp[0]); }
8880 ++#line 2050 "parse.tab.c" /* yacc.c:1646 */
8881 + break;
8882 +
8883 +- case 131:
8884 +-
8885 ++ case 130:
8886 ++#line 495 "parse.y" /* yacc.c:1646 */
8887 + { (yyval) = NULL; }
8888 ++#line 2056 "parse.tab.c" /* yacc.c:1646 */
8889 + break;
8890 +
8891 +- case 133:
8892 +-
8893 +- { export_symbol((*(yyvsp[(3) - (5)]))->string); (yyval) = (yyvsp[(5) - (5)]); }
8894 ++ case 132:
8895 ++#line 501 "parse.y" /* yacc.c:1646 */
8896 ++ { export_symbol((*(yyvsp[-2]))->string); (yyval) = (yyvsp[0]); }
8897 ++#line 2062 "parse.tab.c" /* yacc.c:1646 */
8898 + break;
8899 +
8900 +
8901 +-
8902 ++#line 2066 "parse.tab.c" /* yacc.c:1646 */
8903 + default: break;
8904 + }
8905 + /* User semantic actions sometimes alter yychar, and that requires
8906 +@@ -2177,7 +2084,7 @@ yyreduce:
8907 +
8908 + *++yyvsp = yyval;
8909 +
8910 +- /* Now `shift' the result of the reduction. Determine what state
8911 ++ /* Now 'shift' the result of the reduction. Determine what state
8912 + that goes to, based on the state we popped back to and the rule
8913 + number reduced by. */
8914 +
8915 +@@ -2192,9 +2099,9 @@ yyreduce:
8916 + goto yynewstate;
8917 +
8918 +
8919 +-/*------------------------------------.
8920 +-| yyerrlab -- here on detecting error |
8921 +-`------------------------------------*/
8922 ++/*--------------------------------------.
8923 ++| yyerrlab -- here on detecting error. |
8924 ++`--------------------------------------*/
8925 + yyerrlab:
8926 + /* Make sure we have latest lookahead translation. See comments at
8927 + user semantic actions for why this is necessary. */
8928 +@@ -2245,20 +2152,20 @@ yyerrlab:
8929 + if (yyerrstatus == 3)
8930 + {
8931 + /* If just tried and failed to reuse lookahead token after an
8932 +- error, discard it. */
8933 ++ error, discard it. */
8934 +
8935 + if (yychar <= YYEOF)
8936 +- {
8937 +- /* Return failure if at end of input. */
8938 +- if (yychar == YYEOF)
8939 +- YYABORT;
8940 +- }
8941 ++ {
8942 ++ /* Return failure if at end of input. */
8943 ++ if (yychar == YYEOF)
8944 ++ YYABORT;
8945 ++ }
8946 + else
8947 +- {
8948 +- yydestruct ("Error: discarding",
8949 +- yytoken, &yylval);
8950 +- yychar = YYEMPTY;
8951 +- }
8952 ++ {
8953 ++ yydestruct ("Error: discarding",
8954 ++ yytoken, &yylval);
8955 ++ yychar = YYEMPTY;
8956 ++ }
8957 + }
8958 +
8959 + /* Else will try to reuse lookahead token after shifting the error
8960 +@@ -2277,7 +2184,7 @@ yyerrorlab:
8961 + if (/*CONSTCOND*/ 0)
8962 + goto yyerrorlab;
8963 +
8964 +- /* Do not reclaim the symbols of the rule which action triggered
8965 ++ /* Do not reclaim the symbols of the rule whose action triggered
8966 + this YYERROR. */
8967 + YYPOPSTACK (yylen);
8968 + yylen = 0;
8969 +@@ -2290,29 +2197,29 @@ yyerrorlab:
8970 + | yyerrlab1 -- common code for both syntax error and YYERROR. |
8971 + `-------------------------------------------------------------*/
8972 + yyerrlab1:
8973 +- yyerrstatus = 3; /* Each real token shifted decrements this. */
8974 ++ yyerrstatus = 3; /* Each real token shifted decrements this. */
8975 +
8976 + for (;;)
8977 + {
8978 + yyn = yypact[yystate];
8979 + if (!yypact_value_is_default (yyn))
8980 +- {
8981 +- yyn += YYTERROR;
8982 +- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
8983 +- {
8984 +- yyn = yytable[yyn];
8985 +- if (0 < yyn)
8986 +- break;
8987 +- }
8988 +- }
8989 ++ {
8990 ++ yyn += YYTERROR;
8991 ++ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
8992 ++ {
8993 ++ yyn = yytable[yyn];
8994 ++ if (0 < yyn)
8995 ++ break;
8996 ++ }
8997 ++ }
8998 +
8999 + /* Pop the current state because it cannot handle the error token. */
9000 + if (yyssp == yyss)
9001 +- YYABORT;
9002 ++ YYABORT;
9003 +
9004 +
9005 + yydestruct ("Error: popping",
9006 +- yystos[yystate], yyvsp);
9007 ++ yystos[yystate], yyvsp);
9008 + YYPOPSTACK (1);
9009 + yystate = *yyssp;
9010 + YY_STACK_PRINT (yyss, yyssp);
9011 +@@ -2363,14 +2270,14 @@ yyreturn:
9012 + yydestruct ("Cleanup: discarding lookahead",
9013 + yytoken, &yylval);
9014 + }
9015 +- /* Do not reclaim the symbols of the rule which action triggered
9016 ++ /* Do not reclaim the symbols of the rule whose action triggered
9017 + this YYABORT or YYACCEPT. */
9018 + YYPOPSTACK (yylen);
9019 + YY_STACK_PRINT (yyss, yyssp);
9020 + while (yyssp != yyss)
9021 + {
9022 + yydestruct ("Cleanup: popping",
9023 +- yystos[*yyssp], yyvsp);
9024 ++ yystos[*yyssp], yyvsp);
9025 + YYPOPSTACK (1);
9026 + }
9027 + #ifndef yyoverflow
9028 +@@ -2381,12 +2288,9 @@ yyreturn:
9029 + if (yymsg != yymsgbuf)
9030 + YYSTACK_FREE (yymsg);
9031 + #endif
9032 +- /* Make sure YYID is used. */
9033 +- return YYID (yyresult);
9034 ++ return yyresult;
9035 + }
9036 +-
9037 +-
9038 +-
9039 ++#line 505 "parse.y" /* yacc.c:1906 */
9040 +
9041 +
9042 + static void
9043 +diff --git a/scripts/genksyms/parse.tab.h_shipped b/scripts/genksyms/parse.tab.h_shipped
9044 +index 4c00cef6d71d..1751bd03ad26 100644
9045 +--- a/scripts/genksyms/parse.tab.h_shipped
9046 ++++ b/scripts/genksyms/parse.tab.h_shipped
9047 +@@ -1,19 +1,19 @@
9048 +-/* A Bison parser, made by GNU Bison 2.7. */
9049 ++/* A Bison parser, made by GNU Bison 3.0.4. */
9050 +
9051 + /* Bison interface for Yacc-like parsers in C
9052 +-
9053 +- Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
9054 +-
9055 ++
9056 ++ Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
9057 ++
9058 + This program is free software: you can redistribute it and/or modify
9059 + it under the terms of the GNU General Public License as published by
9060 + the Free Software Foundation, either version 3 of the License, or
9061 + (at your option) any later version.
9062 +-
9063 ++
9064 + This program is distributed in the hope that it will be useful,
9065 + but WITHOUT ANY WARRANTY; without even the implied warranty of
9066 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9067 + GNU General Public License for more details.
9068 +-
9069 ++
9070 + You should have received a copy of the GNU General Public License
9071 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
9072 +
9073 +@@ -26,93 +26,80 @@
9074 + special exception, which will cause the skeleton and the resulting
9075 + Bison output files to be licensed under the GNU General Public
9076 + License without this special exception.
9077 +-
9078 ++
9079 + This special exception was added by the Free Software Foundation in
9080 + version 2.2 of Bison. */
9081 +
9082 +-#ifndef YY_YY_SCRIPTS_GENKSYMS_PARSE_TAB_H_SHIPPED_INCLUDED
9083 +-# define YY_YY_SCRIPTS_GENKSYMS_PARSE_TAB_H_SHIPPED_INCLUDED
9084 +-/* Enabling traces. */
9085 ++#ifndef YY_YY_PARSE_TAB_H_INCLUDED
9086 ++# define YY_YY_PARSE_TAB_H_INCLUDED
9087 ++/* Debug traces. */
9088 + #ifndef YYDEBUG
9089 +-# define YYDEBUG 1
9090 ++# define YYDEBUG 0
9091 + #endif
9092 + #if YYDEBUG
9093 + extern int yydebug;
9094 + #endif
9095 +
9096 +-/* Tokens. */
9097 ++/* Token type. */
9098 + #ifndef YYTOKENTYPE
9099 + # define YYTOKENTYPE
9100 +- /* Put the tokens into the symbol table, so that GDB and other debuggers
9101 +- know about them. */
9102 +- enum yytokentype {
9103 +- ASM_KEYW = 258,
9104 +- ATTRIBUTE_KEYW = 259,
9105 +- AUTO_KEYW = 260,
9106 +- BOOL_KEYW = 261,
9107 +- CHAR_KEYW = 262,
9108 +- CONST_KEYW = 263,
9109 +- DOUBLE_KEYW = 264,
9110 +- ENUM_KEYW = 265,
9111 +- EXTERN_KEYW = 266,
9112 +- EXTENSION_KEYW = 267,
9113 +- FLOAT_KEYW = 268,
9114 +- INLINE_KEYW = 269,
9115 +- INT_KEYW = 270,
9116 +- LONG_KEYW = 271,
9117 +- REGISTER_KEYW = 272,
9118 +- RESTRICT_KEYW = 273,
9119 +- SHORT_KEYW = 274,
9120 +- SIGNED_KEYW = 275,
9121 +- STATIC_KEYW = 276,
9122 +- STRUCT_KEYW = 277,
9123 +- TYPEDEF_KEYW = 278,
9124 +- UNION_KEYW = 279,
9125 +- UNSIGNED_KEYW = 280,
9126 +- VOID_KEYW = 281,
9127 +- VOLATILE_KEYW = 282,
9128 +- TYPEOF_KEYW = 283,
9129 +- EXPORT_SYMBOL_KEYW = 284,
9130 +- ASM_PHRASE = 285,
9131 +- ATTRIBUTE_PHRASE = 286,
9132 +- TYPEOF_PHRASE = 287,
9133 +- BRACE_PHRASE = 288,
9134 +- BRACKET_PHRASE = 289,
9135 +- EXPRESSION_PHRASE = 290,
9136 +- CHAR = 291,
9137 +- DOTS = 292,
9138 +- IDENT = 293,
9139 +- INT = 294,
9140 +- REAL = 295,
9141 +- STRING = 296,
9142 +- TYPE = 297,
9143 +- OTHER = 298,
9144 +- FILENAME = 299
9145 +- };
9146 ++ enum yytokentype
9147 ++ {
9148 ++ ASM_KEYW = 258,
9149 ++ ATTRIBUTE_KEYW = 259,
9150 ++ AUTO_KEYW = 260,
9151 ++ BOOL_KEYW = 261,
9152 ++ CHAR_KEYW = 262,
9153 ++ CONST_KEYW = 263,
9154 ++ DOUBLE_KEYW = 264,
9155 ++ ENUM_KEYW = 265,
9156 ++ EXTERN_KEYW = 266,
9157 ++ EXTENSION_KEYW = 267,
9158 ++ FLOAT_KEYW = 268,
9159 ++ INLINE_KEYW = 269,
9160 ++ INT_KEYW = 270,
9161 ++ LONG_KEYW = 271,
9162 ++ REGISTER_KEYW = 272,
9163 ++ RESTRICT_KEYW = 273,
9164 ++ SHORT_KEYW = 274,
9165 ++ SIGNED_KEYW = 275,
9166 ++ STATIC_KEYW = 276,
9167 ++ STRUCT_KEYW = 277,
9168 ++ TYPEDEF_KEYW = 278,
9169 ++ UNION_KEYW = 279,
9170 ++ UNSIGNED_KEYW = 280,
9171 ++ VOID_KEYW = 281,
9172 ++ VOLATILE_KEYW = 282,
9173 ++ TYPEOF_KEYW = 283,
9174 ++ EXPORT_SYMBOL_KEYW = 284,
9175 ++ ASM_PHRASE = 285,
9176 ++ ATTRIBUTE_PHRASE = 286,
9177 ++ TYPEOF_PHRASE = 287,
9178 ++ BRACE_PHRASE = 288,
9179 ++ BRACKET_PHRASE = 289,
9180 ++ EXPRESSION_PHRASE = 290,
9181 ++ CHAR = 291,
9182 ++ DOTS = 292,
9183 ++ IDENT = 293,
9184 ++ INT = 294,
9185 ++ REAL = 295,
9186 ++ STRING = 296,
9187 ++ TYPE = 297,
9188 ++ OTHER = 298,
9189 ++ FILENAME = 299
9190 ++ };
9191 + #endif
9192 +
9193 +-
9194 ++/* Value type. */
9195 + #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
9196 + typedef int YYSTYPE;
9197 + # define YYSTYPE_IS_TRIVIAL 1
9198 +-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
9199 + # define YYSTYPE_IS_DECLARED 1
9200 + #endif
9201 +
9202 ++
9203 + extern YYSTYPE yylval;
9204 +
9205 +-#ifdef YYPARSE_PARAM
9206 +-#if defined __STDC__ || defined __cplusplus
9207 +-int yyparse (void *YYPARSE_PARAM);
9208 +-#else
9209 +-int yyparse ();
9210 +-#endif
9211 +-#else /* ! YYPARSE_PARAM */
9212 +-#if defined __STDC__ || defined __cplusplus
9213 + int yyparse (void);
9214 +-#else
9215 +-int yyparse ();
9216 +-#endif
9217 +-#endif /* ! YYPARSE_PARAM */
9218 +
9219 +-#endif /* !YY_YY_SCRIPTS_GENKSYMS_PARSE_TAB_H_SHIPPED_INCLUDED */
9220 ++#endif /* !YY_YY_PARSE_TAB_H_INCLUDED */
9221 +diff --git a/scripts/genksyms/parse.y b/scripts/genksyms/parse.y
9222 +index 723ab30fe9d4..268efe37688a 100644
9223 +--- a/scripts/genksyms/parse.y
9224 ++++ b/scripts/genksyms/parse.y
9225 +@@ -320,8 +320,6 @@ direct_declarator:
9226 + { $$ = $2; }
9227 + | '(' declarator ')'
9228 + { $$ = $3; }
9229 +- | '(' error ')'
9230 +- { $$ = $3; }
9231 + ;
9232 +
9233 + /* Nested declarators differ from regular declarators in that they do
9234 +diff --git a/scripts/kernel-doc b/scripts/kernel-doc
9235 +index 638a38e1b419..bba8ad9c4f2c 100755
9236 +--- a/scripts/kernel-doc
9237 ++++ b/scripts/kernel-doc
9238 +@@ -2742,4 +2742,4 @@ if ($verbose && $warnings) {
9239 + print STDERR "$warnings warnings\n";
9240 + }
9241 +
9242 +-exit($errors);
9243 ++exit($output_mode eq "none" ? 0 : $errors);
9244 +diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
9245 +index 48958d3cec9e..bd5151915e5a 100644
9246 +--- a/scripts/mod/modpost.c
9247 ++++ b/scripts/mod/modpost.c
9248 +@@ -2129,6 +2129,14 @@ static void add_intree_flag(struct buffer *b, int is_intree)
9249 + buf_printf(b, "\nMODULE_INFO(intree, \"Y\");\n");
9250 + }
9251 +
9252 ++/* Cannot check for assembler */
9253 ++static void add_retpoline(struct buffer *b)
9254 ++{
9255 ++ buf_printf(b, "\n#ifdef RETPOLINE\n");
9256 ++ buf_printf(b, "MODULE_INFO(retpoline, \"Y\");\n");
9257 ++ buf_printf(b, "#endif\n");
9258 ++}
9259 ++
9260 + static void add_staging_flag(struct buffer *b, const char *name)
9261 + {
9262 + static const char *staging_dir = "drivers/staging";
9263 +@@ -2473,6 +2481,7 @@ int main(int argc, char **argv)
9264 +
9265 + add_header(&buf, mod);
9266 + add_intree_flag(&buf, !external_module);
9267 ++ add_retpoline(&buf);
9268 + add_staging_flag(&buf, mod->name);
9269 + err |= add_versions(&buf, mod);
9270 + add_depends(&buf, mod, modules);
9271 +diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
9272 +index ebb5eb3c318c..db7eff3573a9 100644
9273 +--- a/security/selinux/ss/services.c
9274 ++++ b/security/selinux/ss/services.c
9275 +@@ -860,6 +860,9 @@ int security_bounded_transition(u32 old_sid, u32 new_sid)
9276 + int index;
9277 + int rc;
9278 +
9279 ++ if (!ss_initialized)
9280 ++ return 0;
9281 ++
9282 + read_lock(&policy_rwlock);
9283 +
9284 + rc = -EINVAL;
9285 +@@ -1406,27 +1409,25 @@ static int security_context_to_sid_core(const char *scontext, u32 scontext_len,
9286 + if (!scontext_len)
9287 + return -EINVAL;
9288 +
9289 ++ /* Copy the string to allow changes and ensure a NUL terminator */
9290 ++ scontext2 = kmemdup_nul(scontext, scontext_len, gfp_flags);
9291 ++ if (!scontext2)
9292 ++ return -ENOMEM;
9293 ++
9294 + if (!ss_initialized) {
9295 + int i;
9296 +
9297 + for (i = 1; i < SECINITSID_NUM; i++) {
9298 +- if (!strcmp(initial_sid_to_string[i], scontext)) {
9299 ++ if (!strcmp(initial_sid_to_string[i], scontext2)) {
9300 + *sid = i;
9301 +- return 0;
9302 ++ goto out;
9303 + }
9304 + }
9305 + *sid = SECINITSID_KERNEL;
9306 +- return 0;
9307 ++ goto out;
9308 + }
9309 + *sid = SECSID_NULL;
9310 +
9311 +- /* Copy the string so that we can modify the copy as we parse it. */
9312 +- scontext2 = kmalloc(scontext_len + 1, gfp_flags);
9313 +- if (!scontext2)
9314 +- return -ENOMEM;
9315 +- memcpy(scontext2, scontext, scontext_len);
9316 +- scontext2[scontext_len] = 0;
9317 +-
9318 + if (force) {
9319 + /* Save another copy for storing in uninterpreted form */
9320 + rc = -ENOMEM;
9321 +diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
9322 +index c146d0de53d8..29e1ce2263bc 100644
9323 +--- a/sound/pci/hda/patch_ca0132.c
9324 ++++ b/sound/pci/hda/patch_ca0132.c
9325 +@@ -1482,6 +1482,9 @@ static int dspio_scp(struct hda_codec *codec,
9326 + } else if (ret_size != reply_data_size) {
9327 + codec_dbg(codec, "RetLen and HdrLen .NE.\n");
9328 + return -EINVAL;
9329 ++ } else if (!reply) {
9330 ++ codec_dbg(codec, "NULL reply\n");
9331 ++ return -EINVAL;
9332 + } else {
9333 + *reply_len = ret_size*sizeof(unsigned int);
9334 + memcpy(reply, scp_reply.data, *reply_len);
9335 +diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig
9336 +index d430ef5a4f38..79c29330c56a 100644
9337 +--- a/sound/soc/intel/Kconfig
9338 ++++ b/sound/soc/intel/Kconfig
9339 +@@ -24,7 +24,6 @@ config SND_SST_IPC_PCI
9340 + config SND_SST_IPC_ACPI
9341 + tristate
9342 + select SND_SST_IPC
9343 +- depends on ACPI
9344 +
9345 + config SND_SOC_INTEL_SST
9346 + tristate
9347 +@@ -91,7 +90,7 @@ config SND_SOC_INTEL_BROADWELL_MACH
9348 +
9349 + config SND_SOC_INTEL_BYTCR_RT5640_MACH
9350 + tristate "ASoC Audio DSP Support for MID BYT Platform"
9351 +- depends on X86 && I2C
9352 ++ depends on X86 && I2C && ACPI
9353 + select SND_SOC_RT5640
9354 + select SND_SST_MFLD_PLATFORM
9355 + select SND_SST_IPC_ACPI
9356 +@@ -103,7 +102,7 @@ config SND_SOC_INTEL_BYTCR_RT5640_MACH
9357 +
9358 + config SND_SOC_INTEL_CHT_BSW_RT5672_MACH
9359 + tristate "ASoC Audio driver for Intel Cherrytrail & Braswell with RT5672 codec"
9360 +- depends on X86_INTEL_LPSS && I2C
9361 ++ depends on X86_INTEL_LPSS && I2C && ACPI
9362 + select SND_SOC_RT5670
9363 + select SND_SST_MFLD_PLATFORM
9364 + select SND_SST_IPC_ACPI
9365 +@@ -115,7 +114,7 @@ config SND_SOC_INTEL_CHT_BSW_RT5672_MACH
9366 +
9367 + config SND_SOC_INTEL_CHT_BSW_RT5645_MACH
9368 + tristate "ASoC Audio driver for Intel Cherrytrail & Braswell with RT5645/5650 codec"
9369 +- depends on X86_INTEL_LPSS && I2C
9370 ++ depends on X86_INTEL_LPSS && I2C && ACPI
9371 + select SND_SOC_RT5645
9372 + select SND_SST_MFLD_PLATFORM
9373 + select SND_SST_IPC_ACPI
9374 +diff --git a/sound/soc/mediatek/Kconfig b/sound/soc/mediatek/Kconfig
9375 +index 15c04e2eae34..976967675387 100644
9376 +--- a/sound/soc/mediatek/Kconfig
9377 ++++ b/sound/soc/mediatek/Kconfig
9378 +@@ -9,7 +9,7 @@ config SND_SOC_MEDIATEK
9379 +
9380 + config SND_SOC_MT8173_MAX98090
9381 + tristate "ASoC Audio driver for MT8173 with MAX98090 codec"
9382 +- depends on SND_SOC_MEDIATEK
9383 ++ depends on SND_SOC_MEDIATEK && I2C
9384 + select SND_SOC_MAX98090
9385 + help
9386 + This adds ASoC driver for Mediatek MT8173 boards
9387 +@@ -19,7 +19,7 @@ config SND_SOC_MT8173_MAX98090
9388 +
9389 + config SND_SOC_MT8173_RT5650_RT5676
9390 + tristate "ASoC Audio driver for MT8173 with RT5650 RT5676 codecs"
9391 +- depends on SND_SOC_MEDIATEK
9392 ++ depends on SND_SOC_MEDIATEK && I2C
9393 + select SND_SOC_RT5645
9394 + select SND_SOC_RT5677
9395 + help
9396 +diff --git a/sound/soc/rockchip/rockchip_spdif.c b/sound/soc/rockchip/rockchip_spdif.c
9397 +index 5a806da89f42..5e2eb4cc5cf1 100644
9398 +--- a/sound/soc/rockchip/rockchip_spdif.c
9399 ++++ b/sound/soc/rockchip/rockchip_spdif.c
9400 +@@ -54,7 +54,7 @@ static const struct of_device_id rk_spdif_match[] = {
9401 + };
9402 + MODULE_DEVICE_TABLE(of, rk_spdif_match);
9403 +
9404 +-static int rk_spdif_runtime_suspend(struct device *dev)
9405 ++static int __maybe_unused rk_spdif_runtime_suspend(struct device *dev)
9406 + {
9407 + struct rk_spdif_dev *spdif = dev_get_drvdata(dev);
9408 +
9409 +@@ -64,7 +64,7 @@ static int rk_spdif_runtime_suspend(struct device *dev)
9410 + return 0;
9411 + }
9412 +
9413 +-static int rk_spdif_runtime_resume(struct device *dev)
9414 ++static int __maybe_unused rk_spdif_runtime_resume(struct device *dev)
9415 + {
9416 + struct rk_spdif_dev *spdif = dev_get_drvdata(dev);
9417 + int ret;
9418 +@@ -316,26 +316,30 @@ static int rk_spdif_probe(struct platform_device *pdev)
9419 + spdif->mclk = devm_clk_get(&pdev->dev, "mclk");
9420 + if (IS_ERR(spdif->mclk)) {
9421 + dev_err(&pdev->dev, "Can't retrieve rk_spdif master clock\n");
9422 +- return PTR_ERR(spdif->mclk);
9423 ++ ret = PTR_ERR(spdif->mclk);
9424 ++ goto err_disable_hclk;
9425 + }
9426 +
9427 + ret = clk_prepare_enable(spdif->mclk);
9428 + if (ret) {
9429 + dev_err(spdif->dev, "clock enable failed %d\n", ret);
9430 +- return ret;
9431 ++ goto err_disable_clocks;
9432 + }
9433 +
9434 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
9435 + regs = devm_ioremap_resource(&pdev->dev, res);
9436 +- if (IS_ERR(regs))
9437 +- return PTR_ERR(regs);
9438 ++ if (IS_ERR(regs)) {
9439 ++ ret = PTR_ERR(regs);
9440 ++ goto err_disable_clocks;
9441 ++ }
9442 +
9443 + spdif->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "hclk", regs,
9444 + &rk_spdif_regmap_config);
9445 + if (IS_ERR(spdif->regmap)) {
9446 + dev_err(&pdev->dev,
9447 + "Failed to initialise managed register map\n");
9448 +- return PTR_ERR(spdif->regmap);
9449 ++ ret = PTR_ERR(spdif->regmap);
9450 ++ goto err_disable_clocks;
9451 + }
9452 +
9453 + spdif->playback_dma_data.addr = res->start + SPDIF_SMPDR;
9454 +@@ -367,6 +371,10 @@ static int rk_spdif_probe(struct platform_device *pdev)
9455 +
9456 + err_pm_runtime:
9457 + pm_runtime_disable(&pdev->dev);
9458 ++err_disable_clocks:
9459 ++ clk_disable_unprepare(spdif->mclk);
9460 ++err_disable_hclk:
9461 ++ clk_disable_unprepare(spdif->hclk);
9462 +
9463 + return ret;
9464 + }
9465 +diff --git a/sound/soc/ux500/mop500.c b/sound/soc/ux500/mop500.c
9466 +index ba9fc099cf67..503aef8fcde2 100644
9467 +--- a/sound/soc/ux500/mop500.c
9468 ++++ b/sound/soc/ux500/mop500.c
9469 +@@ -164,3 +164,7 @@ static struct platform_driver snd_soc_mop500_driver = {
9470 + };
9471 +
9472 + module_platform_driver(snd_soc_mop500_driver);
9473 ++
9474 ++MODULE_LICENSE("GPL v2");
9475 ++MODULE_DESCRIPTION("ASoC MOP500 board driver");
9476 ++MODULE_AUTHOR("Ola Lilja");
9477 +diff --git a/sound/soc/ux500/ux500_pcm.c b/sound/soc/ux500/ux500_pcm.c
9478 +index f12c01dddc8d..d35ba7700f46 100644
9479 +--- a/sound/soc/ux500/ux500_pcm.c
9480 ++++ b/sound/soc/ux500/ux500_pcm.c
9481 +@@ -165,3 +165,8 @@ int ux500_pcm_unregister_platform(struct platform_device *pdev)
9482 + return 0;
9483 + }
9484 + EXPORT_SYMBOL_GPL(ux500_pcm_unregister_platform);
9485 ++
9486 ++MODULE_AUTHOR("Ola Lilja");
9487 ++MODULE_AUTHOR("Roger Nilsson");
9488 ++MODULE_DESCRIPTION("ASoC UX500 driver");
9489 ++MODULE_LICENSE("GPL v2");
9490 +diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build
9491 +index 4a96473b180f..4ffc096eaf5d 100644
9492 +--- a/tools/build/Makefile.build
9493 ++++ b/tools/build/Makefile.build
9494 +@@ -19,6 +19,16 @@ else
9495 + Q=@
9496 + endif
9497 +
9498 ++ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4
9499 ++ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
9500 ++ quiet=silent_
9501 ++endif
9502 ++else # make-3.8x
9503 ++ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
9504 ++ quiet=silent_
9505 ++endif
9506 ++endif
9507 ++
9508 + build-dir := $(srctree)/tools/build
9509 +
9510 + # Define $(fixdep) for dep-cmd function
9511 +diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c
9512 +index b4eb5b679081..73d192f57dc3 100644
9513 +--- a/tools/perf/bench/numa.c
9514 ++++ b/tools/perf/bench/numa.c
9515 +@@ -208,6 +208,47 @@ static const char * const numa_usage[] = {
9516 + NULL
9517 + };
9518 +
9519 ++/*
9520 ++ * To get number of numa nodes present.
9521 ++ */
9522 ++static int nr_numa_nodes(void)
9523 ++{
9524 ++ int i, nr_nodes = 0;
9525 ++
9526 ++ for (i = 0; i < g->p.nr_nodes; i++) {
9527 ++ if (numa_bitmask_isbitset(numa_nodes_ptr, i))
9528 ++ nr_nodes++;
9529 ++ }
9530 ++
9531 ++ return nr_nodes;
9532 ++}
9533 ++
9534 ++/*
9535 ++ * To check if given numa node is present.
9536 ++ */
9537 ++static int is_node_present(int node)
9538 ++{
9539 ++ return numa_bitmask_isbitset(numa_nodes_ptr, node);
9540 ++}
9541 ++
9542 ++/*
9543 ++ * To check given numa node has cpus.
9544 ++ */
9545 ++static bool node_has_cpus(int node)
9546 ++{
9547 ++ struct bitmask *cpu = numa_allocate_cpumask();
9548 ++ unsigned int i;
9549 ++
9550 ++ if (cpu && !numa_node_to_cpus(node, cpu)) {
9551 ++ for (i = 0; i < cpu->size; i++) {
9552 ++ if (numa_bitmask_isbitset(cpu, i))
9553 ++ return true;
9554 ++ }
9555 ++ }
9556 ++
9557 ++ return false; /* lets fall back to nocpus safely */
9558 ++}
9559 ++
9560 + static cpu_set_t bind_to_cpu(int target_cpu)
9561 + {
9562 + cpu_set_t orig_mask, mask;
9563 +@@ -236,12 +277,12 @@ static cpu_set_t bind_to_cpu(int target_cpu)
9564 +
9565 + static cpu_set_t bind_to_node(int target_node)
9566 + {
9567 +- int cpus_per_node = g->p.nr_cpus/g->p.nr_nodes;
9568 ++ int cpus_per_node = g->p.nr_cpus / nr_numa_nodes();
9569 + cpu_set_t orig_mask, mask;
9570 + int cpu;
9571 + int ret;
9572 +
9573 +- BUG_ON(cpus_per_node*g->p.nr_nodes != g->p.nr_cpus);
9574 ++ BUG_ON(cpus_per_node * nr_numa_nodes() != g->p.nr_cpus);
9575 + BUG_ON(!cpus_per_node);
9576 +
9577 + ret = sched_getaffinity(0, sizeof(orig_mask), &orig_mask);
9578 +@@ -641,7 +682,7 @@ static int parse_setup_node_list(void)
9579 + int i;
9580 +
9581 + for (i = 0; i < mul; i++) {
9582 +- if (t >= g->p.nr_tasks) {
9583 ++ if (t >= g->p.nr_tasks || !node_has_cpus(bind_node)) {
9584 + printf("\n# NOTE: ignoring bind NODEs starting at NODE#%d\n", bind_node);
9585 + goto out;
9586 + }
9587 +@@ -956,6 +997,8 @@ static void calc_convergence(double runtime_ns_max, double *convergence)
9588 + sum = 0;
9589 +
9590 + for (node = 0; node < g->p.nr_nodes; node++) {
9591 ++ if (!is_node_present(node))
9592 ++ continue;
9593 + nr = nodes[node];
9594 + nr_min = min(nr, nr_min);
9595 + nr_max = max(nr, nr_max);
9596 +@@ -976,8 +1019,11 @@ static void calc_convergence(double runtime_ns_max, double *convergence)
9597 + process_groups = 0;
9598 +
9599 + for (node = 0; node < g->p.nr_nodes; node++) {
9600 +- int processes = count_node_processes(node);
9601 ++ int processes;
9602 +
9603 ++ if (!is_node_present(node))
9604 ++ continue;
9605 ++ processes = count_node_processes(node);
9606 + nr = nodes[node];
9607 + tprintf(" %2d/%-2d", nr, processes);
9608 +
9609 +@@ -1283,7 +1329,7 @@ static void print_summary(void)
9610 +
9611 + printf("\n ###\n");
9612 + printf(" # %d %s will execute (on %d nodes, %d CPUs):\n",
9613 +- g->p.nr_tasks, g->p.nr_tasks == 1 ? "task" : "tasks", g->p.nr_nodes, g->p.nr_cpus);
9614 ++ g->p.nr_tasks, g->p.nr_tasks == 1 ? "task" : "tasks", nr_numa_nodes(), g->p.nr_cpus);
9615 + printf(" # %5dx %5ldMB global shared mem operations\n",
9616 + g->p.nr_loops, g->p.bytes_global/1024/1024);
9617 + printf(" # %5dx %5ldMB process shared mem operations\n",
9618 +diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
9619 +index 4a8a02c302d2..47719bde34c6 100644
9620 +--- a/tools/perf/builtin-top.c
9621 ++++ b/tools/perf/builtin-top.c
9622 +@@ -70,6 +70,7 @@
9623 + #include <linux/types.h>
9624 +
9625 + static volatile int done;
9626 ++static volatile int resize;
9627 +
9628 + #define HEADER_LINE_NR 5
9629 +
9630 +@@ -79,10 +80,13 @@ static void perf_top__update_print_entries(struct perf_top *top)
9631 + }
9632 +
9633 + static void perf_top__sig_winch(int sig __maybe_unused,
9634 +- siginfo_t *info __maybe_unused, void *arg)
9635 ++ siginfo_t *info __maybe_unused, void *arg __maybe_unused)
9636 + {
9637 +- struct perf_top *top = arg;
9638 ++ resize = 1;
9639 ++}
9640 +
9641 ++static void perf_top__resize(struct perf_top *top)
9642 ++{
9643 + get_term_dimensions(&top->winsize);
9644 + perf_top__update_print_entries(top);
9645 + }
9646 +@@ -466,7 +470,7 @@ static bool perf_top__handle_keypress(struct perf_top *top, int c)
9647 + .sa_sigaction = perf_top__sig_winch,
9648 + .sa_flags = SA_SIGINFO,
9649 + };
9650 +- perf_top__sig_winch(SIGWINCH, NULL, top);
9651 ++ perf_top__resize(top);
9652 + sigaction(SIGWINCH, &act, NULL);
9653 + } else {
9654 + signal(SIGWINCH, SIG_DFL);
9655 +@@ -1023,6 +1027,11 @@ static int __cmd_top(struct perf_top *top)
9656 +
9657 + if (hits == top->samples)
9658 + ret = perf_evlist__poll(top->evlist, 100);
9659 ++
9660 ++ if (resize) {
9661 ++ perf_top__resize(top);
9662 ++ resize = 0;
9663 ++ }
9664 + }
9665 +
9666 + ret = 0;
9667 +diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
9668 +index 8abbef164b4e..19edc1a7a232 100644
9669 +--- a/tools/scripts/Makefile.include
9670 ++++ b/tools/scripts/Makefile.include
9671 +@@ -46,6 +46,16 @@ else
9672 + NO_SUBDIR = :
9673 + endif
9674 +
9675 ++ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4
9676 ++ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
9677 ++ silent=1
9678 ++endif
9679 ++else # make-3.8x
9680 ++ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
9681 ++ silent=1
9682 ++endif
9683 ++endif
9684 ++
9685 + #
9686 + # Define a callable command for descending to a new directory
9687 + #
9688 +@@ -58,7 +68,7 @@ descend = \
9689 + QUIET_SUBDIR0 = +$(MAKE) $(COMMAND_O) -C # space to separate -C and subdir
9690 + QUIET_SUBDIR1 =
9691 +
9692 +-ifneq ($(findstring $(MAKEFLAGS),s),s)
9693 ++ifneq ($(silent),1)
9694 + ifneq ($(V),1)
9695 + QUIET_CC = @echo ' CC '$@;
9696 + QUIET_CC_FPIC = @echo ' CC FPIC '$@;