diff options
author | David S. Miller <davem@davemloft.net> | 2012-09-28 14:40:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-09-28 14:40:49 -0400 |
commit | 6a06e5e1bb217be077e1f8ee2745b4c5b1aa02db (patch) | |
tree | 8faea23112a11f52524eb413f71b7b02712d8b53 /arch | |
parent | d9f72f359e00a45a6cd7cc2d5121b04b9dc927e1 (diff) | |
parent | 6672d90fe779dc0dfffe027c3ede12609df091c2 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/team/team.c
drivers/net/usb/qmi_wwan.c
net/batman-adv/bat_iv_ogm.c
net/ipv4/fib_frontend.c
net/ipv4/route.c
net/l2tp/l2tp_netlink.c
The team, fib_frontend, route, and l2tp_netlink conflicts were simply
overlapping changes.
qmi_wwan and bat_iv_ogm were of the "use HEAD" variety.
With help from Antonio Quartulli.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
59 files changed, 335 insertions, 299 deletions
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index 81769c1341fa..bc67cbff3944 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S | |||
@@ -653,6 +653,7 @@ __armv7_mmu_cache_on: | |||
653 | mcrne p15, 0, r0, c8, c7, 0 @ flush I,D TLBs | 653 | mcrne p15, 0, r0, c8, c7, 0 @ flush I,D TLBs |
654 | #endif | 654 | #endif |
655 | mrc p15, 0, r0, c1, c0, 0 @ read control reg | 655 | mrc p15, 0, r0, c1, c0, 0 @ read control reg |
656 | bic r0, r0, #1 << 28 @ clear SCTLR.TRE | ||
656 | orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement | 657 | orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement |
657 | orr r0, r0, #0x003c @ write buffer | 658 | orr r0, r0, #0x003c @ write buffer |
658 | #ifdef CONFIG_MMU | 659 | #ifdef CONFIG_MMU |
diff --git a/arch/arm/boot/dts/at91sam9260.dtsi b/arch/arm/boot/dts/at91sam9260.dtsi index 66389c1c6f62..7c95f76398de 100644 --- a/arch/arm/boot/dts/at91sam9260.dtsi +++ b/arch/arm/boot/dts/at91sam9260.dtsi | |||
@@ -104,6 +104,7 @@ | |||
104 | #gpio-cells = <2>; | 104 | #gpio-cells = <2>; |
105 | gpio-controller; | 105 | gpio-controller; |
106 | interrupt-controller; | 106 | interrupt-controller; |
107 | #interrupt-cells = <2>; | ||
107 | }; | 108 | }; |
108 | 109 | ||
109 | pioB: gpio@fffff600 { | 110 | pioB: gpio@fffff600 { |
@@ -113,6 +114,7 @@ | |||
113 | #gpio-cells = <2>; | 114 | #gpio-cells = <2>; |
114 | gpio-controller; | 115 | gpio-controller; |
115 | interrupt-controller; | 116 | interrupt-controller; |
117 | #interrupt-cells = <2>; | ||
116 | }; | 118 | }; |
117 | 119 | ||
118 | pioC: gpio@fffff800 { | 120 | pioC: gpio@fffff800 { |
@@ -122,6 +124,7 @@ | |||
122 | #gpio-cells = <2>; | 124 | #gpio-cells = <2>; |
123 | gpio-controller; | 125 | gpio-controller; |
124 | interrupt-controller; | 126 | interrupt-controller; |
127 | #interrupt-cells = <2>; | ||
125 | }; | 128 | }; |
126 | 129 | ||
127 | dbgu: serial@fffff200 { | 130 | dbgu: serial@fffff200 { |
diff --git a/arch/arm/boot/dts/at91sam9263.dtsi b/arch/arm/boot/dts/at91sam9263.dtsi index b460d6ce9eb5..195019b7ca0e 100644 --- a/arch/arm/boot/dts/at91sam9263.dtsi +++ b/arch/arm/boot/dts/at91sam9263.dtsi | |||
@@ -95,6 +95,7 @@ | |||
95 | #gpio-cells = <2>; | 95 | #gpio-cells = <2>; |
96 | gpio-controller; | 96 | gpio-controller; |
97 | interrupt-controller; | 97 | interrupt-controller; |
98 | #interrupt-cells = <2>; | ||
98 | }; | 99 | }; |
99 | 100 | ||
100 | pioB: gpio@fffff400 { | 101 | pioB: gpio@fffff400 { |
@@ -104,6 +105,7 @@ | |||
104 | #gpio-cells = <2>; | 105 | #gpio-cells = <2>; |
105 | gpio-controller; | 106 | gpio-controller; |
106 | interrupt-controller; | 107 | interrupt-controller; |
108 | #interrupt-cells = <2>; | ||
107 | }; | 109 | }; |
108 | 110 | ||
109 | pioC: gpio@fffff600 { | 111 | pioC: gpio@fffff600 { |
@@ -113,6 +115,7 @@ | |||
113 | #gpio-cells = <2>; | 115 | #gpio-cells = <2>; |
114 | gpio-controller; | 116 | gpio-controller; |
115 | interrupt-controller; | 117 | interrupt-controller; |
118 | #interrupt-cells = <2>; | ||
116 | }; | 119 | }; |
117 | 120 | ||
118 | pioD: gpio@fffff800 { | 121 | pioD: gpio@fffff800 { |
@@ -122,6 +125,7 @@ | |||
122 | #gpio-cells = <2>; | 125 | #gpio-cells = <2>; |
123 | gpio-controller; | 126 | gpio-controller; |
124 | interrupt-controller; | 127 | interrupt-controller; |
128 | #interrupt-cells = <2>; | ||
125 | }; | 129 | }; |
126 | 130 | ||
127 | pioE: gpio@fffffa00 { | 131 | pioE: gpio@fffffa00 { |
@@ -131,6 +135,7 @@ | |||
131 | #gpio-cells = <2>; | 135 | #gpio-cells = <2>; |
132 | gpio-controller; | 136 | gpio-controller; |
133 | interrupt-controller; | 137 | interrupt-controller; |
138 | #interrupt-cells = <2>; | ||
134 | }; | 139 | }; |
135 | 140 | ||
136 | dbgu: serial@ffffee00 { | 141 | dbgu: serial@ffffee00 { |
diff --git a/arch/arm/boot/dts/at91sam9g45.dtsi b/arch/arm/boot/dts/at91sam9g45.dtsi index bafa8806fc17..63751b1e744b 100644 --- a/arch/arm/boot/dts/at91sam9g45.dtsi +++ b/arch/arm/boot/dts/at91sam9g45.dtsi | |||
@@ -113,6 +113,7 @@ | |||
113 | #gpio-cells = <2>; | 113 | #gpio-cells = <2>; |
114 | gpio-controller; | 114 | gpio-controller; |
115 | interrupt-controller; | 115 | interrupt-controller; |
116 | #interrupt-cells = <2>; | ||
116 | }; | 117 | }; |
117 | 118 | ||
118 | pioB: gpio@fffff400 { | 119 | pioB: gpio@fffff400 { |
@@ -122,6 +123,7 @@ | |||
122 | #gpio-cells = <2>; | 123 | #gpio-cells = <2>; |
123 | gpio-controller; | 124 | gpio-controller; |
124 | interrupt-controller; | 125 | interrupt-controller; |
126 | #interrupt-cells = <2>; | ||
125 | }; | 127 | }; |
126 | 128 | ||
127 | pioC: gpio@fffff600 { | 129 | pioC: gpio@fffff600 { |
@@ -131,6 +133,7 @@ | |||
131 | #gpio-cells = <2>; | 133 | #gpio-cells = <2>; |
132 | gpio-controller; | 134 | gpio-controller; |
133 | interrupt-controller; | 135 | interrupt-controller; |
136 | #interrupt-cells = <2>; | ||
134 | }; | 137 | }; |
135 | 138 | ||
136 | pioD: gpio@fffff800 { | 139 | pioD: gpio@fffff800 { |
@@ -140,6 +143,7 @@ | |||
140 | #gpio-cells = <2>; | 143 | #gpio-cells = <2>; |
141 | gpio-controller; | 144 | gpio-controller; |
142 | interrupt-controller; | 145 | interrupt-controller; |
146 | #interrupt-cells = <2>; | ||
143 | }; | 147 | }; |
144 | 148 | ||
145 | pioE: gpio@fffffa00 { | 149 | pioE: gpio@fffffa00 { |
@@ -149,6 +153,7 @@ | |||
149 | #gpio-cells = <2>; | 153 | #gpio-cells = <2>; |
150 | gpio-controller; | 154 | gpio-controller; |
151 | interrupt-controller; | 155 | interrupt-controller; |
156 | #interrupt-cells = <2>; | ||
152 | }; | 157 | }; |
153 | 158 | ||
154 | dbgu: serial@ffffee00 { | 159 | dbgu: serial@ffffee00 { |
diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi index bfac0dfc332c..ef9336ae9614 100644 --- a/arch/arm/boot/dts/at91sam9n12.dtsi +++ b/arch/arm/boot/dts/at91sam9n12.dtsi | |||
@@ -107,6 +107,7 @@ | |||
107 | #gpio-cells = <2>; | 107 | #gpio-cells = <2>; |
108 | gpio-controller; | 108 | gpio-controller; |
109 | interrupt-controller; | 109 | interrupt-controller; |
110 | #interrupt-cells = <2>; | ||
110 | }; | 111 | }; |
111 | 112 | ||
112 | pioB: gpio@fffff600 { | 113 | pioB: gpio@fffff600 { |
@@ -116,6 +117,7 @@ | |||
116 | #gpio-cells = <2>; | 117 | #gpio-cells = <2>; |
117 | gpio-controller; | 118 | gpio-controller; |
118 | interrupt-controller; | 119 | interrupt-controller; |
120 | #interrupt-cells = <2>; | ||
119 | }; | 121 | }; |
120 | 122 | ||
121 | pioC: gpio@fffff800 { | 123 | pioC: gpio@fffff800 { |
@@ -125,6 +127,7 @@ | |||
125 | #gpio-cells = <2>; | 127 | #gpio-cells = <2>; |
126 | gpio-controller; | 128 | gpio-controller; |
127 | interrupt-controller; | 129 | interrupt-controller; |
130 | #interrupt-cells = <2>; | ||
128 | }; | 131 | }; |
129 | 132 | ||
130 | pioD: gpio@fffffa00 { | 133 | pioD: gpio@fffffa00 { |
@@ -134,6 +137,7 @@ | |||
134 | #gpio-cells = <2>; | 137 | #gpio-cells = <2>; |
135 | gpio-controller; | 138 | gpio-controller; |
136 | interrupt-controller; | 139 | interrupt-controller; |
140 | #interrupt-cells = <2>; | ||
137 | }; | 141 | }; |
138 | 142 | ||
139 | dbgu: serial@fffff200 { | 143 | dbgu: serial@fffff200 { |
diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi index 4a18c393b136..8a387a8d61b7 100644 --- a/arch/arm/boot/dts/at91sam9x5.dtsi +++ b/arch/arm/boot/dts/at91sam9x5.dtsi | |||
@@ -115,6 +115,7 @@ | |||
115 | #gpio-cells = <2>; | 115 | #gpio-cells = <2>; |
116 | gpio-controller; | 116 | gpio-controller; |
117 | interrupt-controller; | 117 | interrupt-controller; |
118 | #interrupt-cells = <2>; | ||
118 | }; | 119 | }; |
119 | 120 | ||
120 | pioB: gpio@fffff600 { | 121 | pioB: gpio@fffff600 { |
@@ -124,6 +125,7 @@ | |||
124 | #gpio-cells = <2>; | 125 | #gpio-cells = <2>; |
125 | gpio-controller; | 126 | gpio-controller; |
126 | interrupt-controller; | 127 | interrupt-controller; |
128 | #interrupt-cells = <2>; | ||
127 | }; | 129 | }; |
128 | 130 | ||
129 | pioC: gpio@fffff800 { | 131 | pioC: gpio@fffff800 { |
@@ -133,6 +135,7 @@ | |||
133 | #gpio-cells = <2>; | 135 | #gpio-cells = <2>; |
134 | gpio-controller; | 136 | gpio-controller; |
135 | interrupt-controller; | 137 | interrupt-controller; |
138 | #interrupt-cells = <2>; | ||
136 | }; | 139 | }; |
137 | 140 | ||
138 | pioD: gpio@fffffa00 { | 141 | pioD: gpio@fffffa00 { |
@@ -142,6 +145,7 @@ | |||
142 | #gpio-cells = <2>; | 145 | #gpio-cells = <2>; |
143 | gpio-controller; | 146 | gpio-controller; |
144 | interrupt-controller; | 147 | interrupt-controller; |
148 | #interrupt-cells = <2>; | ||
145 | }; | 149 | }; |
146 | 150 | ||
147 | dbgu: serial@fffff200 { | 151 | dbgu: serial@fffff200 { |
diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h index 0cab47d4a83f..2fde5fd1acce 100644 --- a/arch/arm/include/asm/unistd.h +++ b/arch/arm/include/asm/unistd.h | |||
@@ -404,6 +404,7 @@ | |||
404 | #define __NR_setns (__NR_SYSCALL_BASE+375) | 404 | #define __NR_setns (__NR_SYSCALL_BASE+375) |
405 | #define __NR_process_vm_readv (__NR_SYSCALL_BASE+376) | 405 | #define __NR_process_vm_readv (__NR_SYSCALL_BASE+376) |
406 | #define __NR_process_vm_writev (__NR_SYSCALL_BASE+377) | 406 | #define __NR_process_vm_writev (__NR_SYSCALL_BASE+377) |
407 | /* 378 for kcmp */ | ||
407 | 408 | ||
408 | /* | 409 | /* |
409 | * The following SWIs are ARM private. | 410 | * The following SWIs are ARM private. |
@@ -483,6 +484,7 @@ | |||
483 | */ | 484 | */ |
484 | #define __IGNORE_fadvise64_64 | 485 | #define __IGNORE_fadvise64_64 |
485 | #define __IGNORE_migrate_pages | 486 | #define __IGNORE_migrate_pages |
487 | #define __IGNORE_kcmp | ||
486 | 488 | ||
487 | #endif /* __KERNEL__ */ | 489 | #endif /* __KERNEL__ */ |
488 | #endif /* __ASM_ARM_UNISTD_H */ | 490 | #endif /* __ASM_ARM_UNISTD_H */ |
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S index 463ff4a0ec8a..e337879595e5 100644 --- a/arch/arm/kernel/calls.S +++ b/arch/arm/kernel/calls.S | |||
@@ -387,6 +387,7 @@ | |||
387 | /* 375 */ CALL(sys_setns) | 387 | /* 375 */ CALL(sys_setns) |
388 | CALL(sys_process_vm_readv) | 388 | CALL(sys_process_vm_readv) |
389 | CALL(sys_process_vm_writev) | 389 | CALL(sys_process_vm_writev) |
390 | CALL(sys_ni_syscall) /* reserved for sys_kcmp */ | ||
390 | #ifndef syscalls_counted | 391 | #ifndef syscalls_counted |
391 | .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls | 392 | .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls |
392 | #define syscalls_counted | 393 | #define syscalls_counted |
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c index fef42b21cecb..e1f906989bb8 100644 --- a/arch/arm/kernel/smp_twd.c +++ b/arch/arm/kernel/smp_twd.c | |||
@@ -11,7 +11,6 @@ | |||
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
13 | #include <linux/clk.h> | 13 | #include <linux/clk.h> |
14 | #include <linux/cpufreq.h> | ||
15 | #include <linux/delay.h> | 14 | #include <linux/delay.h> |
16 | #include <linux/device.h> | 15 | #include <linux/device.h> |
17 | #include <linux/err.h> | 16 | #include <linux/err.h> |
@@ -96,7 +95,52 @@ static void twd_timer_stop(struct clock_event_device *clk) | |||
96 | disable_percpu_irq(clk->irq); | 95 | disable_percpu_irq(clk->irq); |
97 | } | 96 | } |
98 | 97 | ||
99 | #ifdef CONFIG_CPU_FREQ | 98 | #ifdef CONFIG_COMMON_CLK |
99 | |||
100 | /* | ||
101 | * Updates clockevent frequency when the cpu frequency changes. | ||
102 | * Called on the cpu that is changing frequency with interrupts disabled. | ||
103 | */ | ||
104 | static void twd_update_frequency(void *new_rate) | ||
105 | { | ||
106 | twd_timer_rate = *((unsigned long *) new_rate); | ||
107 | |||
108 | clockevents_update_freq(*__this_cpu_ptr(twd_evt), twd_timer_rate); | ||
109 | } | ||
110 | |||
111 | static int twd_rate_change(struct notifier_block *nb, | ||
112 | unsigned long flags, void *data) | ||
113 | { | ||
114 | struct clk_notifier_data *cnd = data; | ||
115 | |||
116 | /* | ||
117 | * The twd clock events must be reprogrammed to account for the new | ||
118 | * frequency. The timer is local to a cpu, so cross-call to the | ||
119 | * changing cpu. | ||
120 | */ | ||
121 | if (flags == POST_RATE_CHANGE) | ||
122 | smp_call_function(twd_update_frequency, | ||
123 | (void *)&cnd->new_rate, 1); | ||
124 | |||
125 | return NOTIFY_OK; | ||
126 | } | ||
127 | |||
128 | static struct notifier_block twd_clk_nb = { | ||
129 | .notifier_call = twd_rate_change, | ||
130 | }; | ||
131 | |||
132 | static int twd_clk_init(void) | ||
133 | { | ||
134 | if (twd_evt && *__this_cpu_ptr(twd_evt) && !IS_ERR(twd_clk)) | ||
135 | return clk_notifier_register(twd_clk, &twd_clk_nb); | ||
136 | |||
137 | return 0; | ||
138 | } | ||
139 | core_initcall(twd_clk_init); | ||
140 | |||
141 | #elif defined (CONFIG_CPU_FREQ) | ||
142 | |||
143 | #include <linux/cpufreq.h> | ||
100 | 144 | ||
101 | /* | 145 | /* |
102 | * Updates clockevent frequency when the cpu frequency changes. | 146 | * Updates clockevent frequency when the cpu frequency changes. |
diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c index 4431a62fff5b..d20d4795f4ea 100644 --- a/arch/arm/mach-imx/clk-imx25.c +++ b/arch/arm/mach-imx/clk-imx25.c | |||
@@ -241,6 +241,6 @@ int __init mx25_clocks_init(void) | |||
241 | clk_register_clkdev(clk[sdma_ahb], "ahb", "imx35-sdma"); | 241 | clk_register_clkdev(clk[sdma_ahb], "ahb", "imx35-sdma"); |
242 | clk_register_clkdev(clk[iim_ipg], "iim", NULL); | 242 | clk_register_clkdev(clk[iim_ipg], "iim", NULL); |
243 | 243 | ||
244 | mxc_timer_init(MX25_IO_ADDRESS(MX25_GPT1_BASE_ADDR), 54); | 244 | mxc_timer_init(MX25_IO_ADDRESS(MX25_GPT1_BASE_ADDR), MX25_INT_GPT1); |
245 | return 0; | 245 | return 0; |
246 | } | 246 | } |
diff --git a/arch/arm/mach-imx/mach-armadillo5x0.c b/arch/arm/mach-imx/mach-armadillo5x0.c index 2c6ab3273f9e..5985ed1b8c98 100644 --- a/arch/arm/mach-imx/mach-armadillo5x0.c +++ b/arch/arm/mach-imx/mach-armadillo5x0.c | |||
@@ -526,7 +526,8 @@ static void __init armadillo5x0_init(void) | |||
526 | imx31_add_mxc_nand(&armadillo5x0_nand_board_info); | 526 | imx31_add_mxc_nand(&armadillo5x0_nand_board_info); |
527 | 527 | ||
528 | /* set NAND page size to 2k if not configured via boot mode pins */ | 528 | /* set NAND page size to 2k if not configured via boot mode pins */ |
529 | __raw_writel(__raw_readl(MXC_CCM_RCSR) | (1 << 30), MXC_CCM_RCSR); | 529 | __raw_writel(__raw_readl(mx3_ccm_base + MXC_CCM_RCSR) | |
530 | (1 << 30), mx3_ccm_base + MXC_CCM_RCSR); | ||
530 | 531 | ||
531 | /* RTC */ | 532 | /* RTC */ |
532 | /* Get RTC IRQ and register the chip */ | 533 | /* Get RTC IRQ and register the chip */ |
diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c index 8dabfe81d07c..ff886e01a0b0 100644 --- a/arch/arm/mach-mxs/mach-mxs.c +++ b/arch/arm/mach-mxs/mach-mxs.c | |||
@@ -261,7 +261,7 @@ static void __init apx4devkit_init(void) | |||
261 | enable_clk_enet_out(); | 261 | enable_clk_enet_out(); |
262 | 262 | ||
263 | if (IS_BUILTIN(CONFIG_PHYLIB)) | 263 | if (IS_BUILTIN(CONFIG_PHYLIB)) |
264 | phy_register_fixup_for_uid(PHY_ID_KS8051, MICREL_PHY_ID_MASK, | 264 | phy_register_fixup_for_uid(PHY_ID_KSZ8051, MICREL_PHY_ID_MASK, |
265 | apx4devkit_phy_fixup); | 265 | apx4devkit_phy_fixup); |
266 | 266 | ||
267 | mxsfb_pdata.mode_list = apx4devkit_video_modes; | 267 | mxsfb_pdata.mode_list = apx4devkit_video_modes; |
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c index 410291c67666..a6cd14ab1e4e 100644 --- a/arch/arm/mach-orion5x/common.c +++ b/arch/arm/mach-orion5x/common.c | |||
@@ -204,6 +204,13 @@ void __init orion5x_wdt_init(void) | |||
204 | void __init orion5x_init_early(void) | 204 | void __init orion5x_init_early(void) |
205 | { | 205 | { |
206 | orion_time_set_base(TIMER_VIRT_BASE); | 206 | orion_time_set_base(TIMER_VIRT_BASE); |
207 | |||
208 | /* | ||
209 | * Some Orion5x devices allocate their coherent buffers from atomic | ||
210 | * context. Increase size of atomic coherent pool to make sure such | ||
211 | * the allocations won't fail. | ||
212 | */ | ||
213 | init_dma_coherent_pool_size(SZ_1M); | ||
207 | } | 214 | } |
208 | 215 | ||
209 | int orion5x_tclk; | 216 | int orion5x_tclk; |
diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c index 53b7ea92c32c..3b8a0171c3cb 100644 --- a/arch/arm/mach-shmobile/board-kzm9g.c +++ b/arch/arm/mach-shmobile/board-kzm9g.c | |||
@@ -346,11 +346,11 @@ static struct resource sh_mmcif_resources[] = { | |||
346 | .flags = IORESOURCE_MEM, | 346 | .flags = IORESOURCE_MEM, |
347 | }, | 347 | }, |
348 | [1] = { | 348 | [1] = { |
349 | .start = gic_spi(141), | 349 | .start = gic_spi(140), |
350 | .flags = IORESOURCE_IRQ, | 350 | .flags = IORESOURCE_IRQ, |
351 | }, | 351 | }, |
352 | [2] = { | 352 | [2] = { |
353 | .start = gic_spi(140), | 353 | .start = gic_spi(141), |
354 | .flags = IORESOURCE_IRQ, | 354 | .flags = IORESOURCE_IRQ, |
355 | }, | 355 | }, |
356 | }; | 356 | }; |
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index e59c4ab71bcb..13f555d62491 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c | |||
@@ -346,6 +346,8 @@ static int __init atomic_pool_init(void) | |||
346 | (unsigned)pool->size / 1024); | 346 | (unsigned)pool->size / 1024); |
347 | return 0; | 347 | return 0; |
348 | } | 348 | } |
349 | |||
350 | kfree(pages); | ||
349 | no_pages: | 351 | no_pages: |
350 | kfree(bitmap); | 352 | kfree(bitmap); |
351 | no_bitmap: | 353 | no_bitmap: |
diff --git a/arch/arm/plat-mxc/include/mach/mx25.h b/arch/arm/plat-mxc/include/mach/mx25.h index 627d94f1b010..ec466400a200 100644 --- a/arch/arm/plat-mxc/include/mach/mx25.h +++ b/arch/arm/plat-mxc/include/mach/mx25.h | |||
@@ -98,6 +98,7 @@ | |||
98 | #define MX25_INT_UART1 (NR_IRQS_LEGACY + 45) | 98 | #define MX25_INT_UART1 (NR_IRQS_LEGACY + 45) |
99 | #define MX25_INT_GPIO2 (NR_IRQS_LEGACY + 51) | 99 | #define MX25_INT_GPIO2 (NR_IRQS_LEGACY + 51) |
100 | #define MX25_INT_GPIO1 (NR_IRQS_LEGACY + 52) | 100 | #define MX25_INT_GPIO1 (NR_IRQS_LEGACY + 52) |
101 | #define MX25_INT_GPT1 (NR_IRQS_LEGACY + 54) | ||
101 | #define MX25_INT_FEC (NR_IRQS_LEGACY + 57) | 102 | #define MX25_INT_FEC (NR_IRQS_LEGACY + 57) |
102 | 103 | ||
103 | #define MX25_DMA_REQ_SSI2_RX1 22 | 104 | #define MX25_DMA_REQ_SSI2_RX1 22 |
diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c index 65c5eca475e7..d1116e2dfbea 100644 --- a/arch/arm/plat-samsung/clock.c +++ b/arch/arm/plat-samsung/clock.c | |||
@@ -144,6 +144,7 @@ long clk_round_rate(struct clk *clk, unsigned long rate) | |||
144 | 144 | ||
145 | int clk_set_rate(struct clk *clk, unsigned long rate) | 145 | int clk_set_rate(struct clk *clk, unsigned long rate) |
146 | { | 146 | { |
147 | unsigned long flags; | ||
147 | int ret; | 148 | int ret; |
148 | 149 | ||
149 | if (IS_ERR(clk)) | 150 | if (IS_ERR(clk)) |
@@ -159,9 +160,9 @@ int clk_set_rate(struct clk *clk, unsigned long rate) | |||
159 | if (clk->ops == NULL || clk->ops->set_rate == NULL) | 160 | if (clk->ops == NULL || clk->ops->set_rate == NULL) |
160 | return -EINVAL; | 161 | return -EINVAL; |
161 | 162 | ||
162 | spin_lock(&clocks_lock); | 163 | spin_lock_irqsave(&clocks_lock, flags); |
163 | ret = (clk->ops->set_rate)(clk, rate); | 164 | ret = (clk->ops->set_rate)(clk, rate); |
164 | spin_unlock(&clocks_lock); | 165 | spin_unlock_irqrestore(&clocks_lock, flags); |
165 | 166 | ||
166 | return ret; | 167 | return ret; |
167 | } | 168 | } |
@@ -173,17 +174,18 @@ struct clk *clk_get_parent(struct clk *clk) | |||
173 | 174 | ||
174 | int clk_set_parent(struct clk *clk, struct clk *parent) | 175 | int clk_set_parent(struct clk *clk, struct clk *parent) |
175 | { | 176 | { |
177 | unsigned long flags; | ||
176 | int ret = 0; | 178 | int ret = 0; |
177 | 179 | ||
178 | if (IS_ERR(clk)) | 180 | if (IS_ERR(clk)) |
179 | return -EINVAL; | 181 | return -EINVAL; |
180 | 182 | ||
181 | spin_lock(&clocks_lock); | 183 | spin_lock_irqsave(&clocks_lock, flags); |
182 | 184 | ||
183 | if (clk->ops && clk->ops->set_parent) | 185 | if (clk->ops && clk->ops->set_parent) |
184 | ret = (clk->ops->set_parent)(clk, parent); | 186 | ret = (clk->ops->set_parent)(clk, parent); |
185 | 187 | ||
186 | spin_unlock(&clocks_lock); | 188 | spin_unlock_irqrestore(&clocks_lock, flags); |
187 | 189 | ||
188 | return ret; | 190 | return ret; |
189 | } | 191 | } |
diff --git a/arch/c6x/include/asm/Kbuild b/arch/c6x/include/asm/Kbuild index 3af601e31e66..f08e89183cda 100644 --- a/arch/c6x/include/asm/Kbuild +++ b/arch/c6x/include/asm/Kbuild | |||
@@ -2,6 +2,7 @@ include include/asm-generic/Kbuild.asm | |||
2 | 2 | ||
3 | generic-y += atomic.h | 3 | generic-y += atomic.h |
4 | generic-y += auxvec.h | 4 | generic-y += auxvec.h |
5 | generic-y += barrier.h | ||
5 | generic-y += bitsperlong.h | 6 | generic-y += bitsperlong.h |
6 | generic-y += bugs.h | 7 | generic-y += bugs.h |
7 | generic-y += cputime.h | 8 | generic-y += cputime.h |
diff --git a/arch/c6x/include/asm/barrier.h b/arch/c6x/include/asm/barrier.h deleted file mode 100644 index 538240e85909..000000000000 --- a/arch/c6x/include/asm/barrier.h +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | /* | ||
2 | * Port on Texas Instruments TMS320C6x architecture | ||
3 | * | ||
4 | * Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated | ||
5 | * Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com) | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | #ifndef _ASM_C6X_BARRIER_H | ||
12 | #define _ASM_C6X_BARRIER_H | ||
13 | |||
14 | #define nop() asm("NOP\n"); | ||
15 | |||
16 | #define mb() barrier() | ||
17 | #define rmb() barrier() | ||
18 | #define wmb() barrier() | ||
19 | #define set_mb(var, value) do { var = value; mb(); } while (0) | ||
20 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | ||
21 | |||
22 | #define smp_mb() barrier() | ||
23 | #define smp_rmb() barrier() | ||
24 | #define smp_wmb() barrier() | ||
25 | #define smp_read_barrier_depends() do { } while (0) | ||
26 | |||
27 | #endif /* _ASM_C6X_BARRIER_H */ | ||
diff --git a/arch/m68k/platform/coldfire/clk.c b/arch/m68k/platform/coldfire/clk.c index 75f9ee967ea7..9cd13b4ce42b 100644 --- a/arch/m68k/platform/coldfire/clk.c +++ b/arch/m68k/platform/coldfire/clk.c | |||
@@ -146,9 +146,3 @@ struct clk_ops clk_ops1 = { | |||
146 | }; | 146 | }; |
147 | #endif /* MCFPM_PPMCR1 */ | 147 | #endif /* MCFPM_PPMCR1 */ |
148 | #endif /* MCFPM_PPMCR0 */ | 148 | #endif /* MCFPM_PPMCR0 */ |
149 | |||
150 | struct clk *devm_clk_get(struct device *dev, const char *id) | ||
151 | { | ||
152 | return NULL; | ||
153 | } | ||
154 | EXPORT_SYMBOL(devm_clk_get); | ||
diff --git a/arch/mips/kernel/smp-cmp.c b/arch/mips/kernel/smp-cmp.c index e7e03ecf5495..afc379ca3753 100644 --- a/arch/mips/kernel/smp-cmp.c +++ b/arch/mips/kernel/smp-cmp.c | |||
@@ -102,7 +102,7 @@ static void cmp_init_secondary(void) | |||
102 | c->vpe_id = (read_c0_tcbind() >> TCBIND_CURVPE_SHIFT) & TCBIND_CURVPE; | 102 | c->vpe_id = (read_c0_tcbind() >> TCBIND_CURVPE_SHIFT) & TCBIND_CURVPE; |
103 | #endif | 103 | #endif |
104 | #ifdef CONFIG_MIPS_MT_SMTC | 104 | #ifdef CONFIG_MIPS_MT_SMTC |
105 | c->tc_id = (read_c0_tcbind() >> TCBIND_CURTC_SHIFT) & TCBIND_CURTC; | 105 | c->tc_id = (read_c0_tcbind() & TCBIND_CURTC) >> TCBIND_CURTC_SHIFT; |
106 | #endif | 106 | #endif |
107 | } | 107 | } |
108 | 108 | ||
diff --git a/arch/mips/mm/gup.c b/arch/mips/mm/gup.c index 33aadbcf170b..dcfd573871c1 100644 --- a/arch/mips/mm/gup.c +++ b/arch/mips/mm/gup.c | |||
@@ -152,6 +152,8 @@ static int gup_huge_pud(pud_t pud, unsigned long addr, unsigned long end, | |||
152 | do { | 152 | do { |
153 | VM_BUG_ON(compound_head(page) != head); | 153 | VM_BUG_ON(compound_head(page) != head); |
154 | pages[*nr] = page; | 154 | pages[*nr] = page; |
155 | if (PageTail(page)) | ||
156 | get_huge_page_tail(page); | ||
155 | (*nr)++; | 157 | (*nr)++; |
156 | page++; | 158 | page++; |
157 | refs++; | 159 | refs++; |
diff --git a/arch/mips/mti-malta/malta-int.c b/arch/mips/mti-malta/malta-int.c index 7b13a4caeea4..fea823f18479 100644 --- a/arch/mips/mti-malta/malta-int.c +++ b/arch/mips/mti-malta/malta-int.c | |||
@@ -273,16 +273,19 @@ asmlinkage void plat_irq_dispatch(void) | |||
273 | unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM; | 273 | unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM; |
274 | int irq; | 274 | int irq; |
275 | 275 | ||
276 | if (unlikely(!pending)) { | ||
277 | spurious_interrupt(); | ||
278 | return; | ||
279 | } | ||
280 | |||
276 | irq = irq_ffs(pending); | 281 | irq = irq_ffs(pending); |
277 | 282 | ||
278 | if (irq == MIPSCPU_INT_I8259A) | 283 | if (irq == MIPSCPU_INT_I8259A) |
279 | malta_hw0_irqdispatch(); | 284 | malta_hw0_irqdispatch(); |
280 | else if (gic_present && ((1 << irq) & ipi_map[smp_processor_id()])) | 285 | else if (gic_present && ((1 << irq) & ipi_map[smp_processor_id()])) |
281 | malta_ipi_irqdispatch(); | 286 | malta_ipi_irqdispatch(); |
282 | else if (irq >= 0) | ||
283 | do_IRQ(MIPS_CPU_IRQ_BASE + irq); | ||
284 | else | 287 | else |
285 | spurious_interrupt(); | 288 | do_IRQ(MIPS_CPU_IRQ_BASE + irq); |
286 | } | 289 | } |
287 | 290 | ||
288 | #ifdef CONFIG_MIPS_MT_SMP | 291 | #ifdef CONFIG_MIPS_MT_SMP |
diff --git a/arch/mips/mti-malta/malta-platform.c b/arch/mips/mti-malta/malta-platform.c index 4c35301720e7..80562b81f0f2 100644 --- a/arch/mips/mti-malta/malta-platform.c +++ b/arch/mips/mti-malta/malta-platform.c | |||
@@ -138,11 +138,6 @@ static int __init malta_add_devices(void) | |||
138 | if (err) | 138 | if (err) |
139 | return err; | 139 | return err; |
140 | 140 | ||
141 | /* | ||
142 | * Set RTC to BCD mode to support current alarm code. | ||
143 | */ | ||
144 | CMOS_WRITE(CMOS_READ(RTC_CONTROL) & ~RTC_DM_BINARY, RTC_CONTROL); | ||
145 | |||
146 | return 0; | 141 | return 0; |
147 | } | 142 | } |
148 | 143 | ||
diff --git a/arch/s390/include/asm/hugetlb.h b/arch/s390/include/asm/hugetlb.h index 799ed0f1643d..2d6e6e380564 100644 --- a/arch/s390/include/asm/hugetlb.h +++ b/arch/s390/include/asm/hugetlb.h | |||
@@ -66,16 +66,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep) | |||
66 | return pte; | 66 | return pte; |
67 | } | 67 | } |
68 | 68 | ||
69 | static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm, | ||
70 | unsigned long addr, pte_t *ptep) | ||
71 | { | ||
72 | pte_t pte = huge_ptep_get(ptep); | ||
73 | |||
74 | mm->context.flush_mm = 1; | ||
75 | pmd_clear((pmd_t *) ptep); | ||
76 | return pte; | ||
77 | } | ||
78 | |||
79 | static inline void __pmd_csp(pmd_t *pmdp) | 69 | static inline void __pmd_csp(pmd_t *pmdp) |
80 | { | 70 | { |
81 | register unsigned long reg2 asm("2") = pmd_val(*pmdp); | 71 | register unsigned long reg2 asm("2") = pmd_val(*pmdp); |
@@ -117,6 +107,15 @@ static inline void huge_ptep_invalidate(struct mm_struct *mm, | |||
117 | __pmd_csp(pmdp); | 107 | __pmd_csp(pmdp); |
118 | } | 108 | } |
119 | 109 | ||
110 | static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm, | ||
111 | unsigned long addr, pte_t *ptep) | ||
112 | { | ||
113 | pte_t pte = huge_ptep_get(ptep); | ||
114 | |||
115 | huge_ptep_invalidate(mm, addr, ptep); | ||
116 | return pte; | ||
117 | } | ||
118 | |||
120 | #define huge_ptep_set_access_flags(__vma, __addr, __ptep, __entry, __dirty) \ | 119 | #define huge_ptep_set_access_flags(__vma, __addr, __ptep, __entry, __dirty) \ |
121 | ({ \ | 120 | ({ \ |
122 | int __changed = !pte_same(huge_ptep_get(__ptep), __entry); \ | 121 | int __changed = !pte_same(huge_ptep_get(__ptep), __entry); \ |
@@ -131,10 +130,7 @@ static inline void huge_ptep_invalidate(struct mm_struct *mm, | |||
131 | ({ \ | 130 | ({ \ |
132 | pte_t __pte = huge_ptep_get(__ptep); \ | 131 | pte_t __pte = huge_ptep_get(__ptep); \ |
133 | if (pte_write(__pte)) { \ | 132 | if (pte_write(__pte)) { \ |
134 | (__mm)->context.flush_mm = 1; \ | 133 | huge_ptep_invalidate(__mm, __addr, __ptep); \ |
135 | if (atomic_read(&(__mm)->context.attach_count) > 1 || \ | ||
136 | (__mm) != current->active_mm) \ | ||
137 | huge_ptep_invalidate(__mm, __addr, __ptep); \ | ||
138 | set_huge_pte_at(__mm, __addr, __ptep, \ | 134 | set_huge_pte_at(__mm, __addr, __ptep, \ |
139 | huge_pte_wrprotect(__pte)); \ | 135 | huge_pte_wrprotect(__pte)); \ |
140 | } \ | 136 | } \ |
diff --git a/arch/s390/include/asm/tlbflush.h b/arch/s390/include/asm/tlbflush.h index 9fde315f3a7c..1d8fe2b17ef6 100644 --- a/arch/s390/include/asm/tlbflush.h +++ b/arch/s390/include/asm/tlbflush.h | |||
@@ -90,12 +90,10 @@ static inline void __tlb_flush_mm(struct mm_struct * mm) | |||
90 | 90 | ||
91 | static inline void __tlb_flush_mm_cond(struct mm_struct * mm) | 91 | static inline void __tlb_flush_mm_cond(struct mm_struct * mm) |
92 | { | 92 | { |
93 | spin_lock(&mm->page_table_lock); | ||
94 | if (mm->context.flush_mm) { | 93 | if (mm->context.flush_mm) { |
95 | __tlb_flush_mm(mm); | 94 | __tlb_flush_mm(mm); |
96 | mm->context.flush_mm = 0; | 95 | mm->context.flush_mm = 0; |
97 | } | 96 | } |
98 | spin_unlock(&mm->page_table_lock); | ||
99 | } | 97 | } |
100 | 98 | ||
101 | /* | 99 | /* |
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index f86c81e13c37..40b57693de38 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -974,11 +974,13 @@ static void __init setup_hwcaps(void) | |||
974 | if (MACHINE_HAS_HPAGE) | 974 | if (MACHINE_HAS_HPAGE) |
975 | elf_hwcap |= HWCAP_S390_HPAGE; | 975 | elf_hwcap |= HWCAP_S390_HPAGE; |
976 | 976 | ||
977 | #if defined(CONFIG_64BIT) | ||
977 | /* | 978 | /* |
978 | * 64-bit register support for 31-bit processes | 979 | * 64-bit register support for 31-bit processes |
979 | * HWCAP_S390_HIGH_GPRS is bit 9. | 980 | * HWCAP_S390_HIGH_GPRS is bit 9. |
980 | */ | 981 | */ |
981 | elf_hwcap |= HWCAP_S390_HIGH_GPRS; | 982 | elf_hwcap |= HWCAP_S390_HIGH_GPRS; |
983 | #endif | ||
982 | 984 | ||
983 | get_cpu_id(&cpu_id); | 985 | get_cpu_id(&cpu_id); |
984 | switch (cpu_id.machine) { | 986 | switch (cpu_id.machine) { |
diff --git a/arch/s390/lib/uaccess_pt.c b/arch/s390/lib/uaccess_pt.c index 60ee2b883797..2d37bb861faf 100644 --- a/arch/s390/lib/uaccess_pt.c +++ b/arch/s390/lib/uaccess_pt.c | |||
@@ -2,69 +2,82 @@ | |||
2 | * User access functions based on page table walks for enhanced | 2 | * User access functions based on page table walks for enhanced |
3 | * system layout without hardware support. | 3 | * system layout without hardware support. |
4 | * | 4 | * |
5 | * Copyright IBM Corp. 2006 | 5 | * Copyright IBM Corp. 2006, 2012 |
6 | * Author(s): Gerald Schaefer (gerald.schaefer@de.ibm.com) | 6 | * Author(s): Gerald Schaefer (gerald.schaefer@de.ibm.com) |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <linux/errno.h> | 9 | #include <linux/errno.h> |
10 | #include <linux/hardirq.h> | 10 | #include <linux/hardirq.h> |
11 | #include <linux/mm.h> | 11 | #include <linux/mm.h> |
12 | #include <linux/hugetlb.h> | ||
12 | #include <asm/uaccess.h> | 13 | #include <asm/uaccess.h> |
13 | #include <asm/futex.h> | 14 | #include <asm/futex.h> |
14 | #include "uaccess.h" | 15 | #include "uaccess.h" |
15 | 16 | ||
16 | static inline pte_t *follow_table(struct mm_struct *mm, unsigned long addr) | 17 | |
18 | /* | ||
19 | * Returns kernel address for user virtual address. If the returned address is | ||
20 | * >= -4095 (IS_ERR_VALUE(x) returns true), a fault has occured and the address | ||
21 | * contains the (negative) exception code. | ||
22 | */ | ||
23 | static __always_inline unsigned long follow_table(struct mm_struct *mm, | ||
24 | unsigned long addr, int write) | ||
17 | { | 25 | { |
18 | pgd_t *pgd; | 26 | pgd_t *pgd; |
19 | pud_t *pud; | 27 | pud_t *pud; |
20 | pmd_t *pmd; | 28 | pmd_t *pmd; |
29 | pte_t *ptep; | ||
21 | 30 | ||
22 | pgd = pgd_offset(mm, addr); | 31 | pgd = pgd_offset(mm, addr); |
23 | if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd))) | 32 | if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd))) |
24 | return (pte_t *) 0x3a; | 33 | return -0x3aUL; |
25 | 34 | ||
26 | pud = pud_offset(pgd, addr); | 35 | pud = pud_offset(pgd, addr); |
27 | if (pud_none(*pud) || unlikely(pud_bad(*pud))) | 36 | if (pud_none(*pud) || unlikely(pud_bad(*pud))) |
28 | return (pte_t *) 0x3b; | 37 | return -0x3bUL; |
29 | 38 | ||
30 | pmd = pmd_offset(pud, addr); | 39 | pmd = pmd_offset(pud, addr); |
31 | if (pmd_none(*pmd) || unlikely(pmd_bad(*pmd))) | 40 | if (pmd_none(*pmd)) |
32 | return (pte_t *) 0x10; | 41 | return -0x10UL; |
42 | if (pmd_huge(*pmd)) { | ||
43 | if (write && (pmd_val(*pmd) & _SEGMENT_ENTRY_RO)) | ||
44 | return -0x04UL; | ||
45 | return (pmd_val(*pmd) & HPAGE_MASK) + (addr & ~HPAGE_MASK); | ||
46 | } | ||
47 | if (unlikely(pmd_bad(*pmd))) | ||
48 | return -0x10UL; | ||
49 | |||
50 | ptep = pte_offset_map(pmd, addr); | ||
51 | if (!pte_present(*ptep)) | ||
52 | return -0x11UL; | ||
53 | if (write && !pte_write(*ptep)) | ||
54 | return -0x04UL; | ||
33 | 55 | ||
34 | return pte_offset_map(pmd, addr); | 56 | return (pte_val(*ptep) & PAGE_MASK) + (addr & ~PAGE_MASK); |
35 | } | 57 | } |
36 | 58 | ||
37 | static __always_inline size_t __user_copy_pt(unsigned long uaddr, void *kptr, | 59 | static __always_inline size_t __user_copy_pt(unsigned long uaddr, void *kptr, |
38 | size_t n, int write_user) | 60 | size_t n, int write_user) |
39 | { | 61 | { |
40 | struct mm_struct *mm = current->mm; | 62 | struct mm_struct *mm = current->mm; |
41 | unsigned long offset, pfn, done, size; | 63 | unsigned long offset, done, size, kaddr; |
42 | pte_t *pte; | ||
43 | void *from, *to; | 64 | void *from, *to; |
44 | 65 | ||
45 | done = 0; | 66 | done = 0; |
46 | retry: | 67 | retry: |
47 | spin_lock(&mm->page_table_lock); | 68 | spin_lock(&mm->page_table_lock); |
48 | do { | 69 | do { |
49 | pte = follow_table(mm, uaddr); | 70 | kaddr = follow_table(mm, uaddr, write_user); |
50 | if ((unsigned long) pte < 0x1000) | 71 | if (IS_ERR_VALUE(kaddr)) |
51 | goto fault; | 72 | goto fault; |
52 | if (!pte_present(*pte)) { | ||
53 | pte = (pte_t *) 0x11; | ||
54 | goto fault; | ||
55 | } else if (write_user && !pte_write(*pte)) { | ||
56 | pte = (pte_t *) 0x04; | ||
57 | goto fault; | ||
58 | } | ||
59 | 73 | ||
60 | pfn = pte_pfn(*pte); | 74 | offset = uaddr & ~PAGE_MASK; |
61 | offset = uaddr & (PAGE_SIZE - 1); | ||
62 | size = min(n - done, PAGE_SIZE - offset); | 75 | size = min(n - done, PAGE_SIZE - offset); |
63 | if (write_user) { | 76 | if (write_user) { |
64 | to = (void *)((pfn << PAGE_SHIFT) + offset); | 77 | to = (void *) kaddr; |
65 | from = kptr + done; | 78 | from = kptr + done; |
66 | } else { | 79 | } else { |
67 | from = (void *)((pfn << PAGE_SHIFT) + offset); | 80 | from = (void *) kaddr; |
68 | to = kptr + done; | 81 | to = kptr + done; |
69 | } | 82 | } |
70 | memcpy(to, from, size); | 83 | memcpy(to, from, size); |
@@ -75,7 +88,7 @@ retry: | |||
75 | return n - done; | 88 | return n - done; |
76 | fault: | 89 | fault: |
77 | spin_unlock(&mm->page_table_lock); | 90 | spin_unlock(&mm->page_table_lock); |
78 | if (__handle_fault(uaddr, (unsigned long) pte, write_user)) | 91 | if (__handle_fault(uaddr, -kaddr, write_user)) |
79 | return n - done; | 92 | return n - done; |
80 | goto retry; | 93 | goto retry; |
81 | } | 94 | } |
@@ -84,27 +97,22 @@ fault: | |||
84 | * Do DAT for user address by page table walk, return kernel address. | 97 | * Do DAT for user address by page table walk, return kernel address. |
85 | * This function needs to be called with current->mm->page_table_lock held. | 98 | * This function needs to be called with current->mm->page_table_lock held. |
86 | */ | 99 | */ |
87 | static __always_inline unsigned long __dat_user_addr(unsigned long uaddr) | 100 | static __always_inline unsigned long __dat_user_addr(unsigned long uaddr, |
101 | int write) | ||
88 | { | 102 | { |
89 | struct mm_struct *mm = current->mm; | 103 | struct mm_struct *mm = current->mm; |
90 | unsigned long pfn; | 104 | unsigned long kaddr; |
91 | pte_t *pte; | ||
92 | int rc; | 105 | int rc; |
93 | 106 | ||
94 | retry: | 107 | retry: |
95 | pte = follow_table(mm, uaddr); | 108 | kaddr = follow_table(mm, uaddr, write); |
96 | if ((unsigned long) pte < 0x1000) | 109 | if (IS_ERR_VALUE(kaddr)) |
97 | goto fault; | ||
98 | if (!pte_present(*pte)) { | ||
99 | pte = (pte_t *) 0x11; | ||
100 | goto fault; | 110 | goto fault; |
101 | } | ||
102 | 111 | ||
103 | pfn = pte_pfn(*pte); | 112 | return kaddr; |
104 | return (pfn << PAGE_SHIFT) + (uaddr & (PAGE_SIZE - 1)); | ||
105 | fault: | 113 | fault: |
106 | spin_unlock(&mm->page_table_lock); | 114 | spin_unlock(&mm->page_table_lock); |
107 | rc = __handle_fault(uaddr, (unsigned long) pte, 0); | 115 | rc = __handle_fault(uaddr, -kaddr, write); |
108 | spin_lock(&mm->page_table_lock); | 116 | spin_lock(&mm->page_table_lock); |
109 | if (!rc) | 117 | if (!rc) |
110 | goto retry; | 118 | goto retry; |
@@ -159,11 +167,9 @@ static size_t clear_user_pt(size_t n, void __user *to) | |||
159 | 167 | ||
160 | static size_t strnlen_user_pt(size_t count, const char __user *src) | 168 | static size_t strnlen_user_pt(size_t count, const char __user *src) |
161 | { | 169 | { |
162 | char *addr; | ||
163 | unsigned long uaddr = (unsigned long) src; | 170 | unsigned long uaddr = (unsigned long) src; |
164 | struct mm_struct *mm = current->mm; | 171 | struct mm_struct *mm = current->mm; |
165 | unsigned long offset, pfn, done, len; | 172 | unsigned long offset, done, len, kaddr; |
166 | pte_t *pte; | ||
167 | size_t len_str; | 173 | size_t len_str; |
168 | 174 | ||
169 | if (segment_eq(get_fs(), KERNEL_DS)) | 175 | if (segment_eq(get_fs(), KERNEL_DS)) |
@@ -172,19 +178,13 @@ static size_t strnlen_user_pt(size_t count, const char __user *src) | |||
172 | retry: | 178 | retry: |
173 | spin_lock(&mm->page_table_lock); | 179 | spin_lock(&mm->page_table_lock); |
174 | do { | 180 | do { |
175 | pte = follow_table(mm, uaddr); | 181 | kaddr = follow_table(mm, uaddr, 0); |
176 | if ((unsigned long) pte < 0x1000) | 182 | if (IS_ERR_VALUE(kaddr)) |
177 | goto fault; | ||
178 | if (!pte_present(*pte)) { | ||
179 | pte = (pte_t *) 0x11; | ||
180 | goto fault; | 183 | goto fault; |
181 | } | ||
182 | 184 | ||
183 | pfn = pte_pfn(*pte); | 185 | offset = uaddr & ~PAGE_MASK; |
184 | offset = uaddr & (PAGE_SIZE-1); | ||
185 | addr = (char *)(pfn << PAGE_SHIFT) + offset; | ||
186 | len = min(count - done, PAGE_SIZE - offset); | 186 | len = min(count - done, PAGE_SIZE - offset); |
187 | len_str = strnlen(addr, len); | 187 | len_str = strnlen((char *) kaddr, len); |
188 | done += len_str; | 188 | done += len_str; |
189 | uaddr += len_str; | 189 | uaddr += len_str; |
190 | } while ((len_str == len) && (done < count)); | 190 | } while ((len_str == len) && (done < count)); |
@@ -192,7 +192,7 @@ retry: | |||
192 | return done + 1; | 192 | return done + 1; |
193 | fault: | 193 | fault: |
194 | spin_unlock(&mm->page_table_lock); | 194 | spin_unlock(&mm->page_table_lock); |
195 | if (__handle_fault(uaddr, (unsigned long) pte, 0)) | 195 | if (__handle_fault(uaddr, -kaddr, 0)) |
196 | return 0; | 196 | return 0; |
197 | goto retry; | 197 | goto retry; |
198 | } | 198 | } |
@@ -225,11 +225,10 @@ static size_t copy_in_user_pt(size_t n, void __user *to, | |||
225 | const void __user *from) | 225 | const void __user *from) |
226 | { | 226 | { |
227 | struct mm_struct *mm = current->mm; | 227 | struct mm_struct *mm = current->mm; |
228 | unsigned long offset_from, offset_to, offset_max, pfn_from, pfn_to, | 228 | unsigned long offset_max, uaddr, done, size, error_code; |
229 | uaddr, done, size, error_code; | ||
230 | unsigned long uaddr_from = (unsigned long) from; | 229 | unsigned long uaddr_from = (unsigned long) from; |
231 | unsigned long uaddr_to = (unsigned long) to; | 230 | unsigned long uaddr_to = (unsigned long) to; |
232 | pte_t *pte_from, *pte_to; | 231 | unsigned long kaddr_to, kaddr_from; |
233 | int write_user; | 232 | int write_user; |
234 | 233 | ||
235 | if (segment_eq(get_fs(), KERNEL_DS)) { | 234 | if (segment_eq(get_fs(), KERNEL_DS)) { |
@@ -242,38 +241,23 @@ retry: | |||
242 | do { | 241 | do { |
243 | write_user = 0; | 242 | write_user = 0; |
244 | uaddr = uaddr_from; | 243 | uaddr = uaddr_from; |
245 | pte_from = follow_table(mm, uaddr_from); | 244 | kaddr_from = follow_table(mm, uaddr_from, 0); |
246 | error_code = (unsigned long) pte_from; | 245 | error_code = kaddr_from; |
247 | if (error_code < 0x1000) | 246 | if (IS_ERR_VALUE(error_code)) |
248 | goto fault; | ||
249 | if (!pte_present(*pte_from)) { | ||
250 | error_code = 0x11; | ||
251 | goto fault; | 247 | goto fault; |
252 | } | ||
253 | 248 | ||
254 | write_user = 1; | 249 | write_user = 1; |
255 | uaddr = uaddr_to; | 250 | uaddr = uaddr_to; |
256 | pte_to = follow_table(mm, uaddr_to); | 251 | kaddr_to = follow_table(mm, uaddr_to, 1); |
257 | error_code = (unsigned long) pte_to; | 252 | error_code = (unsigned long) kaddr_to; |
258 | if (error_code < 0x1000) | 253 | if (IS_ERR_VALUE(error_code)) |
259 | goto fault; | ||
260 | if (!pte_present(*pte_to)) { | ||
261 | error_code = 0x11; | ||
262 | goto fault; | 254 | goto fault; |
263 | } else if (!pte_write(*pte_to)) { | ||
264 | error_code = 0x04; | ||
265 | goto fault; | ||
266 | } | ||
267 | 255 | ||
268 | pfn_from = pte_pfn(*pte_from); | 256 | offset_max = max(uaddr_from & ~PAGE_MASK, |
269 | pfn_to = pte_pfn(*pte_to); | 257 | uaddr_to & ~PAGE_MASK); |
270 | offset_from = uaddr_from & (PAGE_SIZE-1); | ||
271 | offset_to = uaddr_from & (PAGE_SIZE-1); | ||
272 | offset_max = max(offset_from, offset_to); | ||
273 | size = min(n - done, PAGE_SIZE - offset_max); | 258 | size = min(n - done, PAGE_SIZE - offset_max); |
274 | 259 | ||
275 | memcpy((void *)(pfn_to << PAGE_SHIFT) + offset_to, | 260 | memcpy((void *) kaddr_to, (void *) kaddr_from, size); |
276 | (void *)(pfn_from << PAGE_SHIFT) + offset_from, size); | ||
277 | done += size; | 261 | done += size; |
278 | uaddr_from += size; | 262 | uaddr_from += size; |
279 | uaddr_to += size; | 263 | uaddr_to += size; |
@@ -282,7 +266,7 @@ retry: | |||
282 | return n - done; | 266 | return n - done; |
283 | fault: | 267 | fault: |
284 | spin_unlock(&mm->page_table_lock); | 268 | spin_unlock(&mm->page_table_lock); |
285 | if (__handle_fault(uaddr, error_code, write_user)) | 269 | if (__handle_fault(uaddr, -error_code, write_user)) |
286 | return n - done; | 270 | return n - done; |
287 | goto retry; | 271 | goto retry; |
288 | } | 272 | } |
@@ -341,7 +325,7 @@ int futex_atomic_op_pt(int op, u32 __user *uaddr, int oparg, int *old) | |||
341 | return __futex_atomic_op_pt(op, uaddr, oparg, old); | 325 | return __futex_atomic_op_pt(op, uaddr, oparg, old); |
342 | spin_lock(¤t->mm->page_table_lock); | 326 | spin_lock(¤t->mm->page_table_lock); |
343 | uaddr = (u32 __force __user *) | 327 | uaddr = (u32 __force __user *) |
344 | __dat_user_addr((__force unsigned long) uaddr); | 328 | __dat_user_addr((__force unsigned long) uaddr, 1); |
345 | if (!uaddr) { | 329 | if (!uaddr) { |
346 | spin_unlock(¤t->mm->page_table_lock); | 330 | spin_unlock(¤t->mm->page_table_lock); |
347 | return -EFAULT; | 331 | return -EFAULT; |
@@ -378,7 +362,7 @@ int futex_atomic_cmpxchg_pt(u32 *uval, u32 __user *uaddr, | |||
378 | return __futex_atomic_cmpxchg_pt(uval, uaddr, oldval, newval); | 362 | return __futex_atomic_cmpxchg_pt(uval, uaddr, oldval, newval); |
379 | spin_lock(¤t->mm->page_table_lock); | 363 | spin_lock(¤t->mm->page_table_lock); |
380 | uaddr = (u32 __force __user *) | 364 | uaddr = (u32 __force __user *) |
381 | __dat_user_addr((__force unsigned long) uaddr); | 365 | __dat_user_addr((__force unsigned long) uaddr, 1); |
382 | if (!uaddr) { | 366 | if (!uaddr) { |
383 | spin_unlock(¤t->mm->page_table_lock); | 367 | spin_unlock(¤t->mm->page_table_lock); |
384 | return -EFAULT; | 368 | return -EFAULT; |
diff --git a/arch/sh/kernel/cpu/sh5/entry.S b/arch/sh/kernel/cpu/sh5/entry.S index b7cf6a547f11..7e605b95592a 100644 --- a/arch/sh/kernel/cpu/sh5/entry.S +++ b/arch/sh/kernel/cpu/sh5/entry.S | |||
@@ -933,7 +933,7 @@ ret_with_reschedule: | |||
933 | 933 | ||
934 | pta restore_all, tr1 | 934 | pta restore_all, tr1 |
935 | 935 | ||
936 | movi _TIF_SIGPENDING, r8 | 936 | movi (_TIF_SIGPENDING|_TIF_NOTIFY_RESUME), r8 |
937 | and r8, r7, r8 | 937 | and r8, r7, r8 |
938 | pta work_notifysig, tr0 | 938 | pta work_notifysig, tr0 |
939 | bne r8, ZERO, tr0 | 939 | bne r8, ZERO, tr0 |
diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S index f67601cb3f1f..b96489d8b27d 100644 --- a/arch/sh/kernel/entry-common.S +++ b/arch/sh/kernel/entry-common.S | |||
@@ -139,7 +139,7 @@ work_pending: | |||
139 | ! r8: current_thread_info | 139 | ! r8: current_thread_info |
140 | ! t: result of "tst #_TIF_NEED_RESCHED, r0" | 140 | ! t: result of "tst #_TIF_NEED_RESCHED, r0" |
141 | bf/s work_resched | 141 | bf/s work_resched |
142 | tst #_TIF_SIGPENDING, r0 | 142 | tst #(_TIF_SIGPENDING | _TIF_NOTIFY_RESUME), r0 |
143 | work_notifysig: | 143 | work_notifysig: |
144 | bt/s __restore_all | 144 | bt/s __restore_all |
145 | mov r15, r4 | 145 | mov r15, r4 |
diff --git a/arch/sparc/kernel/module.c b/arch/sparc/kernel/module.c index 15e0a1693976..f1ddc0d23679 100644 --- a/arch/sparc/kernel/module.c +++ b/arch/sparc/kernel/module.c | |||
@@ -48,9 +48,7 @@ void *module_alloc(unsigned long size) | |||
48 | return NULL; | 48 | return NULL; |
49 | 49 | ||
50 | ret = module_map(size); | 50 | ret = module_map(size); |
51 | if (!ret) | 51 | if (ret) |
52 | ret = ERR_PTR(-ENOMEM); | ||
53 | else | ||
54 | memset(ret, 0, size); | 52 | memset(ret, 0, size); |
55 | 53 | ||
56 | return ret; | 54 | return ret; |
@@ -116,6 +114,10 @@ int apply_relocate_add(Elf_Shdr *sechdrs, | |||
116 | v = sym->st_value + rel[i].r_addend; | 114 | v = sym->st_value + rel[i].r_addend; |
117 | 115 | ||
118 | switch (ELF_R_TYPE(rel[i].r_info) & 0xff) { | 116 | switch (ELF_R_TYPE(rel[i].r_info) & 0xff) { |
117 | case R_SPARC_DISP32: | ||
118 | v -= (Elf_Addr) location; | ||
119 | *loc32 = v; | ||
120 | break; | ||
119 | #ifdef CONFIG_SPARC64 | 121 | #ifdef CONFIG_SPARC64 |
120 | case R_SPARC_64: | 122 | case R_SPARC_64: |
121 | location[0] = v >> 56; | 123 | location[0] = v >> 56; |
@@ -128,11 +130,6 @@ int apply_relocate_add(Elf_Shdr *sechdrs, | |||
128 | location[7] = v >> 0; | 130 | location[7] = v >> 0; |
129 | break; | 131 | break; |
130 | 132 | ||
131 | case R_SPARC_DISP32: | ||
132 | v -= (Elf_Addr) location; | ||
133 | *loc32 = v; | ||
134 | break; | ||
135 | |||
136 | case R_SPARC_WDISP19: | 133 | case R_SPARC_WDISP19: |
137 | v -= (Elf_Addr) location; | 134 | v -= (Elf_Addr) location; |
138 | *loc32 = (*loc32 & ~0x7ffff) | | 135 | *loc32 = (*loc32 & ~0x7ffff) | |
diff --git a/arch/tile/include/gxio/iorpc_trio.h b/arch/tile/include/gxio/iorpc_trio.h index 15fb77992083..58105c31228b 100644 --- a/arch/tile/include/gxio/iorpc_trio.h +++ b/arch/tile/include/gxio/iorpc_trio.h | |||
@@ -25,21 +25,23 @@ | |||
25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
26 | #include <asm/pgtable.h> | 26 | #include <asm/pgtable.h> |
27 | 27 | ||
28 | #define GXIO_TRIO_OP_ALLOC_ASIDS IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1400) | 28 | #define GXIO_TRIO_OP_DEALLOC_ASID IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1400) |
29 | #define GXIO_TRIO_OP_ALLOC_ASIDS IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1401) | ||
29 | 30 | ||
30 | #define GXIO_TRIO_OP_ALLOC_MEMORY_MAPS IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1402) | 31 | #define GXIO_TRIO_OP_ALLOC_MEMORY_MAPS IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1404) |
31 | 32 | ||
32 | #define GXIO_TRIO_OP_ALLOC_PIO_REGIONS IORPC_OPCODE(IORPC_FORMAT_NONE, 0x140e) | 33 | #define GXIO_TRIO_OP_ALLOC_PIO_REGIONS IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1412) |
33 | #define GXIO_TRIO_OP_INIT_PIO_REGION_AUX IORPC_OPCODE(IORPC_FORMAT_NONE, 0x140f) | ||
34 | 34 | ||
35 | #define GXIO_TRIO_OP_INIT_MEMORY_MAP_MMU_AUX IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x1417) | 35 | #define GXIO_TRIO_OP_INIT_PIO_REGION_AUX IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1414) |
36 | #define GXIO_TRIO_OP_GET_PORT_PROPERTY IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x1418) | ||
37 | #define GXIO_TRIO_OP_CONFIG_LEGACY_INTR IORPC_OPCODE(IORPC_FORMAT_KERNEL_INTERRUPT, 0x1419) | ||
38 | #define GXIO_TRIO_OP_CONFIG_MSI_INTR IORPC_OPCODE(IORPC_FORMAT_KERNEL_INTERRUPT, 0x141a) | ||
39 | 36 | ||
40 | #define GXIO_TRIO_OP_SET_MPS_MRS IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x141c) | 37 | #define GXIO_TRIO_OP_INIT_MEMORY_MAP_MMU_AUX IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x141e) |
41 | #define GXIO_TRIO_OP_FORCE_RC_LINK_UP IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x141d) | 38 | #define GXIO_TRIO_OP_GET_PORT_PROPERTY IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x141f) |
42 | #define GXIO_TRIO_OP_FORCE_EP_LINK_UP IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x141e) | 39 | #define GXIO_TRIO_OP_CONFIG_LEGACY_INTR IORPC_OPCODE(IORPC_FORMAT_KERNEL_INTERRUPT, 0x1420) |
40 | #define GXIO_TRIO_OP_CONFIG_MSI_INTR IORPC_OPCODE(IORPC_FORMAT_KERNEL_INTERRUPT, 0x1421) | ||
41 | |||
42 | #define GXIO_TRIO_OP_SET_MPS_MRS IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x1423) | ||
43 | #define GXIO_TRIO_OP_FORCE_RC_LINK_UP IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x1424) | ||
44 | #define GXIO_TRIO_OP_FORCE_EP_LINK_UP IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x1425) | ||
43 | #define GXIO_TRIO_OP_GET_MMIO_BASE IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8000) | 45 | #define GXIO_TRIO_OP_GET_MMIO_BASE IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8000) |
44 | #define GXIO_TRIO_OP_CHECK_MMIO_OFFSET IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8001) | 46 | #define GXIO_TRIO_OP_CHECK_MMIO_OFFSET IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8001) |
45 | 47 | ||
diff --git a/arch/um/include/asm/processor-generic.h b/arch/um/include/asm/processor-generic.h index 69f1c57a8d0d..33a6a2423bd2 100644 --- a/arch/um/include/asm/processor-generic.h +++ b/arch/um/include/asm/processor-generic.h | |||
@@ -20,14 +20,6 @@ struct mm_struct; | |||
20 | 20 | ||
21 | struct thread_struct { | 21 | struct thread_struct { |
22 | struct task_struct *saved_task; | 22 | struct task_struct *saved_task; |
23 | /* | ||
24 | * This flag is set to 1 before calling do_fork (and analyzed in | ||
25 | * copy_thread) to mark that we are begin called from userspace (fork / | ||
26 | * vfork / clone), and reset to 0 after. It is left to 0 when called | ||
27 | * from kernelspace (i.e. kernel_thread() or fork_idle(), | ||
28 | * as of 2.6.11). | ||
29 | */ | ||
30 | int forking; | ||
31 | struct pt_regs regs; | 23 | struct pt_regs regs; |
32 | int singlestep_syscall; | 24 | int singlestep_syscall; |
33 | void *fault_addr; | 25 | void *fault_addr; |
@@ -58,7 +50,6 @@ struct thread_struct { | |||
58 | 50 | ||
59 | #define INIT_THREAD \ | 51 | #define INIT_THREAD \ |
60 | { \ | 52 | { \ |
61 | .forking = 0, \ | ||
62 | .regs = EMPTY_REGS, \ | 53 | .regs = EMPTY_REGS, \ |
63 | .fault_addr = NULL, \ | 54 | .fault_addr = NULL, \ |
64 | .prev_sched = NULL, \ | 55 | .prev_sched = NULL, \ |
diff --git a/arch/um/include/shared/common-offsets.h b/arch/um/include/shared/common-offsets.h index 40db8f71deae..2df313b6a586 100644 --- a/arch/um/include/shared/common-offsets.h +++ b/arch/um/include/shared/common-offsets.h | |||
@@ -7,16 +7,6 @@ DEFINE(UM_KERN_PAGE_MASK, PAGE_MASK); | |||
7 | DEFINE(UM_KERN_PAGE_SHIFT, PAGE_SHIFT); | 7 | DEFINE(UM_KERN_PAGE_SHIFT, PAGE_SHIFT); |
8 | DEFINE(UM_NSEC_PER_SEC, NSEC_PER_SEC); | 8 | DEFINE(UM_NSEC_PER_SEC, NSEC_PER_SEC); |
9 | 9 | ||
10 | DEFINE_STR(UM_KERN_EMERG, KERN_EMERG); | ||
11 | DEFINE_STR(UM_KERN_ALERT, KERN_ALERT); | ||
12 | DEFINE_STR(UM_KERN_CRIT, KERN_CRIT); | ||
13 | DEFINE_STR(UM_KERN_ERR, KERN_ERR); | ||
14 | DEFINE_STR(UM_KERN_WARNING, KERN_WARNING); | ||
15 | DEFINE_STR(UM_KERN_NOTICE, KERN_NOTICE); | ||
16 | DEFINE_STR(UM_KERN_INFO, KERN_INFO); | ||
17 | DEFINE_STR(UM_KERN_DEBUG, KERN_DEBUG); | ||
18 | DEFINE_STR(UM_KERN_CONT, KERN_CONT); | ||
19 | |||
20 | DEFINE(UM_ELF_CLASS, ELF_CLASS); | 10 | DEFINE(UM_ELF_CLASS, ELF_CLASS); |
21 | DEFINE(UM_ELFCLASS32, ELFCLASS32); | 11 | DEFINE(UM_ELFCLASS32, ELFCLASS32); |
22 | DEFINE(UM_ELFCLASS64, ELFCLASS64); | 12 | DEFINE(UM_ELFCLASS64, ELFCLASS64); |
diff --git a/arch/um/include/shared/user.h b/arch/um/include/shared/user.h index 4fa82c055aab..cef068563336 100644 --- a/arch/um/include/shared/user.h +++ b/arch/um/include/shared/user.h | |||
@@ -26,6 +26,17 @@ | |||
26 | extern void panic(const char *fmt, ...) | 26 | extern void panic(const char *fmt, ...) |
27 | __attribute__ ((format (printf, 1, 2))); | 27 | __attribute__ ((format (printf, 1, 2))); |
28 | 28 | ||
29 | /* Requires preincluding include/linux/kern_levels.h */ | ||
30 | #define UM_KERN_EMERG KERN_EMERG | ||
31 | #define UM_KERN_ALERT KERN_ALERT | ||
32 | #define UM_KERN_CRIT KERN_CRIT | ||
33 | #define UM_KERN_ERR KERN_ERR | ||
34 | #define UM_KERN_WARNING KERN_WARNING | ||
35 | #define UM_KERN_NOTICE KERN_NOTICE | ||
36 | #define UM_KERN_INFO KERN_INFO | ||
37 | #define UM_KERN_DEBUG KERN_DEBUG | ||
38 | #define UM_KERN_CONT KERN_CONT | ||
39 | |||
29 | #ifdef UML_CONFIG_PRINTK | 40 | #ifdef UML_CONFIG_PRINTK |
30 | extern int printk(const char *fmt, ...) | 41 | extern int printk(const char *fmt, ...) |
31 | __attribute__ ((format (printf, 1, 2))); | 42 | __attribute__ ((format (printf, 1, 2))); |
diff --git a/arch/um/kernel/exec.c b/arch/um/kernel/exec.c index 6cade9366364..8c82786da823 100644 --- a/arch/um/kernel/exec.c +++ b/arch/um/kernel/exec.c | |||
@@ -39,34 +39,21 @@ void flush_thread(void) | |||
39 | 39 | ||
40 | void start_thread(struct pt_regs *regs, unsigned long eip, unsigned long esp) | 40 | void start_thread(struct pt_regs *regs, unsigned long eip, unsigned long esp) |
41 | { | 41 | { |
42 | get_safe_registers(regs->regs.gp, regs->regs.fp); | ||
42 | PT_REGS_IP(regs) = eip; | 43 | PT_REGS_IP(regs) = eip; |
43 | PT_REGS_SP(regs) = esp; | 44 | PT_REGS_SP(regs) = esp; |
44 | } | 45 | current->ptrace &= ~PT_DTRACE; |
45 | EXPORT_SYMBOL(start_thread); | ||
46 | |||
47 | static long execve1(const char *file, | ||
48 | const char __user *const __user *argv, | ||
49 | const char __user *const __user *env) | ||
50 | { | ||
51 | long error; | ||
52 | |||
53 | error = do_execve(file, argv, env, ¤t->thread.regs); | ||
54 | if (error == 0) { | ||
55 | task_lock(current); | ||
56 | current->ptrace &= ~PT_DTRACE; | ||
57 | #ifdef SUBARCH_EXECVE1 | 46 | #ifdef SUBARCH_EXECVE1 |
58 | SUBARCH_EXECVE1(¤t->thread.regs.regs); | 47 | SUBARCH_EXECVE1(regs->regs); |
59 | #endif | 48 | #endif |
60 | task_unlock(current); | ||
61 | } | ||
62 | return error; | ||
63 | } | 49 | } |
50 | EXPORT_SYMBOL(start_thread); | ||
64 | 51 | ||
65 | long um_execve(const char *file, const char __user *const __user *argv, const char __user *const __user *env) | 52 | long um_execve(const char *file, const char __user *const __user *argv, const char __user *const __user *env) |
66 | { | 53 | { |
67 | long err; | 54 | long err; |
68 | 55 | ||
69 | err = execve1(file, argv, env); | 56 | err = do_execve(file, argv, env, ¤t->thread.regs); |
70 | if (!err) | 57 | if (!err) |
71 | UML_LONGJMP(current->thread.exec_buf, 1); | 58 | UML_LONGJMP(current->thread.exec_buf, 1); |
72 | return err; | 59 | return err; |
@@ -81,7 +68,7 @@ long sys_execve(const char __user *file, const char __user *const __user *argv, | |||
81 | filename = getname(file); | 68 | filename = getname(file); |
82 | error = PTR_ERR(filename); | 69 | error = PTR_ERR(filename); |
83 | if (IS_ERR(filename)) goto out; | 70 | if (IS_ERR(filename)) goto out; |
84 | error = execve1(filename, argv, env); | 71 | error = do_execve(filename, argv, env, ¤t->thread.regs); |
85 | putname(filename); | 72 | putname(filename); |
86 | out: | 73 | out: |
87 | return error; | 74 | return error; |
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index 57fc7028714a..c5f5afa50745 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c | |||
@@ -181,11 +181,12 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, | |||
181 | struct pt_regs *regs) | 181 | struct pt_regs *regs) |
182 | { | 182 | { |
183 | void (*handler)(void); | 183 | void (*handler)(void); |
184 | int kthread = current->flags & PF_KTHREAD; | ||
184 | int ret = 0; | 185 | int ret = 0; |
185 | 186 | ||
186 | p->thread = (struct thread_struct) INIT_THREAD; | 187 | p->thread = (struct thread_struct) INIT_THREAD; |
187 | 188 | ||
188 | if (current->thread.forking) { | 189 | if (!kthread) { |
189 | memcpy(&p->thread.regs.regs, ®s->regs, | 190 | memcpy(&p->thread.regs.regs, ®s->regs, |
190 | sizeof(p->thread.regs.regs)); | 191 | sizeof(p->thread.regs.regs)); |
191 | PT_REGS_SET_SYSCALL_RETURN(&p->thread.regs, 0); | 192 | PT_REGS_SET_SYSCALL_RETURN(&p->thread.regs, 0); |
@@ -195,8 +196,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, | |||
195 | handler = fork_handler; | 196 | handler = fork_handler; |
196 | 197 | ||
197 | arch_copy_thread(¤t->thread.arch, &p->thread.arch); | 198 | arch_copy_thread(¤t->thread.arch, &p->thread.arch); |
198 | } | 199 | } else { |
199 | else { | ||
200 | get_safe_registers(p->thread.regs.regs.gp, p->thread.regs.regs.fp); | 200 | get_safe_registers(p->thread.regs.regs.gp, p->thread.regs.regs.fp); |
201 | p->thread.request.u.thread = current->thread.request.u.thread; | 201 | p->thread.request.u.thread = current->thread.request.u.thread; |
202 | handler = new_thread_handler; | 202 | handler = new_thread_handler; |
@@ -204,7 +204,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, | |||
204 | 204 | ||
205 | new_thread(task_stack_page(p), &p->thread.switch_buf, handler); | 205 | new_thread(task_stack_page(p), &p->thread.switch_buf, handler); |
206 | 206 | ||
207 | if (current->thread.forking) { | 207 | if (!kthread) { |
208 | clear_flushed_tls(p); | 208 | clear_flushed_tls(p); |
209 | 209 | ||
210 | /* | 210 | /* |
diff --git a/arch/um/kernel/signal.c b/arch/um/kernel/signal.c index 7362d58efc29..cc9c2350e417 100644 --- a/arch/um/kernel/signal.c +++ b/arch/um/kernel/signal.c | |||
@@ -22,9 +22,13 @@ static void handle_signal(struct pt_regs *regs, unsigned long signr, | |||
22 | struct k_sigaction *ka, siginfo_t *info) | 22 | struct k_sigaction *ka, siginfo_t *info) |
23 | { | 23 | { |
24 | sigset_t *oldset = sigmask_to_save(); | 24 | sigset_t *oldset = sigmask_to_save(); |
25 | int singlestep = 0; | ||
25 | unsigned long sp; | 26 | unsigned long sp; |
26 | int err; | 27 | int err; |
27 | 28 | ||
29 | if ((current->ptrace & PT_DTRACE) && (current->ptrace & PT_PTRACED)) | ||
30 | singlestep = 1; | ||
31 | |||
28 | /* Did we come from a system call? */ | 32 | /* Did we come from a system call? */ |
29 | if (PT_REGS_SYSCALL_NR(regs) >= 0) { | 33 | if (PT_REGS_SYSCALL_NR(regs) >= 0) { |
30 | /* If so, check system call restarting.. */ | 34 | /* If so, check system call restarting.. */ |
@@ -61,7 +65,7 @@ static void handle_signal(struct pt_regs *regs, unsigned long signr, | |||
61 | if (err) | 65 | if (err) |
62 | force_sigsegv(signr, current); | 66 | force_sigsegv(signr, current); |
63 | else | 67 | else |
64 | signal_delivered(signr, info, ka, regs, 0); | 68 | signal_delivered(signr, info, ka, regs, singlestep); |
65 | } | 69 | } |
66 | 70 | ||
67 | static int kern_do_signal(struct pt_regs *regs) | 71 | static int kern_do_signal(struct pt_regs *regs) |
diff --git a/arch/um/kernel/syscall.c b/arch/um/kernel/syscall.c index f958cb876ee3..a4c6d8eee74c 100644 --- a/arch/um/kernel/syscall.c +++ b/arch/um/kernel/syscall.c | |||
@@ -17,25 +17,25 @@ | |||
17 | 17 | ||
18 | long sys_fork(void) | 18 | long sys_fork(void) |
19 | { | 19 | { |
20 | long ret; | 20 | return do_fork(SIGCHLD, UPT_SP(¤t->thread.regs.regs), |
21 | |||
22 | current->thread.forking = 1; | ||
23 | ret = do_fork(SIGCHLD, UPT_SP(¤t->thread.regs.regs), | ||
24 | ¤t->thread.regs, 0, NULL, NULL); | 21 | ¤t->thread.regs, 0, NULL, NULL); |
25 | current->thread.forking = 0; | ||
26 | return ret; | ||
27 | } | 22 | } |
28 | 23 | ||
29 | long sys_vfork(void) | 24 | long sys_vfork(void) |
30 | { | 25 | { |
31 | long ret; | 26 | return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, |
32 | |||
33 | current->thread.forking = 1; | ||
34 | ret = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, | ||
35 | UPT_SP(¤t->thread.regs.regs), | 27 | UPT_SP(¤t->thread.regs.regs), |
36 | ¤t->thread.regs, 0, NULL, NULL); | 28 | ¤t->thread.regs, 0, NULL, NULL); |
37 | current->thread.forking = 0; | 29 | } |
38 | return ret; | 30 | |
31 | long sys_clone(unsigned long clone_flags, unsigned long newsp, | ||
32 | void __user *parent_tid, void __user *child_tid) | ||
33 | { | ||
34 | if (!newsp) | ||
35 | newsp = UPT_SP(¤t->thread.regs.regs); | ||
36 | |||
37 | return do_fork(clone_flags, newsp, ¤t->thread.regs, 0, parent_tid, | ||
38 | child_tid); | ||
39 | } | 39 | } |
40 | 40 | ||
41 | long old_mmap(unsigned long addr, unsigned long len, | 41 | long old_mmap(unsigned long addr, unsigned long len, |
diff --git a/arch/um/scripts/Makefile.rules b/arch/um/scripts/Makefile.rules index d50270d26b42..15889df9b466 100644 --- a/arch/um/scripts/Makefile.rules +++ b/arch/um/scripts/Makefile.rules | |||
@@ -8,7 +8,7 @@ USER_OBJS += $(filter %_user.o,$(obj-y) $(obj-m) $(USER_SINGLE_OBJS)) | |||
8 | USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file)) | 8 | USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file)) |
9 | 9 | ||
10 | $(USER_OBJS:.o=.%): \ | 10 | $(USER_OBJS:.o=.%): \ |
11 | c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) -include user.h $(CFLAGS_$(basetarget).o) | 11 | c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) -include $(srctree)/include/linux/kern_levels.h -include user.h $(CFLAGS_$(basetarget).o) |
12 | 12 | ||
13 | # These are like USER_OBJS but filter USER_CFLAGS through unprofile instead of | 13 | # These are like USER_OBJS but filter USER_CFLAGS through unprofile instead of |
14 | # using it directly. | 14 | # using it directly. |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 8ec3a1aa4abd..50a1d1f9b6d3 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -746,10 +746,10 @@ config SWIOTLB | |||
746 | def_bool y if X86_64 | 746 | def_bool y if X86_64 |
747 | ---help--- | 747 | ---help--- |
748 | Support for software bounce buffers used on x86-64 systems | 748 | Support for software bounce buffers used on x86-64 systems |
749 | which don't have a hardware IOMMU (e.g. the current generation | 749 | which don't have a hardware IOMMU. Using this PCI devices |
750 | of Intel's x86-64 CPUs). Using this PCI devices which can only | 750 | which can only access 32-bits of memory can be used on systems |
751 | access 32-bits of memory can be used on systems with more than | 751 | with more than 3 GB of memory. |
752 | 3 GB of memory. If unsure, say Y. | 752 | If unsure, say Y. |
753 | 753 | ||
754 | config IOMMU_HELPER | 754 | config IOMMU_HELPER |
755 | def_bool (CALGARY_IOMMU || GART_IOMMU || SWIOTLB || AMD_IOMMU) | 755 | def_bool (CALGARY_IOMMU || GART_IOMMU || SWIOTLB || AMD_IOMMU) |
diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 682e9c210baa..474ca35b1bce 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile | |||
@@ -142,7 +142,7 @@ KBUILD_CFLAGS += $(call cc-option,-mno-avx,) | |||
142 | KBUILD_CFLAGS += $(mflags-y) | 142 | KBUILD_CFLAGS += $(mflags-y) |
143 | KBUILD_AFLAGS += $(mflags-y) | 143 | KBUILD_AFLAGS += $(mflags-y) |
144 | 144 | ||
145 | archscripts: | 145 | archscripts: scripts_basic |
146 | $(Q)$(MAKE) $(build)=arch/x86/tools relocs | 146 | $(Q)$(MAKE) $(build)=arch/x86/tools relocs |
147 | 147 | ||
148 | ### | 148 | ### |
diff --git a/arch/x86/include/asm/xen/page.h b/arch/x86/include/asm/xen/page.h index 93971e841dd5..472b9b783019 100644 --- a/arch/x86/include/asm/xen/page.h +++ b/arch/x86/include/asm/xen/page.h | |||
@@ -51,7 +51,8 @@ extern unsigned long set_phys_range_identity(unsigned long pfn_s, | |||
51 | 51 | ||
52 | extern int m2p_add_override(unsigned long mfn, struct page *page, | 52 | extern int m2p_add_override(unsigned long mfn, struct page *page, |
53 | struct gnttab_map_grant_ref *kmap_op); | 53 | struct gnttab_map_grant_ref *kmap_op); |
54 | extern int m2p_remove_override(struct page *page, bool clear_pte); | 54 | extern int m2p_remove_override(struct page *page, |
55 | struct gnttab_map_grant_ref *kmap_op); | ||
55 | extern struct page *m2p_find_override(unsigned long mfn); | 56 | extern struct page *m2p_find_override(unsigned long mfn); |
56 | extern unsigned long m2p_find_override_pfn(unsigned long mfn, unsigned long pfn); | 57 | extern unsigned long m2p_find_override_pfn(unsigned long mfn, unsigned long pfn); |
57 | 58 | ||
diff --git a/arch/x86/kernel/cpu/perf_event.h b/arch/x86/kernel/cpu/perf_event.h index 6605a81ba339..8b6defe7eefc 100644 --- a/arch/x86/kernel/cpu/perf_event.h +++ b/arch/x86/kernel/cpu/perf_event.h | |||
@@ -586,6 +586,8 @@ extern struct event_constraint intel_westmere_pebs_event_constraints[]; | |||
586 | 586 | ||
587 | extern struct event_constraint intel_snb_pebs_event_constraints[]; | 587 | extern struct event_constraint intel_snb_pebs_event_constraints[]; |
588 | 588 | ||
589 | extern struct event_constraint intel_ivb_pebs_event_constraints[]; | ||
590 | |||
589 | struct event_constraint *intel_pebs_constraints(struct perf_event *event); | 591 | struct event_constraint *intel_pebs_constraints(struct perf_event *event); |
590 | 592 | ||
591 | void intel_pmu_pebs_enable(struct perf_event *event); | 593 | void intel_pmu_pebs_enable(struct perf_event *event); |
diff --git a/arch/x86/kernel/cpu/perf_event_amd_ibs.c b/arch/x86/kernel/cpu/perf_event_amd_ibs.c index 7bfb5bec8630..eebd5ffe1bba 100644 --- a/arch/x86/kernel/cpu/perf_event_amd_ibs.c +++ b/arch/x86/kernel/cpu/perf_event_amd_ibs.c | |||
@@ -209,6 +209,15 @@ static int perf_ibs_precise_event(struct perf_event *event, u64 *config) | |||
209 | return -EOPNOTSUPP; | 209 | return -EOPNOTSUPP; |
210 | } | 210 | } |
211 | 211 | ||
212 | static const struct perf_event_attr ibs_notsupp = { | ||
213 | .exclude_user = 1, | ||
214 | .exclude_kernel = 1, | ||
215 | .exclude_hv = 1, | ||
216 | .exclude_idle = 1, | ||
217 | .exclude_host = 1, | ||
218 | .exclude_guest = 1, | ||
219 | }; | ||
220 | |||
212 | static int perf_ibs_init(struct perf_event *event) | 221 | static int perf_ibs_init(struct perf_event *event) |
213 | { | 222 | { |
214 | struct hw_perf_event *hwc = &event->hw; | 223 | struct hw_perf_event *hwc = &event->hw; |
@@ -229,6 +238,9 @@ static int perf_ibs_init(struct perf_event *event) | |||
229 | if (event->pmu != &perf_ibs->pmu) | 238 | if (event->pmu != &perf_ibs->pmu) |
230 | return -ENOENT; | 239 | return -ENOENT; |
231 | 240 | ||
241 | if (perf_flags(&event->attr) & perf_flags(&ibs_notsupp)) | ||
242 | return -EINVAL; | ||
243 | |||
232 | if (config & ~perf_ibs->config_mask) | 244 | if (config & ~perf_ibs->config_mask) |
233 | return -EINVAL; | 245 | return -EINVAL; |
234 | 246 | ||
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c index 0d3d63afa76a..6bca492b8547 100644 --- a/arch/x86/kernel/cpu/perf_event_intel.c +++ b/arch/x86/kernel/cpu/perf_event_intel.c | |||
@@ -2048,7 +2048,6 @@ __init int intel_pmu_init(void) | |||
2048 | case 42: /* SandyBridge */ | 2048 | case 42: /* SandyBridge */ |
2049 | case 45: /* SandyBridge, "Romely-EP" */ | 2049 | case 45: /* SandyBridge, "Romely-EP" */ |
2050 | x86_add_quirk(intel_sandybridge_quirk); | 2050 | x86_add_quirk(intel_sandybridge_quirk); |
2051 | case 58: /* IvyBridge */ | ||
2052 | memcpy(hw_cache_event_ids, snb_hw_cache_event_ids, | 2051 | memcpy(hw_cache_event_ids, snb_hw_cache_event_ids, |
2053 | sizeof(hw_cache_event_ids)); | 2052 | sizeof(hw_cache_event_ids)); |
2054 | memcpy(hw_cache_extra_regs, snb_hw_cache_extra_regs, | 2053 | memcpy(hw_cache_extra_regs, snb_hw_cache_extra_regs, |
@@ -2073,6 +2072,29 @@ __init int intel_pmu_init(void) | |||
2073 | 2072 | ||
2074 | pr_cont("SandyBridge events, "); | 2073 | pr_cont("SandyBridge events, "); |
2075 | break; | 2074 | break; |
2075 | case 58: /* IvyBridge */ | ||
2076 | memcpy(hw_cache_event_ids, snb_hw_cache_event_ids, | ||
2077 | sizeof(hw_cache_event_ids)); | ||
2078 | memcpy(hw_cache_extra_regs, snb_hw_cache_extra_regs, | ||
2079 | sizeof(hw_cache_extra_regs)); | ||
2080 | |||
2081 | intel_pmu_lbr_init_snb(); | ||
2082 | |||
2083 | x86_pmu.event_constraints = intel_snb_event_constraints; | ||
2084 | x86_pmu.pebs_constraints = intel_ivb_pebs_event_constraints; | ||
2085 | x86_pmu.pebs_aliases = intel_pebs_aliases_snb; | ||
2086 | x86_pmu.extra_regs = intel_snb_extra_regs; | ||
2087 | /* all extra regs are per-cpu when HT is on */ | ||
2088 | x86_pmu.er_flags |= ERF_HAS_RSP_1; | ||
2089 | x86_pmu.er_flags |= ERF_NO_HT_SHARING; | ||
2090 | |||
2091 | /* UOPS_ISSUED.ANY,c=1,i=1 to count stall cycles */ | ||
2092 | intel_perfmon_event_map[PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = | ||
2093 | X86_CONFIG(.event=0x0e, .umask=0x01, .inv=1, .cmask=1); | ||
2094 | |||
2095 | pr_cont("IvyBridge events, "); | ||
2096 | break; | ||
2097 | |||
2076 | 2098 | ||
2077 | default: | 2099 | default: |
2078 | switch (x86_pmu.version) { | 2100 | switch (x86_pmu.version) { |
diff --git a/arch/x86/kernel/cpu/perf_event_intel_ds.c b/arch/x86/kernel/cpu/perf_event_intel_ds.c index e38d97bf4259..826054a4f2ee 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_ds.c +++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c | |||
@@ -407,6 +407,20 @@ struct event_constraint intel_snb_pebs_event_constraints[] = { | |||
407 | EVENT_CONSTRAINT_END | 407 | EVENT_CONSTRAINT_END |
408 | }; | 408 | }; |
409 | 409 | ||
410 | struct event_constraint intel_ivb_pebs_event_constraints[] = { | ||
411 | INTEL_UEVENT_CONSTRAINT(0x01c0, 0x2), /* INST_RETIRED.PRECDIST */ | ||
412 | INTEL_UEVENT_CONSTRAINT(0x01c2, 0xf), /* UOPS_RETIRED.ALL */ | ||
413 | INTEL_UEVENT_CONSTRAINT(0x02c2, 0xf), /* UOPS_RETIRED.RETIRE_SLOTS */ | ||
414 | INTEL_EVENT_CONSTRAINT(0xc4, 0xf), /* BR_INST_RETIRED.* */ | ||
415 | INTEL_EVENT_CONSTRAINT(0xc5, 0xf), /* BR_MISP_RETIRED.* */ | ||
416 | INTEL_EVENT_CONSTRAINT(0xcd, 0x8), /* MEM_TRANS_RETIRED.* */ | ||
417 | INTEL_EVENT_CONSTRAINT(0xd0, 0xf), /* MEM_UOP_RETIRED.* */ | ||
418 | INTEL_EVENT_CONSTRAINT(0xd1, 0xf), /* MEM_LOAD_UOPS_RETIRED.* */ | ||
419 | INTEL_EVENT_CONSTRAINT(0xd2, 0xf), /* MEM_LOAD_UOPS_LLC_HIT_RETIRED.* */ | ||
420 | INTEL_EVENT_CONSTRAINT(0xd3, 0xf), /* MEM_LOAD_UOPS_LLC_MISS_RETIRED.* */ | ||
421 | EVENT_CONSTRAINT_END | ||
422 | }; | ||
423 | |||
410 | struct event_constraint *intel_pebs_constraints(struct perf_event *event) | 424 | struct event_constraint *intel_pebs_constraints(struct perf_event *event) |
411 | { | 425 | { |
412 | struct event_constraint *c; | 426 | struct event_constraint *c; |
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c index 0a5571080e74..38e4894165b9 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c +++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c | |||
@@ -661,6 +661,11 @@ static void snb_uncore_msr_init_box(struct intel_uncore_box *box) | |||
661 | } | 661 | } |
662 | } | 662 | } |
663 | 663 | ||
664 | static struct uncore_event_desc snb_uncore_events[] = { | ||
665 | INTEL_UNCORE_EVENT_DESC(clockticks, "event=0xff,umask=0x00"), | ||
666 | { /* end: all zeroes */ }, | ||
667 | }; | ||
668 | |||
664 | static struct attribute *snb_uncore_formats_attr[] = { | 669 | static struct attribute *snb_uncore_formats_attr[] = { |
665 | &format_attr_event.attr, | 670 | &format_attr_event.attr, |
666 | &format_attr_umask.attr, | 671 | &format_attr_umask.attr, |
@@ -704,6 +709,7 @@ static struct intel_uncore_type snb_uncore_cbox = { | |||
704 | .constraints = snb_uncore_cbox_constraints, | 709 | .constraints = snb_uncore_cbox_constraints, |
705 | .ops = &snb_uncore_msr_ops, | 710 | .ops = &snb_uncore_msr_ops, |
706 | .format_group = &snb_uncore_format_group, | 711 | .format_group = &snb_uncore_format_group, |
712 | .event_descs = snb_uncore_events, | ||
707 | }; | 713 | }; |
708 | 714 | ||
709 | static struct intel_uncore_type *snb_msr_uncores[] = { | 715 | static struct intel_uncore_type *snb_msr_uncores[] = { |
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index e0e6990723e9..ab1f6a93b527 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c | |||
@@ -319,7 +319,7 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, | |||
319 | */ | 319 | */ |
320 | int devmem_is_allowed(unsigned long pagenr) | 320 | int devmem_is_allowed(unsigned long pagenr) |
321 | { | 321 | { |
322 | if (pagenr <= 256) | 322 | if (pagenr < 256) |
323 | return 1; | 323 | return 1; |
324 | if (iomem_is_exclusive(pagenr << PAGE_SHIFT)) | 324 | if (iomem_is_exclusive(pagenr << PAGE_SHIFT)) |
325 | return 0; | 325 | return 0; |
diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig index 9926e11a772d..aeaff8bef2f1 100644 --- a/arch/x86/um/Kconfig +++ b/arch/x86/um/Kconfig | |||
@@ -21,6 +21,7 @@ config 64BIT | |||
21 | config X86_32 | 21 | config X86_32 |
22 | def_bool !64BIT | 22 | def_bool !64BIT |
23 | select HAVE_AOUT | 23 | select HAVE_AOUT |
24 | select ARCH_WANT_IPC_PARSE_VERSION | ||
24 | 25 | ||
25 | config X86_64 | 26 | config X86_64 |
26 | def_bool 64BIT | 27 | def_bool 64BIT |
diff --git a/arch/x86/um/shared/sysdep/kernel-offsets.h b/arch/x86/um/shared/sysdep/kernel-offsets.h index 5868526b5eef..46a9df99f3c5 100644 --- a/arch/x86/um/shared/sysdep/kernel-offsets.h +++ b/arch/x86/um/shared/sysdep/kernel-offsets.h | |||
@@ -7,9 +7,6 @@ | |||
7 | #define DEFINE(sym, val) \ | 7 | #define DEFINE(sym, val) \ |
8 | asm volatile("\n->" #sym " %0 " #val : : "i" (val)) | 8 | asm volatile("\n->" #sym " %0 " #val : : "i" (val)) |
9 | 9 | ||
10 | #define STR(x) #x | ||
11 | #define DEFINE_STR(sym, val) asm volatile("\n->" #sym " " STR(val) " " #val: : ) | ||
12 | |||
13 | #define BLANK() asm volatile("\n->" : : ) | 10 | #define BLANK() asm volatile("\n->" : : ) |
14 | 11 | ||
15 | #define OFFSET(sym, str, mem) \ | 12 | #define OFFSET(sym, str, mem) \ |
diff --git a/arch/x86/um/shared/sysdep/syscalls.h b/arch/x86/um/shared/sysdep/syscalls.h index bd9a89b67e41..ca255a805ed9 100644 --- a/arch/x86/um/shared/sysdep/syscalls.h +++ b/arch/x86/um/shared/sysdep/syscalls.h | |||
@@ -1,3 +1,5 @@ | |||
1 | extern long sys_clone(unsigned long clone_flags, unsigned long newsp, | ||
2 | void __user *parent_tid, void __user *child_tid); | ||
1 | #ifdef __i386__ | 3 | #ifdef __i386__ |
2 | #include "syscalls_32.h" | 4 | #include "syscalls_32.h" |
3 | #else | 5 | #else |
diff --git a/arch/x86/um/signal.c b/arch/x86/um/signal.c index a508cea13503..ba7363ecf896 100644 --- a/arch/x86/um/signal.c +++ b/arch/x86/um/signal.c | |||
@@ -416,9 +416,6 @@ int setup_signal_stack_sc(unsigned long stack_top, int sig, | |||
416 | PT_REGS_AX(regs) = (unsigned long) sig; | 416 | PT_REGS_AX(regs) = (unsigned long) sig; |
417 | PT_REGS_DX(regs) = (unsigned long) 0; | 417 | PT_REGS_DX(regs) = (unsigned long) 0; |
418 | PT_REGS_CX(regs) = (unsigned long) 0; | 418 | PT_REGS_CX(regs) = (unsigned long) 0; |
419 | |||
420 | if ((current->ptrace & PT_DTRACE) && (current->ptrace & PT_PTRACED)) | ||
421 | ptrace_notify(SIGTRAP); | ||
422 | return 0; | 419 | return 0; |
423 | } | 420 | } |
424 | 421 | ||
@@ -466,9 +463,6 @@ int setup_signal_stack_si(unsigned long stack_top, int sig, | |||
466 | PT_REGS_AX(regs) = (unsigned long) sig; | 463 | PT_REGS_AX(regs) = (unsigned long) sig; |
467 | PT_REGS_DX(regs) = (unsigned long) &frame->info; | 464 | PT_REGS_DX(regs) = (unsigned long) &frame->info; |
468 | PT_REGS_CX(regs) = (unsigned long) &frame->uc; | 465 | PT_REGS_CX(regs) = (unsigned long) &frame->uc; |
469 | |||
470 | if ((current->ptrace & PT_DTRACE) && (current->ptrace & PT_PTRACED)) | ||
471 | ptrace_notify(SIGTRAP); | ||
472 | return 0; | 466 | return 0; |
473 | } | 467 | } |
474 | 468 | ||
diff --git a/arch/x86/um/sys_call_table_32.c b/arch/x86/um/sys_call_table_32.c index 68d1dc91b37b..b5408cecac6c 100644 --- a/arch/x86/um/sys_call_table_32.c +++ b/arch/x86/um/sys_call_table_32.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #define ptregs_execve sys_execve | 28 | #define ptregs_execve sys_execve |
29 | #define ptregs_iopl sys_iopl | 29 | #define ptregs_iopl sys_iopl |
30 | #define ptregs_vm86old sys_vm86old | 30 | #define ptregs_vm86old sys_vm86old |
31 | #define ptregs_clone sys_clone | 31 | #define ptregs_clone i386_clone |
32 | #define ptregs_vm86 sys_vm86 | 32 | #define ptregs_vm86 sys_vm86 |
33 | #define ptregs_sigaltstack sys_sigaltstack | 33 | #define ptregs_sigaltstack sys_sigaltstack |
34 | #define ptregs_vfork sys_vfork | 34 | #define ptregs_vfork sys_vfork |
diff --git a/arch/x86/um/syscalls_32.c b/arch/x86/um/syscalls_32.c index b853e8600b9d..db444c7218fe 100644 --- a/arch/x86/um/syscalls_32.c +++ b/arch/x86/um/syscalls_32.c | |||
@@ -3,37 +3,24 @@ | |||
3 | * Licensed under the GPL | 3 | * Licensed under the GPL |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #include "linux/sched.h" | 6 | #include <linux/syscalls.h> |
7 | #include "linux/shm.h" | 7 | #include <sysdep/syscalls.h> |
8 | #include "linux/ipc.h" | ||
9 | #include "linux/syscalls.h" | ||
10 | #include "asm/mman.h" | ||
11 | #include "asm/uaccess.h" | ||
12 | #include "asm/unistd.h" | ||
13 | 8 | ||
14 | /* | 9 | /* |
15 | * The prototype on i386 is: | 10 | * The prototype on i386 is: |
16 | * | 11 | * |
17 | * int clone(int flags, void * child_stack, int * parent_tidptr, struct user_desc * newtls, int * child_tidptr) | 12 | * int clone(int flags, void * child_stack, int * parent_tidptr, struct user_desc * newtls |
18 | * | 13 | * |
19 | * and the "newtls" arg. on i386 is read by copy_thread directly from the | 14 | * and the "newtls" arg. on i386 is read by copy_thread directly from the |
20 | * register saved on the stack. | 15 | * register saved on the stack. |
21 | */ | 16 | */ |
22 | long sys_clone(unsigned long clone_flags, unsigned long newsp, | 17 | long i386_clone(unsigned long clone_flags, unsigned long newsp, |
23 | int __user *parent_tid, void *newtls, int __user *child_tid) | 18 | int __user *parent_tid, void *newtls, int __user *child_tid) |
24 | { | 19 | { |
25 | long ret; | 20 | return sys_clone(clone_flags, newsp, parent_tid, child_tid); |
26 | |||
27 | if (!newsp) | ||
28 | newsp = UPT_SP(¤t->thread.regs.regs); | ||
29 | |||
30 | current->thread.forking = 1; | ||
31 | ret = do_fork(clone_flags, newsp, ¤t->thread.regs, 0, parent_tid, | ||
32 | child_tid); | ||
33 | current->thread.forking = 0; | ||
34 | return ret; | ||
35 | } | 21 | } |
36 | 22 | ||
23 | |||
37 | long sys_sigaction(int sig, const struct old_sigaction __user *act, | 24 | long sys_sigaction(int sig, const struct old_sigaction __user *act, |
38 | struct old_sigaction __user *oact) | 25 | struct old_sigaction __user *oact) |
39 | { | 26 | { |
diff --git a/arch/x86/um/syscalls_64.c b/arch/x86/um/syscalls_64.c index f3d82bb6e15a..adb08eb5c22a 100644 --- a/arch/x86/um/syscalls_64.c +++ b/arch/x86/um/syscalls_64.c | |||
@@ -5,12 +5,9 @@ | |||
5 | * Licensed under the GPL | 5 | * Licensed under the GPL |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include "linux/linkage.h" | 8 | #include <linux/sched.h> |
9 | #include "linux/personality.h" | 9 | #include <asm/prctl.h> /* XXX This should get the constants from libc */ |
10 | #include "linux/utsname.h" | 10 | #include <os.h> |
11 | #include "asm/prctl.h" /* XXX This should get the constants from libc */ | ||
12 | #include "asm/uaccess.h" | ||
13 | #include "os.h" | ||
14 | 11 | ||
15 | long arch_prctl(struct task_struct *task, int code, unsigned long __user *addr) | 12 | long arch_prctl(struct task_struct *task, int code, unsigned long __user *addr) |
16 | { | 13 | { |
@@ -79,20 +76,6 @@ long sys_arch_prctl(int code, unsigned long addr) | |||
79 | return arch_prctl(current, code, (unsigned long __user *) addr); | 76 | return arch_prctl(current, code, (unsigned long __user *) addr); |
80 | } | 77 | } |
81 | 78 | ||
82 | long sys_clone(unsigned long clone_flags, unsigned long newsp, | ||
83 | void __user *parent_tid, void __user *child_tid) | ||
84 | { | ||
85 | long ret; | ||
86 | |||
87 | if (!newsp) | ||
88 | newsp = UPT_SP(¤t->thread.regs.regs); | ||
89 | current->thread.forking = 1; | ||
90 | ret = do_fork(clone_flags, newsp, ¤t->thread.regs, 0, parent_tid, | ||
91 | child_tid); | ||
92 | current->thread.forking = 0; | ||
93 | return ret; | ||
94 | } | ||
95 | |||
96 | void arch_switch_to(struct task_struct *to) | 79 | void arch_switch_to(struct task_struct *to) |
97 | { | 80 | { |
98 | if ((to->thread.arch.fs == 0) || (to->mm == NULL)) | 81 | if ((to->thread.arch.fs == 0) || (to->mm == NULL)) |
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 9642d4a38602..1fbe75a95f15 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -1452,6 +1452,10 @@ asmlinkage void __init xen_start_kernel(void) | |||
1452 | pci_request_acs(); | 1452 | pci_request_acs(); |
1453 | 1453 | ||
1454 | xen_acpi_sleep_register(); | 1454 | xen_acpi_sleep_register(); |
1455 | |||
1456 | /* Avoid searching for BIOS MP tables */ | ||
1457 | x86_init.mpparse.find_smp_config = x86_init_noop; | ||
1458 | x86_init.mpparse.get_smp_config = x86_init_uint_noop; | ||
1455 | } | 1459 | } |
1456 | #ifdef CONFIG_PCI | 1460 | #ifdef CONFIG_PCI |
1457 | /* PCI BIOS service won't work from a PV guest. */ | 1461 | /* PCI BIOS service won't work from a PV guest. */ |
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c index 76ba0e97e530..72213da605f5 100644 --- a/arch/x86/xen/p2m.c +++ b/arch/x86/xen/p2m.c | |||
@@ -828,9 +828,6 @@ int m2p_add_override(unsigned long mfn, struct page *page, | |||
828 | 828 | ||
829 | xen_mc_issue(PARAVIRT_LAZY_MMU); | 829 | xen_mc_issue(PARAVIRT_LAZY_MMU); |
830 | } | 830 | } |
831 | /* let's use dev_bus_addr to record the old mfn instead */ | ||
832 | kmap_op->dev_bus_addr = page->index; | ||
833 | page->index = (unsigned long) kmap_op; | ||
834 | } | 831 | } |
835 | spin_lock_irqsave(&m2p_override_lock, flags); | 832 | spin_lock_irqsave(&m2p_override_lock, flags); |
836 | list_add(&page->lru, &m2p_overrides[mfn_hash(mfn)]); | 833 | list_add(&page->lru, &m2p_overrides[mfn_hash(mfn)]); |
@@ -857,7 +854,8 @@ int m2p_add_override(unsigned long mfn, struct page *page, | |||
857 | return 0; | 854 | return 0; |
858 | } | 855 | } |
859 | EXPORT_SYMBOL_GPL(m2p_add_override); | 856 | EXPORT_SYMBOL_GPL(m2p_add_override); |
860 | int m2p_remove_override(struct page *page, bool clear_pte) | 857 | int m2p_remove_override(struct page *page, |
858 | struct gnttab_map_grant_ref *kmap_op) | ||
861 | { | 859 | { |
862 | unsigned long flags; | 860 | unsigned long flags; |
863 | unsigned long mfn; | 861 | unsigned long mfn; |
@@ -887,10 +885,8 @@ int m2p_remove_override(struct page *page, bool clear_pte) | |||
887 | WARN_ON(!PagePrivate(page)); | 885 | WARN_ON(!PagePrivate(page)); |
888 | ClearPagePrivate(page); | 886 | ClearPagePrivate(page); |
889 | 887 | ||
890 | if (clear_pte) { | 888 | set_phys_to_machine(pfn, page->index); |
891 | struct gnttab_map_grant_ref *map_op = | 889 | if (kmap_op != NULL) { |
892 | (struct gnttab_map_grant_ref *) page->index; | ||
893 | set_phys_to_machine(pfn, map_op->dev_bus_addr); | ||
894 | if (!PageHighMem(page)) { | 890 | if (!PageHighMem(page)) { |
895 | struct multicall_space mcs; | 891 | struct multicall_space mcs; |
896 | struct gnttab_unmap_grant_ref *unmap_op; | 892 | struct gnttab_unmap_grant_ref *unmap_op; |
@@ -902,13 +898,13 @@ int m2p_remove_override(struct page *page, bool clear_pte) | |||
902 | * issued. In this case handle is going to -1 because | 898 | * issued. In this case handle is going to -1 because |
903 | * it hasn't been modified yet. | 899 | * it hasn't been modified yet. |
904 | */ | 900 | */ |
905 | if (map_op->handle == -1) | 901 | if (kmap_op->handle == -1) |
906 | xen_mc_flush(); | 902 | xen_mc_flush(); |
907 | /* | 903 | /* |
908 | * Now if map_op->handle is negative it means that the | 904 | * Now if kmap_op->handle is negative it means that the |
909 | * hypercall actually returned an error. | 905 | * hypercall actually returned an error. |
910 | */ | 906 | */ |
911 | if (map_op->handle == GNTST_general_error) { | 907 | if (kmap_op->handle == GNTST_general_error) { |
912 | printk(KERN_WARNING "m2p_remove_override: " | 908 | printk(KERN_WARNING "m2p_remove_override: " |
913 | "pfn %lx mfn %lx, failed to modify kernel mappings", | 909 | "pfn %lx mfn %lx, failed to modify kernel mappings", |
914 | pfn, mfn); | 910 | pfn, mfn); |
@@ -918,8 +914,8 @@ int m2p_remove_override(struct page *page, bool clear_pte) | |||
918 | mcs = xen_mc_entry( | 914 | mcs = xen_mc_entry( |
919 | sizeof(struct gnttab_unmap_grant_ref)); | 915 | sizeof(struct gnttab_unmap_grant_ref)); |
920 | unmap_op = mcs.args; | 916 | unmap_op = mcs.args; |
921 | unmap_op->host_addr = map_op->host_addr; | 917 | unmap_op->host_addr = kmap_op->host_addr; |
922 | unmap_op->handle = map_op->handle; | 918 | unmap_op->handle = kmap_op->handle; |
923 | unmap_op->dev_bus_addr = 0; | 919 | unmap_op->dev_bus_addr = 0; |
924 | 920 | ||
925 | MULTI_grant_table_op(mcs.mc, | 921 | MULTI_grant_table_op(mcs.mc, |
@@ -930,10 +926,9 @@ int m2p_remove_override(struct page *page, bool clear_pte) | |||
930 | set_pte_at(&init_mm, address, ptep, | 926 | set_pte_at(&init_mm, address, ptep, |
931 | pfn_pte(pfn, PAGE_KERNEL)); | 927 | pfn_pte(pfn, PAGE_KERNEL)); |
932 | __flush_tlb_single(address); | 928 | __flush_tlb_single(address); |
933 | map_op->host_addr = 0; | 929 | kmap_op->host_addr = 0; |
934 | } | 930 | } |
935 | } else | 931 | } |
936 | set_phys_to_machine(pfn, page->index); | ||
937 | 932 | ||
938 | /* p2m(m2p(mfn)) == FOREIGN_FRAME(mfn): the mfn is already present | 933 | /* p2m(m2p(mfn)) == FOREIGN_FRAME(mfn): the mfn is already present |
939 | * somewhere in this domain, even before being added to the | 934 | * somewhere in this domain, even before being added to the |
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index d11ca11d14fc..e2d62d697b5d 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <asm/e820.h> | 17 | #include <asm/e820.h> |
18 | #include <asm/setup.h> | 18 | #include <asm/setup.h> |
19 | #include <asm/acpi.h> | 19 | #include <asm/acpi.h> |
20 | #include <asm/numa.h> | ||
20 | #include <asm/xen/hypervisor.h> | 21 | #include <asm/xen/hypervisor.h> |
21 | #include <asm/xen/hypercall.h> | 22 | #include <asm/xen/hypercall.h> |
22 | 23 | ||
@@ -544,4 +545,7 @@ void __init xen_arch_setup(void) | |||
544 | disable_cpufreq(); | 545 | disable_cpufreq(); |
545 | WARN_ON(set_pm_idle_to_default()); | 546 | WARN_ON(set_pm_idle_to_default()); |
546 | fiddle_vdso(); | 547 | fiddle_vdso(); |
548 | #ifdef CONFIG_NUMA | ||
549 | numa_off = 1; | ||
550 | #endif | ||
547 | } | 551 | } |