diff options
author | David S. Miller <davem@davemloft.net> | 2013-10-01 17:06:14 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-10-01 17:06:14 -0400 |
commit | 4fbef95af4e62d4aada6c1728e04d3b1c828abe0 (patch) | |
tree | 19cb25e39583119c98dee7114aada6a3b57d18a9 /arch | |
parent | 5229432f15e6f1b1e34e519e51d07917dee8790e (diff) | |
parent | c31eeaced22ce8bd61268a3c595d542bb38c0a4f (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/ethernet/emulex/benet/be.h
drivers/net/usb/qmi_wwan.c
drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h
include/net/netfilter/nf_conntrack_synproxy.h
include/net/secure_seq.h
The conflicts are of two varieties:
1) Conflicts with Joe Perches's 'extern' removal from header file
function declarations. Usually it's an argument signature change
or a function being added/removed. The resolutions are trivial.
2) Some overlapping changes in qmi_wwan.c and be.h, one commit adds
a new value, another changes an existing value. That sort of
thing.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
74 files changed, 387 insertions, 343 deletions
diff --git a/arch/Kconfig b/arch/Kconfig index 1feb169274fe..af2cc6eabcc7 100644 --- a/arch/Kconfig +++ b/arch/Kconfig | |||
@@ -286,9 +286,6 @@ config HAVE_PERF_USER_STACK_DUMP | |||
286 | config HAVE_ARCH_JUMP_LABEL | 286 | config HAVE_ARCH_JUMP_LABEL |
287 | bool | 287 | bool |
288 | 288 | ||
289 | config HAVE_ARCH_MUTEX_CPU_RELAX | ||
290 | bool | ||
291 | |||
292 | config HAVE_RCU_TABLE_FREE | 289 | config HAVE_RCU_TABLE_FREE |
293 | bool | 290 | bool |
294 | 291 | ||
diff --git a/arch/arc/include/asm/spinlock.h b/arch/arc/include/asm/spinlock.h index f158197ac5b0..b6a8c2dfbe6e 100644 --- a/arch/arc/include/asm/spinlock.h +++ b/arch/arc/include/asm/spinlock.h | |||
@@ -45,7 +45,14 @@ static inline int arch_spin_trylock(arch_spinlock_t *lock) | |||
45 | 45 | ||
46 | static inline void arch_spin_unlock(arch_spinlock_t *lock) | 46 | static inline void arch_spin_unlock(arch_spinlock_t *lock) |
47 | { | 47 | { |
48 | lock->slock = __ARCH_SPIN_LOCK_UNLOCKED__; | 48 | unsigned int tmp = __ARCH_SPIN_LOCK_UNLOCKED__; |
49 | |||
50 | __asm__ __volatile__( | ||
51 | " ex %0, [%1] \n" | ||
52 | : "+r" (tmp) | ||
53 | : "r"(&(lock->slock)) | ||
54 | : "memory"); | ||
55 | |||
49 | smp_mb(); | 56 | smp_mb(); |
50 | } | 57 | } |
51 | 58 | ||
diff --git a/arch/arc/include/asm/uaccess.h b/arch/arc/include/asm/uaccess.h index 32420824375b..30c9baffa96f 100644 --- a/arch/arc/include/asm/uaccess.h +++ b/arch/arc/include/asm/uaccess.h | |||
@@ -43,7 +43,7 @@ | |||
43 | * Because it essentially checks if buffer end is within limit and @len is | 43 | * Because it essentially checks if buffer end is within limit and @len is |
44 | * non-ngeative, which implies that buffer start will be within limit too. | 44 | * non-ngeative, which implies that buffer start will be within limit too. |
45 | * | 45 | * |
46 | * The reason for rewriting being, for majorit yof cases, @len is generally | 46 | * The reason for rewriting being, for majority of cases, @len is generally |
47 | * compile time constant, causing first sub-expression to be compile time | 47 | * compile time constant, causing first sub-expression to be compile time |
48 | * subsumed. | 48 | * subsumed. |
49 | * | 49 | * |
@@ -53,7 +53,7 @@ | |||
53 | * | 53 | * |
54 | */ | 54 | */ |
55 | #define __user_ok(addr, sz) (((sz) <= TASK_SIZE) && \ | 55 | #define __user_ok(addr, sz) (((sz) <= TASK_SIZE) && \ |
56 | (((addr)+(sz)) <= get_fs())) | 56 | ((addr) <= (get_fs() - (sz)))) |
57 | #define __access_ok(addr, sz) (unlikely(__kernel_ok) || \ | 57 | #define __access_ok(addr, sz) (unlikely(__kernel_ok) || \ |
58 | likely(__user_ok((addr), (sz)))) | 58 | likely(__user_ok((addr), (sz)))) |
59 | 59 | ||
diff --git a/arch/arc/kernel/time.c b/arch/arc/kernel/time.c index 0e51e69cf30d..3fde7de3ea67 100644 --- a/arch/arc/kernel/time.c +++ b/arch/arc/kernel/time.c | |||
@@ -227,12 +227,9 @@ void __attribute__((weak)) arc_local_timer_setup(unsigned int cpu) | |||
227 | { | 227 | { |
228 | struct clock_event_device *clk = &per_cpu(arc_clockevent_device, cpu); | 228 | struct clock_event_device *clk = &per_cpu(arc_clockevent_device, cpu); |
229 | 229 | ||
230 | clockevents_calc_mult_shift(clk, arc_get_core_freq(), 5); | ||
231 | |||
232 | clk->max_delta_ns = clockevent_delta2ns(ARC_TIMER_MAX, clk); | ||
233 | clk->cpumask = cpumask_of(cpu); | 230 | clk->cpumask = cpumask_of(cpu); |
234 | 231 | clockevents_config_and_register(clk, arc_get_core_freq(), | |
235 | clockevents_register_device(clk); | 232 | 0, ARC_TIMER_MAX); |
236 | 233 | ||
237 | /* | 234 | /* |
238 | * setup the per-cpu timer IRQ handler - for all cpus | 235 | * setup the per-cpu timer IRQ handler - for all cpus |
diff --git a/arch/arc/kernel/unaligned.c b/arch/arc/kernel/unaligned.c index 28d170060747..7ff5b5c183bb 100644 --- a/arch/arc/kernel/unaligned.c +++ b/arch/arc/kernel/unaligned.c | |||
@@ -245,6 +245,12 @@ int misaligned_fixup(unsigned long address, struct pt_regs *regs, | |||
245 | regs->status32 &= ~STATUS_DE_MASK; | 245 | regs->status32 &= ~STATUS_DE_MASK; |
246 | } else { | 246 | } else { |
247 | regs->ret += state.instr_len; | 247 | regs->ret += state.instr_len; |
248 | |||
249 | /* handle zero-overhead-loop */ | ||
250 | if ((regs->ret == regs->lp_end) && (regs->lp_count)) { | ||
251 | regs->ret = regs->lp_start; | ||
252 | regs->lp_count--; | ||
253 | } | ||
248 | } | 254 | } |
249 | 255 | ||
250 | return 0; | 256 | return 0; |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 3f7714d8d2d2..1ad6fb6c094d 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -2217,8 +2217,7 @@ config NEON | |||
2217 | 2217 | ||
2218 | config KERNEL_MODE_NEON | 2218 | config KERNEL_MODE_NEON |
2219 | bool "Support for NEON in kernel mode" | 2219 | bool "Support for NEON in kernel mode" |
2220 | default n | 2220 | depends on NEON && AEABI |
2221 | depends on NEON | ||
2222 | help | 2221 | help |
2223 | Say Y to include support for NEON in kernel mode. | 2222 | Say Y to include support for NEON in kernel mode. |
2224 | 2223 | ||
diff --git a/arch/arm/crypto/aes-armv4.S b/arch/arm/crypto/aes-armv4.S index 19d6cd6f29f9..3a14ea8fe97e 100644 --- a/arch/arm/crypto/aes-armv4.S +++ b/arch/arm/crypto/aes-armv4.S | |||
@@ -148,7 +148,7 @@ AES_Te: | |||
148 | @ const AES_KEY *key) { | 148 | @ const AES_KEY *key) { |
149 | .align 5 | 149 | .align 5 |
150 | ENTRY(AES_encrypt) | 150 | ENTRY(AES_encrypt) |
151 | sub r3,pc,#8 @ AES_encrypt | 151 | adr r3,AES_encrypt |
152 | stmdb sp!,{r1,r4-r12,lr} | 152 | stmdb sp!,{r1,r4-r12,lr} |
153 | mov r12,r0 @ inp | 153 | mov r12,r0 @ inp |
154 | mov r11,r2 | 154 | mov r11,r2 |
@@ -381,7 +381,7 @@ _armv4_AES_encrypt: | |||
381 | .align 5 | 381 | .align 5 |
382 | ENTRY(private_AES_set_encrypt_key) | 382 | ENTRY(private_AES_set_encrypt_key) |
383 | _armv4_AES_set_encrypt_key: | 383 | _armv4_AES_set_encrypt_key: |
384 | sub r3,pc,#8 @ AES_set_encrypt_key | 384 | adr r3,_armv4_AES_set_encrypt_key |
385 | teq r0,#0 | 385 | teq r0,#0 |
386 | moveq r0,#-1 | 386 | moveq r0,#-1 |
387 | beq .Labrt | 387 | beq .Labrt |
@@ -843,7 +843,7 @@ AES_Td: | |||
843 | @ const AES_KEY *key) { | 843 | @ const AES_KEY *key) { |
844 | .align 5 | 844 | .align 5 |
845 | ENTRY(AES_decrypt) | 845 | ENTRY(AES_decrypt) |
846 | sub r3,pc,#8 @ AES_decrypt | 846 | adr r3,AES_decrypt |
847 | stmdb sp!,{r1,r4-r12,lr} | 847 | stmdb sp!,{r1,r4-r12,lr} |
848 | mov r12,r0 @ inp | 848 | mov r12,r0 @ inp |
849 | mov r11,r2 | 849 | mov r11,r2 |
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h index 7e1f76027f66..72abdc541f38 100644 --- a/arch/arm/include/asm/uaccess.h +++ b/arch/arm/include/asm/uaccess.h | |||
@@ -19,6 +19,13 @@ | |||
19 | #include <asm/unified.h> | 19 | #include <asm/unified.h> |
20 | #include <asm/compiler.h> | 20 | #include <asm/compiler.h> |
21 | 21 | ||
22 | #if __LINUX_ARM_ARCH__ < 6 | ||
23 | #include <asm-generic/uaccess-unaligned.h> | ||
24 | #else | ||
25 | #define __get_user_unaligned __get_user | ||
26 | #define __put_user_unaligned __put_user | ||
27 | #endif | ||
28 | |||
22 | #define VERIFY_READ 0 | 29 | #define VERIFY_READ 0 |
23 | #define VERIFY_WRITE 1 | 30 | #define VERIFY_WRITE 1 |
24 | 31 | ||
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 74ad15d1a065..bc6bd9683ba4 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S | |||
@@ -442,10 +442,10 @@ local_restart: | |||
442 | ldrcc pc, [tbl, scno, lsl #2] @ call sys_* routine | 442 | ldrcc pc, [tbl, scno, lsl #2] @ call sys_* routine |
443 | 443 | ||
444 | add r1, sp, #S_OFF | 444 | add r1, sp, #S_OFF |
445 | cmp scno, #(__ARM_NR_BASE - __NR_SYSCALL_BASE) | 445 | 2: cmp scno, #(__ARM_NR_BASE - __NR_SYSCALL_BASE) |
446 | eor r0, scno, #__NR_SYSCALL_BASE @ put OS number back | 446 | eor r0, scno, #__NR_SYSCALL_BASE @ put OS number back |
447 | bcs arm_syscall | 447 | bcs arm_syscall |
448 | 2: mov why, #0 @ no longer a real syscall | 448 | mov why, #0 @ no longer a real syscall |
449 | b sys_ni_syscall @ not private func | 449 | b sys_ni_syscall @ not private func |
450 | 450 | ||
451 | #if defined(CONFIG_OABI_COMPAT) || !defined(CONFIG_AEABI) | 451 | #if defined(CONFIG_OABI_COMPAT) || !defined(CONFIG_AEABI) |
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S index de23a9beed13..39f89fbd5111 100644 --- a/arch/arm/kernel/entry-header.S +++ b/arch/arm/kernel/entry-header.S | |||
@@ -329,10 +329,10 @@ | |||
329 | #ifdef CONFIG_CONTEXT_TRACKING | 329 | #ifdef CONFIG_CONTEXT_TRACKING |
330 | .if \save | 330 | .if \save |
331 | stmdb sp!, {r0-r3, ip, lr} | 331 | stmdb sp!, {r0-r3, ip, lr} |
332 | bl user_exit | 332 | bl context_tracking_user_exit |
333 | ldmia sp!, {r0-r3, ip, lr} | 333 | ldmia sp!, {r0-r3, ip, lr} |
334 | .else | 334 | .else |
335 | bl user_exit | 335 | bl context_tracking_user_exit |
336 | .endif | 336 | .endif |
337 | #endif | 337 | #endif |
338 | .endm | 338 | .endm |
@@ -341,10 +341,10 @@ | |||
341 | #ifdef CONFIG_CONTEXT_TRACKING | 341 | #ifdef CONFIG_CONTEXT_TRACKING |
342 | .if \save | 342 | .if \save |
343 | stmdb sp!, {r0-r3, ip, lr} | 343 | stmdb sp!, {r0-r3, ip, lr} |
344 | bl user_enter | 344 | bl context_tracking_user_enter |
345 | ldmia sp!, {r0-r3, ip, lr} | 345 | ldmia sp!, {r0-r3, ip, lr} |
346 | .else | 346 | .else |
347 | bl user_enter | 347 | bl context_tracking_user_enter |
348 | .endif | 348 | .endif |
349 | #endif | 349 | #endif |
350 | .endm | 350 | .endm |
diff --git a/arch/arm/kvm/reset.c b/arch/arm/kvm/reset.c index 71e08baee209..c02ba4af599f 100644 --- a/arch/arm/kvm/reset.c +++ b/arch/arm/kvm/reset.c | |||
@@ -58,14 +58,14 @@ static const struct kvm_irq_level a15_vtimer_irq = { | |||
58 | */ | 58 | */ |
59 | int kvm_reset_vcpu(struct kvm_vcpu *vcpu) | 59 | int kvm_reset_vcpu(struct kvm_vcpu *vcpu) |
60 | { | 60 | { |
61 | struct kvm_regs *cpu_reset; | 61 | struct kvm_regs *reset_regs; |
62 | const struct kvm_irq_level *cpu_vtimer_irq; | 62 | const struct kvm_irq_level *cpu_vtimer_irq; |
63 | 63 | ||
64 | switch (vcpu->arch.target) { | 64 | switch (vcpu->arch.target) { |
65 | case KVM_ARM_TARGET_CORTEX_A15: | 65 | case KVM_ARM_TARGET_CORTEX_A15: |
66 | if (vcpu->vcpu_id > a15_max_cpu_idx) | 66 | if (vcpu->vcpu_id > a15_max_cpu_idx) |
67 | return -EINVAL; | 67 | return -EINVAL; |
68 | cpu_reset = &a15_regs_reset; | 68 | reset_regs = &a15_regs_reset; |
69 | vcpu->arch.midr = read_cpuid_id(); | 69 | vcpu->arch.midr = read_cpuid_id(); |
70 | cpu_vtimer_irq = &a15_vtimer_irq; | 70 | cpu_vtimer_irq = &a15_vtimer_irq; |
71 | break; | 71 | break; |
@@ -74,7 +74,7 @@ int kvm_reset_vcpu(struct kvm_vcpu *vcpu) | |||
74 | } | 74 | } |
75 | 75 | ||
76 | /* Reset core registers */ | 76 | /* Reset core registers */ |
77 | memcpy(&vcpu->arch.regs, cpu_reset, sizeof(vcpu->arch.regs)); | 77 | memcpy(&vcpu->arch.regs, reset_regs, sizeof(vcpu->arch.regs)); |
78 | 78 | ||
79 | /* Reset CP15 registers */ | 79 | /* Reset CP15 registers */ |
80 | kvm_reset_coprocs(vcpu); | 80 | kvm_reset_coprocs(vcpu); |
diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c index c3cfa4116dc0..c6b40f386786 100644 --- a/arch/arm/mach-imx/clk-imx27.c +++ b/arch/arm/mach-imx/clk-imx27.c | |||
@@ -285,7 +285,7 @@ int __init mx27_clocks_init(unsigned long fref) | |||
285 | clk_register_clkdev(clk[ata_ahb_gate], "ata", NULL); | 285 | clk_register_clkdev(clk[ata_ahb_gate], "ata", NULL); |
286 | clk_register_clkdev(clk[rtc_ipg_gate], NULL, "imx21-rtc"); | 286 | clk_register_clkdev(clk[rtc_ipg_gate], NULL, "imx21-rtc"); |
287 | clk_register_clkdev(clk[scc_ipg_gate], "scc", NULL); | 287 | clk_register_clkdev(clk[scc_ipg_gate], "scc", NULL); |
288 | clk_register_clkdev(clk[cpu_div], NULL, "cpufreq-cpu0.0"); | 288 | clk_register_clkdev(clk[cpu_div], NULL, "cpu0"); |
289 | clk_register_clkdev(clk[emi_ahb_gate], "emi_ahb" , NULL); | 289 | clk_register_clkdev(clk[emi_ahb_gate], "emi_ahb" , NULL); |
290 | 290 | ||
291 | mxc_timer_init(MX27_IO_ADDRESS(MX27_GPT1_BASE_ADDR), MX27_INT_GPT1); | 291 | mxc_timer_init(MX27_IO_ADDRESS(MX27_GPT1_BASE_ADDR), MX27_INT_GPT1); |
diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c index d9094b9a5185..7c0dc4540aa4 100644 --- a/arch/arm/mach-imx/clk-imx51-imx53.c +++ b/arch/arm/mach-imx/clk-imx51-imx53.c | |||
@@ -328,7 +328,7 @@ static void __init mx5_clocks_common_init(unsigned long rate_ckil, | |||
328 | clk_register_clkdev(clk[ssi2_ipg_gate], NULL, "imx-ssi.1"); | 328 | clk_register_clkdev(clk[ssi2_ipg_gate], NULL, "imx-ssi.1"); |
329 | clk_register_clkdev(clk[ssi3_ipg_gate], NULL, "imx-ssi.2"); | 329 | clk_register_clkdev(clk[ssi3_ipg_gate], NULL, "imx-ssi.2"); |
330 | clk_register_clkdev(clk[sdma_gate], NULL, "imx35-sdma"); | 330 | clk_register_clkdev(clk[sdma_gate], NULL, "imx35-sdma"); |
331 | clk_register_clkdev(clk[cpu_podf], NULL, "cpufreq-cpu0.0"); | 331 | clk_register_clkdev(clk[cpu_podf], NULL, "cpu0"); |
332 | clk_register_clkdev(clk[iim_gate], "iim", NULL); | 332 | clk_register_clkdev(clk[iim_gate], "iim", NULL); |
333 | clk_register_clkdev(clk[dummy], NULL, "imx2-wdt.0"); | 333 | clk_register_clkdev(clk[dummy], NULL, "imx2-wdt.0"); |
334 | clk_register_clkdev(clk[dummy], NULL, "imx2-wdt.1"); | 334 | clk_register_clkdev(clk[dummy], NULL, "imx2-wdt.1"); |
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index 85a1b51346c8..90372a21087f 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c | |||
@@ -233,10 +233,15 @@ put_node: | |||
233 | of_node_put(np); | 233 | of_node_put(np); |
234 | } | 234 | } |
235 | 235 | ||
236 | static void __init imx6q_opp_init(struct device *cpu_dev) | 236 | static void __init imx6q_opp_init(void) |
237 | { | 237 | { |
238 | struct device_node *np; | 238 | struct device_node *np; |
239 | struct device *cpu_dev = get_cpu_device(0); | ||
239 | 240 | ||
241 | if (!cpu_dev) { | ||
242 | pr_warn("failed to get cpu0 device\n"); | ||
243 | return; | ||
244 | } | ||
240 | np = of_node_get(cpu_dev->of_node); | 245 | np = of_node_get(cpu_dev->of_node); |
241 | if (!np) { | 246 | if (!np) { |
242 | pr_warn("failed to find cpu0 node\n"); | 247 | pr_warn("failed to find cpu0 node\n"); |
@@ -268,7 +273,7 @@ static void __init imx6q_init_late(void) | |||
268 | imx6q_cpuidle_init(); | 273 | imx6q_cpuidle_init(); |
269 | 274 | ||
270 | if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) { | 275 | if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) { |
271 | imx6q_opp_init(&imx6q_cpufreq_pdev.dev); | 276 | imx6q_opp_init(); |
272 | platform_device_register(&imx6q_cpufreq_pdev); | 277 | platform_device_register(&imx6q_cpufreq_pdev); |
273 | } | 278 | } |
274 | } | 279 | } |
diff --git a/arch/arm/mach-shmobile/clock-r8a73a4.c b/arch/arm/mach-shmobile/clock-r8a73a4.c index 8ea5ef6c79cc..5bd2e851e3c7 100644 --- a/arch/arm/mach-shmobile/clock-r8a73a4.c +++ b/arch/arm/mach-shmobile/clock-r8a73a4.c | |||
@@ -555,7 +555,7 @@ static struct clk_lookup lookups[] = { | |||
555 | CLKDEV_CON_ID("pll2h", &pll2h_clk), | 555 | CLKDEV_CON_ID("pll2h", &pll2h_clk), |
556 | 556 | ||
557 | /* CPU clock */ | 557 | /* CPU clock */ |
558 | CLKDEV_DEV_ID("cpufreq-cpu0", &z_clk), | 558 | CLKDEV_DEV_ID("cpu0", &z_clk), |
559 | 559 | ||
560 | /* DIV6 */ | 560 | /* DIV6 */ |
561 | CLKDEV_CON_ID("zb", &div6_clks[DIV6_ZB]), | 561 | CLKDEV_CON_ID("zb", &div6_clks[DIV6_ZB]), |
diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c index 1942eaef5181..c92c023f0d27 100644 --- a/arch/arm/mach-shmobile/clock-sh73a0.c +++ b/arch/arm/mach-shmobile/clock-sh73a0.c | |||
@@ -616,7 +616,7 @@ static struct clk_lookup lookups[] = { | |||
616 | CLKDEV_DEV_ID("smp_twd", &twd_clk), /* smp_twd */ | 616 | CLKDEV_DEV_ID("smp_twd", &twd_clk), /* smp_twd */ |
617 | 617 | ||
618 | /* DIV4 clocks */ | 618 | /* DIV4 clocks */ |
619 | CLKDEV_DEV_ID("cpufreq-cpu0", &div4_clks[DIV4_Z]), | 619 | CLKDEV_DEV_ID("cpu0", &div4_clks[DIV4_Z]), |
620 | 620 | ||
621 | /* DIV6 clocks */ | 621 | /* DIV6 clocks */ |
622 | CLKDEV_CON_ID("vck1_clk", &div6_clks[DIV6_VCK1]), | 622 | CLKDEV_CON_ID("vck1_clk", &div6_clks[DIV6_VCK1]), |
diff --git a/arch/avr32/include/asm/Kbuild b/arch/avr32/include/asm/Kbuild index d22af851f3f6..fd7980743890 100644 --- a/arch/avr32/include/asm/Kbuild +++ b/arch/avr32/include/asm/Kbuild | |||
@@ -1,5 +1,19 @@ | |||
1 | 1 | ||
2 | generic-y += clkdev.h | 2 | generic-y += clkdev.h |
3 | generic-y += cputime.h | ||
4 | generic-y += delay.h | ||
5 | generic-y += device.h | ||
6 | generic-y += div64.h | ||
7 | generic-y += emergency-restart.h | ||
3 | generic-y += exec.h | 8 | generic-y += exec.h |
4 | generic-y += trace_clock.h | 9 | generic-y += futex.h |
10 | generic-y += irq_regs.h | ||
5 | generic-y += param.h | 11 | generic-y += param.h |
12 | generic-y += local.h | ||
13 | generic-y += local64.h | ||
14 | generic-y += percpu.h | ||
15 | generic-y += scatterlist.h | ||
16 | generic-y += sections.h | ||
17 | generic-y += topology.h | ||
18 | generic-y += trace_clock.h | ||
19 | generic-y += xor.h | ||
diff --git a/arch/avr32/include/asm/cputime.h b/arch/avr32/include/asm/cputime.h deleted file mode 100644 index e87e0f81cbeb..000000000000 --- a/arch/avr32/include/asm/cputime.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_AVR32_CPUTIME_H | ||
2 | #define __ASM_AVR32_CPUTIME_H | ||
3 | |||
4 | #include <asm-generic/cputime.h> | ||
5 | |||
6 | #endif /* __ASM_AVR32_CPUTIME_H */ | ||
diff --git a/arch/avr32/include/asm/delay.h b/arch/avr32/include/asm/delay.h deleted file mode 100644 index 9670e127b7b2..000000000000 --- a/arch/avr32/include/asm/delay.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/delay.h> | ||
diff --git a/arch/avr32/include/asm/device.h b/arch/avr32/include/asm/device.h deleted file mode 100644 index d8f9872b0e2d..000000000000 --- a/arch/avr32/include/asm/device.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/arch/avr32/include/asm/div64.h b/arch/avr32/include/asm/div64.h deleted file mode 100644 index d7ddd4fdeca6..000000000000 --- a/arch/avr32/include/asm/div64.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_AVR32_DIV64_H | ||
2 | #define __ASM_AVR32_DIV64_H | ||
3 | |||
4 | #include <asm-generic/div64.h> | ||
5 | |||
6 | #endif /* __ASM_AVR32_DIV64_H */ | ||
diff --git a/arch/avr32/include/asm/emergency-restart.h b/arch/avr32/include/asm/emergency-restart.h deleted file mode 100644 index 3e7e014776ba..000000000000 --- a/arch/avr32/include/asm/emergency-restart.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_AVR32_EMERGENCY_RESTART_H | ||
2 | #define __ASM_AVR32_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* __ASM_AVR32_EMERGENCY_RESTART_H */ | ||
diff --git a/arch/avr32/include/asm/futex.h b/arch/avr32/include/asm/futex.h deleted file mode 100644 index 10419f14a68a..000000000000 --- a/arch/avr32/include/asm/futex.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_AVR32_FUTEX_H | ||
2 | #define __ASM_AVR32_FUTEX_H | ||
3 | |||
4 | #include <asm-generic/futex.h> | ||
5 | |||
6 | #endif /* __ASM_AVR32_FUTEX_H */ | ||
diff --git a/arch/avr32/include/asm/irq_regs.h b/arch/avr32/include/asm/irq_regs.h deleted file mode 100644 index 3dd9c0b70270..000000000000 --- a/arch/avr32/include/asm/irq_regs.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/irq_regs.h> | ||
diff --git a/arch/avr32/include/asm/local.h b/arch/avr32/include/asm/local.h deleted file mode 100644 index 1c1619694da3..000000000000 --- a/arch/avr32/include/asm/local.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_AVR32_LOCAL_H | ||
2 | #define __ASM_AVR32_LOCAL_H | ||
3 | |||
4 | #include <asm-generic/local.h> | ||
5 | |||
6 | #endif /* __ASM_AVR32_LOCAL_H */ | ||
diff --git a/arch/avr32/include/asm/local64.h b/arch/avr32/include/asm/local64.h deleted file mode 100644 index 36c93b5cc239..000000000000 --- a/arch/avr32/include/asm/local64.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/local64.h> | ||
diff --git a/arch/avr32/include/asm/percpu.h b/arch/avr32/include/asm/percpu.h deleted file mode 100644 index 69227b4cd0d4..000000000000 --- a/arch/avr32/include/asm/percpu.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_AVR32_PERCPU_H | ||
2 | #define __ASM_AVR32_PERCPU_H | ||
3 | |||
4 | #include <asm-generic/percpu.h> | ||
5 | |||
6 | #endif /* __ASM_AVR32_PERCPU_H */ | ||
diff --git a/arch/avr32/include/asm/scatterlist.h b/arch/avr32/include/asm/scatterlist.h deleted file mode 100644 index a5902d9834e8..000000000000 --- a/arch/avr32/include/asm/scatterlist.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_AVR32_SCATTERLIST_H | ||
2 | #define __ASM_AVR32_SCATTERLIST_H | ||
3 | |||
4 | #include <asm-generic/scatterlist.h> | ||
5 | |||
6 | #endif /* __ASM_AVR32_SCATTERLIST_H */ | ||
diff --git a/arch/avr32/include/asm/sections.h b/arch/avr32/include/asm/sections.h deleted file mode 100644 index aa14252e4181..000000000000 --- a/arch/avr32/include/asm/sections.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_AVR32_SECTIONS_H | ||
2 | #define __ASM_AVR32_SECTIONS_H | ||
3 | |||
4 | #include <asm-generic/sections.h> | ||
5 | |||
6 | #endif /* __ASM_AVR32_SECTIONS_H */ | ||
diff --git a/arch/avr32/include/asm/topology.h b/arch/avr32/include/asm/topology.h deleted file mode 100644 index 5b766cbb4806..000000000000 --- a/arch/avr32/include/asm/topology.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_AVR32_TOPOLOGY_H | ||
2 | #define __ASM_AVR32_TOPOLOGY_H | ||
3 | |||
4 | #include <asm-generic/topology.h> | ||
5 | |||
6 | #endif /* __ASM_AVR32_TOPOLOGY_H */ | ||
diff --git a/arch/avr32/include/asm/xor.h b/arch/avr32/include/asm/xor.h deleted file mode 100644 index 99c87aa0af4f..000000000000 --- a/arch/avr32/include/asm/xor.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _ASM_XOR_H | ||
2 | #define _ASM_XOR_H | ||
3 | |||
4 | #include <asm-generic/xor.h> | ||
5 | |||
6 | #endif | ||
diff --git a/arch/avr32/kernel/process.c b/arch/avr32/kernel/process.c index c2731003edef..42a53e740a7e 100644 --- a/arch/avr32/kernel/process.c +++ b/arch/avr32/kernel/process.c | |||
@@ -289,7 +289,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
289 | memset(childregs, 0, sizeof(struct pt_regs)); | 289 | memset(childregs, 0, sizeof(struct pt_regs)); |
290 | p->thread.cpu_context.r0 = arg; | 290 | p->thread.cpu_context.r0 = arg; |
291 | p->thread.cpu_context.r1 = usp; /* fn */ | 291 | p->thread.cpu_context.r1 = usp; /* fn */ |
292 | p->thread.cpu_context.r2 = syscall_return; | 292 | p->thread.cpu_context.r2 = (unsigned long)syscall_return; |
293 | p->thread.cpu_context.pc = (unsigned long)ret_from_kernel_thread; | 293 | p->thread.cpu_context.pc = (unsigned long)ret_from_kernel_thread; |
294 | childregs->sr = MODE_SUPERVISOR; | 294 | childregs->sr = MODE_SUPERVISOR; |
295 | } else { | 295 | } else { |
diff --git a/arch/avr32/kernel/time.c b/arch/avr32/kernel/time.c index 869a1c6ffeee..12f828ad5058 100644 --- a/arch/avr32/kernel/time.c +++ b/arch/avr32/kernel/time.c | |||
@@ -98,7 +98,14 @@ static void comparator_mode(enum clock_event_mode mode, | |||
98 | case CLOCK_EVT_MODE_SHUTDOWN: | 98 | case CLOCK_EVT_MODE_SHUTDOWN: |
99 | sysreg_write(COMPARE, 0); | 99 | sysreg_write(COMPARE, 0); |
100 | pr_debug("%s: stop\n", evdev->name); | 100 | pr_debug("%s: stop\n", evdev->name); |
101 | cpu_idle_poll_ctrl(false); | 101 | if (evdev->mode == CLOCK_EVT_MODE_ONESHOT || |
102 | evdev->mode == CLOCK_EVT_MODE_RESUME) { | ||
103 | /* | ||
104 | * Only disable idle poll if we have forced that | ||
105 | * in a previous call. | ||
106 | */ | ||
107 | cpu_idle_poll_ctrl(false); | ||
108 | } | ||
102 | break; | 109 | break; |
103 | default: | 110 | default: |
104 | BUG(); | 111 | BUG(); |
diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h index 51680d15ca8e..d445d060e346 100644 --- a/arch/mips/include/asm/cpu-features.h +++ b/arch/mips/include/asm/cpu-features.h | |||
@@ -187,7 +187,7 @@ | |||
187 | 187 | ||
188 | /* | 188 | /* |
189 | * MIPS32, MIPS64, VR5500, IDT32332, IDT32334 and maybe a few other | 189 | * MIPS32, MIPS64, VR5500, IDT32332, IDT32334 and maybe a few other |
190 | * pre-MIPS32/MIPS53 processors have CLO, CLZ. The IDT RC64574 is 64-bit and | 190 | * pre-MIPS32/MIPS64 processors have CLO, CLZ. The IDT RC64574 is 64-bit and |
191 | * has CLO and CLZ but not DCLO nor DCLZ. For 64-bit kernels | 191 | * has CLO and CLZ but not DCLO nor DCLZ. For 64-bit kernels |
192 | * cpu_has_clo_clz also indicates the availability of DCLO and DCLZ. | 192 | * cpu_has_clo_clz also indicates the availability of DCLO and DCLZ. |
193 | */ | 193 | */ |
diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c index f25a7e9f8cbc..5f8b95512580 100644 --- a/arch/mips/mm/dma-default.c +++ b/arch/mips/mm/dma-default.c | |||
@@ -308,12 +308,10 @@ static void mips_dma_sync_sg_for_cpu(struct device *dev, | |||
308 | { | 308 | { |
309 | int i; | 309 | int i; |
310 | 310 | ||
311 | /* Make sure that gcc doesn't leave the empty loop body. */ | 311 | if (cpu_needs_post_dma_flush(dev)) |
312 | for (i = 0; i < nelems; i++, sg++) { | 312 | for (i = 0; i < nelems; i++, sg++) |
313 | if (cpu_needs_post_dma_flush(dev)) | ||
314 | __dma_sync(sg_page(sg), sg->offset, sg->length, | 313 | __dma_sync(sg_page(sg), sg->offset, sg->length, |
315 | direction); | 314 | direction); |
316 | } | ||
317 | } | 315 | } |
318 | 316 | ||
319 | static void mips_dma_sync_sg_for_device(struct device *dev, | 317 | static void mips_dma_sync_sg_for_device(struct device *dev, |
@@ -321,12 +319,10 @@ static void mips_dma_sync_sg_for_device(struct device *dev, | |||
321 | { | 319 | { |
322 | int i; | 320 | int i; |
323 | 321 | ||
324 | /* Make sure that gcc doesn't leave the empty loop body. */ | 322 | if (!plat_device_is_coherent(dev)) |
325 | for (i = 0; i < nelems; i++, sg++) { | 323 | for (i = 0; i < nelems; i++, sg++) |
326 | if (!plat_device_is_coherent(dev)) | ||
327 | __dma_sync(sg_page(sg), sg->offset, sg->length, | 324 | __dma_sync(sg_page(sg), sg->offset, sg->length, |
328 | direction); | 325 | direction); |
329 | } | ||
330 | } | 326 | } |
331 | 327 | ||
332 | int mips_dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | 328 | int mips_dma_mapping_error(struct device *dev, dma_addr_t dma_addr) |
diff --git a/arch/openrisc/include/asm/prom.h b/arch/openrisc/include/asm/prom.h index eb59bfe23e85..93c9980e1b6b 100644 --- a/arch/openrisc/include/asm/prom.h +++ b/arch/openrisc/include/asm/prom.h | |||
@@ -14,53 +14,9 @@ | |||
14 | * the Free Software Foundation; either version 2 of the License, or | 14 | * the Free Software Foundation; either version 2 of the License, or |
15 | * (at your option) any later version. | 15 | * (at your option) any later version. |
16 | */ | 16 | */ |
17 | |||
18 | #include <linux/of.h> /* linux/of.h gets to determine #include ordering */ | ||
19 | |||
20 | #ifndef _ASM_OPENRISC_PROM_H | 17 | #ifndef _ASM_OPENRISC_PROM_H |
21 | #define _ASM_OPENRISC_PROM_H | 18 | #define _ASM_OPENRISC_PROM_H |
22 | #ifdef __KERNEL__ | ||
23 | #ifndef __ASSEMBLY__ | ||
24 | 19 | ||
25 | #include <linux/types.h> | ||
26 | #include <asm/irq.h> | ||
27 | #include <linux/irqdomain.h> | ||
28 | #include <linux/atomic.h> | ||
29 | #include <linux/of_irq.h> | ||
30 | #include <linux/of_fdt.h> | ||
31 | #include <linux/of_address.h> | ||
32 | #include <linux/proc_fs.h> | ||
33 | #include <linux/platform_device.h> | ||
34 | #define HAVE_ARCH_DEVTREE_FIXUPS | 20 | #define HAVE_ARCH_DEVTREE_FIXUPS |
35 | 21 | ||
36 | /* Other Prototypes */ | ||
37 | extern int early_uartlite_console(void); | ||
38 | |||
39 | /* Parse the ibm,dma-window property of an OF node into the busno, phys and | ||
40 | * size parameters. | ||
41 | */ | ||
42 | void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop, | ||
43 | unsigned long *busno, unsigned long *phys, unsigned long *size); | ||
44 | |||
45 | extern void kdump_move_device_tree(void); | ||
46 | |||
47 | /* Get the MAC address */ | ||
48 | extern const void *of_get_mac_address(struct device_node *np); | ||
49 | |||
50 | /** | ||
51 | * of_irq_map_pci - Resolve the interrupt for a PCI device | ||
52 | * @pdev: the device whose interrupt is to be resolved | ||
53 | * @out_irq: structure of_irq filled by this function | ||
54 | * | ||
55 | * This function resolves the PCI interrupt for a given PCI device. If a | ||
56 | * device-node exists for a given pci_dev, it will use normal OF tree | ||
57 | * walking. If not, it will implement standard swizzling and walk up the | ||
58 | * PCI tree until an device-node is found, at which point it will finish | ||
59 | * resolving using the OF tree walking. | ||
60 | */ | ||
61 | struct pci_dev; | ||
62 | extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq); | ||
63 | |||
64 | #endif /* __ASSEMBLY__ */ | ||
65 | #endif /* __KERNEL__ */ | ||
66 | #endif /* _ASM_OPENRISC_PROM_H */ | 22 | #endif /* _ASM_OPENRISC_PROM_H */ |
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c index d10d27a720c0..00c0ed333a3d 100644 --- a/arch/parisc/mm/fault.c +++ b/arch/parisc/mm/fault.c | |||
@@ -182,6 +182,9 @@ void do_page_fault(struct pt_regs *regs, unsigned long code, | |||
182 | 182 | ||
183 | if (user_mode(regs)) | 183 | if (user_mode(regs)) |
184 | flags |= FAULT_FLAG_USER; | 184 | flags |= FAULT_FLAG_USER; |
185 | |||
186 | acc_type = parisc_acctyp(code, regs->iir); | ||
187 | |||
185 | if (acc_type & VM_WRITE) | 188 | if (acc_type & VM_WRITE) |
186 | flags |= FAULT_FLAG_WRITE; | 189 | flags |= FAULT_FLAG_WRITE; |
187 | retry: | 190 | retry: |
@@ -196,8 +199,6 @@ retry: | |||
196 | 199 | ||
197 | good_area: | 200 | good_area: |
198 | 201 | ||
199 | acc_type = parisc_acctyp(code,regs->iir); | ||
200 | |||
201 | if ((vma->vm_flags & acc_type) != acc_type) | 202 | if ((vma->vm_flags & acc_type) != acc_type) |
202 | goto bad_area; | 203 | goto bad_area; |
203 | 204 | ||
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 6a15c968d214..15ca2255f438 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile | |||
@@ -74,7 +74,7 @@ src-wlib-$(CONFIG_8xx) += mpc8xx.c planetcore.c | |||
74 | src-wlib-$(CONFIG_PPC_82xx) += pq2.c fsl-soc.c planetcore.c | 74 | src-wlib-$(CONFIG_PPC_82xx) += pq2.c fsl-soc.c planetcore.c |
75 | src-wlib-$(CONFIG_EMBEDDED6xx) += mv64x60.c mv64x60_i2c.c ugecon.c | 75 | src-wlib-$(CONFIG_EMBEDDED6xx) += mv64x60.c mv64x60_i2c.c ugecon.c |
76 | 76 | ||
77 | src-plat-y := of.c | 77 | src-plat-y := of.c epapr.c |
78 | src-plat-$(CONFIG_40x) += fixed-head.S ep405.c cuboot-hotfoot.c \ | 78 | src-plat-$(CONFIG_40x) += fixed-head.S ep405.c cuboot-hotfoot.c \ |
79 | treeboot-walnut.c cuboot-acadia.c \ | 79 | treeboot-walnut.c cuboot-acadia.c \ |
80 | cuboot-kilauea.c simpleboot.c \ | 80 | cuboot-kilauea.c simpleboot.c \ |
@@ -97,7 +97,7 @@ src-plat-$(CONFIG_EMBEDDED6xx) += cuboot-pq2.c cuboot-mpc7448hpc2.c \ | |||
97 | prpmc2800.c | 97 | prpmc2800.c |
98 | src-plat-$(CONFIG_AMIGAONE) += cuboot-amigaone.c | 98 | src-plat-$(CONFIG_AMIGAONE) += cuboot-amigaone.c |
99 | src-plat-$(CONFIG_PPC_PS3) += ps3-head.S ps3-hvcall.S ps3.c | 99 | src-plat-$(CONFIG_PPC_PS3) += ps3-head.S ps3-hvcall.S ps3.c |
100 | src-plat-$(CONFIG_EPAPR_BOOT) += epapr.c | 100 | src-plat-$(CONFIG_EPAPR_BOOT) += epapr.c epapr-wrapper.c |
101 | 101 | ||
102 | src-wlib := $(sort $(src-wlib-y)) | 102 | src-wlib := $(sort $(src-wlib-y)) |
103 | src-plat := $(sort $(src-plat-y)) | 103 | src-plat := $(sort $(src-plat-y)) |
diff --git a/arch/powerpc/boot/epapr-wrapper.c b/arch/powerpc/boot/epapr-wrapper.c new file mode 100644 index 000000000000..c10191006673 --- /dev/null +++ b/arch/powerpc/boot/epapr-wrapper.c | |||
@@ -0,0 +1,9 @@ | |||
1 | extern void epapr_platform_init(unsigned long r3, unsigned long r4, | ||
2 | unsigned long r5, unsigned long r6, | ||
3 | unsigned long r7); | ||
4 | |||
5 | void platform_init(unsigned long r3, unsigned long r4, unsigned long r5, | ||
6 | unsigned long r6, unsigned long r7) | ||
7 | { | ||
8 | epapr_platform_init(r3, r4, r5, r6, r7); | ||
9 | } | ||
diff --git a/arch/powerpc/boot/epapr.c b/arch/powerpc/boot/epapr.c index 06c1961bd124..02e91aa2194a 100644 --- a/arch/powerpc/boot/epapr.c +++ b/arch/powerpc/boot/epapr.c | |||
@@ -48,8 +48,8 @@ static void platform_fixups(void) | |||
48 | fdt_addr, fdt_totalsize((void *)fdt_addr), ima_size); | 48 | fdt_addr, fdt_totalsize((void *)fdt_addr), ima_size); |
49 | } | 49 | } |
50 | 50 | ||
51 | void platform_init(unsigned long r3, unsigned long r4, unsigned long r5, | 51 | void epapr_platform_init(unsigned long r3, unsigned long r4, unsigned long r5, |
52 | unsigned long r6, unsigned long r7) | 52 | unsigned long r6, unsigned long r7) |
53 | { | 53 | { |
54 | epapr_magic = r6; | 54 | epapr_magic = r6; |
55 | ima_size = r7; | 55 | ima_size = r7; |
diff --git a/arch/powerpc/boot/of.c b/arch/powerpc/boot/of.c index 61d9899aa0d0..62e2f43ec1df 100644 --- a/arch/powerpc/boot/of.c +++ b/arch/powerpc/boot/of.c | |||
@@ -26,6 +26,9 @@ | |||
26 | 26 | ||
27 | static unsigned long claim_base; | 27 | static unsigned long claim_base; |
28 | 28 | ||
29 | void epapr_platform_init(unsigned long r3, unsigned long r4, unsigned long r5, | ||
30 | unsigned long r6, unsigned long r7); | ||
31 | |||
29 | static void *of_try_claim(unsigned long size) | 32 | static void *of_try_claim(unsigned long size) |
30 | { | 33 | { |
31 | unsigned long addr = 0; | 34 | unsigned long addr = 0; |
@@ -61,7 +64,7 @@ static void of_image_hdr(const void *hdr) | |||
61 | } | 64 | } |
62 | } | 65 | } |
63 | 66 | ||
64 | void platform_init(unsigned long a1, unsigned long a2, void *promptr) | 67 | static void of_platform_init(unsigned long a1, unsigned long a2, void *promptr) |
65 | { | 68 | { |
66 | platform_ops.image_hdr = of_image_hdr; | 69 | platform_ops.image_hdr = of_image_hdr; |
67 | platform_ops.malloc = of_try_claim; | 70 | platform_ops.malloc = of_try_claim; |
@@ -81,3 +84,14 @@ void platform_init(unsigned long a1, unsigned long a2, void *promptr) | |||
81 | loader_info.initrd_size = a2; | 84 | loader_info.initrd_size = a2; |
82 | } | 85 | } |
83 | } | 86 | } |
87 | |||
88 | void platform_init(unsigned long r3, unsigned long r4, unsigned long r5, | ||
89 | unsigned long r6, unsigned long r7) | ||
90 | { | ||
91 | /* Detect OF vs. ePAPR boot */ | ||
92 | if (r5) | ||
93 | of_platform_init(r3, r4, (void *)r5); | ||
94 | else | ||
95 | epapr_platform_init(r3, r4, r5, r6, r7); | ||
96 | } | ||
97 | |||
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper index 6761c746048d..cd7af841ba05 100755 --- a/arch/powerpc/boot/wrapper +++ b/arch/powerpc/boot/wrapper | |||
@@ -148,18 +148,18 @@ make_space=y | |||
148 | 148 | ||
149 | case "$platform" in | 149 | case "$platform" in |
150 | pseries) | 150 | pseries) |
151 | platformo=$object/of.o | 151 | platformo="$object/of.o $object/epapr.o" |
152 | link_address='0x4000000' | 152 | link_address='0x4000000' |
153 | ;; | 153 | ;; |
154 | maple) | 154 | maple) |
155 | platformo=$object/of.o | 155 | platformo="$object/of.o $object/epapr.o" |
156 | link_address='0x400000' | 156 | link_address='0x400000' |
157 | ;; | 157 | ;; |
158 | pmac|chrp) | 158 | pmac|chrp) |
159 | platformo=$object/of.o | 159 | platformo="$object/of.o $object/epapr.o" |
160 | ;; | 160 | ;; |
161 | coff) | 161 | coff) |
162 | platformo="$object/crt0.o $object/of.o" | 162 | platformo="$object/crt0.o $object/of.o $object/epapr.o" |
163 | lds=$object/zImage.coff.lds | 163 | lds=$object/zImage.coff.lds |
164 | link_address='0x500000' | 164 | link_address='0x500000' |
165 | pie= | 165 | pie= |
@@ -253,6 +253,7 @@ treeboot-iss4xx-mpic) | |||
253 | platformo="$object/treeboot-iss4xx.o" | 253 | platformo="$object/treeboot-iss4xx.o" |
254 | ;; | 254 | ;; |
255 | epapr) | 255 | epapr) |
256 | platformo="$object/epapr.o $object/epapr-wrapper.o" | ||
256 | link_address='0x20000000' | 257 | link_address='0x20000000' |
257 | pie=-pie | 258 | pie=-pie |
258 | ;; | 259 | ;; |
diff --git a/arch/powerpc/include/asm/irq.h b/arch/powerpc/include/asm/irq.h index 0e40843a1c6e..41f13cec8a8f 100644 --- a/arch/powerpc/include/asm/irq.h +++ b/arch/powerpc/include/asm/irq.h | |||
@@ -69,9 +69,9 @@ extern struct thread_info *softirq_ctx[NR_CPUS]; | |||
69 | 69 | ||
70 | extern void irq_ctx_init(void); | 70 | extern void irq_ctx_init(void); |
71 | extern void call_do_softirq(struct thread_info *tp); | 71 | extern void call_do_softirq(struct thread_info *tp); |
72 | extern int call_handle_irq(int irq, void *p1, | 72 | extern void call_do_irq(struct pt_regs *regs, struct thread_info *tp); |
73 | struct thread_info *tp, void *func); | ||
74 | extern void do_IRQ(struct pt_regs *regs); | 73 | extern void do_IRQ(struct pt_regs *regs); |
74 | extern void __do_irq(struct pt_regs *regs); | ||
75 | 75 | ||
76 | int irq_choose_cpu(const struct cpumask *mask); | 76 | int irq_choose_cpu(const struct cpumask *mask); |
77 | 77 | ||
diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h index e378cccfca55..ce4de5aed7b5 100644 --- a/arch/powerpc/include/asm/processor.h +++ b/arch/powerpc/include/asm/processor.h | |||
@@ -149,8 +149,6 @@ typedef struct { | |||
149 | 149 | ||
150 | struct thread_struct { | 150 | struct thread_struct { |
151 | unsigned long ksp; /* Kernel stack pointer */ | 151 | unsigned long ksp; /* Kernel stack pointer */ |
152 | unsigned long ksp_limit; /* if ksp <= ksp_limit stack overflow */ | ||
153 | |||
154 | #ifdef CONFIG_PPC64 | 152 | #ifdef CONFIG_PPC64 |
155 | unsigned long ksp_vsid; | 153 | unsigned long ksp_vsid; |
156 | #endif | 154 | #endif |
@@ -162,6 +160,7 @@ struct thread_struct { | |||
162 | #endif | 160 | #endif |
163 | #ifdef CONFIG_PPC32 | 161 | #ifdef CONFIG_PPC32 |
164 | void *pgdir; /* root of page-table tree */ | 162 | void *pgdir; /* root of page-table tree */ |
163 | unsigned long ksp_limit; /* if ksp <= ksp_limit stack overflow */ | ||
165 | #endif | 164 | #endif |
166 | #ifdef CONFIG_PPC_ADV_DEBUG_REGS | 165 | #ifdef CONFIG_PPC_ADV_DEBUG_REGS |
167 | /* | 166 | /* |
@@ -321,7 +320,6 @@ struct thread_struct { | |||
321 | #else | 320 | #else |
322 | #define INIT_THREAD { \ | 321 | #define INIT_THREAD { \ |
323 | .ksp = INIT_SP, \ | 322 | .ksp = INIT_SP, \ |
324 | .ksp_limit = INIT_SP_LIMIT, \ | ||
325 | .regs = (struct pt_regs *)INIT_SP - 1, /* XXX bogus, I think */ \ | 323 | .regs = (struct pt_regs *)INIT_SP - 1, /* XXX bogus, I think */ \ |
326 | .fs = KERNEL_DS, \ | 324 | .fs = KERNEL_DS, \ |
327 | .fpr = {{0}}, \ | 325 | .fpr = {{0}}, \ |
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c index d8958be5f31a..502c7a4e73f7 100644 --- a/arch/powerpc/kernel/asm-offsets.c +++ b/arch/powerpc/kernel/asm-offsets.c | |||
@@ -80,10 +80,11 @@ int main(void) | |||
80 | DEFINE(TASKTHREADPPR, offsetof(struct task_struct, thread.ppr)); | 80 | DEFINE(TASKTHREADPPR, offsetof(struct task_struct, thread.ppr)); |
81 | #else | 81 | #else |
82 | DEFINE(THREAD_INFO, offsetof(struct task_struct, stack)); | 82 | DEFINE(THREAD_INFO, offsetof(struct task_struct, stack)); |
83 | DEFINE(THREAD_INFO_GAP, _ALIGN_UP(sizeof(struct thread_info), 16)); | ||
84 | DEFINE(KSP_LIMIT, offsetof(struct thread_struct, ksp_limit)); | ||
83 | #endif /* CONFIG_PPC64 */ | 85 | #endif /* CONFIG_PPC64 */ |
84 | 86 | ||
85 | DEFINE(KSP, offsetof(struct thread_struct, ksp)); | 87 | DEFINE(KSP, offsetof(struct thread_struct, ksp)); |
86 | DEFINE(KSP_LIMIT, offsetof(struct thread_struct, ksp_limit)); | ||
87 | DEFINE(PT_REGS, offsetof(struct thread_struct, regs)); | 88 | DEFINE(PT_REGS, offsetof(struct thread_struct, regs)); |
88 | #ifdef CONFIG_BOOKE | 89 | #ifdef CONFIG_BOOKE |
89 | DEFINE(THREAD_NORMSAVES, offsetof(struct thread_struct, normsave[0])); | 90 | DEFINE(THREAD_NORMSAVES, offsetof(struct thread_struct, normsave[0])); |
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index c69440cef7af..57d286a78f86 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c | |||
@@ -441,50 +441,6 @@ void migrate_irqs(void) | |||
441 | } | 441 | } |
442 | #endif | 442 | #endif |
443 | 443 | ||
444 | static inline void handle_one_irq(unsigned int irq) | ||
445 | { | ||
446 | struct thread_info *curtp, *irqtp; | ||
447 | unsigned long saved_sp_limit; | ||
448 | struct irq_desc *desc; | ||
449 | |||
450 | desc = irq_to_desc(irq); | ||
451 | if (!desc) | ||
452 | return; | ||
453 | |||
454 | /* Switch to the irq stack to handle this */ | ||
455 | curtp = current_thread_info(); | ||
456 | irqtp = hardirq_ctx[smp_processor_id()]; | ||
457 | |||
458 | if (curtp == irqtp) { | ||
459 | /* We're already on the irq stack, just handle it */ | ||
460 | desc->handle_irq(irq, desc); | ||
461 | return; | ||
462 | } | ||
463 | |||
464 | saved_sp_limit = current->thread.ksp_limit; | ||
465 | |||
466 | irqtp->task = curtp->task; | ||
467 | irqtp->flags = 0; | ||
468 | |||
469 | /* Copy the softirq bits in preempt_count so that the | ||
470 | * softirq checks work in the hardirq context. */ | ||
471 | irqtp->preempt_count = (irqtp->preempt_count & ~SOFTIRQ_MASK) | | ||
472 | (curtp->preempt_count & SOFTIRQ_MASK); | ||
473 | |||
474 | current->thread.ksp_limit = (unsigned long)irqtp + | ||
475 | _ALIGN_UP(sizeof(struct thread_info), 16); | ||
476 | |||
477 | call_handle_irq(irq, desc, irqtp, desc->handle_irq); | ||
478 | current->thread.ksp_limit = saved_sp_limit; | ||
479 | irqtp->task = NULL; | ||
480 | |||
481 | /* Set any flag that may have been set on the | ||
482 | * alternate stack | ||
483 | */ | ||
484 | if (irqtp->flags) | ||
485 | set_bits(irqtp->flags, &curtp->flags); | ||
486 | } | ||
487 | |||
488 | static inline void check_stack_overflow(void) | 444 | static inline void check_stack_overflow(void) |
489 | { | 445 | { |
490 | #ifdef CONFIG_DEBUG_STACKOVERFLOW | 446 | #ifdef CONFIG_DEBUG_STACKOVERFLOW |
@@ -501,9 +457,9 @@ static inline void check_stack_overflow(void) | |||
501 | #endif | 457 | #endif |
502 | } | 458 | } |
503 | 459 | ||
504 | void do_IRQ(struct pt_regs *regs) | 460 | void __do_irq(struct pt_regs *regs) |
505 | { | 461 | { |
506 | struct pt_regs *old_regs = set_irq_regs(regs); | 462 | struct irq_desc *desc; |
507 | unsigned int irq; | 463 | unsigned int irq; |
508 | 464 | ||
509 | irq_enter(); | 465 | irq_enter(); |
@@ -519,18 +475,56 @@ void do_IRQ(struct pt_regs *regs) | |||
519 | */ | 475 | */ |
520 | irq = ppc_md.get_irq(); | 476 | irq = ppc_md.get_irq(); |
521 | 477 | ||
522 | /* We can hard enable interrupts now */ | 478 | /* We can hard enable interrupts now to allow perf interrupts */ |
523 | may_hard_irq_enable(); | 479 | may_hard_irq_enable(); |
524 | 480 | ||
525 | /* And finally process it */ | 481 | /* And finally process it */ |
526 | if (irq != NO_IRQ) | 482 | if (unlikely(irq == NO_IRQ)) |
527 | handle_one_irq(irq); | ||
528 | else | ||
529 | __get_cpu_var(irq_stat).spurious_irqs++; | 483 | __get_cpu_var(irq_stat).spurious_irqs++; |
484 | else { | ||
485 | desc = irq_to_desc(irq); | ||
486 | if (likely(desc)) | ||
487 | desc->handle_irq(irq, desc); | ||
488 | } | ||
530 | 489 | ||
531 | trace_irq_exit(regs); | 490 | trace_irq_exit(regs); |
532 | 491 | ||
533 | irq_exit(); | 492 | irq_exit(); |
493 | } | ||
494 | |||
495 | void do_IRQ(struct pt_regs *regs) | ||
496 | { | ||
497 | struct pt_regs *old_regs = set_irq_regs(regs); | ||
498 | struct thread_info *curtp, *irqtp; | ||
499 | |||
500 | /* Switch to the irq stack to handle this */ | ||
501 | curtp = current_thread_info(); | ||
502 | irqtp = hardirq_ctx[raw_smp_processor_id()]; | ||
503 | |||
504 | /* Already there ? */ | ||
505 | if (unlikely(curtp == irqtp)) { | ||
506 | __do_irq(regs); | ||
507 | set_irq_regs(old_regs); | ||
508 | return; | ||
509 | } | ||
510 | |||
511 | /* Prepare the thread_info in the irq stack */ | ||
512 | irqtp->task = curtp->task; | ||
513 | irqtp->flags = 0; | ||
514 | |||
515 | /* Copy the preempt_count so that the [soft]irq checks work. */ | ||
516 | irqtp->preempt_count = curtp->preempt_count; | ||
517 | |||
518 | /* Switch stack and call */ | ||
519 | call_do_irq(regs, irqtp); | ||
520 | |||
521 | /* Restore stack limit */ | ||
522 | irqtp->task = NULL; | ||
523 | |||
524 | /* Copy back updates to the thread_info */ | ||
525 | if (irqtp->flags) | ||
526 | set_bits(irqtp->flags, &curtp->flags); | ||
527 | |||
534 | set_irq_regs(old_regs); | 528 | set_irq_regs(old_regs); |
535 | } | 529 | } |
536 | 530 | ||
@@ -592,28 +586,22 @@ void irq_ctx_init(void) | |||
592 | memset((void *)softirq_ctx[i], 0, THREAD_SIZE); | 586 | memset((void *)softirq_ctx[i], 0, THREAD_SIZE); |
593 | tp = softirq_ctx[i]; | 587 | tp = softirq_ctx[i]; |
594 | tp->cpu = i; | 588 | tp->cpu = i; |
595 | tp->preempt_count = 0; | ||
596 | 589 | ||
597 | memset((void *)hardirq_ctx[i], 0, THREAD_SIZE); | 590 | memset((void *)hardirq_ctx[i], 0, THREAD_SIZE); |
598 | tp = hardirq_ctx[i]; | 591 | tp = hardirq_ctx[i]; |
599 | tp->cpu = i; | 592 | tp->cpu = i; |
600 | tp->preempt_count = HARDIRQ_OFFSET; | ||
601 | } | 593 | } |
602 | } | 594 | } |
603 | 595 | ||
604 | static inline void do_softirq_onstack(void) | 596 | static inline void do_softirq_onstack(void) |
605 | { | 597 | { |
606 | struct thread_info *curtp, *irqtp; | 598 | struct thread_info *curtp, *irqtp; |
607 | unsigned long saved_sp_limit = current->thread.ksp_limit; | ||
608 | 599 | ||
609 | curtp = current_thread_info(); | 600 | curtp = current_thread_info(); |
610 | irqtp = softirq_ctx[smp_processor_id()]; | 601 | irqtp = softirq_ctx[smp_processor_id()]; |
611 | irqtp->task = curtp->task; | 602 | irqtp->task = curtp->task; |
612 | irqtp->flags = 0; | 603 | irqtp->flags = 0; |
613 | current->thread.ksp_limit = (unsigned long)irqtp + | ||
614 | _ALIGN_UP(sizeof(struct thread_info), 16); | ||
615 | call_do_softirq(irqtp); | 604 | call_do_softirq(irqtp); |
616 | current->thread.ksp_limit = saved_sp_limit; | ||
617 | irqtp->task = NULL; | 605 | irqtp->task = NULL; |
618 | 606 | ||
619 | /* Set any flag that may have been set on the | 607 | /* Set any flag that may have been set on the |
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S index 777d999f563b..2b0ad9845363 100644 --- a/arch/powerpc/kernel/misc_32.S +++ b/arch/powerpc/kernel/misc_32.S | |||
@@ -36,26 +36,41 @@ | |||
36 | 36 | ||
37 | .text | 37 | .text |
38 | 38 | ||
39 | /* | ||
40 | * We store the saved ksp_limit in the unused part | ||
41 | * of the STACK_FRAME_OVERHEAD | ||
42 | */ | ||
39 | _GLOBAL(call_do_softirq) | 43 | _GLOBAL(call_do_softirq) |
40 | mflr r0 | 44 | mflr r0 |
41 | stw r0,4(r1) | 45 | stw r0,4(r1) |
46 | lwz r10,THREAD+KSP_LIMIT(r2) | ||
47 | addi r11,r3,THREAD_INFO_GAP | ||
42 | stwu r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r3) | 48 | stwu r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r3) |
43 | mr r1,r3 | 49 | mr r1,r3 |
50 | stw r10,8(r1) | ||
51 | stw r11,THREAD+KSP_LIMIT(r2) | ||
44 | bl __do_softirq | 52 | bl __do_softirq |
53 | lwz r10,8(r1) | ||
45 | lwz r1,0(r1) | 54 | lwz r1,0(r1) |
46 | lwz r0,4(r1) | 55 | lwz r0,4(r1) |
56 | stw r10,THREAD+KSP_LIMIT(r2) | ||
47 | mtlr r0 | 57 | mtlr r0 |
48 | blr | 58 | blr |
49 | 59 | ||
50 | _GLOBAL(call_handle_irq) | 60 | _GLOBAL(call_do_irq) |
51 | mflr r0 | 61 | mflr r0 |
52 | stw r0,4(r1) | 62 | stw r0,4(r1) |
53 | mtctr r6 | 63 | lwz r10,THREAD+KSP_LIMIT(r2) |
54 | stwu r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r5) | 64 | addi r11,r3,THREAD_INFO_GAP |
55 | mr r1,r5 | 65 | stwu r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r4) |
56 | bctrl | 66 | mr r1,r4 |
67 | stw r10,8(r1) | ||
68 | stw r11,THREAD+KSP_LIMIT(r2) | ||
69 | bl __do_irq | ||
70 | lwz r10,8(r1) | ||
57 | lwz r1,0(r1) | 71 | lwz r1,0(r1) |
58 | lwz r0,4(r1) | 72 | lwz r0,4(r1) |
73 | stw r10,THREAD+KSP_LIMIT(r2) | ||
59 | mtlr r0 | 74 | mtlr r0 |
60 | blr | 75 | blr |
61 | 76 | ||
diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S index 971d7e78aff2..e59caf874d05 100644 --- a/arch/powerpc/kernel/misc_64.S +++ b/arch/powerpc/kernel/misc_64.S | |||
@@ -40,14 +40,12 @@ _GLOBAL(call_do_softirq) | |||
40 | mtlr r0 | 40 | mtlr r0 |
41 | blr | 41 | blr |
42 | 42 | ||
43 | _GLOBAL(call_handle_irq) | 43 | _GLOBAL(call_do_irq) |
44 | ld r8,0(r6) | ||
45 | mflr r0 | 44 | mflr r0 |
46 | std r0,16(r1) | 45 | std r0,16(r1) |
47 | mtctr r8 | 46 | stdu r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r4) |
48 | stdu r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r5) | 47 | mr r1,r4 |
49 | mr r1,r5 | 48 | bl .__do_irq |
50 | bctrl | ||
51 | ld r1,0(r1) | 49 | ld r1,0(r1) |
52 | ld r0,16(r1) | 50 | ld r0,16(r1) |
53 | mtlr r0 | 51 | mtlr r0 |
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 6f428da53e20..96d2fdf3aa9e 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c | |||
@@ -1000,9 +1000,10 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
1000 | kregs = (struct pt_regs *) sp; | 1000 | kregs = (struct pt_regs *) sp; |
1001 | sp -= STACK_FRAME_OVERHEAD; | 1001 | sp -= STACK_FRAME_OVERHEAD; |
1002 | p->thread.ksp = sp; | 1002 | p->thread.ksp = sp; |
1003 | #ifdef CONFIG_PPC32 | ||
1003 | p->thread.ksp_limit = (unsigned long)task_stack_page(p) + | 1004 | p->thread.ksp_limit = (unsigned long)task_stack_page(p) + |
1004 | _ALIGN_UP(sizeof(struct thread_info), 16); | 1005 | _ALIGN_UP(sizeof(struct thread_info), 16); |
1005 | 1006 | #endif | |
1006 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | 1007 | #ifdef CONFIG_HAVE_HW_BREAKPOINT |
1007 | p->thread.ptrace_bps[0] = NULL; | 1008 | p->thread.ptrace_bps[0] = NULL; |
1008 | #endif | 1009 | #endif |
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index 12e656ffe60e..5fe2842e8bab 100644 --- a/arch/powerpc/kernel/prom_init.c +++ b/arch/powerpc/kernel/prom_init.c | |||
@@ -196,6 +196,8 @@ static int __initdata mem_reserve_cnt; | |||
196 | 196 | ||
197 | static cell_t __initdata regbuf[1024]; | 197 | static cell_t __initdata regbuf[1024]; |
198 | 198 | ||
199 | static bool rtas_has_query_cpu_stopped; | ||
200 | |||
199 | 201 | ||
200 | /* | 202 | /* |
201 | * Error results ... some OF calls will return "-1" on error, some | 203 | * Error results ... some OF calls will return "-1" on error, some |
@@ -1574,6 +1576,11 @@ static void __init prom_instantiate_rtas(void) | |||
1574 | prom_setprop(rtas_node, "/rtas", "linux,rtas-entry", | 1576 | prom_setprop(rtas_node, "/rtas", "linux,rtas-entry", |
1575 | &val, sizeof(val)); | 1577 | &val, sizeof(val)); |
1576 | 1578 | ||
1579 | /* Check if it supports "query-cpu-stopped-state" */ | ||
1580 | if (prom_getprop(rtas_node, "query-cpu-stopped-state", | ||
1581 | &val, sizeof(val)) != PROM_ERROR) | ||
1582 | rtas_has_query_cpu_stopped = true; | ||
1583 | |||
1577 | #if defined(CONFIG_PPC_POWERNV) && defined(__BIG_ENDIAN__) | 1584 | #if defined(CONFIG_PPC_POWERNV) && defined(__BIG_ENDIAN__) |
1578 | /* PowerVN takeover hack */ | 1585 | /* PowerVN takeover hack */ |
1579 | prom_rtas_data = base; | 1586 | prom_rtas_data = base; |
@@ -1815,6 +1822,18 @@ static void __init prom_hold_cpus(void) | |||
1815 | = (void *) LOW_ADDR(__secondary_hold_acknowledge); | 1822 | = (void *) LOW_ADDR(__secondary_hold_acknowledge); |
1816 | unsigned long secondary_hold = LOW_ADDR(__secondary_hold); | 1823 | unsigned long secondary_hold = LOW_ADDR(__secondary_hold); |
1817 | 1824 | ||
1825 | /* | ||
1826 | * On pseries, if RTAS supports "query-cpu-stopped-state", | ||
1827 | * we skip this stage, the CPUs will be started by the | ||
1828 | * kernel using RTAS. | ||
1829 | */ | ||
1830 | if ((of_platform == PLATFORM_PSERIES || | ||
1831 | of_platform == PLATFORM_PSERIES_LPAR) && | ||
1832 | rtas_has_query_cpu_stopped) { | ||
1833 | prom_printf("prom_hold_cpus: skipped\n"); | ||
1834 | return; | ||
1835 | } | ||
1836 | |||
1818 | prom_debug("prom_hold_cpus: start...\n"); | 1837 | prom_debug("prom_hold_cpus: start...\n"); |
1819 | prom_debug(" 1) spinloop = 0x%x\n", (unsigned long)spinloop); | 1838 | prom_debug(" 1) spinloop = 0x%x\n", (unsigned long)spinloop); |
1820 | prom_debug(" 1) *spinloop = 0x%x\n", *spinloop); | 1839 | prom_debug(" 1) *spinloop = 0x%x\n", *spinloop); |
@@ -3011,6 +3030,8 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4, | |||
3011 | * On non-powermacs, put all CPUs in spin-loops. | 3030 | * On non-powermacs, put all CPUs in spin-loops. |
3012 | * | 3031 | * |
3013 | * PowerMacs use a different mechanism to spin CPUs | 3032 | * PowerMacs use a different mechanism to spin CPUs |
3033 | * | ||
3034 | * (This must be done after instanciating RTAS) | ||
3014 | */ | 3035 | */ |
3015 | if (of_platform != PLATFORM_POWERMAC && | 3036 | if (of_platform != PLATFORM_POWERMAC && |
3016 | of_platform != PLATFORM_OPAL) | 3037 | of_platform != PLATFORM_OPAL) |
diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c index a7ee978fb860..b1faa1593c90 100644 --- a/arch/powerpc/lib/sstep.c +++ b/arch/powerpc/lib/sstep.c | |||
@@ -1505,6 +1505,7 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr) | |||
1505 | */ | 1505 | */ |
1506 | if ((ra == 1) && !(regs->msr & MSR_PR) \ | 1506 | if ((ra == 1) && !(regs->msr & MSR_PR) \ |
1507 | && (val3 >= (regs->gpr[1] - STACK_INT_FRAME_SIZE))) { | 1507 | && (val3 >= (regs->gpr[1] - STACK_INT_FRAME_SIZE))) { |
1508 | #ifdef CONFIG_PPC32 | ||
1508 | /* | 1509 | /* |
1509 | * Check if we will touch kernel sack overflow | 1510 | * Check if we will touch kernel sack overflow |
1510 | */ | 1511 | */ |
@@ -1513,7 +1514,7 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr) | |||
1513 | err = -EINVAL; | 1514 | err = -EINVAL; |
1514 | break; | 1515 | break; |
1515 | } | 1516 | } |
1516 | 1517 | #endif /* CONFIG_PPC32 */ | |
1517 | /* | 1518 | /* |
1518 | * Check if we already set since that means we'll | 1519 | * Check if we already set since that means we'll |
1519 | * lose the previous value. | 1520 | * lose the previous value. |
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c index 1c1771a40250..24f58cb0a543 100644 --- a/arch/powerpc/platforms/pseries/smp.c +++ b/arch/powerpc/platforms/pseries/smp.c | |||
@@ -233,18 +233,24 @@ static void __init smp_init_pseries(void) | |||
233 | 233 | ||
234 | alloc_bootmem_cpumask_var(&of_spin_mask); | 234 | alloc_bootmem_cpumask_var(&of_spin_mask); |
235 | 235 | ||
236 | /* Mark threads which are still spinning in hold loops. */ | 236 | /* |
237 | if (cpu_has_feature(CPU_FTR_SMT)) { | 237 | * Mark threads which are still spinning in hold loops |
238 | for_each_present_cpu(i) { | 238 | * |
239 | if (cpu_thread_in_core(i) == 0) | 239 | * We know prom_init will not have started them if RTAS supports |
240 | cpumask_set_cpu(i, of_spin_mask); | 240 | * query-cpu-stopped-state. |
241 | } | 241 | */ |
242 | } else { | 242 | if (rtas_token("query-cpu-stopped-state") == RTAS_UNKNOWN_SERVICE) { |
243 | cpumask_copy(of_spin_mask, cpu_present_mask); | 243 | if (cpu_has_feature(CPU_FTR_SMT)) { |
244 | for_each_present_cpu(i) { | ||
245 | if (cpu_thread_in_core(i) == 0) | ||
246 | cpumask_set_cpu(i, of_spin_mask); | ||
247 | } | ||
248 | } else | ||
249 | cpumask_copy(of_spin_mask, cpu_present_mask); | ||
250 | |||
251 | cpumask_clear_cpu(boot_cpuid, of_spin_mask); | ||
244 | } | 252 | } |
245 | 253 | ||
246 | cpumask_clear_cpu(boot_cpuid, of_spin_mask); | ||
247 | |||
248 | /* Non-lpar has additional take/give timebase */ | 254 | /* Non-lpar has additional take/give timebase */ |
249 | if (rtas_token("freeze-time-base") != RTAS_UNKNOWN_SERVICE) { | 255 | if (rtas_token("freeze-time-base") != RTAS_UNKNOWN_SERVICE) { |
250 | smp_ops->give_timebase = rtas_give_timebase; | 256 | smp_ops->give_timebase = rtas_give_timebase; |
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index dcc6ac2d8026..7143793859fa 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
@@ -93,6 +93,7 @@ config S390 | |||
93 | select ARCH_INLINE_WRITE_UNLOCK_IRQ | 93 | select ARCH_INLINE_WRITE_UNLOCK_IRQ |
94 | select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE | 94 | select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE |
95 | select ARCH_SAVE_PAGE_KEYS if HIBERNATION | 95 | select ARCH_SAVE_PAGE_KEYS if HIBERNATION |
96 | select ARCH_USE_CMPXCHG_LOCKREF | ||
96 | select ARCH_WANT_IPC_PARSE_VERSION | 97 | select ARCH_WANT_IPC_PARSE_VERSION |
97 | select BUILDTIME_EXTABLE_SORT | 98 | select BUILDTIME_EXTABLE_SORT |
98 | select CLONE_BACKWARDS2 | 99 | select CLONE_BACKWARDS2 |
@@ -102,7 +103,6 @@ config S390 | |||
102 | select GENERIC_TIME_VSYSCALL_OLD | 103 | select GENERIC_TIME_VSYSCALL_OLD |
103 | select HAVE_ALIGNED_STRUCT_PAGE if SLUB | 104 | select HAVE_ALIGNED_STRUCT_PAGE if SLUB |
104 | select HAVE_ARCH_JUMP_LABEL if !MARCH_G5 | 105 | select HAVE_ARCH_JUMP_LABEL if !MARCH_G5 |
105 | select HAVE_ARCH_MUTEX_CPU_RELAX | ||
106 | select HAVE_ARCH_SECCOMP_FILTER | 106 | select HAVE_ARCH_SECCOMP_FILTER |
107 | select HAVE_ARCH_TRACEHOOK | 107 | select HAVE_ARCH_TRACEHOOK |
108 | select HAVE_ARCH_TRANSPARENT_HUGEPAGE if 64BIT | 108 | select HAVE_ARCH_TRANSPARENT_HUGEPAGE if 64BIT |
diff --git a/arch/s390/include/asm/mutex.h b/arch/s390/include/asm/mutex.h index 688271f5f2e4..458c1f7fbc18 100644 --- a/arch/s390/include/asm/mutex.h +++ b/arch/s390/include/asm/mutex.h | |||
@@ -7,5 +7,3 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <asm-generic/mutex-dec.h> | 9 | #include <asm-generic/mutex-dec.h> |
10 | |||
11 | #define arch_mutex_cpu_relax() barrier() | ||
diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h index 0eb37505cab1..ca7821f07260 100644 --- a/arch/s390/include/asm/processor.h +++ b/arch/s390/include/asm/processor.h | |||
@@ -198,6 +198,8 @@ static inline void cpu_relax(void) | |||
198 | barrier(); | 198 | barrier(); |
199 | } | 199 | } |
200 | 200 | ||
201 | #define arch_mutex_cpu_relax() barrier() | ||
202 | |||
201 | static inline void psw_set_key(unsigned int key) | 203 | static inline void psw_set_key(unsigned int key) |
202 | { | 204 | { |
203 | asm volatile("spka 0(%0)" : : "d" (key)); | 205 | asm volatile("spka 0(%0)" : : "d" (key)); |
diff --git a/arch/s390/include/asm/spinlock.h b/arch/s390/include/asm/spinlock.h index 701fe8c59e1f..83e5d216105e 100644 --- a/arch/s390/include/asm/spinlock.h +++ b/arch/s390/include/asm/spinlock.h | |||
@@ -44,6 +44,11 @@ extern void arch_spin_lock_wait_flags(arch_spinlock_t *, unsigned long flags); | |||
44 | extern int arch_spin_trylock_retry(arch_spinlock_t *); | 44 | extern int arch_spin_trylock_retry(arch_spinlock_t *); |
45 | extern void arch_spin_relax(arch_spinlock_t *lock); | 45 | extern void arch_spin_relax(arch_spinlock_t *lock); |
46 | 46 | ||
47 | static inline int arch_spin_value_unlocked(arch_spinlock_t lock) | ||
48 | { | ||
49 | return lock.owner_cpu == 0; | ||
50 | } | ||
51 | |||
47 | static inline void arch_spin_lock(arch_spinlock_t *lp) | 52 | static inline void arch_spin_lock(arch_spinlock_t *lp) |
48 | { | 53 | { |
49 | int old; | 54 | int old; |
diff --git a/arch/score/Kconfig b/arch/score/Kconfig index a1be70db75fe..305f7ee1f382 100644 --- a/arch/score/Kconfig +++ b/arch/score/Kconfig | |||
@@ -2,6 +2,7 @@ menu "Machine selection" | |||
2 | 2 | ||
3 | config SCORE | 3 | config SCORE |
4 | def_bool y | 4 | def_bool y |
5 | select HAVE_GENERIC_HARDIRQS | ||
5 | select GENERIC_IRQ_SHOW | 6 | select GENERIC_IRQ_SHOW |
6 | select GENERIC_IOMAP | 7 | select GENERIC_IOMAP |
7 | select GENERIC_ATOMIC64 | 8 | select GENERIC_ATOMIC64 |
@@ -110,3 +111,6 @@ source "security/Kconfig" | |||
110 | source "crypto/Kconfig" | 111 | source "crypto/Kconfig" |
111 | 112 | ||
112 | source "lib/Kconfig" | 113 | source "lib/Kconfig" |
114 | |||
115 | config NO_IOMEM | ||
116 | def_bool y | ||
diff --git a/arch/score/Makefile b/arch/score/Makefile index 974aefe86123..9e3e060290e0 100644 --- a/arch/score/Makefile +++ b/arch/score/Makefile | |||
@@ -20,8 +20,8 @@ cflags-y += -G0 -pipe -mel -mnhwloop -D__SCOREEL__ \ | |||
20 | # | 20 | # |
21 | KBUILD_AFLAGS += $(cflags-y) | 21 | KBUILD_AFLAGS += $(cflags-y) |
22 | KBUILD_CFLAGS += $(cflags-y) | 22 | KBUILD_CFLAGS += $(cflags-y) |
23 | KBUILD_AFLAGS_MODULE += -mlong-calls | 23 | KBUILD_AFLAGS_MODULE += |
24 | KBUILD_CFLAGS_MODULE += -mlong-calls | 24 | KBUILD_CFLAGS_MODULE += |
25 | LDFLAGS += --oformat elf32-littlescore | 25 | LDFLAGS += --oformat elf32-littlescore |
26 | LDFLAGS_vmlinux += -G0 -static -nostdlib | 26 | LDFLAGS_vmlinux += -G0 -static -nostdlib |
27 | 27 | ||
diff --git a/arch/score/include/asm/checksum.h b/arch/score/include/asm/checksum.h index f909ac3144a4..961bd64015a8 100644 --- a/arch/score/include/asm/checksum.h +++ b/arch/score/include/asm/checksum.h | |||
@@ -184,48 +184,57 @@ static inline __sum16 csum_ipv6_magic(const struct in6_addr *saddr, | |||
184 | __wsum sum) | 184 | __wsum sum) |
185 | { | 185 | { |
186 | __asm__ __volatile__( | 186 | __asm__ __volatile__( |
187 | ".set\tnoreorder\t\t\t# csum_ipv6_magic\n\t" | 187 | ".set\tvolatile\t\t\t# csum_ipv6_magic\n\t" |
188 | ".set\tnoat\n\t" | 188 | "add\t%0, %0, %5\t\t\t# proto (long in network byte order)\n\t" |
189 | "addu\t%0, %5\t\t\t# proto (long in network byte order)\n\t" | 189 | "cmp.c\t%5, %0\n\t" |
190 | "sltu\t$1, %0, %5\n\t" | 190 | "bleu 1f\n\t" |
191 | "addu\t%0, $1\n\t" | 191 | "addi\t%0, 0x1\n\t" |
192 | "addu\t%0, %6\t\t\t# csum\n\t" | 192 | "1:add\t%0, %0, %6\t\t\t# csum\n\t" |
193 | "sltu\t$1, %0, %6\n\t" | 193 | "cmp.c\t%6, %0\n\t" |
194 | "lw\t%1, 0(%2)\t\t\t# four words source address\n\t" | 194 | "lw\t%1, [%2, 0]\t\t\t# four words source address\n\t" |
195 | "addu\t%0, $1\n\t" | 195 | "bleu 1f\n\t" |
196 | "addu\t%0, %1\n\t" | 196 | "addi\t%0, 0x1\n\t" |
197 | "sltu\t$1, %0, %1\n\t" | 197 | "1:add\t%0, %0, %1\n\t" |
198 | "lw\t%1, 4(%2)\n\t" | 198 | "cmp.c\t%1, %0\n\t" |
199 | "addu\t%0, $1\n\t" | 199 | "1:lw\t%1, [%2, 4]\n\t" |
200 | "addu\t%0, %1\n\t" | 200 | "bleu 1f\n\t" |
201 | "sltu\t$1, %0, %1\n\t" | 201 | "addi\t%0, 0x1\n\t" |
202 | "lw\t%1, 8(%2)\n\t" | 202 | "1:add\t%0, %0, %1\n\t" |
203 | "addu\t%0, $1\n\t" | 203 | "cmp.c\t%1, %0\n\t" |
204 | "addu\t%0, %1\n\t" | 204 | "lw\t%1, [%2,8]\n\t" |
205 | "sltu\t$1, %0, %1\n\t" | 205 | "bleu 1f\n\t" |
206 | "lw\t%1, 12(%2)\n\t" | 206 | "addi\t%0, 0x1\n\t" |
207 | "addu\t%0, $1\n\t" | 207 | "1:add\t%0, %0, %1\n\t" |
208 | "addu\t%0, %1\n\t" | 208 | "cmp.c\t%1, %0\n\t" |
209 | "sltu\t$1, %0, %1\n\t" | 209 | "lw\t%1, [%2, 12]\n\t" |
210 | "lw\t%1, 0(%3)\n\t" | 210 | "bleu 1f\n\t" |
211 | "addu\t%0, $1\n\t" | 211 | "addi\t%0, 0x1\n\t" |
212 | "addu\t%0, %1\n\t" | 212 | "1:add\t%0, %0,%1\n\t" |
213 | "sltu\t$1, %0, %1\n\t" | 213 | "cmp.c\t%1, %0\n\t" |
214 | "lw\t%1, 4(%3)\n\t" | 214 | "lw\t%1, [%3, 0]\n\t" |
215 | "addu\t%0, $1\n\t" | 215 | "bleu 1f\n\t" |
216 | "addu\t%0, %1\n\t" | 216 | "addi\t%0, 0x1\n\t" |
217 | "sltu\t$1, %0, %1\n\t" | 217 | "1:add\t%0, %0, %1\n\t" |
218 | "lw\t%1, 8(%3)\n\t" | 218 | "cmp.c\t%1, %0\n\t" |
219 | "addu\t%0, $1\n\t" | 219 | "lw\t%1, [%3, 4]\n\t" |
220 | "addu\t%0, %1\n\t" | 220 | "bleu 1f\n\t" |
221 | "sltu\t$1, %0, %1\n\t" | 221 | "addi\t%0, 0x1\n\t" |
222 | "lw\t%1, 12(%3)\n\t" | 222 | "1:add\t%0, %0, %1\n\t" |
223 | "addu\t%0, $1\n\t" | 223 | "cmp.c\t%1, %0\n\t" |
224 | "addu\t%0, %1\n\t" | 224 | "lw\t%1, [%3, 8]\n\t" |
225 | "sltu\t$1, %0, %1\n\t" | 225 | "bleu 1f\n\t" |
226 | "addu\t%0, $1\t\t\t# Add final carry\n\t" | 226 | "addi\t%0, 0x1\n\t" |
227 | ".set\tnoat\n\t" | 227 | "1:add\t%0, %0, %1\n\t" |
228 | ".set\tnoreorder" | 228 | "cmp.c\t%1, %0\n\t" |
229 | "lw\t%1, [%3, 12]\n\t" | ||
230 | "bleu 1f\n\t" | ||
231 | "addi\t%0, 0x1\n\t" | ||
232 | "1:add\t%0, %0, %1\n\t" | ||
233 | "cmp.c\t%1, %0\n\t" | ||
234 | "bleu 1f\n\t" | ||
235 | "addi\t%0, 0x1\n\t" | ||
236 | "1:\n\t" | ||
237 | ".set\toptimize" | ||
229 | : "=r" (sum), "=r" (proto) | 238 | : "=r" (sum), "=r" (proto) |
230 | : "r" (saddr), "r" (daddr), | 239 | : "r" (saddr), "r" (daddr), |
231 | "0" (htonl(len)), "1" (htonl(proto)), "r" (sum)); | 240 | "0" (htonl(len)), "1" (htonl(proto)), "r" (sum)); |
diff --git a/arch/score/include/asm/io.h b/arch/score/include/asm/io.h index fbbfd7132e3b..574c8827abe2 100644 --- a/arch/score/include/asm/io.h +++ b/arch/score/include/asm/io.h | |||
@@ -5,5 +5,4 @@ | |||
5 | 5 | ||
6 | #define virt_to_bus virt_to_phys | 6 | #define virt_to_bus virt_to_phys |
7 | #define bus_to_virt phys_to_virt | 7 | #define bus_to_virt phys_to_virt |
8 | |||
9 | #endif /* _ASM_SCORE_IO_H */ | 8 | #endif /* _ASM_SCORE_IO_H */ |
diff --git a/arch/score/include/asm/pgalloc.h b/arch/score/include/asm/pgalloc.h index 059a61b7071b..716b3fd1d863 100644 --- a/arch/score/include/asm/pgalloc.h +++ b/arch/score/include/asm/pgalloc.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define _ASM_SCORE_PGALLOC_H | 2 | #define _ASM_SCORE_PGALLOC_H |
3 | 3 | ||
4 | #include <linux/mm.h> | 4 | #include <linux/mm.h> |
5 | 5 | #include <linux/highmem.h> | |
6 | static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, | 6 | static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, |
7 | pte_t *pte) | 7 | pte_t *pte) |
8 | { | 8 | { |
diff --git a/arch/score/kernel/entry.S b/arch/score/kernel/entry.S index 7234ed09b7b7..befb87d30a89 100644 --- a/arch/score/kernel/entry.S +++ b/arch/score/kernel/entry.S | |||
@@ -264,7 +264,7 @@ resume_kernel: | |||
264 | disable_irq | 264 | disable_irq |
265 | lw r8, [r28, TI_PRE_COUNT] | 265 | lw r8, [r28, TI_PRE_COUNT] |
266 | cmpz.c r8 | 266 | cmpz.c r8 |
267 | bne r8, restore_all | 267 | bne restore_all |
268 | need_resched: | 268 | need_resched: |
269 | lw r8, [r28, TI_FLAGS] | 269 | lw r8, [r28, TI_FLAGS] |
270 | andri.c r9, r8, _TIF_NEED_RESCHED | 270 | andri.c r9, r8, _TIF_NEED_RESCHED |
@@ -415,7 +415,7 @@ ENTRY(handle_sys) | |||
415 | sw r9, [r0, PT_EPC] | 415 | sw r9, [r0, PT_EPC] |
416 | 416 | ||
417 | cmpi.c r27, __NR_syscalls # check syscall number | 417 | cmpi.c r27, __NR_syscalls # check syscall number |
418 | bgeu illegal_syscall | 418 | bcs illegal_syscall |
419 | 419 | ||
420 | slli r8, r27, 2 # get syscall routine | 420 | slli r8, r27, 2 # get syscall routine |
421 | la r11, sys_call_table | 421 | la r11, sys_call_table |
diff --git a/arch/score/kernel/process.c b/arch/score/kernel/process.c index f4c6d02421d3..a1519ad3d49d 100644 --- a/arch/score/kernel/process.c +++ b/arch/score/kernel/process.c | |||
@@ -78,8 +78,8 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
78 | p->thread.reg0 = (unsigned long) childregs; | 78 | p->thread.reg0 = (unsigned long) childregs; |
79 | if (unlikely(p->flags & PF_KTHREAD)) { | 79 | if (unlikely(p->flags & PF_KTHREAD)) { |
80 | memset(childregs, 0, sizeof(struct pt_regs)); | 80 | memset(childregs, 0, sizeof(struct pt_regs)); |
81 | p->thread->reg12 = usp; | 81 | p->thread.reg12 = usp; |
82 | p->thread->reg13 = arg; | 82 | p->thread.reg13 = arg; |
83 | p->thread.reg3 = (unsigned long) ret_from_kernel_thread; | 83 | p->thread.reg3 = (unsigned long) ret_from_kernel_thread; |
84 | } else { | 84 | } else { |
85 | *childregs = *current_pt_regs(); | 85 | *childregs = *current_pt_regs(); |
diff --git a/arch/sparc/kernel/ds.c b/arch/sparc/kernel/ds.c index 62d6b153ffa2..4d9ac8406f32 100644 --- a/arch/sparc/kernel/ds.c +++ b/arch/sparc/kernel/ds.c | |||
@@ -851,7 +851,7 @@ void ldom_reboot(const char *boot_command) | |||
851 | 851 | ||
852 | strcpy(full_boot_str, "boot "); | 852 | strcpy(full_boot_str, "boot "); |
853 | strlcpy(full_boot_str + strlen("boot "), boot_command, | 853 | strlcpy(full_boot_str + strlen("boot "), boot_command, |
854 | sizeof(full_boot_str + strlen("boot "))); | 854 | sizeof(full_boot_str)); |
855 | len = strlen(full_boot_str); | 855 | len = strlen(full_boot_str); |
856 | 856 | ||
857 | if (reboot_data_supported) { | 857 | if (reboot_data_supported) { |
diff --git a/arch/x86/include/asm/xen/page.h b/arch/x86/include/asm/xen/page.h index 6aef9fbc09b7..b913915e8e63 100644 --- a/arch/x86/include/asm/xen/page.h +++ b/arch/x86/include/asm/xen/page.h | |||
@@ -79,30 +79,38 @@ static inline int phys_to_machine_mapping_valid(unsigned long pfn) | |||
79 | return get_phys_to_machine(pfn) != INVALID_P2M_ENTRY; | 79 | return get_phys_to_machine(pfn) != INVALID_P2M_ENTRY; |
80 | } | 80 | } |
81 | 81 | ||
82 | static inline unsigned long mfn_to_pfn(unsigned long mfn) | 82 | static inline unsigned long mfn_to_pfn_no_overrides(unsigned long mfn) |
83 | { | 83 | { |
84 | unsigned long pfn; | 84 | unsigned long pfn; |
85 | int ret = 0; | 85 | int ret; |
86 | 86 | ||
87 | if (xen_feature(XENFEAT_auto_translated_physmap)) | 87 | if (xen_feature(XENFEAT_auto_translated_physmap)) |
88 | return mfn; | 88 | return mfn; |
89 | 89 | ||
90 | if (unlikely(mfn >= machine_to_phys_nr)) { | 90 | if (unlikely(mfn >= machine_to_phys_nr)) |
91 | pfn = ~0; | 91 | return ~0; |
92 | goto try_override; | 92 | |
93 | } | ||
94 | pfn = 0; | ||
95 | /* | 93 | /* |
96 | * The array access can fail (e.g., device space beyond end of RAM). | 94 | * The array access can fail (e.g., device space beyond end of RAM). |
97 | * In such cases it doesn't matter what we return (we return garbage), | 95 | * In such cases it doesn't matter what we return (we return garbage), |
98 | * but we must handle the fault without crashing! | 96 | * but we must handle the fault without crashing! |
99 | */ | 97 | */ |
100 | ret = __get_user(pfn, &machine_to_phys_mapping[mfn]); | 98 | ret = __get_user(pfn, &machine_to_phys_mapping[mfn]); |
101 | try_override: | ||
102 | /* ret might be < 0 if there are no entries in the m2p for mfn */ | ||
103 | if (ret < 0) | 99 | if (ret < 0) |
104 | pfn = ~0; | 100 | return ~0; |
105 | else if (get_phys_to_machine(pfn) != mfn) | 101 | |
102 | return pfn; | ||
103 | } | ||
104 | |||
105 | static inline unsigned long mfn_to_pfn(unsigned long mfn) | ||
106 | { | ||
107 | unsigned long pfn; | ||
108 | |||
109 | if (xen_feature(XENFEAT_auto_translated_physmap)) | ||
110 | return mfn; | ||
111 | |||
112 | pfn = mfn_to_pfn_no_overrides(mfn); | ||
113 | if (get_phys_to_machine(pfn) != mfn) { | ||
106 | /* | 114 | /* |
107 | * If this appears to be a foreign mfn (because the pfn | 115 | * If this appears to be a foreign mfn (because the pfn |
108 | * doesn't map back to the mfn), then check the local override | 116 | * doesn't map back to the mfn), then check the local override |
@@ -111,6 +119,7 @@ try_override: | |||
111 | * m2p_find_override_pfn returns ~0 if it doesn't find anything. | 119 | * m2p_find_override_pfn returns ~0 if it doesn't find anything. |
112 | */ | 120 | */ |
113 | pfn = m2p_find_override_pfn(mfn, ~0); | 121 | pfn = m2p_find_override_pfn(mfn, ~0); |
122 | } | ||
114 | 123 | ||
115 | /* | 124 | /* |
116 | * pfn is ~0 if there are no entries in the m2p for mfn or if the | 125 | * pfn is ~0 if there are no entries in the m2p for mfn or if the |
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 8355c84b9729..897783b3302a 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
@@ -1506,7 +1506,7 @@ static int __init init_hw_perf_events(void) | |||
1506 | err = amd_pmu_init(); | 1506 | err = amd_pmu_init(); |
1507 | break; | 1507 | break; |
1508 | default: | 1508 | default: |
1509 | return 0; | 1509 | err = -ENOTSUPP; |
1510 | } | 1510 | } |
1511 | if (err != 0) { | 1511 | if (err != 0) { |
1512 | pr_cont("no PMU driver, software events only.\n"); | 1512 | pr_cont("no PMU driver, software events only.\n"); |
@@ -1883,9 +1883,9 @@ static struct pmu pmu = { | |||
1883 | 1883 | ||
1884 | void arch_perf_update_userpage(struct perf_event_mmap_page *userpg, u64 now) | 1884 | void arch_perf_update_userpage(struct perf_event_mmap_page *userpg, u64 now) |
1885 | { | 1885 | { |
1886 | userpg->cap_usr_time = 0; | 1886 | userpg->cap_user_time = 0; |
1887 | userpg->cap_usr_time_zero = 0; | 1887 | userpg->cap_user_time_zero = 0; |
1888 | userpg->cap_usr_rdpmc = x86_pmu.attr_rdpmc; | 1888 | userpg->cap_user_rdpmc = x86_pmu.attr_rdpmc; |
1889 | userpg->pmc_width = x86_pmu.cntval_bits; | 1889 | userpg->pmc_width = x86_pmu.cntval_bits; |
1890 | 1890 | ||
1891 | if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) | 1891 | if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) |
@@ -1894,13 +1894,13 @@ void arch_perf_update_userpage(struct perf_event_mmap_page *userpg, u64 now) | |||
1894 | if (!boot_cpu_has(X86_FEATURE_NONSTOP_TSC)) | 1894 | if (!boot_cpu_has(X86_FEATURE_NONSTOP_TSC)) |
1895 | return; | 1895 | return; |
1896 | 1896 | ||
1897 | userpg->cap_usr_time = 1; | 1897 | userpg->cap_user_time = 1; |
1898 | userpg->time_mult = this_cpu_read(cyc2ns); | 1898 | userpg->time_mult = this_cpu_read(cyc2ns); |
1899 | userpg->time_shift = CYC2NS_SCALE_FACTOR; | 1899 | userpg->time_shift = CYC2NS_SCALE_FACTOR; |
1900 | userpg->time_offset = this_cpu_read(cyc2ns_offset) - now; | 1900 | userpg->time_offset = this_cpu_read(cyc2ns_offset) - now; |
1901 | 1901 | ||
1902 | if (sched_clock_stable && !check_tsc_disabled()) { | 1902 | if (sched_clock_stable && !check_tsc_disabled()) { |
1903 | userpg->cap_usr_time_zero = 1; | 1903 | userpg->cap_user_time_zero = 1; |
1904 | userpg->time_zero = this_cpu_read(cyc2ns_offset); | 1904 | userpg->time_zero = this_cpu_read(cyc2ns_offset); |
1905 | } | 1905 | } |
1906 | } | 1906 | } |
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c index 9db76c31b3c3..f31a1655d1ff 100644 --- a/arch/x86/kernel/cpu/perf_event_intel.c +++ b/arch/x86/kernel/cpu/perf_event_intel.c | |||
@@ -2325,6 +2325,7 @@ __init int intel_pmu_init(void) | |||
2325 | break; | 2325 | break; |
2326 | 2326 | ||
2327 | case 55: /* Atom 22nm "Silvermont" */ | 2327 | case 55: /* Atom 22nm "Silvermont" */ |
2328 | case 77: /* Avoton "Silvermont" */ | ||
2328 | memcpy(hw_cache_event_ids, slm_hw_cache_event_ids, | 2329 | memcpy(hw_cache_event_ids, slm_hw_cache_event_ids, |
2329 | sizeof(hw_cache_event_ids)); | 2330 | sizeof(hw_cache_event_ids)); |
2330 | memcpy(hw_cache_extra_regs, slm_hw_cache_extra_regs, | 2331 | memcpy(hw_cache_extra_regs, slm_hw_cache_extra_regs, |
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c index 8ed44589b0e4..4118f9f68315 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c +++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c | |||
@@ -2706,14 +2706,14 @@ static void uncore_pmu_init_hrtimer(struct intel_uncore_box *box) | |||
2706 | box->hrtimer.function = uncore_pmu_hrtimer; | 2706 | box->hrtimer.function = uncore_pmu_hrtimer; |
2707 | } | 2707 | } |
2708 | 2708 | ||
2709 | struct intel_uncore_box *uncore_alloc_box(struct intel_uncore_type *type, int cpu) | 2709 | static struct intel_uncore_box *uncore_alloc_box(struct intel_uncore_type *type, int node) |
2710 | { | 2710 | { |
2711 | struct intel_uncore_box *box; | 2711 | struct intel_uncore_box *box; |
2712 | int i, size; | 2712 | int i, size; |
2713 | 2713 | ||
2714 | size = sizeof(*box) + type->num_shared_regs * sizeof(struct intel_uncore_extra_reg); | 2714 | size = sizeof(*box) + type->num_shared_regs * sizeof(struct intel_uncore_extra_reg); |
2715 | 2715 | ||
2716 | box = kzalloc_node(size, GFP_KERNEL, cpu_to_node(cpu)); | 2716 | box = kzalloc_node(size, GFP_KERNEL, node); |
2717 | if (!box) | 2717 | if (!box) |
2718 | return NULL; | 2718 | return NULL; |
2719 | 2719 | ||
@@ -3031,7 +3031,7 @@ static int uncore_validate_group(struct intel_uncore_pmu *pmu, | |||
3031 | struct intel_uncore_box *fake_box; | 3031 | struct intel_uncore_box *fake_box; |
3032 | int ret = -EINVAL, n; | 3032 | int ret = -EINVAL, n; |
3033 | 3033 | ||
3034 | fake_box = uncore_alloc_box(pmu->type, smp_processor_id()); | 3034 | fake_box = uncore_alloc_box(pmu->type, NUMA_NO_NODE); |
3035 | if (!fake_box) | 3035 | if (!fake_box) |
3036 | return -ENOMEM; | 3036 | return -ENOMEM; |
3037 | 3037 | ||
@@ -3294,7 +3294,7 @@ static int uncore_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id | |||
3294 | } | 3294 | } |
3295 | 3295 | ||
3296 | type = pci_uncores[UNCORE_PCI_DEV_TYPE(id->driver_data)]; | 3296 | type = pci_uncores[UNCORE_PCI_DEV_TYPE(id->driver_data)]; |
3297 | box = uncore_alloc_box(type, 0); | 3297 | box = uncore_alloc_box(type, NUMA_NO_NODE); |
3298 | if (!box) | 3298 | if (!box) |
3299 | return -ENOMEM; | 3299 | return -ENOMEM; |
3300 | 3300 | ||
@@ -3499,7 +3499,7 @@ static int uncore_cpu_prepare(int cpu, int phys_id) | |||
3499 | if (pmu->func_id < 0) | 3499 | if (pmu->func_id < 0) |
3500 | pmu->func_id = j; | 3500 | pmu->func_id = j; |
3501 | 3501 | ||
3502 | box = uncore_alloc_box(type, cpu); | 3502 | box = uncore_alloc_box(type, cpu_to_node(cpu)); |
3503 | if (!box) | 3503 | if (!box) |
3504 | return -ENOMEM; | 3504 | return -ENOMEM; |
3505 | 3505 | ||
diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c index 7123b5df479d..af99f71aeb7f 100644 --- a/arch/x86/kernel/microcode_amd.c +++ b/arch/x86/kernel/microcode_amd.c | |||
@@ -216,6 +216,7 @@ int apply_microcode_amd(int cpu) | |||
216 | /* need to apply patch? */ | 216 | /* need to apply patch? */ |
217 | if (rev >= mc_amd->hdr.patch_id) { | 217 | if (rev >= mc_amd->hdr.patch_id) { |
218 | c->microcode = rev; | 218 | c->microcode = rev; |
219 | uci->cpu_sig.rev = rev; | ||
219 | return 0; | 220 | return 0; |
220 | } | 221 | } |
221 | 222 | ||
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index 563ed91e6faa..e643e744e4d8 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c | |||
@@ -352,12 +352,28 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = { | |||
352 | }, | 352 | }, |
353 | { /* Handle problems with rebooting on the Precision M6600. */ | 353 | { /* Handle problems with rebooting on the Precision M6600. */ |
354 | .callback = set_pci_reboot, | 354 | .callback = set_pci_reboot, |
355 | .ident = "Dell OptiPlex 990", | 355 | .ident = "Dell Precision M6600", |
356 | .matches = { | 356 | .matches = { |
357 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | 357 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), |
358 | DMI_MATCH(DMI_PRODUCT_NAME, "Precision M6600"), | 358 | DMI_MATCH(DMI_PRODUCT_NAME, "Precision M6600"), |
359 | }, | 359 | }, |
360 | }, | 360 | }, |
361 | { /* Handle problems with rebooting on the Dell PowerEdge C6100. */ | ||
362 | .callback = set_pci_reboot, | ||
363 | .ident = "Dell PowerEdge C6100", | ||
364 | .matches = { | ||
365 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
366 | DMI_MATCH(DMI_PRODUCT_NAME, "C6100"), | ||
367 | }, | ||
368 | }, | ||
369 | { /* Some C6100 machines were shipped with vendor being 'Dell'. */ | ||
370 | .callback = set_pci_reboot, | ||
371 | .ident = "Dell PowerEdge C6100", | ||
372 | .matches = { | ||
373 | DMI_MATCH(DMI_SYS_VENDOR, "Dell"), | ||
374 | DMI_MATCH(DMI_PRODUCT_NAME, "C6100"), | ||
375 | }, | ||
376 | }, | ||
361 | { } | 377 | { } |
362 | }; | 378 | }; |
363 | 379 | ||
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index a1216de9ffda..3b8e7459dd4d 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -5345,7 +5345,9 @@ static int handle_ept_violation(struct kvm_vcpu *vcpu) | |||
5345 | * There are errata that may cause this bit to not be set: | 5345 | * There are errata that may cause this bit to not be set: |
5346 | * AAK134, BY25. | 5346 | * AAK134, BY25. |
5347 | */ | 5347 | */ |
5348 | if (exit_qualification & INTR_INFO_UNBLOCK_NMI) | 5348 | if (!(to_vmx(vcpu)->idt_vectoring_info & VECTORING_INFO_VALID_MASK) && |
5349 | cpu_has_virtual_nmis() && | ||
5350 | (exit_qualification & INTR_INFO_UNBLOCK_NMI)) | ||
5349 | vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO, GUEST_INTR_STATE_NMI); | 5351 | vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO, GUEST_INTR_STATE_NMI); |
5350 | 5352 | ||
5351 | gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS); | 5353 | gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS); |
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index 90f6ed127096..c7e22ab29a5a 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c | |||
@@ -912,10 +912,13 @@ void __init efi_enter_virtual_mode(void) | |||
912 | 912 | ||
913 | for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) { | 913 | for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) { |
914 | md = p; | 914 | md = p; |
915 | if (!(md->attribute & EFI_MEMORY_RUNTIME) && | 915 | if (!(md->attribute & EFI_MEMORY_RUNTIME)) { |
916 | md->type != EFI_BOOT_SERVICES_CODE && | 916 | #ifdef CONFIG_X86_64 |
917 | md->type != EFI_BOOT_SERVICES_DATA) | 917 | if (md->type != EFI_BOOT_SERVICES_CODE && |
918 | continue; | 918 | md->type != EFI_BOOT_SERVICES_DATA) |
919 | #endif | ||
920 | continue; | ||
921 | } | ||
919 | 922 | ||
920 | size = md->num_pages << EFI_PAGE_SHIFT; | 923 | size = md->num_pages << EFI_PAGE_SHIFT; |
921 | end = md->phys_addr + size; | 924 | end = md->phys_addr + size; |
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c index 8b901e8d782d..a61c7d5811be 100644 --- a/arch/x86/xen/p2m.c +++ b/arch/x86/xen/p2m.c | |||
@@ -879,7 +879,6 @@ int m2p_add_override(unsigned long mfn, struct page *page, | |||
879 | unsigned long uninitialized_var(address); | 879 | unsigned long uninitialized_var(address); |
880 | unsigned level; | 880 | unsigned level; |
881 | pte_t *ptep = NULL; | 881 | pte_t *ptep = NULL; |
882 | int ret = 0; | ||
883 | 882 | ||
884 | pfn = page_to_pfn(page); | 883 | pfn = page_to_pfn(page); |
885 | if (!PageHighMem(page)) { | 884 | if (!PageHighMem(page)) { |
@@ -926,8 +925,8 @@ int m2p_add_override(unsigned long mfn, struct page *page, | |||
926 | * frontend pages while they are being shared with the backend, | 925 | * frontend pages while they are being shared with the backend, |
927 | * because mfn_to_pfn (that ends up being called by GUPF) will | 926 | * because mfn_to_pfn (that ends up being called by GUPF) will |
928 | * return the backend pfn rather than the frontend pfn. */ | 927 | * return the backend pfn rather than the frontend pfn. */ |
929 | ret = __get_user(pfn, &machine_to_phys_mapping[mfn]); | 928 | pfn = mfn_to_pfn_no_overrides(mfn); |
930 | if (ret == 0 && get_phys_to_machine(pfn) == mfn) | 929 | if (get_phys_to_machine(pfn) == mfn) |
931 | set_phys_to_machine(pfn, FOREIGN_FRAME(mfn)); | 930 | set_phys_to_machine(pfn, FOREIGN_FRAME(mfn)); |
932 | 931 | ||
933 | return 0; | 932 | return 0; |
@@ -942,7 +941,6 @@ int m2p_remove_override(struct page *page, | |||
942 | unsigned long uninitialized_var(address); | 941 | unsigned long uninitialized_var(address); |
943 | unsigned level; | 942 | unsigned level; |
944 | pte_t *ptep = NULL; | 943 | pte_t *ptep = NULL; |
945 | int ret = 0; | ||
946 | 944 | ||
947 | pfn = page_to_pfn(page); | 945 | pfn = page_to_pfn(page); |
948 | mfn = get_phys_to_machine(pfn); | 946 | mfn = get_phys_to_machine(pfn); |
@@ -1029,8 +1027,8 @@ int m2p_remove_override(struct page *page, | |||
1029 | * the original pfn causes mfn_to_pfn(mfn) to return the frontend | 1027 | * the original pfn causes mfn_to_pfn(mfn) to return the frontend |
1030 | * pfn again. */ | 1028 | * pfn again. */ |
1031 | mfn &= ~FOREIGN_FRAME_BIT; | 1029 | mfn &= ~FOREIGN_FRAME_BIT; |
1032 | ret = __get_user(pfn, &machine_to_phys_mapping[mfn]); | 1030 | pfn = mfn_to_pfn_no_overrides(mfn); |
1033 | if (ret == 0 && get_phys_to_machine(pfn) == FOREIGN_FRAME(mfn) && | 1031 | if (get_phys_to_machine(pfn) == FOREIGN_FRAME(mfn) && |
1034 | m2p_find_override(mfn) == NULL) | 1032 | m2p_find_override(mfn) == NULL) |
1035 | set_phys_to_machine(pfn, mfn); | 1033 | set_phys_to_machine(pfn, mfn); |
1036 | 1034 | ||
diff --git a/arch/x86/xen/spinlock.c b/arch/x86/xen/spinlock.c index 253f63fceea1..be6b86078957 100644 --- a/arch/x86/xen/spinlock.c +++ b/arch/x86/xen/spinlock.c | |||
@@ -259,6 +259,14 @@ void xen_uninit_lock_cpu(int cpu) | |||
259 | } | 259 | } |
260 | 260 | ||
261 | 261 | ||
262 | /* | ||
263 | * Our init of PV spinlocks is split in two init functions due to us | ||
264 | * using paravirt patching and jump labels patching and having to do | ||
265 | * all of this before SMP code is invoked. | ||
266 | * | ||
267 | * The paravirt patching needs to be done _before_ the alternative asm code | ||
268 | * is started, otherwise we would not patch the core kernel code. | ||
269 | */ | ||
262 | void __init xen_init_spinlocks(void) | 270 | void __init xen_init_spinlocks(void) |
263 | { | 271 | { |
264 | 272 | ||
@@ -267,12 +275,26 @@ void __init xen_init_spinlocks(void) | |||
267 | return; | 275 | return; |
268 | } | 276 | } |
269 | 277 | ||
270 | static_key_slow_inc(¶virt_ticketlocks_enabled); | ||
271 | |||
272 | pv_lock_ops.lock_spinning = PV_CALLEE_SAVE(xen_lock_spinning); | 278 | pv_lock_ops.lock_spinning = PV_CALLEE_SAVE(xen_lock_spinning); |
273 | pv_lock_ops.unlock_kick = xen_unlock_kick; | 279 | pv_lock_ops.unlock_kick = xen_unlock_kick; |
274 | } | 280 | } |
275 | 281 | ||
282 | /* | ||
283 | * While the jump_label init code needs to happend _after_ the jump labels are | ||
284 | * enabled and before SMP is started. Hence we use pre-SMP initcall level | ||
285 | * init. We cannot do it in xen_init_spinlocks as that is done before | ||
286 | * jump labels are activated. | ||
287 | */ | ||
288 | static __init int xen_init_spinlocks_jump(void) | ||
289 | { | ||
290 | if (!xen_pvspin) | ||
291 | return 0; | ||
292 | |||
293 | static_key_slow_inc(¶virt_ticketlocks_enabled); | ||
294 | return 0; | ||
295 | } | ||
296 | early_initcall(xen_init_spinlocks_jump); | ||
297 | |||
276 | static __init int xen_parse_nopvspin(char *arg) | 298 | static __init int xen_parse_nopvspin(char *arg) |
277 | { | 299 | { |
278 | xen_pvspin = false; | 300 | xen_pvspin = false; |