aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arc/kernel/ptrace.c2
-rw-r--r--arch/arm/boot/dts/exynos5250.dtsi5
-rw-r--r--arch/arm/boot/dts/integratorcp.dts9
-rw-r--r--arch/arm/boot/dts/omap3-beagle-xm.dts2
-rw-r--r--arch/arm/boot/dts/omap3.dtsi4
-rw-r--r--arch/arm/common/mcpm_entry.c6
-rw-r--r--arch/arm/common/sharpsl_param.c5
-rw-r--r--arch/arm/include/asm/Kbuild1
-rw-r--r--arch/arm/include/asm/mcpm.h14
-rw-r--r--arch/arm/include/asm/syscall.h6
-rw-r--r--arch/arm/kernel/head.S21
-rw-r--r--arch/arm/mach-omap2/board-generic.c18
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c9
-rw-r--r--arch/arm/mach-omap2/gpmc-onenand.c12
-rw-r--r--arch/arm/mach-omap2/mux.h4
-rw-r--r--arch/arm/mach-omap2/timer.c4
-rw-r--r--arch/arm/mm/dma-mapping.c43
-rw-r--r--arch/arm/mm/init.c3
-rw-r--r--arch/arm/net/bpf_jit_32.c1
-rw-r--r--arch/mips/kernel/octeon_switch.S2
-rw-r--r--arch/mips/kernel/r2300_switch.S2
-rw-r--r--arch/mips/kernel/r4k_switch.S2
-rw-r--r--arch/parisc/configs/712_defconfig2
-rw-r--r--arch/parisc/configs/a500_defconfig2
-rw-r--r--arch/parisc/configs/b180_defconfig3
-rw-r--r--arch/parisc/configs/c3000_defconfig3
-rw-r--r--arch/parisc/configs/c8000_defconfig2
-rw-r--r--arch/parisc/configs/default_defconfig2
-rw-r--r--arch/parisc/include/asm/traps.h2
-rw-r--r--arch/parisc/kernel/head.S4
-rw-r--r--arch/parisc/kernel/smp.c8
-rw-r--r--arch/parisc/kernel/traps.c11
-rw-r--r--arch/parisc/lib/memcpy.c15
-rw-r--r--arch/parisc/mm/fault.c15
-rw-r--r--arch/powerpc/net/bpf_jit_comp.c1
-rw-r--r--arch/s390/include/asm/pgtable.h4
-rw-r--r--arch/s390/include/asm/timex.h28
-rw-r--r--arch/s390/kernel/compat_signal.c4
-rw-r--r--arch/s390/kernel/debug.c2
-rw-r--r--arch/s390/kvm/interrupt.c6
-rw-r--r--arch/s390/lib/delay.c14
-rw-r--r--arch/s390/net/bpf_jit_comp.c4
-rw-r--r--arch/sparc/net/bpf_jit_comp.c1
-rw-r--r--arch/um/kernel/exitcode.c4
-rw-r--r--arch/x86/Kconfig7
-rw-r--r--arch/x86/include/asm/percpu.h3
-rw-r--r--arch/x86/kernel/apic/x2apic_uv_x.c2
-rw-r--r--arch/x86/kernel/kvm.c19
-rw-r--r--arch/x86/kernel/reboot.c8
-rw-r--r--arch/x86/net/bpf_jit_comp.c18
-rw-r--r--arch/x86/xen/smp.c9
-rw-r--r--arch/xtensa/kernel/entry.S49
-rw-r--r--arch/xtensa/kernel/signal.c2
-rw-r--r--arch/xtensa/platforms/iss/network.c3
54 files changed, 300 insertions, 132 deletions
diff --git a/arch/arc/kernel/ptrace.c b/arch/arc/kernel/ptrace.c
index 333238564b67..5d76706139dd 100644
--- a/arch/arc/kernel/ptrace.c
+++ b/arch/arc/kernel/ptrace.c
@@ -102,7 +102,7 @@ static int genregs_set(struct task_struct *target,
102 REG_IGNORE_ONE(pad2); 102 REG_IGNORE_ONE(pad2);
103 REG_IN_CHUNK(callee, efa, cregs); /* callee_regs[r25..r13] */ 103 REG_IN_CHUNK(callee, efa, cregs); /* callee_regs[r25..r13] */
104 REG_IGNORE_ONE(efa); /* efa update invalid */ 104 REG_IGNORE_ONE(efa); /* efa update invalid */
105 REG_IN_ONE(stop_pc, &ptregs->ret); /* stop_pc: PC update */ 105 REG_IGNORE_ONE(stop_pc); /* PC updated via @ret */
106 106
107 return ret; 107 return ret;
108} 108}
diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index 7d7cc777ff7b..bbac42a78ce5 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -96,6 +96,11 @@
96 <1 14 0xf08>, 96 <1 14 0xf08>,
97 <1 11 0xf08>, 97 <1 11 0xf08>,
98 <1 10 0xf08>; 98 <1 10 0xf08>;
99 /* Unfortunately we need this since some versions of U-Boot
100 * on Exynos don't set the CNTFRQ register, so we need the
101 * value from DT.
102 */
103 clock-frequency = <24000000>;
99 }; 104 };
100 105
101 mct@101C0000 { 106 mct@101C0000 {
diff --git a/arch/arm/boot/dts/integratorcp.dts b/arch/arm/boot/dts/integratorcp.dts
index ff1aea0ee043..72693a69f830 100644
--- a/arch/arm/boot/dts/integratorcp.dts
+++ b/arch/arm/boot/dts/integratorcp.dts
@@ -9,11 +9,6 @@
9 model = "ARM Integrator/CP"; 9 model = "ARM Integrator/CP";
10 compatible = "arm,integrator-cp"; 10 compatible = "arm,integrator-cp";
11 11
12 aliases {
13 arm,timer-primary = &timer2;
14 arm,timer-secondary = &timer1;
15 };
16
17 chosen { 12 chosen {
18 bootargs = "root=/dev/ram0 console=ttyAMA0,38400n8 earlyprintk"; 13 bootargs = "root=/dev/ram0 console=ttyAMA0,38400n8 earlyprintk";
19 }; 14 };
@@ -24,14 +19,18 @@
24 }; 19 };
25 20
26 timer0: timer@13000000 { 21 timer0: timer@13000000 {
22 /* TIMER0 runs @ 25MHz */
27 compatible = "arm,integrator-cp-timer"; 23 compatible = "arm,integrator-cp-timer";
24 status = "disabled";
28 }; 25 };
29 26
30 timer1: timer@13000100 { 27 timer1: timer@13000100 {
28 /* TIMER1 runs @ 1MHz */
31 compatible = "arm,integrator-cp-timer"; 29 compatible = "arm,integrator-cp-timer";
32 }; 30 };
33 31
34 timer2: timer@13000200 { 32 timer2: timer@13000200 {
33 /* TIMER2 runs @ 1MHz */
35 compatible = "arm,integrator-cp-timer"; 34 compatible = "arm,integrator-cp-timer";
36 }; 35 };
37 36
diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts b/arch/arm/boot/dts/omap3-beagle-xm.dts
index 0c514dc8460c..2816bf612672 100644
--- a/arch/arm/boot/dts/omap3-beagle-xm.dts
+++ b/arch/arm/boot/dts/omap3-beagle-xm.dts
@@ -11,7 +11,7 @@
11 11
12/ { 12/ {
13 model = "TI OMAP3 BeagleBoard xM"; 13 model = "TI OMAP3 BeagleBoard xM";
14 compatible = "ti,omap3-beagle-xm", "ti,omap3-beagle", "ti,omap3"; 14 compatible = "ti,omap3-beagle-xm", "ti,omap36xx", "ti,omap3";
15 15
16 cpus { 16 cpus {
17 cpu@0 { 17 cpu@0 {
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index 7d95cda1fae4..b41bd57f4328 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -108,7 +108,7 @@
108 #address-cells = <1>; 108 #address-cells = <1>;
109 #size-cells = <0>; 109 #size-cells = <0>;
110 pinctrl-single,register-width = <16>; 110 pinctrl-single,register-width = <16>;
111 pinctrl-single,function-mask = <0x7f1f>; 111 pinctrl-single,function-mask = <0xff1f>;
112 }; 112 };
113 113
114 omap3_pmx_wkup: pinmux@0x48002a00 { 114 omap3_pmx_wkup: pinmux@0x48002a00 {
@@ -117,7 +117,7 @@
117 #address-cells = <1>; 117 #address-cells = <1>;
118 #size-cells = <0>; 118 #size-cells = <0>;
119 pinctrl-single,register-width = <16>; 119 pinctrl-single,register-width = <16>;
120 pinctrl-single,function-mask = <0x7f1f>; 120 pinctrl-single,function-mask = <0xff1f>;
121 }; 121 };
122 122
123 gpio1: gpio@48310000 { 123 gpio1: gpio@48310000 {
diff --git a/arch/arm/common/mcpm_entry.c b/arch/arm/common/mcpm_entry.c
index 370236dd1a03..990250965f2c 100644
--- a/arch/arm/common/mcpm_entry.c
+++ b/arch/arm/common/mcpm_entry.c
@@ -51,7 +51,8 @@ void mcpm_cpu_power_down(void)
51{ 51{
52 phys_reset_t phys_reset; 52 phys_reset_t phys_reset;
53 53
54 BUG_ON(!platform_ops); 54 if (WARN_ON_ONCE(!platform_ops || !platform_ops->power_down))
55 return;
55 BUG_ON(!irqs_disabled()); 56 BUG_ON(!irqs_disabled());
56 57
57 /* 58 /*
@@ -93,7 +94,8 @@ void mcpm_cpu_suspend(u64 expected_residency)
93{ 94{
94 phys_reset_t phys_reset; 95 phys_reset_t phys_reset;
95 96
96 BUG_ON(!platform_ops); 97 if (WARN_ON_ONCE(!platform_ops || !platform_ops->suspend))
98 return;
97 BUG_ON(!irqs_disabled()); 99 BUG_ON(!irqs_disabled());
98 100
99 /* Very similar to mcpm_cpu_power_down() */ 101 /* Very similar to mcpm_cpu_power_down() */
diff --git a/arch/arm/common/sharpsl_param.c b/arch/arm/common/sharpsl_param.c
index d56c932580eb..025f6ce38596 100644
--- a/arch/arm/common/sharpsl_param.c
+++ b/arch/arm/common/sharpsl_param.c
@@ -15,6 +15,7 @@
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/string.h> 16#include <linux/string.h>
17#include <asm/mach/sharpsl_param.h> 17#include <asm/mach/sharpsl_param.h>
18#include <asm/memory.h>
18 19
19/* 20/*
20 * Certain hardware parameters determined at the time of device manufacture, 21 * Certain hardware parameters determined at the time of device manufacture,
@@ -25,8 +26,10 @@
25 */ 26 */
26#ifdef CONFIG_ARCH_SA1100 27#ifdef CONFIG_ARCH_SA1100
27#define PARAM_BASE 0xe8ffc000 28#define PARAM_BASE 0xe8ffc000
29#define param_start(x) (void *)(x)
28#else 30#else
29#define PARAM_BASE 0xa0000a00 31#define PARAM_BASE 0xa0000a00
32#define param_start(x) __va(x)
30#endif 33#endif
31#define MAGIC_CHG(a,b,c,d) ( ( d << 24 ) | ( c << 16 ) | ( b << 8 ) | a ) 34#define MAGIC_CHG(a,b,c,d) ( ( d << 24 ) | ( c << 16 ) | ( b << 8 ) | a )
32 35
@@ -41,7 +44,7 @@ EXPORT_SYMBOL(sharpsl_param);
41 44
42void sharpsl_save_param(void) 45void sharpsl_save_param(void)
43{ 46{
44 memcpy(&sharpsl_param, (void *)PARAM_BASE, sizeof(struct sharpsl_param_info)); 47 memcpy(&sharpsl_param, param_start(PARAM_BASE), sizeof(struct sharpsl_param_info));
45 48
46 if (sharpsl_param.comadj_keyword != COMADJ_MAGIC) 49 if (sharpsl_param.comadj_keyword != COMADJ_MAGIC)
47 sharpsl_param.comadj=-1; 50 sharpsl_param.comadj=-1;
diff --git a/arch/arm/include/asm/Kbuild b/arch/arm/include/asm/Kbuild
index 4e6838d4ddf6..1a7024b41351 100644
--- a/arch/arm/include/asm/Kbuild
+++ b/arch/arm/include/asm/Kbuild
@@ -31,6 +31,5 @@ generic-y += termbits.h
31generic-y += termios.h 31generic-y += termios.h
32generic-y += timex.h 32generic-y += timex.h
33generic-y += trace_clock.h 33generic-y += trace_clock.h
34generic-y += types.h
35generic-y += unaligned.h 34generic-y += unaligned.h
36generic-y += preempt.h 35generic-y += preempt.h
diff --git a/arch/arm/include/asm/mcpm.h b/arch/arm/include/asm/mcpm.h
index 0f7b7620e9a5..fc82a88f5b69 100644
--- a/arch/arm/include/asm/mcpm.h
+++ b/arch/arm/include/asm/mcpm.h
@@ -76,8 +76,11 @@ int mcpm_cpu_power_up(unsigned int cpu, unsigned int cluster);
76 * 76 *
77 * This must be called with interrupts disabled. 77 * This must be called with interrupts disabled.
78 * 78 *
79 * This does not return. Re-entry in the kernel is expected via 79 * On success this does not return. Re-entry in the kernel is expected
80 * mcpm_entry_point. 80 * via mcpm_entry_point.
81 *
82 * This will return if mcpm_platform_register() has not been called
83 * previously in which case the caller should take appropriate action.
81 */ 84 */
82void mcpm_cpu_power_down(void); 85void mcpm_cpu_power_down(void);
83 86
@@ -98,8 +101,11 @@ void mcpm_cpu_power_down(void);
98 * 101 *
99 * This must be called with interrupts disabled. 102 * This must be called with interrupts disabled.
100 * 103 *
101 * This does not return. Re-entry in the kernel is expected via 104 * On success this does not return. Re-entry in the kernel is expected
102 * mcpm_entry_point. 105 * via mcpm_entry_point.
106 *
107 * This will return if mcpm_platform_register() has not been called
108 * previously in which case the caller should take appropriate action.
103 */ 109 */
104void mcpm_cpu_suspend(u64 expected_residency); 110void mcpm_cpu_suspend(u64 expected_residency);
105 111
diff --git a/arch/arm/include/asm/syscall.h b/arch/arm/include/asm/syscall.h
index f1d96d4e8092..73ddd7239b33 100644
--- a/arch/arm/include/asm/syscall.h
+++ b/arch/arm/include/asm/syscall.h
@@ -57,6 +57,9 @@ static inline void syscall_get_arguments(struct task_struct *task,
57 unsigned int i, unsigned int n, 57 unsigned int i, unsigned int n,
58 unsigned long *args) 58 unsigned long *args)
59{ 59{
60 if (n == 0)
61 return;
62
60 if (i + n > SYSCALL_MAX_ARGS) { 63 if (i + n > SYSCALL_MAX_ARGS) {
61 unsigned long *args_bad = args + SYSCALL_MAX_ARGS - i; 64 unsigned long *args_bad = args + SYSCALL_MAX_ARGS - i;
62 unsigned int n_bad = n + i - SYSCALL_MAX_ARGS; 65 unsigned int n_bad = n + i - SYSCALL_MAX_ARGS;
@@ -81,6 +84,9 @@ static inline void syscall_set_arguments(struct task_struct *task,
81 unsigned int i, unsigned int n, 84 unsigned int i, unsigned int n,
82 const unsigned long *args) 85 const unsigned long *args)
83{ 86{
87 if (n == 0)
88 return;
89
84 if (i + n > SYSCALL_MAX_ARGS) { 90 if (i + n > SYSCALL_MAX_ARGS) {
85 pr_warning("%s called with max args %d, handling only %d\n", 91 pr_warning("%s called with max args %d, handling only %d\n",
86 __func__, i + n, SYSCALL_MAX_ARGS); 92 __func__, i + n, SYSCALL_MAX_ARGS);
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 2c7cc1e03473..476de57dcef2 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -487,7 +487,26 @@ __fixup_smp:
487 mrc p15, 0, r0, c0, c0, 5 @ read MPIDR 487 mrc p15, 0, r0, c0, c0, 5 @ read MPIDR
488 and r0, r0, #0xc0000000 @ multiprocessing extensions and 488 and r0, r0, #0xc0000000 @ multiprocessing extensions and
489 teq r0, #0x80000000 @ not part of a uniprocessor system? 489 teq r0, #0x80000000 @ not part of a uniprocessor system?
490 moveq pc, lr @ yes, assume SMP 490 bne __fixup_smp_on_up @ no, assume UP
491
492 @ Core indicates it is SMP. Check for Aegis SOC where a single
493 @ Cortex-A9 CPU is present but SMP operations fault.
494 mov r4, #0x41000000
495 orr r4, r4, #0x0000c000
496 orr r4, r4, #0x00000090
497 teq r3, r4 @ Check for ARM Cortex-A9
498 movne pc, lr @ Not ARM Cortex-A9,
499
500 @ If a future SoC *does* use 0x0 as the PERIPH_BASE, then the
501 @ below address check will need to be #ifdef'd or equivalent
502 @ for the Aegis platform.
503 mrc p15, 4, r0, c15, c0 @ get SCU base address
504 teq r0, #0x0 @ '0' on actual UP A9 hardware
505 beq __fixup_smp_on_up @ So its an A9 UP
506 ldr r0, [r0, #4] @ read SCU Config
507 and r0, r0, #0x3 @ number of CPUs
508 teq r0, #0x0 @ is 1?
509 movne pc, lr
491 510
492__fixup_smp_on_up: 511__fixup_smp_on_up:
493 adr r0, 1f 512 adr r0, 1f
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 39c78387ddec..87162e1b94a5 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -129,6 +129,24 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)")
129 .restart = omap3xxx_restart, 129 .restart = omap3xxx_restart,
130MACHINE_END 130MACHINE_END
131 131
132static const char *omap36xx_boards_compat[] __initdata = {
133 "ti,omap36xx",
134 NULL,
135};
136
137DT_MACHINE_START(OMAP36XX_DT, "Generic OMAP36xx (Flattened Device Tree)")
138 .reserve = omap_reserve,
139 .map_io = omap3_map_io,
140 .init_early = omap3630_init_early,
141 .init_irq = omap_intc_of_init,
142 .handle_irq = omap3_intc_handle_irq,
143 .init_machine = omap_generic_init,
144 .init_late = omap3_init_late,
145 .init_time = omap3_sync32k_timer_init,
146 .dt_compat = omap36xx_boards_compat,
147 .restart = omap3xxx_restart,
148MACHINE_END
149
132static const char *omap3_gp_boards_compat[] __initdata = { 150static const char *omap3_gp_boards_compat[] __initdata = {
133 "ti,omap3-beagle", 151 "ti,omap3-beagle",
134 "timll,omap3-devkit8000", 152 "timll,omap3-devkit8000",
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index c3270c0f1fce..f6fe388af989 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -167,38 +167,47 @@ static struct lp55xx_led_config rx51_lp5523_led_config[] = {
167 .name = "lp5523:kb1", 167 .name = "lp5523:kb1",
168 .chan_nr = 0, 168 .chan_nr = 0,
169 .led_current = 50, 169 .led_current = 50,
170 .max_current = 100,
170 }, { 171 }, {
171 .name = "lp5523:kb2", 172 .name = "lp5523:kb2",
172 .chan_nr = 1, 173 .chan_nr = 1,
173 .led_current = 50, 174 .led_current = 50,
175 .max_current = 100,
174 }, { 176 }, {
175 .name = "lp5523:kb3", 177 .name = "lp5523:kb3",
176 .chan_nr = 2, 178 .chan_nr = 2,
177 .led_current = 50, 179 .led_current = 50,
180 .max_current = 100,
178 }, { 181 }, {
179 .name = "lp5523:kb4", 182 .name = "lp5523:kb4",
180 .chan_nr = 3, 183 .chan_nr = 3,
181 .led_current = 50, 184 .led_current = 50,
185 .max_current = 100,
182 }, { 186 }, {
183 .name = "lp5523:b", 187 .name = "lp5523:b",
184 .chan_nr = 4, 188 .chan_nr = 4,
185 .led_current = 50, 189 .led_current = 50,
190 .max_current = 100,
186 }, { 191 }, {
187 .name = "lp5523:g", 192 .name = "lp5523:g",
188 .chan_nr = 5, 193 .chan_nr = 5,
189 .led_current = 50, 194 .led_current = 50,
195 .max_current = 100,
190 }, { 196 }, {
191 .name = "lp5523:r", 197 .name = "lp5523:r",
192 .chan_nr = 6, 198 .chan_nr = 6,
193 .led_current = 50, 199 .led_current = 50,
200 .max_current = 100,
194 }, { 201 }, {
195 .name = "lp5523:kb5", 202 .name = "lp5523:kb5",
196 .chan_nr = 7, 203 .chan_nr = 7,
197 .led_current = 50, 204 .led_current = 50,
205 .max_current = 100,
198 }, { 206 }, {
199 .name = "lp5523:kb6", 207 .name = "lp5523:kb6",
200 .chan_nr = 8, 208 .chan_nr = 8,
201 .led_current = 50, 209 .led_current = 50,
210 .max_current = 100,
202 } 211 }
203}; 212};
204 213
diff --git a/arch/arm/mach-omap2/gpmc-onenand.c b/arch/arm/mach-omap2/gpmc-onenand.c
index 64b5a8346982..8b6876c98ce1 100644
--- a/arch/arm/mach-omap2/gpmc-onenand.c
+++ b/arch/arm/mach-omap2/gpmc-onenand.c
@@ -272,9 +272,19 @@ static int omap2_onenand_setup_async(void __iomem *onenand_base)
272 struct gpmc_timings t; 272 struct gpmc_timings t;
273 int ret; 273 int ret;
274 274
275 if (gpmc_onenand_data->of_node) 275 if (gpmc_onenand_data->of_node) {
276 gpmc_read_settings_dt(gpmc_onenand_data->of_node, 276 gpmc_read_settings_dt(gpmc_onenand_data->of_node,
277 &onenand_async); 277 &onenand_async);
278 if (onenand_async.sync_read || onenand_async.sync_write) {
279 if (onenand_async.sync_write)
280 gpmc_onenand_data->flags |=
281 ONENAND_SYNC_READWRITE;
282 else
283 gpmc_onenand_data->flags |= ONENAND_SYNC_READ;
284 onenand_async.sync_read = false;
285 onenand_async.sync_write = false;
286 }
287 }
278 288
279 omap2_onenand_set_async_mode(onenand_base); 289 omap2_onenand_set_async_mode(onenand_base);
280 290
diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h
index 5d2080ef7923..16f78a990d04 100644
--- a/arch/arm/mach-omap2/mux.h
+++ b/arch/arm/mach-omap2/mux.h
@@ -28,7 +28,7 @@
28#define OMAP_PULL_UP (1 << 4) 28#define OMAP_PULL_UP (1 << 4)
29#define OMAP_ALTELECTRICALSEL (1 << 5) 29#define OMAP_ALTELECTRICALSEL (1 << 5)
30 30
31/* 34xx specific mux bit defines */ 31/* omap3/4/5 specific mux bit defines */
32#define OMAP_INPUT_EN (1 << 8) 32#define OMAP_INPUT_EN (1 << 8)
33#define OMAP_OFF_EN (1 << 9) 33#define OMAP_OFF_EN (1 << 9)
34#define OMAP_OFFOUT_EN (1 << 10) 34#define OMAP_OFFOUT_EN (1 << 10)
@@ -36,8 +36,6 @@
36#define OMAP_OFF_PULL_EN (1 << 12) 36#define OMAP_OFF_PULL_EN (1 << 12)
37#define OMAP_OFF_PULL_UP (1 << 13) 37#define OMAP_OFF_PULL_UP (1 << 13)
38#define OMAP_WAKEUP_EN (1 << 14) 38#define OMAP_WAKEUP_EN (1 << 14)
39
40/* 44xx specific mux bit defines */
41#define OMAP_WAKEUP_EVENT (1 << 15) 39#define OMAP_WAKEUP_EVENT (1 << 15)
42 40
43/* Active pin states */ 41/* Active pin states */
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index fa74a0625da1..ead48fa5715e 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -628,7 +628,7 @@ void __init omap4_local_timer_init(void)
628#endif /* CONFIG_HAVE_ARM_TWD */ 628#endif /* CONFIG_HAVE_ARM_TWD */
629#endif /* CONFIG_ARCH_OMAP4 */ 629#endif /* CONFIG_ARCH_OMAP4 */
630 630
631#ifdef CONFIG_SOC_OMAP5 631#if defined(CONFIG_SOC_OMAP5) || defined(CONFIG_SOC_DRA7XX)
632void __init omap5_realtime_timer_init(void) 632void __init omap5_realtime_timer_init(void)
633{ 633{
634 omap4_sync32k_timer_init(); 634 omap4_sync32k_timer_init();
@@ -636,7 +636,7 @@ void __init omap5_realtime_timer_init(void)
636 636
637 clocksource_of_init(); 637 clocksource_of_init();
638} 638}
639#endif /* CONFIG_SOC_OMAP5 */ 639#endif /* CONFIG_SOC_OMAP5 || CONFIG_SOC_DRA7XX */
640 640
641/** 641/**
642 * omap_timer_init - build and register timer device with an 642 * omap_timer_init - build and register timer device with an
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index f5e1a8471714..1272ed202dde 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -1232,7 +1232,8 @@ __iommu_create_mapping(struct device *dev, struct page **pages, size_t size)
1232 break; 1232 break;
1233 1233
1234 len = (j - i) << PAGE_SHIFT; 1234 len = (j - i) << PAGE_SHIFT;
1235 ret = iommu_map(mapping->domain, iova, phys, len, 0); 1235 ret = iommu_map(mapping->domain, iova, phys, len,
1236 IOMMU_READ|IOMMU_WRITE);
1236 if (ret < 0) 1237 if (ret < 0)
1237 goto fail; 1238 goto fail;
1238 iova += len; 1239 iova += len;
@@ -1431,6 +1432,27 @@ static int arm_iommu_get_sgtable(struct device *dev, struct sg_table *sgt,
1431 GFP_KERNEL); 1432 GFP_KERNEL);
1432} 1433}
1433 1434
1435static int __dma_direction_to_prot(enum dma_data_direction dir)
1436{
1437 int prot;
1438
1439 switch (dir) {
1440 case DMA_BIDIRECTIONAL:
1441 prot = IOMMU_READ | IOMMU_WRITE;
1442 break;
1443 case DMA_TO_DEVICE:
1444 prot = IOMMU_READ;
1445 break;
1446 case DMA_FROM_DEVICE:
1447 prot = IOMMU_WRITE;
1448 break;
1449 default:
1450 prot = 0;
1451 }
1452
1453 return prot;
1454}
1455
1434/* 1456/*
1435 * Map a part of the scatter-gather list into contiguous io address space 1457 * Map a part of the scatter-gather list into contiguous io address space
1436 */ 1458 */
@@ -1444,6 +1466,7 @@ static int __map_sg_chunk(struct device *dev, struct scatterlist *sg,
1444 int ret = 0; 1466 int ret = 0;
1445 unsigned int count; 1467 unsigned int count;
1446 struct scatterlist *s; 1468 struct scatterlist *s;
1469 int prot;
1447 1470
1448 size = PAGE_ALIGN(size); 1471 size = PAGE_ALIGN(size);
1449 *handle = DMA_ERROR_CODE; 1472 *handle = DMA_ERROR_CODE;
@@ -1460,7 +1483,9 @@ static int __map_sg_chunk(struct device *dev, struct scatterlist *sg,
1460 !dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs)) 1483 !dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs))
1461 __dma_page_cpu_to_dev(sg_page(s), s->offset, s->length, dir); 1484 __dma_page_cpu_to_dev(sg_page(s), s->offset, s->length, dir);
1462 1485
1463 ret = iommu_map(mapping->domain, iova, phys, len, 0); 1486 prot = __dma_direction_to_prot(dir);
1487
1488 ret = iommu_map(mapping->domain, iova, phys, len, prot);
1464 if (ret < 0) 1489 if (ret < 0)
1465 goto fail; 1490 goto fail;
1466 count += len >> PAGE_SHIFT; 1491 count += len >> PAGE_SHIFT;
@@ -1665,19 +1690,7 @@ static dma_addr_t arm_coherent_iommu_map_page(struct device *dev, struct page *p
1665 if (dma_addr == DMA_ERROR_CODE) 1690 if (dma_addr == DMA_ERROR_CODE)
1666 return dma_addr; 1691 return dma_addr;
1667 1692
1668 switch (dir) { 1693 prot = __dma_direction_to_prot(dir);
1669 case DMA_BIDIRECTIONAL:
1670 prot = IOMMU_READ | IOMMU_WRITE;
1671 break;
1672 case DMA_TO_DEVICE:
1673 prot = IOMMU_READ;
1674 break;
1675 case DMA_FROM_DEVICE:
1676 prot = IOMMU_WRITE;
1677 break;
1678 default:
1679 prot = 0;
1680 }
1681 1694
1682 ret = iommu_map(mapping->domain, dma_addr, page_to_phys(page), len, prot); 1695 ret = iommu_map(mapping->domain, dma_addr, page_to_phys(page), len, prot);
1683 if (ret < 0) 1696 if (ret < 0)
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index febaee7ca57b..18ec4c504abf 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -17,7 +17,6 @@
17#include <linux/nodemask.h> 17#include <linux/nodemask.h>
18#include <linux/initrd.h> 18#include <linux/initrd.h>
19#include <linux/of_fdt.h> 19#include <linux/of_fdt.h>
20#include <linux/of_reserved_mem.h>
21#include <linux/highmem.h> 20#include <linux/highmem.h>
22#include <linux/gfp.h> 21#include <linux/gfp.h>
23#include <linux/memblock.h> 22#include <linux/memblock.h>
@@ -379,8 +378,6 @@ void __init arm_memblock_init(struct meminfo *mi,
379 if (mdesc->reserve) 378 if (mdesc->reserve)
380 mdesc->reserve(); 379 mdesc->reserve();
381 380
382 early_init_dt_scan_reserved_mem();
383
384 /* 381 /*
385 * reserve memory for DMA contigouos allocations, 382 * reserve memory for DMA contigouos allocations,
386 * must come from DMA area inside low memory 383 * must come from DMA area inside low memory
diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c
index f50d223a0bd3..99b44e0e8d86 100644
--- a/arch/arm/net/bpf_jit_32.c
+++ b/arch/arm/net/bpf_jit_32.c
@@ -930,4 +930,5 @@ void bpf_jit_free(struct sk_filter *fp)
930{ 930{
931 if (fp->bpf_func != sk_run_filter) 931 if (fp->bpf_func != sk_run_filter)
932 module_free(NULL, fp->bpf_func); 932 module_free(NULL, fp->bpf_func);
933 kfree(fp);
933} 934}
diff --git a/arch/mips/kernel/octeon_switch.S b/arch/mips/kernel/octeon_switch.S
index 4204d76af854..029e002a4ea0 100644
--- a/arch/mips/kernel/octeon_switch.S
+++ b/arch/mips/kernel/octeon_switch.S
@@ -73,7 +73,7 @@
733: 733:
74 74
75#if defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_SMP) 75#if defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_SMP)
76 PTR_L t8, __stack_chk_guard 76 PTR_LA t8, __stack_chk_guard
77 LONG_L t9, TASK_STACK_CANARY(a1) 77 LONG_L t9, TASK_STACK_CANARY(a1)
78 LONG_S t9, 0(t8) 78 LONG_S t9, 0(t8)
79#endif 79#endif
diff --git a/arch/mips/kernel/r2300_switch.S b/arch/mips/kernel/r2300_switch.S
index 38af83f84c4a..20b7b040e76f 100644
--- a/arch/mips/kernel/r2300_switch.S
+++ b/arch/mips/kernel/r2300_switch.S
@@ -67,7 +67,7 @@ LEAF(resume)
671: 671:
68 68
69#if defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_SMP) 69#if defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_SMP)
70 PTR_L t8, __stack_chk_guard 70 PTR_LA t8, __stack_chk_guard
71 LONG_L t9, TASK_STACK_CANARY(a1) 71 LONG_L t9, TASK_STACK_CANARY(a1)
72 LONG_S t9, 0(t8) 72 LONG_S t9, 0(t8)
73#endif 73#endif
diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S
index 921238a6bd26..078de5eaca8f 100644
--- a/arch/mips/kernel/r4k_switch.S
+++ b/arch/mips/kernel/r4k_switch.S
@@ -69,7 +69,7 @@
691: 691:
70 70
71#if defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_SMP) 71#if defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_SMP)
72 PTR_L t8, __stack_chk_guard 72 PTR_LA t8, __stack_chk_guard
73 LONG_L t9, TASK_STACK_CANARY(a1) 73 LONG_L t9, TASK_STACK_CANARY(a1)
74 LONG_S t9, 0(t8) 74 LONG_S t9, 0(t8)
75#endif 75#endif
diff --git a/arch/parisc/configs/712_defconfig b/arch/parisc/configs/712_defconfig
index 0f90569b9d85..9387cc2693f6 100644
--- a/arch/parisc/configs/712_defconfig
+++ b/arch/parisc/configs/712_defconfig
@@ -40,6 +40,8 @@ CONFIG_IP_NF_QUEUE=m
40CONFIG_LLC2=m 40CONFIG_LLC2=m
41CONFIG_NET_PKTGEN=m 41CONFIG_NET_PKTGEN=m
42CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 42CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
43CONFIG_DEVTMPFS=y
44CONFIG_DEVTMPFS_MOUNT=y
43# CONFIG_STANDALONE is not set 45# CONFIG_STANDALONE is not set
44# CONFIG_PREVENT_FIRMWARE_BUILD is not set 46# CONFIG_PREVENT_FIRMWARE_BUILD is not set
45CONFIG_PARPORT=y 47CONFIG_PARPORT=y
diff --git a/arch/parisc/configs/a500_defconfig b/arch/parisc/configs/a500_defconfig
index b647b182dacc..90025322b75e 100644
--- a/arch/parisc/configs/a500_defconfig
+++ b/arch/parisc/configs/a500_defconfig
@@ -79,6 +79,8 @@ CONFIG_IP_DCCP=m
79CONFIG_LLC2=m 79CONFIG_LLC2=m
80CONFIG_NET_PKTGEN=m 80CONFIG_NET_PKTGEN=m
81CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 81CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
82CONFIG_DEVTMPFS=y
83CONFIG_DEVTMPFS_MOUNT=y
82# CONFIG_STANDALONE is not set 84# CONFIG_STANDALONE is not set
83# CONFIG_PREVENT_FIRMWARE_BUILD is not set 85# CONFIG_PREVENT_FIRMWARE_BUILD is not set
84CONFIG_BLK_DEV_UMEM=m 86CONFIG_BLK_DEV_UMEM=m
diff --git a/arch/parisc/configs/b180_defconfig b/arch/parisc/configs/b180_defconfig
index e289f5bf3148..f1a0c25bef8d 100644
--- a/arch/parisc/configs/b180_defconfig
+++ b/arch/parisc/configs/b180_defconfig
@@ -4,6 +4,7 @@ CONFIG_IKCONFIG=y
4CONFIG_IKCONFIG_PROC=y 4CONFIG_IKCONFIG_PROC=y
5CONFIG_LOG_BUF_SHIFT=16 5CONFIG_LOG_BUF_SHIFT=16
6CONFIG_SYSFS_DEPRECATED_V2=y 6CONFIG_SYSFS_DEPRECATED_V2=y
7CONFIG_BLK_DEV_INITRD=y
7CONFIG_SLAB=y 8CONFIG_SLAB=y
8CONFIG_MODULES=y 9CONFIG_MODULES=y
9CONFIG_MODVERSIONS=y 10CONFIG_MODVERSIONS=y
@@ -27,6 +28,8 @@ CONFIG_IP_PNP_BOOTP=y
27# CONFIG_INET_LRO is not set 28# CONFIG_INET_LRO is not set
28CONFIG_IPV6=y 29CONFIG_IPV6=y
29CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 30CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
31CONFIG_DEVTMPFS=y
32CONFIG_DEVTMPFS_MOUNT=y
30# CONFIG_PREVENT_FIRMWARE_BUILD is not set 33# CONFIG_PREVENT_FIRMWARE_BUILD is not set
31CONFIG_PARPORT=y 34CONFIG_PARPORT=y
32CONFIG_PARPORT_PC=y 35CONFIG_PARPORT_PC=y
diff --git a/arch/parisc/configs/c3000_defconfig b/arch/parisc/configs/c3000_defconfig
index 311ca367b622..ec1b014952b6 100644
--- a/arch/parisc/configs/c3000_defconfig
+++ b/arch/parisc/configs/c3000_defconfig
@@ -5,6 +5,7 @@ CONFIG_IKCONFIG=y
5CONFIG_IKCONFIG_PROC=y 5CONFIG_IKCONFIG_PROC=y
6CONFIG_LOG_BUF_SHIFT=16 6CONFIG_LOG_BUF_SHIFT=16
7CONFIG_SYSFS_DEPRECATED_V2=y 7CONFIG_SYSFS_DEPRECATED_V2=y
8CONFIG_BLK_DEV_INITRD=y
8# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 9# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
9CONFIG_EXPERT=y 10CONFIG_EXPERT=y
10CONFIG_KALLSYMS_ALL=y 11CONFIG_KALLSYMS_ALL=y
@@ -39,6 +40,8 @@ CONFIG_NETFILTER_DEBUG=y
39CONFIG_IP_NF_QUEUE=m 40CONFIG_IP_NF_QUEUE=m
40CONFIG_NET_PKTGEN=m 41CONFIG_NET_PKTGEN=m
41CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 42CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
43CONFIG_DEVTMPFS=y
44CONFIG_DEVTMPFS_MOUNT=y
42# CONFIG_STANDALONE is not set 45# CONFIG_STANDALONE is not set
43# CONFIG_PREVENT_FIRMWARE_BUILD is not set 46# CONFIG_PREVENT_FIRMWARE_BUILD is not set
44CONFIG_BLK_DEV_UMEM=m 47CONFIG_BLK_DEV_UMEM=m
diff --git a/arch/parisc/configs/c8000_defconfig b/arch/parisc/configs/c8000_defconfig
index f11006361297..e1c8d2015c89 100644
--- a/arch/parisc/configs/c8000_defconfig
+++ b/arch/parisc/configs/c8000_defconfig
@@ -62,6 +62,8 @@ CONFIG_TIPC=m
62CONFIG_LLC2=m 62CONFIG_LLC2=m
63CONFIG_DNS_RESOLVER=y 63CONFIG_DNS_RESOLVER=y
64CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 64CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
65CONFIG_DEVTMPFS=y
66CONFIG_DEVTMPFS_MOUNT=y
65# CONFIG_STANDALONE is not set 67# CONFIG_STANDALONE is not set
66CONFIG_PARPORT=y 68CONFIG_PARPORT=y
67CONFIG_PARPORT_PC=y 69CONFIG_PARPORT_PC=y
diff --git a/arch/parisc/configs/default_defconfig b/arch/parisc/configs/default_defconfig
index dfe88f6c95c4..ba61495e1fa4 100644
--- a/arch/parisc/configs/default_defconfig
+++ b/arch/parisc/configs/default_defconfig
@@ -49,6 +49,8 @@ CONFIG_INET6_ESP=y
49CONFIG_INET6_IPCOMP=y 49CONFIG_INET6_IPCOMP=y
50CONFIG_LLC2=m 50CONFIG_LLC2=m
51CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 51CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
52CONFIG_DEVTMPFS=y
53CONFIG_DEVTMPFS_MOUNT=y
52# CONFIG_STANDALONE is not set 54# CONFIG_STANDALONE is not set
53# CONFIG_PREVENT_FIRMWARE_BUILD is not set 55# CONFIG_PREVENT_FIRMWARE_BUILD is not set
54CONFIG_PARPORT=y 56CONFIG_PARPORT=y
diff --git a/arch/parisc/include/asm/traps.h b/arch/parisc/include/asm/traps.h
index 1945f995f2df..4736020ba5ea 100644
--- a/arch/parisc/include/asm/traps.h
+++ b/arch/parisc/include/asm/traps.h
@@ -6,7 +6,7 @@ struct pt_regs;
6 6
7/* traps.c */ 7/* traps.c */
8void parisc_terminate(char *msg, struct pt_regs *regs, 8void parisc_terminate(char *msg, struct pt_regs *regs,
9 int code, unsigned long offset); 9 int code, unsigned long offset) __noreturn __cold;
10 10
11/* mm/fault.c */ 11/* mm/fault.c */
12void do_page_fault(struct pt_regs *regs, unsigned long code, 12void do_page_fault(struct pt_regs *regs, unsigned long code,
diff --git a/arch/parisc/kernel/head.S b/arch/parisc/kernel/head.S
index 37aabd772fbb..d2d58258aea6 100644
--- a/arch/parisc/kernel/head.S
+++ b/arch/parisc/kernel/head.S
@@ -195,6 +195,8 @@ common_stext:
195 ldw MEM_PDC_HI(%r0),%r6 195 ldw MEM_PDC_HI(%r0),%r6
196 depd %r6, 31, 32, %r3 /* move to upper word */ 196 depd %r6, 31, 32, %r3 /* move to upper word */
197 197
198 mfctl %cr30,%r6 /* PCX-W2 firmware bug */
199
198 ldo PDC_PSW(%r0),%arg0 /* 21 */ 200 ldo PDC_PSW(%r0),%arg0 /* 21 */
199 ldo PDC_PSW_SET_DEFAULTS(%r0),%arg1 /* 2 */ 201 ldo PDC_PSW_SET_DEFAULTS(%r0),%arg1 /* 2 */
200 ldo PDC_PSW_WIDE_BIT(%r0),%arg2 /* 2 */ 202 ldo PDC_PSW_WIDE_BIT(%r0),%arg2 /* 2 */
@@ -203,6 +205,8 @@ common_stext:
203 copy %r0,%arg3 205 copy %r0,%arg3
204 206
205stext_pdc_ret: 207stext_pdc_ret:
208 mtctl %r6,%cr30 /* restore task thread info */
209
206 /* restore rfi target address*/ 210 /* restore rfi target address*/
207 ldd TI_TASK-THREAD_SZ_ALGN(%sp), %r10 211 ldd TI_TASK-THREAD_SZ_ALGN(%sp), %r10
208 tophys_r1 %r10 212 tophys_r1 %r10
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index 8a252f2d6c08..2b96602e812f 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -72,7 +72,6 @@ enum ipi_message_type {
72 IPI_NOP=0, 72 IPI_NOP=0,
73 IPI_RESCHEDULE=1, 73 IPI_RESCHEDULE=1,
74 IPI_CALL_FUNC, 74 IPI_CALL_FUNC,
75 IPI_CALL_FUNC_SINGLE,
76 IPI_CPU_START, 75 IPI_CPU_START,
77 IPI_CPU_STOP, 76 IPI_CPU_STOP,
78 IPI_CPU_TEST 77 IPI_CPU_TEST
@@ -164,11 +163,6 @@ ipi_interrupt(int irq, void *dev_id)
164 generic_smp_call_function_interrupt(); 163 generic_smp_call_function_interrupt();
165 break; 164 break;
166 165
167 case IPI_CALL_FUNC_SINGLE:
168 smp_debug(100, KERN_DEBUG "CPU%d IPI_CALL_FUNC_SINGLE\n", this_cpu);
169 generic_smp_call_function_single_interrupt();
170 break;
171
172 case IPI_CPU_START: 166 case IPI_CPU_START:
173 smp_debug(100, KERN_DEBUG "CPU%d IPI_CPU_START\n", this_cpu); 167 smp_debug(100, KERN_DEBUG "CPU%d IPI_CPU_START\n", this_cpu);
174 break; 168 break;
@@ -260,7 +254,7 @@ void arch_send_call_function_ipi_mask(const struct cpumask *mask)
260 254
261void arch_send_call_function_single_ipi(int cpu) 255void arch_send_call_function_single_ipi(int cpu)
262{ 256{
263 send_IPI_single(cpu, IPI_CALL_FUNC_SINGLE); 257 send_IPI_single(cpu, IPI_CALL_FUNC);
264} 258}
265 259
266/* 260/*
diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c
index 04e47c6a4562..1cd1d0c83b6d 100644
--- a/arch/parisc/kernel/traps.c
+++ b/arch/parisc/kernel/traps.c
@@ -291,11 +291,6 @@ void die_if_kernel(char *str, struct pt_regs *regs, long err)
291 do_exit(SIGSEGV); 291 do_exit(SIGSEGV);
292} 292}
293 293
294int syscall_ipi(int (*syscall) (struct pt_regs *), struct pt_regs *regs)
295{
296 return syscall(regs);
297}
298
299/* gdb uses break 4,8 */ 294/* gdb uses break 4,8 */
300#define GDB_BREAK_INSN 0x10004 295#define GDB_BREAK_INSN 0x10004
301static void handle_gdb_break(struct pt_regs *regs, int wot) 296static void handle_gdb_break(struct pt_regs *regs, int wot)
@@ -805,14 +800,14 @@ void notrace handle_interruption(int code, struct pt_regs *regs)
805 else { 800 else {
806 801
807 /* 802 /*
808 * The kernel should never fault on its own address space. 803 * The kernel should never fault on its own address space,
804 * unless pagefault_disable() was called before.
809 */ 805 */
810 806
811 if (fault_space == 0) 807 if (fault_space == 0 && !in_atomic())
812 { 808 {
813 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_PANIC); 809 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_PANIC);
814 parisc_terminate("Kernel Fault", regs, code, fault_address); 810 parisc_terminate("Kernel Fault", regs, code, fault_address);
815
816 } 811 }
817 } 812 }
818 813
diff --git a/arch/parisc/lib/memcpy.c b/arch/parisc/lib/memcpy.c
index ac4370b1ca40..b5507ec06b84 100644
--- a/arch/parisc/lib/memcpy.c
+++ b/arch/parisc/lib/memcpy.c
@@ -56,7 +56,7 @@
56#ifdef __KERNEL__ 56#ifdef __KERNEL__
57#include <linux/module.h> 57#include <linux/module.h>
58#include <linux/compiler.h> 58#include <linux/compiler.h>
59#include <asm/uaccess.h> 59#include <linux/uaccess.h>
60#define s_space "%%sr1" 60#define s_space "%%sr1"
61#define d_space "%%sr2" 61#define d_space "%%sr2"
62#else 62#else
@@ -524,4 +524,17 @@ EXPORT_SYMBOL(copy_to_user);
524EXPORT_SYMBOL(copy_from_user); 524EXPORT_SYMBOL(copy_from_user);
525EXPORT_SYMBOL(copy_in_user); 525EXPORT_SYMBOL(copy_in_user);
526EXPORT_SYMBOL(memcpy); 526EXPORT_SYMBOL(memcpy);
527
528long probe_kernel_read(void *dst, const void *src, size_t size)
529{
530 unsigned long addr = (unsigned long)src;
531
532 if (size < 0 || addr < PAGE_SIZE)
533 return -EFAULT;
534
535 /* check for I/O space F_EXTEND(0xfff00000) access as well? */
536
537 return __probe_kernel_read(dst, src, size);
538}
539
527#endif 540#endif
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c
index 00c0ed333a3d..0293588d5b8c 100644
--- a/arch/parisc/mm/fault.c
+++ b/arch/parisc/mm/fault.c
@@ -171,20 +171,25 @@ void do_page_fault(struct pt_regs *regs, unsigned long code,
171 unsigned long address) 171 unsigned long address)
172{ 172{
173 struct vm_area_struct *vma, *prev_vma; 173 struct vm_area_struct *vma, *prev_vma;
174 struct task_struct *tsk = current; 174 struct task_struct *tsk;
175 struct mm_struct *mm = tsk->mm; 175 struct mm_struct *mm;
176 unsigned long acc_type; 176 unsigned long acc_type;
177 int fault; 177 int fault;
178 unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; 178 unsigned int flags;
179 179
180 if (in_atomic() || !mm) 180 if (in_atomic())
181 goto no_context; 181 goto no_context;
182 182
183 tsk = current;
184 mm = tsk->mm;
185 if (!mm)
186 goto no_context;
187
188 flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
183 if (user_mode(regs)) 189 if (user_mode(regs))
184 flags |= FAULT_FLAG_USER; 190 flags |= FAULT_FLAG_USER;
185 191
186 acc_type = parisc_acctyp(code, regs->iir); 192 acc_type = parisc_acctyp(code, regs->iir);
187
188 if (acc_type & VM_WRITE) 193 if (acc_type & VM_WRITE)
189 flags |= FAULT_FLAG_WRITE; 194 flags |= FAULT_FLAG_WRITE;
190retry: 195retry:
diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c
index bf56e33f8257..2345bdb4d917 100644
--- a/arch/powerpc/net/bpf_jit_comp.c
+++ b/arch/powerpc/net/bpf_jit_comp.c
@@ -691,4 +691,5 @@ void bpf_jit_free(struct sk_filter *fp)
691{ 691{
692 if (fp->bpf_func != sk_run_filter) 692 if (fp->bpf_func != sk_run_filter)
693 module_free(NULL, fp->bpf_func); 693 module_free(NULL, fp->bpf_func);
694 kfree(fp);
694} 695}
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
index 9b60a36c348d..2204400d0bd5 100644
--- a/arch/s390/include/asm/pgtable.h
+++ b/arch/s390/include/asm/pgtable.h
@@ -748,7 +748,9 @@ static inline void pgste_set_key(pte_t *ptep, pgste_t pgste, pte_t entry)
748 748
749static inline void pgste_set_pte(pte_t *ptep, pte_t entry) 749static inline void pgste_set_pte(pte_t *ptep, pte_t entry)
750{ 750{
751 if (!MACHINE_HAS_ESOP && (pte_val(entry) & _PAGE_WRITE)) { 751 if (!MACHINE_HAS_ESOP &&
752 (pte_val(entry) & _PAGE_PRESENT) &&
753 (pte_val(entry) & _PAGE_WRITE)) {
752 /* 754 /*
753 * Without enhanced suppression-on-protection force 755 * Without enhanced suppression-on-protection force
754 * the dirty bit on for all writable ptes. 756 * the dirty bit on for all writable ptes.
diff --git a/arch/s390/include/asm/timex.h b/arch/s390/include/asm/timex.h
index 8ad8af915032..819b94d22720 100644
--- a/arch/s390/include/asm/timex.h
+++ b/arch/s390/include/asm/timex.h
@@ -71,30 +71,30 @@ static inline void local_tick_enable(unsigned long long comp)
71 71
72typedef unsigned long long cycles_t; 72typedef unsigned long long cycles_t;
73 73
74static inline unsigned long long get_tod_clock(void)
75{
76 unsigned long long clk;
77
78#ifdef CONFIG_HAVE_MARCH_Z9_109_FEATURES
79 asm volatile(".insn s,0xb27c0000,%0" : "=Q" (clk) : : "cc");
80#else
81 asm volatile("stck %0" : "=Q" (clk) : : "cc");
82#endif
83 return clk;
84}
85
86static inline void get_tod_clock_ext(char *clk) 74static inline void get_tod_clock_ext(char *clk)
87{ 75{
88 asm volatile("stcke %0" : "=Q" (*clk) : : "cc"); 76 asm volatile("stcke %0" : "=Q" (*clk) : : "cc");
89} 77}
90 78
91static inline unsigned long long get_tod_clock_xt(void) 79static inline unsigned long long get_tod_clock(void)
92{ 80{
93 unsigned char clk[16]; 81 unsigned char clk[16];
94 get_tod_clock_ext(clk); 82 get_tod_clock_ext(clk);
95 return *((unsigned long long *)&clk[1]); 83 return *((unsigned long long *)&clk[1]);
96} 84}
97 85
86static inline unsigned long long get_tod_clock_fast(void)
87{
88#ifdef CONFIG_HAVE_MARCH_Z9_109_FEATURES
89 unsigned long long clk;
90
91 asm volatile("stckf %0" : "=Q" (clk) : : "cc");
92 return clk;
93#else
94 return get_tod_clock();
95#endif
96}
97
98static inline cycles_t get_cycles(void) 98static inline cycles_t get_cycles(void)
99{ 99{
100 return (cycles_t) get_tod_clock() >> 2; 100 return (cycles_t) get_tod_clock() >> 2;
@@ -125,7 +125,7 @@ extern u64 sched_clock_base_cc;
125 */ 125 */
126static inline unsigned long long get_tod_clock_monotonic(void) 126static inline unsigned long long get_tod_clock_monotonic(void)
127{ 127{
128 return get_tod_clock_xt() - sched_clock_base_cc; 128 return get_tod_clock() - sched_clock_base_cc;
129} 129}
130 130
131/** 131/**
diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c
index 1389b637dae5..adaa9e9478d8 100644
--- a/arch/s390/kernel/compat_signal.c
+++ b/arch/s390/kernel/compat_signal.c
@@ -99,7 +99,7 @@ int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from)
99 break; 99 break;
100 } 100 }
101 } 101 }
102 return err; 102 return err ? -EFAULT : 0;
103} 103}
104 104
105int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from) 105int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from)
@@ -148,7 +148,7 @@ int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from)
148 break; 148 break;
149 } 149 }
150 } 150 }
151 return err; 151 return err ? -EFAULT : 0;
152} 152}
153 153
154static int save_sigregs32(struct pt_regs *regs, _sigregs32 __user *sregs) 154static int save_sigregs32(struct pt_regs *regs, _sigregs32 __user *sregs)
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
index f1279dc2e1bc..17d62fe5d7b7 100644
--- a/arch/s390/kernel/debug.c
+++ b/arch/s390/kernel/debug.c
@@ -867,7 +867,7 @@ static inline void
867debug_finish_entry(debug_info_t * id, debug_entry_t* active, int level, 867debug_finish_entry(debug_info_t * id, debug_entry_t* active, int level,
868 int exception) 868 int exception)
869{ 869{
870 active->id.stck = get_tod_clock(); 870 active->id.stck = get_tod_clock_fast();
871 active->id.fields.cpuid = smp_processor_id(); 871 active->id.fields.cpuid = smp_processor_id();
872 active->caller = __builtin_return_address(0); 872 active->caller = __builtin_return_address(0);
873 active->id.fields.exception = exception; 873 active->id.fields.exception = exception;
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 7f35cb33e510..7f1f7ac5cf7f 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -385,7 +385,7 @@ static int kvm_cpu_has_interrupt(struct kvm_vcpu *vcpu)
385 } 385 }
386 386
387 if ((!rc) && (vcpu->arch.sie_block->ckc < 387 if ((!rc) && (vcpu->arch.sie_block->ckc <
388 get_tod_clock() + vcpu->arch.sie_block->epoch)) { 388 get_tod_clock_fast() + vcpu->arch.sie_block->epoch)) {
389 if ((!psw_extint_disabled(vcpu)) && 389 if ((!psw_extint_disabled(vcpu)) &&
390 (vcpu->arch.sie_block->gcr[0] & 0x800ul)) 390 (vcpu->arch.sie_block->gcr[0] & 0x800ul))
391 rc = 1; 391 rc = 1;
@@ -425,7 +425,7 @@ int kvm_s390_handle_wait(struct kvm_vcpu *vcpu)
425 goto no_timer; 425 goto no_timer;
426 } 426 }
427 427
428 now = get_tod_clock() + vcpu->arch.sie_block->epoch; 428 now = get_tod_clock_fast() + vcpu->arch.sie_block->epoch;
429 if (vcpu->arch.sie_block->ckc < now) { 429 if (vcpu->arch.sie_block->ckc < now) {
430 __unset_cpu_idle(vcpu); 430 __unset_cpu_idle(vcpu);
431 return 0; 431 return 0;
@@ -515,7 +515,7 @@ void kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu)
515 } 515 }
516 516
517 if ((vcpu->arch.sie_block->ckc < 517 if ((vcpu->arch.sie_block->ckc <
518 get_tod_clock() + vcpu->arch.sie_block->epoch)) 518 get_tod_clock_fast() + vcpu->arch.sie_block->epoch))
519 __try_deliver_ckc_interrupt(vcpu); 519 __try_deliver_ckc_interrupt(vcpu);
520 520
521 if (atomic_read(&fi->active)) { 521 if (atomic_read(&fi->active)) {
diff --git a/arch/s390/lib/delay.c b/arch/s390/lib/delay.c
index 57c87d7d7ede..a9f3d0042d58 100644
--- a/arch/s390/lib/delay.c
+++ b/arch/s390/lib/delay.c
@@ -44,7 +44,7 @@ static void __udelay_disabled(unsigned long long usecs)
44 do { 44 do {
45 set_clock_comparator(end); 45 set_clock_comparator(end);
46 vtime_stop_cpu(); 46 vtime_stop_cpu();
47 } while (get_tod_clock() < end); 47 } while (get_tod_clock_fast() < end);
48 lockdep_on(); 48 lockdep_on();
49 __ctl_load(cr0, 0, 0); 49 __ctl_load(cr0, 0, 0);
50 __ctl_load(cr6, 6, 6); 50 __ctl_load(cr6, 6, 6);
@@ -55,7 +55,7 @@ static void __udelay_enabled(unsigned long long usecs)
55{ 55{
56 u64 clock_saved, end; 56 u64 clock_saved, end;
57 57
58 end = get_tod_clock() + (usecs << 12); 58 end = get_tod_clock_fast() + (usecs << 12);
59 do { 59 do {
60 clock_saved = 0; 60 clock_saved = 0;
61 if (end < S390_lowcore.clock_comparator) { 61 if (end < S390_lowcore.clock_comparator) {
@@ -65,7 +65,7 @@ static void __udelay_enabled(unsigned long long usecs)
65 vtime_stop_cpu(); 65 vtime_stop_cpu();
66 if (clock_saved) 66 if (clock_saved)
67 local_tick_enable(clock_saved); 67 local_tick_enable(clock_saved);
68 } while (get_tod_clock() < end); 68 } while (get_tod_clock_fast() < end);
69} 69}
70 70
71/* 71/*
@@ -109,8 +109,8 @@ void udelay_simple(unsigned long long usecs)
109{ 109{
110 u64 end; 110 u64 end;
111 111
112 end = get_tod_clock() + (usecs << 12); 112 end = get_tod_clock_fast() + (usecs << 12);
113 while (get_tod_clock() < end) 113 while (get_tod_clock_fast() < end)
114 cpu_relax(); 114 cpu_relax();
115} 115}
116 116
@@ -120,10 +120,10 @@ void __ndelay(unsigned long long nsecs)
120 120
121 nsecs <<= 9; 121 nsecs <<= 9;
122 do_div(nsecs, 125); 122 do_div(nsecs, 125);
123 end = get_tod_clock() + nsecs; 123 end = get_tod_clock_fast() + nsecs;
124 if (nsecs & ~0xfffUL) 124 if (nsecs & ~0xfffUL)
125 __udelay(nsecs >> 12); 125 __udelay(nsecs >> 12);
126 while (get_tod_clock() < end) 126 while (get_tod_clock_fast() < end)
127 barrier(); 127 barrier();
128} 128}
129EXPORT_SYMBOL(__ndelay); 129EXPORT_SYMBOL(__ndelay);
diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c
index 709239285869..a5df511e27a2 100644
--- a/arch/s390/net/bpf_jit_comp.c
+++ b/arch/s390/net/bpf_jit_comp.c
@@ -881,7 +881,9 @@ void bpf_jit_free(struct sk_filter *fp)
881 struct bpf_binary_header *header = (void *)addr; 881 struct bpf_binary_header *header = (void *)addr;
882 882
883 if (fp->bpf_func == sk_run_filter) 883 if (fp->bpf_func == sk_run_filter)
884 return; 884 goto free_filter;
885 set_memory_rw(addr, header->pages); 885 set_memory_rw(addr, header->pages);
886 module_free(NULL, header); 886 module_free(NULL, header);
887free_filter:
888 kfree(fp);
887} 889}
diff --git a/arch/sparc/net/bpf_jit_comp.c b/arch/sparc/net/bpf_jit_comp.c
index 9c7be59e6f5a..218b6b23c378 100644
--- a/arch/sparc/net/bpf_jit_comp.c
+++ b/arch/sparc/net/bpf_jit_comp.c
@@ -808,4 +808,5 @@ void bpf_jit_free(struct sk_filter *fp)
808{ 808{
809 if (fp->bpf_func != sk_run_filter) 809 if (fp->bpf_func != sk_run_filter)
810 module_free(NULL, fp->bpf_func); 810 module_free(NULL, fp->bpf_func);
811 kfree(fp);
811} 812}
diff --git a/arch/um/kernel/exitcode.c b/arch/um/kernel/exitcode.c
index 829df49dee99..41ebbfebb333 100644
--- a/arch/um/kernel/exitcode.c
+++ b/arch/um/kernel/exitcode.c
@@ -40,9 +40,11 @@ static ssize_t exitcode_proc_write(struct file *file,
40 const char __user *buffer, size_t count, loff_t *pos) 40 const char __user *buffer, size_t count, loff_t *pos)
41{ 41{
42 char *end, buf[sizeof("nnnnn\0")]; 42 char *end, buf[sizeof("nnnnn\0")];
43 size_t size;
43 int tmp; 44 int tmp;
44 45
45 if (copy_from_user(buf, buffer, count)) 46 size = min(count, sizeof(buf));
47 if (copy_from_user(buf, buffer, size))
46 return -EFAULT; 48 return -EFAULT;
47 49
48 tmp = simple_strtol(buf, &end, 0); 50 tmp = simple_strtol(buf, &end, 0);
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index ee2fb9d37745..f67e839f06c8 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -860,7 +860,7 @@ source "kernel/Kconfig.preempt"
860 860
861config X86_UP_APIC 861config X86_UP_APIC
862 bool "Local APIC support on uniprocessors" 862 bool "Local APIC support on uniprocessors"
863 depends on X86_32 && !SMP && !X86_32_NON_STANDARD 863 depends on X86_32 && !SMP && !X86_32_NON_STANDARD && !PCI_MSI
864 ---help--- 864 ---help---
865 A local APIC (Advanced Programmable Interrupt Controller) is an 865 A local APIC (Advanced Programmable Interrupt Controller) is an
866 integrated interrupt controller in the CPU. If you have a single-CPU 866 integrated interrupt controller in the CPU. If you have a single-CPU
@@ -885,11 +885,11 @@ config X86_UP_IOAPIC
885 885
886config X86_LOCAL_APIC 886config X86_LOCAL_APIC
887 def_bool y 887 def_bool y
888 depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_APIC 888 depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_APIC || PCI_MSI
889 889
890config X86_IO_APIC 890config X86_IO_APIC
891 def_bool y 891 def_bool y
892 depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_IOAPIC 892 depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_IOAPIC || PCI_MSI
893 893
894config X86_VISWS_APIC 894config X86_VISWS_APIC
895 def_bool y 895 def_bool y
@@ -1033,6 +1033,7 @@ config X86_REBOOTFIXUPS
1033 1033
1034config MICROCODE 1034config MICROCODE
1035 tristate "CPU microcode loading support" 1035 tristate "CPU microcode loading support"
1036 depends on CPU_SUP_AMD || CPU_SUP_INTEL
1036 select FW_LOADER 1037 select FW_LOADER
1037 ---help--- 1038 ---help---
1038 1039
diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h
index 0da5200ee79d..b3e18f800302 100644
--- a/arch/x86/include/asm/percpu.h
+++ b/arch/x86/include/asm/percpu.h
@@ -128,7 +128,8 @@ do { \
128do { \ 128do { \
129 typedef typeof(var) pao_T__; \ 129 typedef typeof(var) pao_T__; \
130 const int pao_ID__ = (__builtin_constant_p(val) && \ 130 const int pao_ID__ = (__builtin_constant_p(val) && \
131 ((val) == 1 || (val) == -1)) ? (val) : 0; \ 131 ((val) == 1 || (val) == -1)) ? \
132 (int)(val) : 0; \
132 if (0) { \ 133 if (0) { \
133 pao_T__ pao_tmp__; \ 134 pao_T__ pao_tmp__; \
134 pao_tmp__ = (val); \ 135 pao_tmp__ = (val); \
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
index 1191ac1c9d25..a419814cea57 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -113,7 +113,7 @@ static int __init early_get_pnodeid(void)
113 break; 113 break;
114 case UV3_HUB_PART_NUMBER: 114 case UV3_HUB_PART_NUMBER:
115 case UV3_HUB_PART_NUMBER_X: 115 case UV3_HUB_PART_NUMBER_X:
116 uv_min_hub_revision_id += UV3_HUB_REVISION_BASE - 1; 116 uv_min_hub_revision_id += UV3_HUB_REVISION_BASE;
117 break; 117 break;
118 } 118 }
119 119
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 697b93af02dd..b2046e4d0b59 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -609,7 +609,7 @@ static struct dentry *d_kvm_debug;
609 609
610struct dentry *kvm_init_debugfs(void) 610struct dentry *kvm_init_debugfs(void)
611{ 611{
612 d_kvm_debug = debugfs_create_dir("kvm", NULL); 612 d_kvm_debug = debugfs_create_dir("kvm-guest", NULL);
613 if (!d_kvm_debug) 613 if (!d_kvm_debug)
614 printk(KERN_WARNING "Could not create 'kvm' debugfs directory\n"); 614 printk(KERN_WARNING "Could not create 'kvm' debugfs directory\n");
615 615
@@ -775,11 +775,22 @@ void __init kvm_spinlock_init(void)
775 if (!kvm_para_has_feature(KVM_FEATURE_PV_UNHALT)) 775 if (!kvm_para_has_feature(KVM_FEATURE_PV_UNHALT))
776 return; 776 return;
777 777
778 printk(KERN_INFO "KVM setup paravirtual spinlock\n"); 778 pv_lock_ops.lock_spinning = PV_CALLEE_SAVE(kvm_lock_spinning);
779 pv_lock_ops.unlock_kick = kvm_unlock_kick;
780}
781
782static __init int kvm_spinlock_init_jump(void)
783{
784 if (!kvm_para_available())
785 return 0;
786 if (!kvm_para_has_feature(KVM_FEATURE_PV_UNHALT))
787 return 0;
779 788
780 static_key_slow_inc(&paravirt_ticketlocks_enabled); 789 static_key_slow_inc(&paravirt_ticketlocks_enabled);
790 printk(KERN_INFO "KVM setup paravirtual spinlock\n");
781 791
782 pv_lock_ops.lock_spinning = PV_CALLEE_SAVE(kvm_lock_spinning); 792 return 0;
783 pv_lock_ops.unlock_kick = kvm_unlock_kick;
784} 793}
794early_initcall(kvm_spinlock_init_jump);
795
785#endif /* CONFIG_PARAVIRT_SPINLOCKS */ 796#endif /* CONFIG_PARAVIRT_SPINLOCKS */
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index e643e744e4d8..7e920bff99a3 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -326,6 +326,14 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = {
326 DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320"), 326 DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320"),
327 }, 327 },
328 }, 328 },
329 { /* Handle problems with rebooting on the Latitude E5410. */
330 .callback = set_pci_reboot,
331 .ident = "Dell Latitude E5410",
332 .matches = {
333 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
334 DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E5410"),
335 },
336 },
329 { /* Handle problems with rebooting on the Latitude E5420. */ 337 { /* Handle problems with rebooting on the Latitude E5420. */
330 .callback = set_pci_reboot, 338 .callback = set_pci_reboot,
331 .ident = "Dell Latitude E5420", 339 .ident = "Dell Latitude E5420",
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index 79c216aa0e2b..516593e1ce33 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -772,13 +772,21 @@ out:
772 return; 772 return;
773} 773}
774 774
775static void bpf_jit_free_deferred(struct work_struct *work)
776{
777 struct sk_filter *fp = container_of(work, struct sk_filter, work);
778 unsigned long addr = (unsigned long)fp->bpf_func & PAGE_MASK;
779 struct bpf_binary_header *header = (void *)addr;
780
781 set_memory_rw(addr, header->pages);
782 module_free(NULL, header);
783 kfree(fp);
784}
785
775void bpf_jit_free(struct sk_filter *fp) 786void bpf_jit_free(struct sk_filter *fp)
776{ 787{
777 if (fp->bpf_func != sk_run_filter) { 788 if (fp->bpf_func != sk_run_filter) {
778 unsigned long addr = (unsigned long)fp->bpf_func & PAGE_MASK; 789 INIT_WORK(&fp->work, bpf_jit_free_deferred);
779 struct bpf_binary_header *header = (void *)addr; 790 schedule_work(&fp->work);
780
781 set_memory_rw(addr, header->pages);
782 module_free(NULL, header);
783 } 791 }
784} 792}
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index d1e4777b4e75..31d04758b76f 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -278,6 +278,15 @@ static void __init xen_smp_prepare_boot_cpu(void)
278 old memory can be recycled */ 278 old memory can be recycled */
279 make_lowmem_page_readwrite(xen_initial_gdt); 279 make_lowmem_page_readwrite(xen_initial_gdt);
280 280
281#ifdef CONFIG_X86_32
282 /*
283 * Xen starts us with XEN_FLAT_RING1_DS, but linux code
284 * expects __USER_DS
285 */
286 loadsegment(ds, __USER_DS);
287 loadsegment(es, __USER_DS);
288#endif
289
281 xen_filter_cpu_maps(); 290 xen_filter_cpu_maps();
282 xen_setup_vcpu_info_placement(); 291 xen_setup_vcpu_info_placement();
283 } 292 }
diff --git a/arch/xtensa/kernel/entry.S b/arch/xtensa/kernel/entry.S
index de1dfa18d0a1..21dbe6bdb8ed 100644
--- a/arch/xtensa/kernel/entry.S
+++ b/arch/xtensa/kernel/entry.S
@@ -1122,7 +1122,7 @@ ENDPROC(fast_syscall_spill_registers)
1122 * a3: exctable, original value in excsave1 1122 * a3: exctable, original value in excsave1
1123 */ 1123 */
1124 1124
1125fast_syscall_spill_registers_fixup: 1125ENTRY(fast_syscall_spill_registers_fixup)
1126 1126
1127 rsr a2, windowbase # get current windowbase (a2 is saved) 1127 rsr a2, windowbase # get current windowbase (a2 is saved)
1128 xsr a0, depc # restore depc and a0 1128 xsr a0, depc # restore depc and a0
@@ -1134,22 +1134,26 @@ fast_syscall_spill_registers_fixup:
1134 */ 1134 */
1135 1135
1136 xsr a3, excsave1 # get spill-mask 1136 xsr a3, excsave1 # get spill-mask
1137 slli a2, a3, 1 # shift left by one 1137 slli a3, a3, 1 # shift left by one
1138 1138
1139 slli a3, a2, 32-WSBITS 1139 slli a2, a3, 32-WSBITS
1140 src a2, a2, a3 # a1 = xxwww1yyxxxwww1yy...... 1140 src a2, a3, a2 # a2 = xxwww1yyxxxwww1yy......
1141 wsr a2, windowstart # set corrected windowstart 1141 wsr a2, windowstart # set corrected windowstart
1142 1142
1143 rsr a3, excsave1 1143 srli a3, a3, 1
1144 l32i a2, a3, EXC_TABLE_DOUBLE_SAVE # restore a2 1144 rsr a2, excsave1
1145 l32i a3, a3, EXC_TABLE_PARAM # original WB (in user task) 1145 l32i a2, a2, EXC_TABLE_DOUBLE_SAVE # restore a2
1146 xsr a2, excsave1
1147 s32i a3, a2, EXC_TABLE_DOUBLE_SAVE # save a3
1148 l32i a3, a2, EXC_TABLE_PARAM # original WB (in user task)
1149 xsr a2, excsave1
1146 1150
1147 /* Return to the original (user task) WINDOWBASE. 1151 /* Return to the original (user task) WINDOWBASE.
1148 * We leave the following frame behind: 1152 * We leave the following frame behind:
1149 * a0, a1, a2 same 1153 * a0, a1, a2 same
1150 * a3: trashed (saved in excsave_1) 1154 * a3: trashed (saved in EXC_TABLE_DOUBLE_SAVE)
1151 * depc: depc (we have to return to that address) 1155 * depc: depc (we have to return to that address)
1152 * excsave_1: a3 1156 * excsave_1: exctable
1153 */ 1157 */
1154 1158
1155 wsr a3, windowbase 1159 wsr a3, windowbase
@@ -1159,9 +1163,9 @@ fast_syscall_spill_registers_fixup:
1159 * a0: return address 1163 * a0: return address
1160 * a1: used, stack pointer 1164 * a1: used, stack pointer
1161 * a2: kernel stack pointer 1165 * a2: kernel stack pointer
1162 * a3: available, saved in EXCSAVE_1 1166 * a3: available
1163 * depc: exception address 1167 * depc: exception address
1164 * excsave: a3 1168 * excsave: exctable
1165 * Note: This frame might be the same as above. 1169 * Note: This frame might be the same as above.
1166 */ 1170 */
1167 1171
@@ -1181,9 +1185,12 @@ fast_syscall_spill_registers_fixup:
1181 rsr a0, exccause 1185 rsr a0, exccause
1182 addx4 a0, a0, a3 # find entry in table 1186 addx4 a0, a0, a3 # find entry in table
1183 l32i a0, a0, EXC_TABLE_FAST_USER # load handler 1187 l32i a0, a0, EXC_TABLE_FAST_USER # load handler
1188 l32i a3, a3, EXC_TABLE_DOUBLE_SAVE
1184 jx a0 1189 jx a0
1185 1190
1186fast_syscall_spill_registers_fixup_return: 1191ENDPROC(fast_syscall_spill_registers_fixup)
1192
1193ENTRY(fast_syscall_spill_registers_fixup_return)
1187 1194
1188 /* When we return here, all registers have been restored (a2: DEPC) */ 1195 /* When we return here, all registers have been restored (a2: DEPC) */
1189 1196
@@ -1191,13 +1198,13 @@ fast_syscall_spill_registers_fixup_return:
1191 1198
1192 /* Restore fixup handler. */ 1199 /* Restore fixup handler. */
1193 1200
1194 xsr a3, excsave1 1201 rsr a2, excsave1
1195 movi a2, fast_syscall_spill_registers_fixup 1202 s32i a3, a2, EXC_TABLE_DOUBLE_SAVE
1196 s32i a2, a3, EXC_TABLE_FIXUP 1203 movi a3, fast_syscall_spill_registers_fixup
1197 s32i a0, a3, EXC_TABLE_DOUBLE_SAVE 1204 s32i a3, a2, EXC_TABLE_FIXUP
1198 rsr a2, windowbase 1205 rsr a3, windowbase
1199 s32i a2, a3, EXC_TABLE_PARAM 1206 s32i a3, a2, EXC_TABLE_PARAM
1200 l32i a2, a3, EXC_TABLE_KSTK 1207 l32i a2, a2, EXC_TABLE_KSTK
1201 1208
1202 /* Load WB at the time the exception occurred. */ 1209 /* Load WB at the time the exception occurred. */
1203 1210
@@ -1206,8 +1213,12 @@ fast_syscall_spill_registers_fixup_return:
1206 wsr a3, windowbase 1213 wsr a3, windowbase
1207 rsync 1214 rsync
1208 1215
1216 rsr a3, excsave1
1217 l32i a3, a3, EXC_TABLE_DOUBLE_SAVE
1218
1209 rfde 1219 rfde
1210 1220
1221ENDPROC(fast_syscall_spill_registers_fixup_return)
1211 1222
1212/* 1223/*
1213 * spill all registers. 1224 * spill all registers.
diff --git a/arch/xtensa/kernel/signal.c b/arch/xtensa/kernel/signal.c
index 718eca1850bd..98b67d5f1514 100644
--- a/arch/xtensa/kernel/signal.c
+++ b/arch/xtensa/kernel/signal.c
@@ -341,7 +341,7 @@ static int setup_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
341 341
342 sp = regs->areg[1]; 342 sp = regs->areg[1];
343 343
344 if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! on_sig_stack(sp)) { 344 if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && sas_ss_flags(sp) == 0) {
345 sp = current->sas_ss_sp + current->sas_ss_size; 345 sp = current->sas_ss_sp + current->sas_ss_size;
346 } 346 }
347 347
diff --git a/arch/xtensa/platforms/iss/network.c b/arch/xtensa/platforms/iss/network.c
index 56f88b7afe2f..e9e1aad8c271 100644
--- a/arch/xtensa/platforms/iss/network.c
+++ b/arch/xtensa/platforms/iss/network.c
@@ -737,7 +737,8 @@ static int __init iss_net_setup(char *str)
737 return 1; 737 return 1;
738 } 738 }
739 739
740 if ((new = alloc_bootmem(sizeof new)) == NULL) { 740 new = alloc_bootmem(sizeof(*new));
741 if (new == NULL) {
741 printk("Alloc_bootmem failed\n"); 742 printk("Alloc_bootmem failed\n");
742 return 1; 743 return 1;
743 } 744 }