aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-01-21 04:39:51 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-21 04:39:51 -0500
commit198030782cedf25391e67e7c88b04f87a5eb6563 (patch)
tree5b7368c6bf052bcb4bb273497a57900720d36f51 /arch
parent4ec71fa2d2c3f1040348f2604f4b8ccc833d1c2e (diff)
parent92181f190b649f7ef2b79cbf5c00f26ccc66da2a (diff)
Merge branch 'x86/mm' into core/percpu
Conflicts: arch/x86/mm/fault.c
Diffstat (limited to 'arch')
-rw-r--r--arch/Kconfig3
-rw-r--r--arch/alpha/include/asm/Kbuild1
-rw-r--r--arch/alpha/include/asm/byteorder.h1
-rw-r--r--arch/alpha/include/asm/machvec.h4
-rw-r--r--arch/alpha/include/asm/pgalloc.h7
-rw-r--r--arch/alpha/include/asm/rtc.h12
-rw-r--r--arch/alpha/kernel/.gitignore1
-rw-r--r--arch/alpha/kernel/core_marvel.c10
-rw-r--r--arch/alpha/kernel/entry.S8
-rw-r--r--arch/alpha/kernel/irq_srm.c2
-rw-r--r--arch/alpha/kernel/machvec_impl.h5
-rw-r--r--arch/alpha/kernel/proto.h2
-rw-r--r--arch/alpha/kernel/sys_jensen.c2
-rw-r--r--arch/alpha/kernel/sys_marvel.c56
-rw-r--r--arch/alpha/kernel/sys_nautilus.c4
-rw-r--r--arch/alpha/kernel/systbls.S2
-rw-r--r--arch/alpha/kernel/time.c10
-rw-r--r--arch/alpha/mm/init.c7
-rw-r--r--arch/arm/include/asm/Kbuild1
-rw-r--r--arch/arm/include/asm/byteorder.h2
-rw-r--r--arch/arm/kernel/calls.S2
-rw-r--r--arch/avr32/include/asm/Kbuild1
-rw-r--r--arch/avr32/include/asm/byteorder.h1
-rw-r--r--arch/blackfin/include/asm/Kbuild1
-rw-r--r--arch/blackfin/include/asm/byteorder.h1
-rw-r--r--arch/cris/arch-v10/kernel/entry.S2
-rw-r--r--arch/cris/arch-v32/kernel/entry.S2
-rw-r--r--arch/cris/include/arch-v10/arch/swab.h (renamed from arch/cris/include/arch-v10/arch/byteorder.h)16
-rw-r--r--arch/cris/include/arch-v32/arch/byteorder.h20
-rw-r--r--arch/cris/include/arch-v32/arch/swab.h24
-rw-r--r--arch/cris/include/asm/byteorder.h19
-rw-r--r--arch/cris/include/asm/swab.h8
-rw-r--r--arch/h8300/include/asm/Kbuild1
-rw-r--r--arch/h8300/include/asm/byteorder.h1
-rw-r--r--arch/h8300/kernel/syscalls.S2
-rw-r--r--arch/ia64/Kconfig1
-rw-r--r--arch/ia64/configs/generic_defconfig2
-rw-r--r--arch/ia64/ia32/ia32_entry.S2
-rw-r--r--arch/ia64/include/asm/Kbuild1
-rw-r--r--arch/ia64/include/asm/byteorder.h1
-rw-r--r--arch/ia64/include/asm/dma-mapping.h2
-rw-r--r--arch/ia64/include/asm/machvec.h7
-rw-r--r--arch/ia64/include/asm/machvec_init.h1
-rw-r--r--arch/ia64/include/asm/machvec_sn2.h2
-rw-r--r--arch/ia64/include/asm/unistd.h2
-rw-r--r--arch/ia64/kernel/entry.S2
-rw-r--r--arch/ia64/kernel/kprobes.c2
-rw-r--r--arch/ia64/kernel/sys_ia64.c2
-rw-r--r--arch/ia64/kernel/unaligned.c6
-rw-r--r--arch/ia64/pci/pci.c27
-rw-r--r--arch/ia64/sn/pci/pci_dma.c6
-rw-r--r--arch/ia64/xen/time.c4
-rw-r--r--arch/m68k/kernel/entry.S2
-rw-r--r--arch/m68knommu/include/asm/Kbuild2
-rw-r--r--arch/m68knommu/include/asm/byteorder.h1
-rw-r--r--arch/m68knommu/kernel/syscalltable.S2
-rw-r--r--arch/mips/include/asm/Kbuild1
-rw-r--r--arch/mips/include/asm/byteorder.h2
-rw-r--r--arch/mips/kernel/scall32-o32.S2
-rw-r--r--arch/mn10300/kernel/entry.S2
-rw-r--r--arch/parisc/include/asm/Kbuild1
-rw-r--r--arch/parisc/include/asm/byteorder.h1
-rw-r--r--arch/powerpc/Kconfig1
-rw-r--r--arch/powerpc/boot/dts/mpc8315erdb.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8544ds.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8572ds.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts2
-rw-r--r--arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts2
-rw-r--r--arch/powerpc/configs/ppc64_defconfig26
-rw-r--r--arch/powerpc/include/asm/Kbuild1
-rw-r--r--arch/powerpc/include/asm/byteorder.h2
-rw-r--r--arch/powerpc/include/asm/ps3.h8
-rw-r--r--arch/powerpc/include/asm/qe.h19
-rw-r--r--arch/powerpc/include/asm/rtas.h2
-rw-r--r--arch/powerpc/include/asm/systbl.h2
-rw-r--r--arch/powerpc/include/asm/types.h7
-rw-r--r--arch/powerpc/kernel/asm-offsets.c7
-rw-r--r--arch/powerpc/kernel/cacheinfo.c10
-rw-r--r--arch/powerpc/kernel/dma-iommu.c4
-rw-r--r--arch/powerpc/kernel/head_64.S9
-rw-r--r--arch/powerpc/kernel/head_fsl_booke.S8
-rw-r--r--arch/powerpc/kernel/iommu.c12
-rw-r--r--arch/powerpc/kernel/lparcfg.c10
-rw-r--r--arch/powerpc/kernel/machine_kexec.c25
-rw-r--r--arch/powerpc/kernel/pci_64.c6
-rw-r--r--arch/powerpc/kernel/prom.c5
-rw-r--r--arch/powerpc/kernel/setup_64.c6
-rw-r--r--arch/powerpc/kernel/vmlinux.lds.S4
-rw-r--r--arch/powerpc/mm/fsl_booke_mmu.c9
-rw-r--r--arch/powerpc/mm/mmu_decl.h11
-rw-r--r--arch/powerpc/mm/slice.c11
-rw-r--r--arch/powerpc/mm/stab.c4
-rw-r--r--arch/powerpc/oprofile/op_model_pa6t.c6
-rw-r--r--arch/powerpc/platforms/512x/clock.c4
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_gpio.c3
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_pic.c8
-rw-r--r--arch/powerpc/platforms/83xx/Makefile1
-rw-r--r--arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c209
-rw-r--r--arch/powerpc/platforms/Kconfig11
-rw-r--r--arch/powerpc/platforms/cell/beat_interrupt.c2
-rw-r--r--arch/powerpc/platforms/cell/celleb_scc_epci.c4
-rw-r--r--arch/powerpc/platforms/cell/iommu.c4
-rw-r--r--arch/powerpc/platforms/cell/ras.c8
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c4
-rw-r--r--arch/powerpc/platforms/cell/spu_callbacks.c2
-rw-r--r--arch/powerpc/platforms/cell/spufs/coredump.c2
-rw-r--r--arch/powerpc/platforms/cell/spufs/fault.c2
-rw-r--r--arch/powerpc/platforms/cell/spufs/file.c6
-rw-r--r--arch/powerpc/platforms/fsl_uli1575.c1
-rw-r--r--arch/powerpc/platforms/iseries/iommu.c4
-rw-r--r--arch/powerpc/platforms/powermac/smp.c2
-rw-r--r--arch/powerpc/platforms/ps3/device-init.c26
-rw-r--r--arch/powerpc/platforms/ps3/htab.c2
-rw-r--r--arch/powerpc/platforms/ps3/interrupt.c28
-rw-r--r--arch/powerpc/platforms/ps3/mm.c97
-rw-r--r--arch/powerpc/platforms/ps3/os-area.c2
-rw-r--r--arch/powerpc/platforms/ps3/repository.c22
-rw-r--r--arch/powerpc/platforms/ps3/setup.c2
-rw-r--r--arch/powerpc/platforms/ps3/spu.c12
-rw-r--r--arch/powerpc/platforms/ps3/system-bus.c14
-rw-r--r--arch/powerpc/platforms/pseries/iommu.c35
-rw-r--r--arch/powerpc/sysdev/fsl_pci.c107
-rw-r--r--arch/powerpc/sysdev/mpic.c2
-rw-r--r--arch/s390/Kconfig1
-rw-r--r--arch/s390/include/asm/Kbuild1
-rw-r--r--arch/s390/include/asm/byteorder.h1
-rw-r--r--arch/s390/kernel/compat_wrapper.S4
-rw-r--r--arch/s390/kernel/entry.h16
-rw-r--r--arch/s390/kernel/process.c9
-rw-r--r--arch/s390/kernel/signal.c19
-rw-r--r--arch/s390/kernel/sys_s390.c35
-rw-r--r--arch/s390/kernel/syscalls.S12
-rw-r--r--arch/sh/include/asm/Kbuild1
-rw-r--r--arch/sh/include/asm/byteorder.h2
-rw-r--r--arch/sh/include/asm/syscalls_32.h6
-rw-r--r--arch/sh/kernel/sys_sh32.c2
-rw-r--r--arch/sh/kernel/syscalls_32.S4
-rw-r--r--arch/sh/kernel/syscalls_64.S2
-rw-r--r--arch/sparc/include/asm/Kbuild1
-rw-r--r--arch/sparc/include/asm/byteorder.h1
-rw-r--r--arch/sparc/kernel/entry.S4
-rw-r--r--arch/sparc/kernel/sparc_ksyms_64.c11
-rw-r--r--arch/sparc/kernel/syscalls.S2
-rw-r--r--arch/sparc/kernel/systbls_32.S4
-rw-r--r--arch/sparc/kernel/systbls_64.S4
-rw-r--r--arch/x86/Kconfig.cpu4
-rw-r--r--arch/x86/include/asm/Kbuild1
-rw-r--r--arch/x86/include/asm/byteorder.h1
-rw-r--r--arch/x86/kernel/kprobes.c2
-rw-r--r--arch/x86/kernel/syscall_table_32.S2
-rw-r--r--arch/x86/mm/fault.c450
-rw-r--r--arch/x86/mm/pageattr.c10
-rw-r--r--arch/x86/mm/pat.c45
-rw-r--r--arch/x86/mm/tlb.c16
-rw-r--r--arch/xtensa/include/asm/Kbuild2
-rw-r--r--arch/xtensa/include/asm/byteorder.h2
156 files changed, 1189 insertions, 672 deletions
diff --git a/arch/Kconfig b/arch/Kconfig
index 2e13aa261929..550dab22daa1 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -62,6 +62,9 @@ config HAVE_EFFICIENT_UNALIGNED_ACCESS
62 See Documentation/unaligned-memory-access.txt for more 62 See Documentation/unaligned-memory-access.txt for more
63 information on the topic of unaligned memory accesses. 63 information on the topic of unaligned memory accesses.
64 64
65config HAVE_SYSCALL_WRAPPERS
66 bool
67
65config KRETPROBES 68config KRETPROBES
66 def_bool y 69 def_bool y
67 depends on KPROBES && HAVE_KRETPROBES 70 depends on KPROBES && HAVE_KRETPROBES
diff --git a/arch/alpha/include/asm/Kbuild b/arch/alpha/include/asm/Kbuild
index 4dad27360576..b7c8f188b313 100644
--- a/arch/alpha/include/asm/Kbuild
+++ b/arch/alpha/include/asm/Kbuild
@@ -9,4 +9,3 @@ unifdef-y += console.h
9unifdef-y += fpu.h 9unifdef-y += fpu.h
10unifdef-y += sysinfo.h 10unifdef-y += sysinfo.h
11unifdef-y += compiler.h 11unifdef-y += compiler.h
12unifdef-y += swab.h
diff --git a/arch/alpha/include/asm/byteorder.h b/arch/alpha/include/asm/byteorder.h
index 6772f3168701..73683093202d 100644
--- a/arch/alpha/include/asm/byteorder.h
+++ b/arch/alpha/include/asm/byteorder.h
@@ -1,7 +1,6 @@
1#ifndef _ALPHA_BYTEORDER_H 1#ifndef _ALPHA_BYTEORDER_H
2#define _ALPHA_BYTEORDER_H 2#define _ALPHA_BYTEORDER_H
3 3
4#include <asm/swab.h>
5#include <linux/byteorder/little_endian.h> 4#include <linux/byteorder/little_endian.h>
6 5
7#endif /* _ALPHA_BYTEORDER_H */ 6#endif /* _ALPHA_BYTEORDER_H */
diff --git a/arch/alpha/include/asm/machvec.h b/arch/alpha/include/asm/machvec.h
index a86c083cdf7f..fea4ea75b79d 100644
--- a/arch/alpha/include/asm/machvec.h
+++ b/arch/alpha/include/asm/machvec.h
@@ -21,6 +21,7 @@ struct pci_dev;
21struct pci_ops; 21struct pci_ops;
22struct pci_controller; 22struct pci_controller;
23struct _alpha_agp_info; 23struct _alpha_agp_info;
24struct rtc_time;
24 25
25struct alpha_machine_vector 26struct alpha_machine_vector
26{ 27{
@@ -94,6 +95,9 @@ struct alpha_machine_vector
94 95
95 struct _alpha_agp_info *(*agp_info)(void); 96 struct _alpha_agp_info *(*agp_info)(void);
96 97
98 unsigned int (*rtc_get_time)(struct rtc_time *);
99 int (*rtc_set_time)(struct rtc_time *);
100
97 const char *vector_name; 101 const char *vector_name;
98 102
99 /* NUMA information */ 103 /* NUMA information */
diff --git a/arch/alpha/include/asm/pgalloc.h b/arch/alpha/include/asm/pgalloc.h
index fd090155dccd..bc2a0daf2d92 100644
--- a/arch/alpha/include/asm/pgalloc.h
+++ b/arch/alpha/include/asm/pgalloc.h
@@ -50,7 +50,12 @@ pmd_free(struct mm_struct *mm, pmd_t *pmd)
50 free_page((unsigned long)pmd); 50 free_page((unsigned long)pmd);
51} 51}
52 52
53extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr); 53static inline pte_t *
54pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
55{
56 pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
57 return pte;
58}
54 59
55static inline void 60static inline void
56pte_free_kernel(struct mm_struct *mm, pte_t *pte) 61pte_free_kernel(struct mm_struct *mm, pte_t *pte)
diff --git a/arch/alpha/include/asm/rtc.h b/arch/alpha/include/asm/rtc.h
index 4e854b1333eb..1f7fba671ae6 100644
--- a/arch/alpha/include/asm/rtc.h
+++ b/arch/alpha/include/asm/rtc.h
@@ -1,9 +1,15 @@
1#ifndef _ALPHA_RTC_H 1#ifndef _ALPHA_RTC_H
2#define _ALPHA_RTC_H 2#define _ALPHA_RTC_H
3 3
4/* 4#if defined(CONFIG_ALPHA_GENERIC)
5 * Alpha uses the default access methods for the RTC. 5# define get_rtc_time alpha_mv.rtc_get_time
6 */ 6# define set_rtc_time alpha_mv.rtc_set_time
7#else
8# if defined(CONFIG_ALPHA_MARVEL) && defined(CONFIG_SMP)
9# define get_rtc_time marvel_get_rtc_time
10# define set_rtc_time marvel_set_rtc_time
11# endif
12#endif
7 13
8#include <asm-generic/rtc.h> 14#include <asm-generic/rtc.h>
9 15
diff --git a/arch/alpha/kernel/.gitignore b/arch/alpha/kernel/.gitignore
new file mode 100644
index 000000000000..c5f676c3c224
--- /dev/null
+++ b/arch/alpha/kernel/.gitignore
@@ -0,0 +1 @@
vmlinux.lds
diff --git a/arch/alpha/kernel/core_marvel.c b/arch/alpha/kernel/core_marvel.c
index 9cd8dca742a7..e302daecbe56 100644
--- a/arch/alpha/kernel/core_marvel.c
+++ b/arch/alpha/kernel/core_marvel.c
@@ -658,16 +658,8 @@ __marvel_rtc_io(u8 b, unsigned long addr, int write)
658 rtc_access.data = bcd2bin(b); 658 rtc_access.data = bcd2bin(b);
659 rtc_access.function = 0x48 + !write; /* GET/PUT_TOY */ 659 rtc_access.function = 0x48 + !write; /* GET/PUT_TOY */
660 660
661#ifdef CONFIG_SMP
662 if (smp_processor_id() != boot_cpuid)
663 smp_call_function_single(boot_cpuid,
664 __marvel_access_rtc,
665 &rtc_access, 1);
666 else
667 __marvel_access_rtc(&rtc_access);
668#else
669 __marvel_access_rtc(&rtc_access); 661 __marvel_access_rtc(&rtc_access);
670#endif 662
671 ret = bin2bcd(rtc_access.data); 663 ret = bin2bcd(rtc_access.data);
672 break; 664 break;
673 665
diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S
index f77345bc66a9..aa2e50cf9857 100644
--- a/arch/alpha/kernel/entry.S
+++ b/arch/alpha/kernel/entry.S
@@ -896,9 +896,9 @@ sys_getxpid:
896.end sys_getxpid 896.end sys_getxpid
897 897
898 .align 4 898 .align 4
899 .globl sys_pipe 899 .globl sys_alpha_pipe
900 .ent sys_pipe 900 .ent sys_alpha_pipe
901sys_pipe: 901sys_alpha_pipe:
902 lda $sp, -16($sp) 902 lda $sp, -16($sp)
903 stq $26, 0($sp) 903 stq $26, 0($sp)
904 .prologue 0 904 .prologue 0
@@ -916,7 +916,7 @@ sys_pipe:
916 stq $1, 80+16($sp) 916 stq $1, 80+16($sp)
9171: lda $sp, 16($sp) 9171: lda $sp, 16($sp)
918 ret 918 ret
919.end sys_pipe 919.end sys_alpha_pipe
920 920
921 .align 4 921 .align 4
922 .globl sys_execve 922 .globl sys_execve
diff --git a/arch/alpha/kernel/irq_srm.c b/arch/alpha/kernel/irq_srm.c
index 32212014fbe9..a03fbca4940e 100644
--- a/arch/alpha/kernel/irq_srm.c
+++ b/arch/alpha/kernel/irq_srm.c
@@ -63,6 +63,8 @@ init_srm_irqs(long max, unsigned long ignore_mask)
63{ 63{
64 long i; 64 long i;
65 65
66 if (NR_IRQS <= 16)
67 return;
66 for (i = 16; i < max; ++i) { 68 for (i = 16; i < max; ++i) {
67 if (i < 64 && ((ignore_mask >> i) & 1)) 69 if (i < 64 && ((ignore_mask >> i) & 1))
68 continue; 70 continue;
diff --git a/arch/alpha/kernel/machvec_impl.h b/arch/alpha/kernel/machvec_impl.h
index 466c9dff8181..512685f78097 100644
--- a/arch/alpha/kernel/machvec_impl.h
+++ b/arch/alpha/kernel/machvec_impl.h
@@ -40,7 +40,10 @@
40#define CAT1(x,y) x##y 40#define CAT1(x,y) x##y
41#define CAT(x,y) CAT1(x,y) 41#define CAT(x,y) CAT1(x,y)
42 42
43#define DO_DEFAULT_RTC .rtc_port = 0x70 43#define DO_DEFAULT_RTC \
44 .rtc_port = 0x70, \
45 .rtc_get_time = common_get_rtc_time, \
46 .rtc_set_time = common_set_rtc_time
44 47
45#define DO_EV4_MMU \ 48#define DO_EV4_MMU \
46 .max_asn = EV4_MAX_ASN, \ 49 .max_asn = EV4_MAX_ASN, \
diff --git a/arch/alpha/kernel/proto.h b/arch/alpha/kernel/proto.h
index 708d5ca87782..fe14c6747cd6 100644
--- a/arch/alpha/kernel/proto.h
+++ b/arch/alpha/kernel/proto.h
@@ -145,6 +145,8 @@ extern void smp_percpu_timer_interrupt(struct pt_regs *);
145extern irqreturn_t timer_interrupt(int irq, void *dev); 145extern irqreturn_t timer_interrupt(int irq, void *dev);
146extern void common_init_rtc(void); 146extern void common_init_rtc(void);
147extern unsigned long est_cycle_freq; 147extern unsigned long est_cycle_freq;
148extern unsigned int common_get_rtc_time(struct rtc_time *time);
149extern int common_set_rtc_time(struct rtc_time *time);
148 150
149/* smc37c93x.c */ 151/* smc37c93x.c */
150extern void SMC93x_Init(void); 152extern void SMC93x_Init(void);
diff --git a/arch/alpha/kernel/sys_jensen.c b/arch/alpha/kernel/sys_jensen.c
index 2c3de97de46c..e2516f9a8967 100644
--- a/arch/alpha/kernel/sys_jensen.c
+++ b/arch/alpha/kernel/sys_jensen.c
@@ -261,6 +261,8 @@ struct alpha_machine_vector jensen_mv __initmv = {
261 .machine_check = jensen_machine_check, 261 .machine_check = jensen_machine_check,
262 .max_isa_dma_address = ALPHA_MAX_ISA_DMA_ADDRESS, 262 .max_isa_dma_address = ALPHA_MAX_ISA_DMA_ADDRESS,
263 .rtc_port = 0x170, 263 .rtc_port = 0x170,
264 .rtc_get_time = common_get_rtc_time,
265 .rtc_set_time = common_set_rtc_time,
264 266
265 .nr_irqs = 16, 267 .nr_irqs = 16,
266 .device_interrupt = jensen_device_interrupt, 268 .device_interrupt = jensen_device_interrupt,
diff --git a/arch/alpha/kernel/sys_marvel.c b/arch/alpha/kernel/sys_marvel.c
index 828449cd2636..c5a1a2438c67 100644
--- a/arch/alpha/kernel/sys_marvel.c
+++ b/arch/alpha/kernel/sys_marvel.c
@@ -23,6 +23,7 @@
23#include <asm/hwrpb.h> 23#include <asm/hwrpb.h>
24#include <asm/tlbflush.h> 24#include <asm/tlbflush.h>
25#include <asm/vga.h> 25#include <asm/vga.h>
26#include <asm/rtc.h>
26 27
27#include "proto.h" 28#include "proto.h"
28#include "err_impl.h" 29#include "err_impl.h"
@@ -426,6 +427,57 @@ marvel_init_rtc(void)
426 init_rtc_irq(); 427 init_rtc_irq();
427} 428}
428 429
430struct marvel_rtc_time {
431 struct rtc_time *time;
432 int retval;
433};
434
435#ifdef CONFIG_SMP
436static void
437smp_get_rtc_time(void *data)
438{
439 struct marvel_rtc_time *mrt = data;
440 mrt->retval = __get_rtc_time(mrt->time);
441}
442
443static void
444smp_set_rtc_time(void *data)
445{
446 struct marvel_rtc_time *mrt = data;
447 mrt->retval = __set_rtc_time(mrt->time);
448}
449#endif
450
451static unsigned int
452marvel_get_rtc_time(struct rtc_time *time)
453{
454#ifdef CONFIG_SMP
455 struct marvel_rtc_time mrt;
456
457 if (smp_processor_id() != boot_cpuid) {
458 mrt.time = time;
459 smp_call_function_single(boot_cpuid, smp_get_rtc_time, &mrt, 1);
460 return mrt.retval;
461 }
462#endif
463 return __get_rtc_time(time);
464}
465
466static int
467marvel_set_rtc_time(struct rtc_time *time)
468{
469#ifdef CONFIG_SMP
470 struct marvel_rtc_time mrt;
471
472 if (smp_processor_id() != boot_cpuid) {
473 mrt.time = time;
474 smp_call_function_single(boot_cpuid, smp_set_rtc_time, &mrt, 1);
475 return mrt.retval;
476 }
477#endif
478 return __set_rtc_time(time);
479}
480
429static void 481static void
430marvel_smp_callin(void) 482marvel_smp_callin(void)
431{ 483{
@@ -466,7 +518,9 @@ marvel_smp_callin(void)
466struct alpha_machine_vector marvel_ev7_mv __initmv = { 518struct alpha_machine_vector marvel_ev7_mv __initmv = {
467 .vector_name = "MARVEL/EV7", 519 .vector_name = "MARVEL/EV7",
468 DO_EV7_MMU, 520 DO_EV7_MMU,
469 DO_DEFAULT_RTC, 521 .rtc_port = 0x70,
522 .rtc_get_time = marvel_get_rtc_time,
523 .rtc_set_time = marvel_set_rtc_time,
470 DO_MARVEL_IO, 524 DO_MARVEL_IO,
471 .machine_check = marvel_machine_check, 525 .machine_check = marvel_machine_check,
472 .max_isa_dma_address = ALPHA_MAX_ISA_DMA_ADDRESS, 526 .max_isa_dma_address = ALPHA_MAX_ISA_DMA_ADDRESS,
diff --git a/arch/alpha/kernel/sys_nautilus.c b/arch/alpha/kernel/sys_nautilus.c
index a7f23b5ab814..99c0f46f6b9c 100644
--- a/arch/alpha/kernel/sys_nautilus.c
+++ b/arch/alpha/kernel/sys_nautilus.c
@@ -245,6 +245,10 @@ nautilus_init_pci(void)
245 IRONGATE0->pci_mem = pci_mem; 245 IRONGATE0->pci_mem = pci_mem;
246 246
247 pci_bus_assign_resources(bus); 247 pci_bus_assign_resources(bus);
248
249 /* pci_common_swizzle() relies on bus->self being NULL
250 for the root bus, so just clear it. */
251 bus->self = NULL;
248 pci_fixup_irqs(alpha_mv.pci_swizzle, alpha_mv.pci_map_irq); 252 pci_fixup_irqs(alpha_mv.pci_swizzle, alpha_mv.pci_map_irq);
249} 253}
250 254
diff --git a/arch/alpha/kernel/systbls.S b/arch/alpha/kernel/systbls.S
index ba914af18c4f..9d9e3a98bb95 100644
--- a/arch/alpha/kernel/systbls.S
+++ b/arch/alpha/kernel/systbls.S
@@ -52,7 +52,7 @@ sys_call_table:
52 .quad sys_setpgid 52 .quad sys_setpgid
53 .quad alpha_ni_syscall /* 40 */ 53 .quad alpha_ni_syscall /* 40 */
54 .quad sys_dup 54 .quad sys_dup
55 .quad sys_pipe 55 .quad sys_alpha_pipe
56 .quad osf_set_program_attributes 56 .quad osf_set_program_attributes
57 .quad alpha_ni_syscall 57 .quad alpha_ni_syscall
58 .quad sys_open /* 45 */ 58 .quad sys_open /* 45 */
diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c
index e6a231435cba..b04e2cbf23a4 100644
--- a/arch/alpha/kernel/time.c
+++ b/arch/alpha/kernel/time.c
@@ -46,6 +46,7 @@
46#include <asm/io.h> 46#include <asm/io.h>
47#include <asm/hwrpb.h> 47#include <asm/hwrpb.h>
48#include <asm/8253pit.h> 48#include <asm/8253pit.h>
49#include <asm/rtc.h>
49 50
50#include <linux/mc146818rtc.h> 51#include <linux/mc146818rtc.h>
51#include <linux/time.h> 52#include <linux/time.h>
@@ -180,6 +181,15 @@ common_init_rtc(void)
180 init_rtc_irq(); 181 init_rtc_irq();
181} 182}
182 183
184unsigned int common_get_rtc_time(struct rtc_time *time)
185{
186 return __get_rtc_time(time);
187}
188
189int common_set_rtc_time(struct rtc_time *time)
190{
191 return __set_rtc_time(time);
192}
183 193
184/* Validate a computed cycle counter result against the known bounds for 194/* Validate a computed cycle counter result against the known bounds for
185 the given processor core. There's too much brokenness in the way of 195 the given processor core. There's too much brokenness in the way of
diff --git a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c
index 234e42b8ee74..5d7a16eab312 100644
--- a/arch/alpha/mm/init.c
+++ b/arch/alpha/mm/init.c
@@ -59,13 +59,6 @@ pgd_alloc(struct mm_struct *mm)
59 return ret; 59 return ret;
60} 60}
61 61
62pte_t *
63pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
64{
65 pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
66 return pte;
67}
68
69 62
70/* 63/*
71 * BAD_PAGE is the page that is used for page faults when linux 64 * BAD_PAGE is the page that is used for page faults when linux
diff --git a/arch/arm/include/asm/Kbuild b/arch/arm/include/asm/Kbuild
index 43b0b2ba392f..73237bd130a2 100644
--- a/arch/arm/include/asm/Kbuild
+++ b/arch/arm/include/asm/Kbuild
@@ -1,4 +1,3 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2 2
3unifdef-y += hwcap.h 3unifdef-y += hwcap.h
4unifdef-y += swab.h
diff --git a/arch/arm/include/asm/byteorder.h b/arch/arm/include/asm/byteorder.h
index c02b6fc28e1a..77379748b171 100644
--- a/arch/arm/include/asm/byteorder.h
+++ b/arch/arm/include/asm/byteorder.h
@@ -15,8 +15,6 @@
15#ifndef __ASM_ARM_BYTEORDER_H 15#ifndef __ASM_ARM_BYTEORDER_H
16#define __ASM_ARM_BYTEORDER_H 16#define __ASM_ARM_BYTEORDER_H
17 17
18#include <asm/swab.h>
19
20#ifdef __ARMEB__ 18#ifdef __ARMEB__
21#include <linux/byteorder/big_endian.h> 19#include <linux/byteorder/big_endian.h>
22#else 20#else
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S
index 09a061cb7838..9ca8d13f05f7 100644
--- a/arch/arm/kernel/calls.S
+++ b/arch/arm/kernel/calls.S
@@ -98,7 +98,7 @@
98 CALL(sys_uselib) 98 CALL(sys_uselib)
99 CALL(sys_swapon) 99 CALL(sys_swapon)
100 CALL(sys_reboot) 100 CALL(sys_reboot)
101 CALL(OBSOLETE(old_readdir)) /* used by libc4 */ 101 CALL(OBSOLETE(sys_old_readdir)) /* used by libc4 */
102/* 90 */ CALL(OBSOLETE(old_mmap)) /* used by libc4 */ 102/* 90 */ CALL(OBSOLETE(old_mmap)) /* used by libc4 */
103 CALL(sys_munmap) 103 CALL(sys_munmap)
104 CALL(sys_truncate) 104 CALL(sys_truncate)
diff --git a/arch/avr32/include/asm/Kbuild b/arch/avr32/include/asm/Kbuild
index 219822c8ad18..3136628ba8d2 100644
--- a/arch/avr32/include/asm/Kbuild
+++ b/arch/avr32/include/asm/Kbuild
@@ -1,4 +1,3 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2 2
3header-y += swab.h
4header-y += cachectl.h 3header-y += cachectl.h
diff --git a/arch/avr32/include/asm/byteorder.h b/arch/avr32/include/asm/byteorder.h
index 2aba64b4e122..50abc21619a8 100644
--- a/arch/avr32/include/asm/byteorder.h
+++ b/arch/avr32/include/asm/byteorder.h
@@ -4,7 +4,6 @@
4#ifndef __ASM_AVR32_BYTEORDER_H 4#ifndef __ASM_AVR32_BYTEORDER_H
5#define __ASM_AVR32_BYTEORDER_H 5#define __ASM_AVR32_BYTEORDER_H
6 6
7#include <asm/swab.h>
8#include <linux/byteorder/big_endian.h> 7#include <linux/byteorder/big_endian.h>
9 8
10#endif /* __ASM_AVR32_BYTEORDER_H */ 9#endif /* __ASM_AVR32_BYTEORDER_H */
diff --git a/arch/blackfin/include/asm/Kbuild b/arch/blackfin/include/asm/Kbuild
index d0d1ac435544..606ecfdcc962 100644
--- a/arch/blackfin/include/asm/Kbuild
+++ b/arch/blackfin/include/asm/Kbuild
@@ -1,4 +1,3 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2 2
3unifdef-y += fixed_code.h 3unifdef-y += fixed_code.h
4unifdef-y += swab.h
diff --git a/arch/blackfin/include/asm/byteorder.h b/arch/blackfin/include/asm/byteorder.h
index b9e797a497b4..3e69106a4d37 100644
--- a/arch/blackfin/include/asm/byteorder.h
+++ b/arch/blackfin/include/asm/byteorder.h
@@ -1,7 +1,6 @@
1#ifndef _BLACKFIN_BYTEORDER_H 1#ifndef _BLACKFIN_BYTEORDER_H
2#define _BLACKFIN_BYTEORDER_H 2#define _BLACKFIN_BYTEORDER_H
3 3
4#include <asm/swab.h>
5#include <linux/byteorder/little_endian.h> 4#include <linux/byteorder/little_endian.h>
6 5
7#endif /* _BLACKFIN_BYTEORDER_H */ 6#endif /* _BLACKFIN_BYTEORDER_H */
diff --git a/arch/cris/arch-v10/kernel/entry.S b/arch/cris/arch-v10/kernel/entry.S
index ed171d389e65..72f5cd319b97 100644
--- a/arch/cris/arch-v10/kernel/entry.S
+++ b/arch/cris/arch-v10/kernel/entry.S
@@ -691,7 +691,7 @@ sys_call_table:
691 .long sys_uselib 691 .long sys_uselib
692 .long sys_swapon 692 .long sys_swapon
693 .long sys_reboot 693 .long sys_reboot
694 .long old_readdir 694 .long sys_old_readdir
695 .long old_mmap /* 90 */ 695 .long old_mmap /* 90 */
696 .long sys_munmap 696 .long sys_munmap
697 .long sys_truncate 697 .long sys_truncate
diff --git a/arch/cris/arch-v32/kernel/entry.S b/arch/cris/arch-v32/kernel/entry.S
index 7f6f93e6b70e..5e674c8f7c51 100644
--- a/arch/cris/arch-v32/kernel/entry.S
+++ b/arch/cris/arch-v32/kernel/entry.S
@@ -614,7 +614,7 @@ sys_call_table:
614 .long sys_uselib 614 .long sys_uselib
615 .long sys_swapon 615 .long sys_swapon
616 .long sys_reboot 616 .long sys_reboot
617 .long old_readdir 617 .long sys_old_readdir
618 .long old_mmap /* 90 */ 618 .long old_mmap /* 90 */
619 .long sys_munmap 619 .long sys_munmap
620 .long sys_truncate 620 .long sys_truncate
diff --git a/arch/cris/include/arch-v10/arch/byteorder.h b/arch/cris/include/arch-v10/arch/swab.h
index 255b646b7fa8..e4e847d8a05e 100644
--- a/arch/cris/include/arch-v10/arch/byteorder.h
+++ b/arch/cris/include/arch-v10/arch/swab.h
@@ -1,26 +1,30 @@
1#ifndef _CRIS_ARCH_BYTEORDER_H 1#ifndef _CRIS_ARCH_SWAB_H
2#define _CRIS_ARCH_BYTEORDER_H 2#define _CRIS_ARCH_SWAB_H
3 3
4#include <asm/types.h> 4#include <asm/types.h>
5#include <linux/compiler.h> 5#include <linux/compiler.h>
6 6
7#define __SWAB_64_THRU_32__
8
7/* we just define these two (as we can do the swap in a single 9/* we just define these two (as we can do the swap in a single
8 * asm instruction in CRIS) and the arch-independent files will put 10 * asm instruction in CRIS) and the arch-independent files will put
9 * them together into ntohl etc. 11 * them together into ntohl etc.
10 */ 12 */
11 13
12static inline __attribute_const__ __u32 ___arch__swab32(__u32 x) 14static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
13{ 15{
14 __asm__ ("swapwb %0" : "=r" (x) : "0" (x)); 16 __asm__ ("swapwb %0" : "=r" (x) : "0" (x));
15 17
16 return(x); 18 return(x);
17} 19}
20#define __arch_swab32 __arch_swab32
18 21
19static inline __attribute_const__ __u16 ___arch__swab16(__u16 x) 22static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
20{ 23{
21 __asm__ ("swapb %0" : "=r" (x) : "0" (x)); 24 __asm__ ("swapb %0" : "=r" (x) : "0" (x));
22 25
23 return(x); 26 return(x);
24} 27}
28#define __arch_swab16 __arch_swab16
25 29
26#endif 30#endif
diff --git a/arch/cris/include/arch-v32/arch/byteorder.h b/arch/cris/include/arch-v32/arch/byteorder.h
deleted file mode 100644
index 6ef8fb4a35f2..000000000000
--- a/arch/cris/include/arch-v32/arch/byteorder.h
+++ /dev/null
@@ -1,20 +0,0 @@
1#ifndef _ASM_CRIS_ARCH_BYTEORDER_H
2#define _ASM_CRIS_ARCH_BYTEORDER_H
3
4#include <asm/types.h>
5
6static inline __const__ __u32
7___arch__swab32(__u32 x)
8{
9 __asm__ __volatile__ ("swapwb %0" : "=r" (x) : "0" (x));
10 return (x);
11}
12
13static inline __const__ __u16
14___arch__swab16(__u16 x)
15{
16 __asm__ __volatile__ ("swapb %0" : "=r" (x) : "0" (x));
17 return (x);
18}
19
20#endif /* _ASM_CRIS_ARCH_BYTEORDER_H */
diff --git a/arch/cris/include/arch-v32/arch/swab.h b/arch/cris/include/arch-v32/arch/swab.h
new file mode 100644
index 000000000000..9a4ea5e209c2
--- /dev/null
+++ b/arch/cris/include/arch-v32/arch/swab.h
@@ -0,0 +1,24 @@
1#ifndef _ASM_CRIS_ARCH_SWAB_H
2#define _ASM_CRIS_ARCH_SWAB_H
3
4#include <asm/types.h>
5
6#define __SWAB_64_THRU_32__
7
8static inline __const__ __u32
9__arch_swab32(__u32 x)
10{
11 __asm__ __volatile__ ("swapwb %0" : "=r" (x) : "0" (x));
12 return (x);
13}
14#define __arch_swab32 __arch_swab32
15
16static inline __const__ __u16
17__arch_swab16(__u16 x)
18{
19 __asm__ __volatile__ ("swapb %0" : "=r" (x) : "0" (x));
20 return (x);
21}
22#define __arch_swab16 __arch_swab16
23
24#endif /* _ASM_CRIS_ARCH_SWAB_H */
diff --git a/arch/cris/include/asm/byteorder.h b/arch/cris/include/asm/byteorder.h
index cc8e418cfd14..bcd189798e26 100644
--- a/arch/cris/include/asm/byteorder.h
+++ b/arch/cris/include/asm/byteorder.h
@@ -1,25 +1,6 @@
1#ifndef _CRIS_BYTEORDER_H 1#ifndef _CRIS_BYTEORDER_H
2#define _CRIS_BYTEORDER_H 2#define _CRIS_BYTEORDER_H
3 3
4#ifdef __GNUC__
5
6#ifdef __KERNEL__
7#include <arch/byteorder.h>
8
9/* defines are necessary because the other files detect the presence
10 * of a defined __arch_swab32, not an inline
11 */
12#define __arch__swab32(x) ___arch__swab32(x)
13#define __arch__swab16(x) ___arch__swab16(x)
14#endif /* __KERNEL__ */
15
16#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
17# define __BYTEORDER_HAS_U64__
18# define __SWAB_64_THRU_32__
19#endif
20
21#endif /* __GNUC__ */
22
23#include <linux/byteorder/little_endian.h> 4#include <linux/byteorder/little_endian.h>
24 5
25#endif 6#endif
diff --git a/arch/cris/include/asm/swab.h b/arch/cris/include/asm/swab.h
new file mode 100644
index 000000000000..80668e88419c
--- /dev/null
+++ b/arch/cris/include/asm/swab.h
@@ -0,0 +1,8 @@
1#ifndef _CRIS_SWAB_H
2#define _CRIS_SWAB_H
3
4#ifdef __KERNEL__
5#include <arch/swab.h>
6#endif /* __KERNEL__ */
7
8#endif /* _CRIS_SWAB_H */
diff --git a/arch/h8300/include/asm/Kbuild b/arch/h8300/include/asm/Kbuild
index 27b108a86b39..c68e1680da01 100644
--- a/arch/h8300/include/asm/Kbuild
+++ b/arch/h8300/include/asm/Kbuild
@@ -1,2 +1 @@
1include include/asm-generic/Kbuild.asm include include/asm-generic/Kbuild.asm
2unifdef-y += swab.h
diff --git a/arch/h8300/include/asm/byteorder.h b/arch/h8300/include/asm/byteorder.h
index c36b80a3dd84..13539da99efd 100644
--- a/arch/h8300/include/asm/byteorder.h
+++ b/arch/h8300/include/asm/byteorder.h
@@ -1,7 +1,6 @@
1#ifndef _H8300_BYTEORDER_H 1#ifndef _H8300_BYTEORDER_H
2#define _H8300_BYTEORDER_H 2#define _H8300_BYTEORDER_H
3 3
4#include <asm/swab.h>
5#include <linux/byteorder/big_endian.h> 4#include <linux/byteorder/big_endian.h>
6 5
7#endif /* _H8300_BYTEORDER_H */ 6#endif /* _H8300_BYTEORDER_H */
diff --git a/arch/h8300/kernel/syscalls.S b/arch/h8300/kernel/syscalls.S
index 54e21c3f2057..4eb67faac633 100644
--- a/arch/h8300/kernel/syscalls.S
+++ b/arch/h8300/kernel/syscalls.S
@@ -103,7 +103,7 @@ SYMBOL_NAME_LABEL(sys_call_table)
103 .long SYMBOL_NAME(sys_uselib) 103 .long SYMBOL_NAME(sys_uselib)
104 .long SYMBOL_NAME(sys_swapon) 104 .long SYMBOL_NAME(sys_swapon)
105 .long SYMBOL_NAME(sys_reboot) 105 .long SYMBOL_NAME(sys_reboot)
106 .long SYMBOL_NAME(old_readdir) 106 .long SYMBOL_NAME(sys_old_readdir)
107 .long SYMBOL_NAME(old_mmap) /* 90 */ 107 .long SYMBOL_NAME(old_mmap) /* 90 */
108 .long SYMBOL_NAME(sys_munmap) 108 .long SYMBOL_NAME(sys_munmap)
109 .long SYMBOL_NAME(sys_truncate) 109 .long SYMBOL_NAME(sys_truncate)
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 3d31636cbafb..6183aeccecf1 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -17,6 +17,7 @@ config IA64
17 select ACPI if (!IA64_HP_SIM) 17 select ACPI if (!IA64_HP_SIM)
18 select PM if (!IA64_HP_SIM) 18 select PM if (!IA64_HP_SIM)
19 select ARCH_SUPPORTS_MSI 19 select ARCH_SUPPORTS_MSI
20 select HAVE_UNSTABLE_SCHED_CLOCK
20 select HAVE_IDE 21 select HAVE_IDE
21 select HAVE_OPROFILE 22 select HAVE_OPROFILE
22 select HAVE_KPROBES 23 select HAVE_KPROBES
diff --git a/arch/ia64/configs/generic_defconfig b/arch/ia64/configs/generic_defconfig
index 27eb67604c53..a109db30ce55 100644
--- a/arch/ia64/configs/generic_defconfig
+++ b/arch/ia64/configs/generic_defconfig
@@ -578,7 +578,7 @@ CONFIG_ATA_PIIX=y
578# CONFIG_SATA_SIS is not set 578# CONFIG_SATA_SIS is not set
579# CONFIG_SATA_ULI is not set 579# CONFIG_SATA_ULI is not set
580# CONFIG_SATA_VIA is not set 580# CONFIG_SATA_VIA is not set
581# CONFIG_SATA_VITESSE is not set 581CONFIG_SATA_VITESSE=y
582# CONFIG_SATA_INIC162X is not set 582# CONFIG_SATA_INIC162X is not set
583# CONFIG_PATA_ACPI is not set 583# CONFIG_PATA_ACPI is not set
584# CONFIG_PATA_ALI is not set 584# CONFIG_PATA_ALI is not set
diff --git a/arch/ia64/ia32/ia32_entry.S b/arch/ia64/ia32/ia32_entry.S
index a8cf19958850..a46f8395e9a5 100644
--- a/arch/ia64/ia32/ia32_entry.S
+++ b/arch/ia64/ia32/ia32_entry.S
@@ -220,7 +220,7 @@ ia32_syscall_table:
220 data8 sys_mkdir 220 data8 sys_mkdir
221 data8 sys_rmdir /* 40 */ 221 data8 sys_rmdir /* 40 */
222 data8 sys_dup 222 data8 sys_dup
223 data8 sys_pipe 223 data8 sys_ia64_pipe
224 data8 compat_sys_times 224 data8 compat_sys_times
225 data8 sys_ni_syscall /* old prof syscall holder */ 225 data8 sys_ni_syscall /* old prof syscall holder */
226 data8 sys32_brk /* 45 */ 226 data8 sys32_brk /* 45 */
diff --git a/arch/ia64/include/asm/Kbuild b/arch/ia64/include/asm/Kbuild
index 3b25bd9dca91..ccbe8ae47a61 100644
--- a/arch/ia64/include/asm/Kbuild
+++ b/arch/ia64/include/asm/Kbuild
@@ -14,4 +14,3 @@ unifdef-y += gcc_intrin.h
14unifdef-y += intrinsics.h 14unifdef-y += intrinsics.h
15unifdef-y += perfmon.h 15unifdef-y += perfmon.h
16unifdef-y += ustack.h 16unifdef-y += ustack.h
17unifdef-y += swab.h
diff --git a/arch/ia64/include/asm/byteorder.h b/arch/ia64/include/asm/byteorder.h
index 0f84c5cb703d..a8dd73558150 100644
--- a/arch/ia64/include/asm/byteorder.h
+++ b/arch/ia64/include/asm/byteorder.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_IA64_BYTEORDER_H 1#ifndef _ASM_IA64_BYTEORDER_H
2#define _ASM_IA64_BYTEORDER_H 2#define _ASM_IA64_BYTEORDER_H
3 3
4#include <asm/swab.h>
5#include <linux/byteorder/little_endian.h> 4#include <linux/byteorder/little_endian.h>
6 5
7#endif /* _ASM_IA64_BYTEORDER_H */ 6#endif /* _ASM_IA64_BYTEORDER_H */
diff --git a/arch/ia64/include/asm/dma-mapping.h b/arch/ia64/include/asm/dma-mapping.h
index bbab7e2b0fc9..1f912d927585 100644
--- a/arch/ia64/include/asm/dma-mapping.h
+++ b/arch/ia64/include/asm/dma-mapping.h
@@ -9,6 +9,8 @@
9#include <linux/scatterlist.h> 9#include <linux/scatterlist.h>
10#include <asm/swiotlb.h> 10#include <asm/swiotlb.h>
11 11
12#define ARCH_HAS_DMA_GET_REQUIRED_MASK
13
12struct dma_mapping_ops { 14struct dma_mapping_ops {
13 int (*mapping_error)(struct device *dev, 15 int (*mapping_error)(struct device *dev,
14 dma_addr_t dma_addr); 16 dma_addr_t dma_addr);
diff --git a/arch/ia64/include/asm/machvec.h b/arch/ia64/include/asm/machvec.h
index 59c17e446683..fe87b2121707 100644
--- a/arch/ia64/include/asm/machvec.h
+++ b/arch/ia64/include/asm/machvec.h
@@ -62,6 +62,7 @@ typedef dma_addr_t ia64_mv_dma_map_single_attrs (struct device *, void *, size_t
62typedef void ia64_mv_dma_unmap_single_attrs (struct device *, dma_addr_t, size_t, int, struct dma_attrs *); 62typedef void ia64_mv_dma_unmap_single_attrs (struct device *, dma_addr_t, size_t, int, struct dma_attrs *);
63typedef int ia64_mv_dma_map_sg_attrs (struct device *, struct scatterlist *, int, int, struct dma_attrs *); 63typedef int ia64_mv_dma_map_sg_attrs (struct device *, struct scatterlist *, int, int, struct dma_attrs *);
64typedef void ia64_mv_dma_unmap_sg_attrs (struct device *, struct scatterlist *, int, int, struct dma_attrs *); 64typedef void ia64_mv_dma_unmap_sg_attrs (struct device *, struct scatterlist *, int, int, struct dma_attrs *);
65typedef u64 ia64_mv_dma_get_required_mask (struct device *);
65 66
66/* 67/*
67 * WARNING: The legacy I/O space is _architected_. Platforms are 68 * WARNING: The legacy I/O space is _architected_. Platforms are
@@ -159,6 +160,7 @@ extern void machvec_tlb_migrate_finish (struct mm_struct *);
159# define platform_dma_sync_sg_for_device ia64_mv.dma_sync_sg_for_device 160# define platform_dma_sync_sg_for_device ia64_mv.dma_sync_sg_for_device
160# define platform_dma_mapping_error ia64_mv.dma_mapping_error 161# define platform_dma_mapping_error ia64_mv.dma_mapping_error
161# define platform_dma_supported ia64_mv.dma_supported 162# define platform_dma_supported ia64_mv.dma_supported
163# define platform_dma_get_required_mask ia64_mv.dma_get_required_mask
162# define platform_irq_to_vector ia64_mv.irq_to_vector 164# define platform_irq_to_vector ia64_mv.irq_to_vector
163# define platform_local_vector_to_irq ia64_mv.local_vector_to_irq 165# define platform_local_vector_to_irq ia64_mv.local_vector_to_irq
164# define platform_pci_get_legacy_mem ia64_mv.pci_get_legacy_mem 166# define platform_pci_get_legacy_mem ia64_mv.pci_get_legacy_mem
@@ -213,6 +215,7 @@ struct ia64_machine_vector {
213 ia64_mv_dma_sync_sg_for_device *dma_sync_sg_for_device; 215 ia64_mv_dma_sync_sg_for_device *dma_sync_sg_for_device;
214 ia64_mv_dma_mapping_error *dma_mapping_error; 216 ia64_mv_dma_mapping_error *dma_mapping_error;
215 ia64_mv_dma_supported *dma_supported; 217 ia64_mv_dma_supported *dma_supported;
218 ia64_mv_dma_get_required_mask *dma_get_required_mask;
216 ia64_mv_irq_to_vector *irq_to_vector; 219 ia64_mv_irq_to_vector *irq_to_vector;
217 ia64_mv_local_vector_to_irq *local_vector_to_irq; 220 ia64_mv_local_vector_to_irq *local_vector_to_irq;
218 ia64_mv_pci_get_legacy_mem_t *pci_get_legacy_mem; 221 ia64_mv_pci_get_legacy_mem_t *pci_get_legacy_mem;
@@ -263,6 +266,7 @@ struct ia64_machine_vector {
263 platform_dma_sync_sg_for_device, \ 266 platform_dma_sync_sg_for_device, \
264 platform_dma_mapping_error, \ 267 platform_dma_mapping_error, \
265 platform_dma_supported, \ 268 platform_dma_supported, \
269 platform_dma_get_required_mask, \
266 platform_irq_to_vector, \ 270 platform_irq_to_vector, \
267 platform_local_vector_to_irq, \ 271 platform_local_vector_to_irq, \
268 platform_pci_get_legacy_mem, \ 272 platform_pci_get_legacy_mem, \
@@ -366,6 +370,9 @@ extern void machvec_init_from_cmdline(const char *cmdline);
366#ifndef platform_dma_supported 370#ifndef platform_dma_supported
367# define platform_dma_supported swiotlb_dma_supported 371# define platform_dma_supported swiotlb_dma_supported
368#endif 372#endif
373#ifndef platform_dma_get_required_mask
374# define platform_dma_get_required_mask ia64_dma_get_required_mask
375#endif
369#ifndef platform_irq_to_vector 376#ifndef platform_irq_to_vector
370# define platform_irq_to_vector __ia64_irq_to_vector 377# define platform_irq_to_vector __ia64_irq_to_vector
371#endif 378#endif
diff --git a/arch/ia64/include/asm/machvec_init.h b/arch/ia64/include/asm/machvec_init.h
index ef964b286842..37a469849ab9 100644
--- a/arch/ia64/include/asm/machvec_init.h
+++ b/arch/ia64/include/asm/machvec_init.h
@@ -3,6 +3,7 @@
3 3
4extern ia64_mv_send_ipi_t ia64_send_ipi; 4extern ia64_mv_send_ipi_t ia64_send_ipi;
5extern ia64_mv_global_tlb_purge_t ia64_global_tlb_purge; 5extern ia64_mv_global_tlb_purge_t ia64_global_tlb_purge;
6extern ia64_mv_dma_get_required_mask ia64_dma_get_required_mask;
6extern ia64_mv_irq_to_vector __ia64_irq_to_vector; 7extern ia64_mv_irq_to_vector __ia64_irq_to_vector;
7extern ia64_mv_local_vector_to_irq __ia64_local_vector_to_irq; 8extern ia64_mv_local_vector_to_irq __ia64_local_vector_to_irq;
8extern ia64_mv_pci_get_legacy_mem_t ia64_pci_get_legacy_mem; 9extern ia64_mv_pci_get_legacy_mem_t ia64_pci_get_legacy_mem;
diff --git a/arch/ia64/include/asm/machvec_sn2.h b/arch/ia64/include/asm/machvec_sn2.h
index 781308ea7b88..f1a6e0d6dfa5 100644
--- a/arch/ia64/include/asm/machvec_sn2.h
+++ b/arch/ia64/include/asm/machvec_sn2.h
@@ -67,6 +67,7 @@ extern ia64_mv_dma_sync_single_for_device sn_dma_sync_single_for_device;
67extern ia64_mv_dma_sync_sg_for_device sn_dma_sync_sg_for_device; 67extern ia64_mv_dma_sync_sg_for_device sn_dma_sync_sg_for_device;
68extern ia64_mv_dma_mapping_error sn_dma_mapping_error; 68extern ia64_mv_dma_mapping_error sn_dma_mapping_error;
69extern ia64_mv_dma_supported sn_dma_supported; 69extern ia64_mv_dma_supported sn_dma_supported;
70extern ia64_mv_dma_get_required_mask sn_dma_get_required_mask;
70extern ia64_mv_migrate_t sn_migrate; 71extern ia64_mv_migrate_t sn_migrate;
71extern ia64_mv_kernel_launch_event_t sn_kernel_launch_event; 72extern ia64_mv_kernel_launch_event_t sn_kernel_launch_event;
72extern ia64_mv_setup_msi_irq_t sn_setup_msi_irq; 73extern ia64_mv_setup_msi_irq_t sn_setup_msi_irq;
@@ -123,6 +124,7 @@ extern ia64_mv_pci_fixup_bus_t sn_pci_fixup_bus;
123#define platform_dma_sync_sg_for_device sn_dma_sync_sg_for_device 124#define platform_dma_sync_sg_for_device sn_dma_sync_sg_for_device
124#define platform_dma_mapping_error sn_dma_mapping_error 125#define platform_dma_mapping_error sn_dma_mapping_error
125#define platform_dma_supported sn_dma_supported 126#define platform_dma_supported sn_dma_supported
127#define platform_dma_get_required_mask sn_dma_get_required_mask
126#define platform_migrate sn_migrate 128#define platform_migrate sn_migrate
127#define platform_kernel_launch_event sn_kernel_launch_event 129#define platform_kernel_launch_event sn_kernel_launch_event
128#ifdef CONFIG_PCI_MSI 130#ifdef CONFIG_PCI_MSI
diff --git a/arch/ia64/include/asm/unistd.h b/arch/ia64/include/asm/unistd.h
index f791576355ad..9015979ebe0f 100644
--- a/arch/ia64/include/asm/unistd.h
+++ b/arch/ia64/include/asm/unistd.h
@@ -364,7 +364,7 @@ struct pt_regs;
364struct sigaction; 364struct sigaction;
365long sys_execve(char __user *filename, char __user * __user *argv, 365long sys_execve(char __user *filename, char __user * __user *argv,
366 char __user * __user *envp, struct pt_regs *regs); 366 char __user * __user *envp, struct pt_regs *regs);
367asmlinkage long sys_pipe(void); 367asmlinkage long sys_ia64_pipe(void);
368asmlinkage long sys_rt_sigaction(int sig, 368asmlinkage long sys_rt_sigaction(int sig,
369 const struct sigaction __user *act, 369 const struct sigaction __user *act,
370 struct sigaction __user *oact, 370 struct sigaction __user *oact,
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index d435f4a7a96c..e5341e2c1175 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -1442,7 +1442,7 @@ sys_call_table:
1442 data8 sys_mkdir // 1055 1442 data8 sys_mkdir // 1055
1443 data8 sys_rmdir 1443 data8 sys_rmdir
1444 data8 sys_dup 1444 data8 sys_dup
1445 data8 sys_pipe 1445 data8 sys_ia64_pipe
1446 data8 sys_times 1446 data8 sys_times
1447 data8 ia64_brk // 1060 1447 data8 ia64_brk // 1060
1448 data8 sys_setgid 1448 data8 sys_setgid
diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c
index f90be51b1123..9adac441ac9b 100644
--- a/arch/ia64/kernel/kprobes.c
+++ b/arch/ia64/kernel/kprobes.c
@@ -870,7 +870,7 @@ static int __kprobes pre_kprobes_handler(struct die_args *args)
870 return 1; 870 return 1;
871 871
872ss_probe: 872ss_probe:
873#if !defined(CONFIG_PREEMPT) || defined(CONFIG_PM) 873#if !defined(CONFIG_PREEMPT) || defined(CONFIG_FREEZER)
874 if (p->ainsn.inst_flag == INST_FLAG_BOOSTABLE && !p->post_handler) { 874 if (p->ainsn.inst_flag == INST_FLAG_BOOSTABLE && !p->post_handler) {
875 /* Boost up -- we can execute copied instructions directly */ 875 /* Boost up -- we can execute copied instructions directly */
876 ia64_psr(regs)->ri = p->ainsn.slot; 876 ia64_psr(regs)->ri = p->ainsn.slot;
diff --git a/arch/ia64/kernel/sys_ia64.c b/arch/ia64/kernel/sys_ia64.c
index bcbb6d8792d3..92ed83f34036 100644
--- a/arch/ia64/kernel/sys_ia64.c
+++ b/arch/ia64/kernel/sys_ia64.c
@@ -154,7 +154,7 @@ out:
154 * and r9) as this is faster than doing a copy_to_user(). 154 * and r9) as this is faster than doing a copy_to_user().
155 */ 155 */
156asmlinkage long 156asmlinkage long
157sys_pipe (void) 157sys_ia64_pipe (void)
158{ 158{
159 struct pt_regs *regs = task_pt_regs(current); 159 struct pt_regs *regs = task_pt_regs(current);
160 int fd[2]; 160 int fd[2];
diff --git a/arch/ia64/kernel/unaligned.c b/arch/ia64/kernel/unaligned.c
index ff0e7c10faa7..6db08599ebbc 100644
--- a/arch/ia64/kernel/unaligned.c
+++ b/arch/ia64/kernel/unaligned.c
@@ -59,6 +59,7 @@ dump (const char *str, void *vp, size_t len)
59 * (i.e. don't allow attacker to fill up logs with unaligned accesses). 59 * (i.e. don't allow attacker to fill up logs with unaligned accesses).
60 */ 60 */
61int no_unaligned_warning; 61int no_unaligned_warning;
62int unaligned_dump_stack;
62static int noprint_warning; 63static int noprint_warning;
63 64
64/* 65/*
@@ -1371,9 +1372,12 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)
1371 } 1372 }
1372 } 1373 }
1373 } else { 1374 } else {
1374 if (within_logging_rate_limit()) 1375 if (within_logging_rate_limit()) {
1375 printk(KERN_WARNING "kernel unaligned access to 0x%016lx, ip=0x%016lx\n", 1376 printk(KERN_WARNING "kernel unaligned access to 0x%016lx, ip=0x%016lx\n",
1376 ifa, regs->cr_iip + ipsr->ri); 1377 ifa, regs->cr_iip + ipsr->ri);
1378 if (unaligned_dump_stack)
1379 dump_stack();
1380 }
1377 set_fs(KERNEL_DS); 1381 set_fs(KERNEL_DS);
1378 } 1382 }
1379 1383
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index 211fcfd115f9..61f1af5c23c1 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -19,6 +19,7 @@
19#include <linux/ioport.h> 19#include <linux/ioport.h>
20#include <linux/slab.h> 20#include <linux/slab.h>
21#include <linux/spinlock.h> 21#include <linux/spinlock.h>
22#include <linux/bootmem.h>
22 23
23#include <asm/machvec.h> 24#include <asm/machvec.h>
24#include <asm/page.h> 25#include <asm/page.h>
@@ -748,6 +749,32 @@ static void __init set_pci_cacheline_size(void)
748 pci_cache_line_size = (1 << cci.pcci_line_size) / 4; 749 pci_cache_line_size = (1 << cci.pcci_line_size) / 4;
749} 750}
750 751
752u64 ia64_dma_get_required_mask(struct device *dev)
753{
754 u32 low_totalram = ((max_pfn - 1) << PAGE_SHIFT);
755 u32 high_totalram = ((max_pfn - 1) >> (32 - PAGE_SHIFT));
756 u64 mask;
757
758 if (!high_totalram) {
759 /* convert to mask just covering totalram */
760 low_totalram = (1 << (fls(low_totalram) - 1));
761 low_totalram += low_totalram - 1;
762 mask = low_totalram;
763 } else {
764 high_totalram = (1 << (fls(high_totalram) - 1));
765 high_totalram += high_totalram - 1;
766 mask = (((u64)high_totalram) << 32) + 0xffffffff;
767 }
768 return mask;
769}
770EXPORT_SYMBOL_GPL(ia64_dma_get_required_mask);
771
772u64 dma_get_required_mask(struct device *dev)
773{
774 return platform_dma_get_required_mask(dev);
775}
776EXPORT_SYMBOL_GPL(dma_get_required_mask);
777
751static int __init pcibios_init(void) 778static int __init pcibios_init(void)
752{ 779{
753 set_pci_cacheline_size(); 780 set_pci_cacheline_size();
diff --git a/arch/ia64/sn/pci/pci_dma.c b/arch/ia64/sn/pci/pci_dma.c
index 53ebb6484495..863f5017baae 100644
--- a/arch/ia64/sn/pci/pci_dma.c
+++ b/arch/ia64/sn/pci/pci_dma.c
@@ -356,6 +356,12 @@ int sn_dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
356} 356}
357EXPORT_SYMBOL(sn_dma_mapping_error); 357EXPORT_SYMBOL(sn_dma_mapping_error);
358 358
359u64 sn_dma_get_required_mask(struct device *dev)
360{
361 return DMA_64BIT_MASK;
362}
363EXPORT_SYMBOL_GPL(sn_dma_get_required_mask);
364
359char *sn_pci_get_legacy_mem(struct pci_bus *bus) 365char *sn_pci_get_legacy_mem(struct pci_bus *bus)
360{ 366{
361 if (!SN_PCIBUS_BUSSOFT(bus)) 367 if (!SN_PCIBUS_BUSSOFT(bus))
diff --git a/arch/ia64/xen/time.c b/arch/ia64/xen/time.c
index d15a94c330fb..68d6204c3f16 100644
--- a/arch/ia64/xen/time.c
+++ b/arch/ia64/xen/time.c
@@ -129,8 +129,8 @@ consider_steal_time(unsigned long new_itm)
129 blocked = stolentick; 129 blocked = stolentick;
130 130
131 if (stolen > 0 || blocked > 0) { 131 if (stolen > 0 || blocked > 0) {
132 account_steal_time(NULL, jiffies_to_cputime(stolen)); 132 account_steal_ticks(stolen);
133 account_steal_time(idle_task(cpu), jiffies_to_cputime(blocked)); 133 account_idle_ticks(blocked);
134 run_local_timers(); 134 run_local_timers();
135 135
136 if (rcu_pending(cpu)) 136 if (rcu_pending(cpu))
diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S
index 5b780826647c..5c332f2b9b83 100644
--- a/arch/m68k/kernel/entry.S
+++ b/arch/m68k/kernel/entry.S
@@ -513,7 +513,7 @@ sys_call_table:
513 .long sys_uselib 513 .long sys_uselib
514 .long sys_swapon 514 .long sys_swapon
515 .long sys_reboot 515 .long sys_reboot
516 .long old_readdir 516 .long sys_old_readdir
517 .long old_mmap /* 90 */ 517 .long old_mmap /* 90 */
518 .long sys_munmap 518 .long sys_munmap
519 .long sys_truncate 519 .long sys_truncate
diff --git a/arch/m68knommu/include/asm/Kbuild b/arch/m68knommu/include/asm/Kbuild
index 58c02a454130..c68e1680da01 100644
--- a/arch/m68knommu/include/asm/Kbuild
+++ b/arch/m68knommu/include/asm/Kbuild
@@ -1,3 +1 @@
1include include/asm-generic/Kbuild.asm include include/asm-generic/Kbuild.asm
2
3unifdef-y += swab.h
diff --git a/arch/m68knommu/include/asm/byteorder.h b/arch/m68knommu/include/asm/byteorder.h
index a6f0b8f7f622..9c6c76a15041 100644
--- a/arch/m68knommu/include/asm/byteorder.h
+++ b/arch/m68knommu/include/asm/byteorder.h
@@ -1,7 +1,6 @@
1#ifndef _M68KNOMMU_BYTEORDER_H 1#ifndef _M68KNOMMU_BYTEORDER_H
2#define _M68KNOMMU_BYTEORDER_H 2#define _M68KNOMMU_BYTEORDER_H
3 3
4#include <asm/swab.h>
5#include <linux/byteorder/big_endian.h> 4#include <linux/byteorder/big_endian.h>
6 5
7#endif /* _M68KNOMMU_BYTEORDER_H */ 6#endif /* _M68KNOMMU_BYTEORDER_H */
diff --git a/arch/m68knommu/kernel/syscalltable.S b/arch/m68knommu/kernel/syscalltable.S
index 812f8d8b7a85..5c3e3f62194a 100644
--- a/arch/m68knommu/kernel/syscalltable.S
+++ b/arch/m68knommu/kernel/syscalltable.S
@@ -107,7 +107,7 @@ ENTRY(sys_call_table)
107 .long sys_uselib 107 .long sys_uselib
108 .long sys_ni_syscall /* sys_swapon */ 108 .long sys_ni_syscall /* sys_swapon */
109 .long sys_reboot 109 .long sys_reboot
110 .long old_readdir 110 .long sys_old_readdir
111 .long old_mmap /* 90 */ 111 .long old_mmap /* 90 */
112 .long sys_munmap 112 .long sys_munmap
113 .long sys_truncate 113 .long sys_truncate
diff --git a/arch/mips/include/asm/Kbuild b/arch/mips/include/asm/Kbuild
index 023866c0c102..7897f05e3165 100644
--- a/arch/mips/include/asm/Kbuild
+++ b/arch/mips/include/asm/Kbuild
@@ -1,4 +1,3 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2 2
3header-y += cachectl.h sgidefs.h sysmips.h 3header-y += cachectl.h sgidefs.h sysmips.h
4header-y += swab.h
diff --git a/arch/mips/include/asm/byteorder.h b/arch/mips/include/asm/byteorder.h
index 607b71830707..9579051ff1c7 100644
--- a/arch/mips/include/asm/byteorder.h
+++ b/arch/mips/include/asm/byteorder.h
@@ -8,8 +8,6 @@
8#ifndef _ASM_BYTEORDER_H 8#ifndef _ASM_BYTEORDER_H
9#define _ASM_BYTEORDER_H 9#define _ASM_BYTEORDER_H
10 10
11#include <asm/swab.h>
12
13#if defined(__MIPSEB__) 11#if defined(__MIPSEB__)
14#include <linux/byteorder/big_endian.h> 12#include <linux/byteorder/big_endian.h>
15#elif defined(__MIPSEL__) 13#elif defined(__MIPSEL__)
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
index d0916a55cd77..51d1ba415b90 100644
--- a/arch/mips/kernel/scall32-o32.S
+++ b/arch/mips/kernel/scall32-o32.S
@@ -398,7 +398,7 @@ einval: li v0, -ENOSYS
398 sys sys_uselib 1 398 sys sys_uselib 1
399 sys sys_swapon 2 399 sys sys_swapon 2
400 sys sys_reboot 3 400 sys sys_reboot 3
401 sys old_readdir 3 401 sys sys_old_readdir 3
402 sys old_mmap 6 /* 4090 */ 402 sys old_mmap 6 /* 4090 */
403 sys sys_munmap 2 403 sys sys_munmap 2
404 sys sys_truncate 2 404 sys sys_truncate 2
diff --git a/arch/mn10300/kernel/entry.S b/arch/mn10300/kernel/entry.S
index 62fba8aa9b6e..ceeaaaa359e2 100644
--- a/arch/mn10300/kernel/entry.S
+++ b/arch/mn10300/kernel/entry.S
@@ -478,7 +478,7 @@ ENTRY(sys_call_table)
478 .long sys_uselib 478 .long sys_uselib
479 .long sys_swapon 479 .long sys_swapon
480 .long sys_reboot 480 .long sys_reboot
481 .long old_readdir 481 .long sys_old_readdir
482 .long old_mmap /* 90 */ 482 .long old_mmap /* 90 */
483 .long sys_munmap 483 .long sys_munmap
484 .long sys_truncate 484 .long sys_truncate
diff --git a/arch/parisc/include/asm/Kbuild b/arch/parisc/include/asm/Kbuild
index 2121d99f8364..f88b252e419c 100644
--- a/arch/parisc/include/asm/Kbuild
+++ b/arch/parisc/include/asm/Kbuild
@@ -1,4 +1,3 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2 2
3unifdef-y += pdc.h 3unifdef-y += pdc.h
4unifdef-y += swab.h
diff --git a/arch/parisc/include/asm/byteorder.h b/arch/parisc/include/asm/byteorder.h
index da66029c4cb2..58af2c5f5d61 100644
--- a/arch/parisc/include/asm/byteorder.h
+++ b/arch/parisc/include/asm/byteorder.h
@@ -1,7 +1,6 @@
1#ifndef _PARISC_BYTEORDER_H 1#ifndef _PARISC_BYTEORDER_H
2#define _PARISC_BYTEORDER_H 2#define _PARISC_BYTEORDER_H
3 3
4#include <asm/swab.h>
5#include <linux/byteorder/big_endian.h> 4#include <linux/byteorder/big_endian.h>
6 5
7#endif /* _PARISC_BYTEORDER_H */ 6#endif /* _PARISC_BYTEORDER_H */
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 84b861316ce7..e39b73bc0ff8 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -123,6 +123,7 @@ config PPC
123 select HAVE_DMA_ATTRS if PPC64 123 select HAVE_DMA_ATTRS if PPC64
124 select USE_GENERIC_SMP_HELPERS if SMP 124 select USE_GENERIC_SMP_HELPERS if SMP
125 select HAVE_OPROFILE 125 select HAVE_OPROFILE
126 select HAVE_SYSCALL_WRAPPERS if PPC64
126 127
127config EARLY_PRINTK 128config EARLY_PRINTK
128 bool 129 bool
diff --git a/arch/powerpc/boot/dts/mpc8315erdb.dts b/arch/powerpc/boot/dts/mpc8315erdb.dts
index 072c9b0f8c8e..71784165b77e 100644
--- a/arch/powerpc/boot/dts/mpc8315erdb.dts
+++ b/arch/powerpc/boot/dts/mpc8315erdb.dts
@@ -255,7 +255,7 @@
255 device_type = "serial"; 255 device_type = "serial";
256 compatible = "ns16550"; 256 compatible = "ns16550";
257 reg = <0x4500 0x100>; 257 reg = <0x4500 0x100>;
258 clock-frequency = <0>; 258 clock-frequency = <133333333>;
259 interrupts = <9 0x8>; 259 interrupts = <9 0x8>;
260 interrupt-parent = <&ipic>; 260 interrupt-parent = <&ipic>;
261 }; 261 };
@@ -265,7 +265,7 @@
265 device_type = "serial"; 265 device_type = "serial";
266 compatible = "ns16550"; 266 compatible = "ns16550";
267 reg = <0x4600 0x100>; 267 reg = <0x4600 0x100>;
268 clock-frequency = <0>; 268 clock-frequency = <133333333>;
269 interrupts = <10 0x8>; 269 interrupts = <10 0x8>;
270 interrupt-parent = <&ipic>; 270 interrupt-parent = <&ipic>;
271 }; 271 };
diff --git a/arch/powerpc/boot/dts/mpc8544ds.dts b/arch/powerpc/boot/dts/mpc8544ds.dts
index b9da42105066..0668d1048779 100644
--- a/arch/powerpc/boot/dts/mpc8544ds.dts
+++ b/arch/powerpc/boot/dts/mpc8544ds.dts
@@ -313,7 +313,7 @@
313 0x1000000 0x0 0x0 0xe1010000 0x0 0x10000>; 313 0x1000000 0x0 0x0 0xe1010000 0x0 0x10000>;
314 clock-frequency = <33333333>; 314 clock-frequency = <33333333>;
315 interrupt-parent = <&mpic>; 315 interrupt-parent = <&mpic>;
316 interrupts = <26 2>; 316 interrupts = <25 2>;
317 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 317 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
318 interrupt-map = < 318 interrupt-map = <
319 /* IDSEL 0x0 */ 319 /* IDSEL 0x0 */
@@ -350,7 +350,7 @@
350 0x1000000 0x0 0x0 0xe1020000 0x0 0x10000>; 350 0x1000000 0x0 0x0 0xe1020000 0x0 0x10000>;
351 clock-frequency = <33333333>; 351 clock-frequency = <33333333>;
352 interrupt-parent = <&mpic>; 352 interrupt-parent = <&mpic>;
353 interrupts = <25 2>; 353 interrupts = <26 2>;
354 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 354 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
355 interrupt-map = < 355 interrupt-map = <
356 /* IDSEL 0x0 */ 356 /* IDSEL 0x0 */
diff --git a/arch/powerpc/boot/dts/mpc8572ds.dts b/arch/powerpc/boot/dts/mpc8572ds.dts
index 21459e161d02..3dcc001b8ed3 100644
--- a/arch/powerpc/boot/dts/mpc8572ds.dts
+++ b/arch/powerpc/boot/dts/mpc8572ds.dts
@@ -724,7 +724,7 @@
724 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x00010000>; 724 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x00010000>;
725 clock-frequency = <33333333>; 725 clock-frequency = <33333333>;
726 interrupt-parent = <&mpic>; 726 interrupt-parent = <&mpic>;
727 interrupts = <26 2>; 727 interrupts = <25 2>;
728 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 728 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
729 interrupt-map = < 729 interrupt-map = <
730 /* IDSEL 0x0 */ 730 /* IDSEL 0x0 */
@@ -761,7 +761,7 @@
761 0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x00010000>; 761 0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x00010000>;
762 clock-frequency = <33333333>; 762 clock-frequency = <33333333>;
763 interrupt-parent = <&mpic>; 763 interrupt-parent = <&mpic>;
764 interrupts = <27 2>; 764 interrupts = <26 2>;
765 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 765 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
766 interrupt-map = < 766 interrupt-map = <
767 /* IDSEL 0x0 */ 767 /* IDSEL 0x0 */
diff --git a/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts b/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts
index c114c4ee9931..fd462efa9e61 100644
--- a/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts
+++ b/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts
@@ -457,7 +457,7 @@
457 0x1000000 0x0 0x0 0xffc10000 0x0 0x10000>; 457 0x1000000 0x0 0x0 0xffc10000 0x0 0x10000>;
458 clock-frequency = <33333333>; 458 clock-frequency = <33333333>;
459 interrupt-parent = <&mpic>; 459 interrupt-parent = <&mpic>;
460 interrupts = <26 2>; 460 interrupts = <25 2>;
461 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 461 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
462 interrupt-map = < 462 interrupt-map = <
463 /* IDSEL 0x0 */ 463 /* IDSEL 0x0 */
diff --git a/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts b/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts
index 04ecda18d206..e35230f2ac93 100644
--- a/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts
+++ b/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts
@@ -208,7 +208,7 @@
208 0x1000000 0x0 0x0 0xffc20000 0x0 0x10000>; 208 0x1000000 0x0 0x0 0xffc20000 0x0 0x10000>;
209 clock-frequency = <33333333>; 209 clock-frequency = <33333333>;
210 interrupt-parent = <&mpic>; 210 interrupt-parent = <&mpic>;
211 interrupts = <27 2>; 211 interrupts = <26 2>;
212 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 212 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
213 interrupt-map = < 213 interrupt-map = <
214 /* IDSEL 0x0 */ 214 /* IDSEL 0x0 */
diff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/ppc64_defconfig
index 069ae1bbac29..d4685d1c0be8 100644
--- a/arch/powerpc/configs/ppc64_defconfig
+++ b/arch/powerpc/configs/ppc64_defconfig
@@ -211,11 +211,28 @@ CONFIG_PPC_PASEMI=y
211CONFIG_PPC_PASEMI_IOMMU=y 211CONFIG_PPC_PASEMI_IOMMU=y
212# CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE is not set 212# CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE is not set
213CONFIG_PPC_PASEMI_MDIO=y 213CONFIG_PPC_PASEMI_MDIO=y
214# CONFIG_PPC_PS3 is not set 214CONFIG_PPC_PS3=y
215
216#
217# PS3 Platform Options
218#
219# CONFIG_PS3_ADVANCED is not set
220CONFIG_PS3_HTAB_SIZE=20
221# CONFIG_PS3_DYNAMIC_DMA is not set
222CONFIG_PS3_VUART=y
223CONFIG_PS3_PS3AV=y
224CONFIG_PS3_SYS_MANAGER=y
225CONFIG_PS3_STORAGE=m
226CONFIG_PS3_DISK=m
227CONFIG_PS3_ROM=m
228CONFIG_PS3_FLASH=m
229CONFIG_PS3_LPM=m
215CONFIG_PPC_CELL=y 230CONFIG_PPC_CELL=y
231CONFIG_PPC_CELL_COMMON=y
216CONFIG_PPC_CELL_NATIVE=y 232CONFIG_PPC_CELL_NATIVE=y
217CONFIG_PPC_IBM_CELL_BLADE=y 233CONFIG_PPC_IBM_CELL_BLADE=y
218CONFIG_PPC_CELLEB=y 234CONFIG_PPC_CELLEB=y
235CONFIG_PPC_CELL_QPACE=y
219 236
220# 237#
221# Cell Broadband Engine options 238# Cell Broadband Engine options
@@ -981,6 +998,9 @@ CONFIG_E1000=y
981CONFIG_TIGON3=y 998CONFIG_TIGON3=y
982# CONFIG_BNX2 is not set 999# CONFIG_BNX2 is not set
983CONFIG_SPIDER_NET=m 1000CONFIG_SPIDER_NET=m
1001CONFIG_GELIC_NET=m
1002CONFIG_GELIC_WIRELESS=y
1003# CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE is not set
984# CONFIG_QLA3XXX is not set 1004# CONFIG_QLA3XXX is not set
985# CONFIG_ATL1 is not set 1005# CONFIG_ATL1 is not set
986# CONFIG_ATL1E is not set 1006# CONFIG_ATL1E is not set
@@ -1370,6 +1390,8 @@ CONFIG_FB_RADEON_BACKLIGHT=y
1370# CONFIG_FB_PM3 is not set 1390# CONFIG_FB_PM3 is not set
1371# CONFIG_FB_CARMINE is not set 1391# CONFIG_FB_CARMINE is not set
1372CONFIG_FB_IBM_GXT4500=y 1392CONFIG_FB_IBM_GXT4500=y
1393CONFIG_FB_PS3=m
1394CONFIG_FB_PS3_DEFAULT_SIZE_M=9
1373# CONFIG_FB_VIRTUAL is not set 1395# CONFIG_FB_VIRTUAL is not set
1374# CONFIG_FB_METRONOME is not set 1396# CONFIG_FB_METRONOME is not set
1375CONFIG_BACKLIGHT_LCD_SUPPORT=y 1397CONFIG_BACKLIGHT_LCD_SUPPORT=y
@@ -1492,6 +1514,8 @@ CONFIG_SND_PCI=y
1492CONFIG_SND_PPC=y 1514CONFIG_SND_PPC=y
1493CONFIG_SND_POWERMAC=m 1515CONFIG_SND_POWERMAC=m
1494CONFIG_SND_POWERMAC_AUTO_DRC=y 1516CONFIG_SND_POWERMAC_AUTO_DRC=y
1517CONFIG_SND_PS3=m
1518CONFIG_SND_PS3_DEFAULT_START_DELAY=2000
1495CONFIG_SND_AOA=m 1519CONFIG_SND_AOA=m
1496CONFIG_SND_AOA_FABRIC_LAYOUT=m 1520CONFIG_SND_AOA_FABRIC_LAYOUT=m
1497CONFIG_SND_AOA_ONYX=m 1521CONFIG_SND_AOA_ONYX=m
diff --git a/arch/powerpc/include/asm/Kbuild b/arch/powerpc/include/asm/Kbuild
index 9268602de5d0..5ab7d7fe198c 100644
--- a/arch/powerpc/include/asm/Kbuild
+++ b/arch/powerpc/include/asm/Kbuild
@@ -35,4 +35,3 @@ unifdef-y += spu_info.h
35unifdef-y += termios.h 35unifdef-y += termios.h
36unifdef-y += types.h 36unifdef-y += types.h
37unifdef-y += unistd.h 37unifdef-y += unistd.h
38unifdef-y += swab.h
diff --git a/arch/powerpc/include/asm/byteorder.h b/arch/powerpc/include/asm/byteorder.h
index 5cca27a41532..aa6cc4fac965 100644
--- a/arch/powerpc/include/asm/byteorder.h
+++ b/arch/powerpc/include/asm/byteorder.h
@@ -7,8 +7,6 @@
7 * as published by the Free Software Foundation; either version 7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version. 8 * 2 of the License, or (at your option) any later version.
9 */ 9 */
10
11#include <asm/swab.h>
12#include <linux/byteorder/big_endian.h> 10#include <linux/byteorder/big_endian.h>
13 11
14#endif /* _ASM_POWERPC_BYTEORDER_H */ 12#endif /* _ASM_POWERPC_BYTEORDER_H */
diff --git a/arch/powerpc/include/asm/ps3.h b/arch/powerpc/include/asm/ps3.h
index eead5c67197a..67f1812698d2 100644
--- a/arch/powerpc/include/asm/ps3.h
+++ b/arch/powerpc/include/asm/ps3.h
@@ -103,10 +103,10 @@ struct ps3_dma_region_ops {
103 int (*map)(struct ps3_dma_region *, 103 int (*map)(struct ps3_dma_region *,
104 unsigned long virt_addr, 104 unsigned long virt_addr,
105 unsigned long len, 105 unsigned long len,
106 unsigned long *bus_addr, 106 dma_addr_t *bus_addr,
107 u64 iopte_pp); 107 u64 iopte_pp);
108 int (*unmap)(struct ps3_dma_region *, 108 int (*unmap)(struct ps3_dma_region *,
109 unsigned long bus_addr, 109 dma_addr_t bus_addr,
110 unsigned long len); 110 unsigned long len);
111}; 111};
112/** 112/**
@@ -124,9 +124,9 @@ int ps3_dma_region_init(struct ps3_system_bus_device *dev,
124int ps3_dma_region_create(struct ps3_dma_region *r); 124int ps3_dma_region_create(struct ps3_dma_region *r);
125int ps3_dma_region_free(struct ps3_dma_region *r); 125int ps3_dma_region_free(struct ps3_dma_region *r);
126int ps3_dma_map(struct ps3_dma_region *r, unsigned long virt_addr, 126int ps3_dma_map(struct ps3_dma_region *r, unsigned long virt_addr,
127 unsigned long len, unsigned long *bus_addr, 127 unsigned long len, dma_addr_t *bus_addr,
128 u64 iopte_pp); 128 u64 iopte_pp);
129int ps3_dma_unmap(struct ps3_dma_region *r, unsigned long bus_addr, 129int ps3_dma_unmap(struct ps3_dma_region *r, dma_addr_t bus_addr,
130 unsigned long len); 130 unsigned long len);
131 131
132/* mmio routines */ 132/* mmio routines */
diff --git a/arch/powerpc/include/asm/qe.h b/arch/powerpc/include/asm/qe.h
index a0a15311d0d8..2701753d9937 100644
--- a/arch/powerpc/include/asm/qe.h
+++ b/arch/powerpc/include/asm/qe.h
@@ -624,7 +624,7 @@ struct ucc_slow_pram {
624#define UCC_GETH_UCCE_RXF1 0x00000002 624#define UCC_GETH_UCCE_RXF1 0x00000002
625#define UCC_GETH_UCCE_RXF0 0x00000001 625#define UCC_GETH_UCCE_RXF0 0x00000001
626 626
627/* UPSMR, when used as a UART */ 627/* UCC Protocol Specific Mode Register (UPSMR), when used for UART */
628#define UCC_UART_UPSMR_FLC 0x8000 628#define UCC_UART_UPSMR_FLC 0x8000
629#define UCC_UART_UPSMR_SL 0x4000 629#define UCC_UART_UPSMR_SL 0x4000
630#define UCC_UART_UPSMR_CL_MASK 0x3000 630#define UCC_UART_UPSMR_CL_MASK 0x3000
@@ -652,6 +652,23 @@ struct ucc_slow_pram {
652#define UCC_UART_UPSMR_TPM_EVEN 0x0002 652#define UCC_UART_UPSMR_TPM_EVEN 0x0002
653#define UCC_UART_UPSMR_TPM_HIGH 0x0003 653#define UCC_UART_UPSMR_TPM_HIGH 0x0003
654 654
655/* UCC Protocol Specific Mode Register (UPSMR), when used for Ethernet */
656#define UCC_GETH_UPSMR_FTFE 0x80000000
657#define UCC_GETH_UPSMR_PTPE 0x40000000
658#define UCC_GETH_UPSMR_ECM 0x04000000
659#define UCC_GETH_UPSMR_HSE 0x02000000
660#define UCC_GETH_UPSMR_PRO 0x00400000
661#define UCC_GETH_UPSMR_CAP 0x00200000
662#define UCC_GETH_UPSMR_RSH 0x00100000
663#define UCC_GETH_UPSMR_RPM 0x00080000
664#define UCC_GETH_UPSMR_R10M 0x00040000
665#define UCC_GETH_UPSMR_RLPB 0x00020000
666#define UCC_GETH_UPSMR_TBIM 0x00010000
667#define UCC_GETH_UPSMR_RES1 0x00002000
668#define UCC_GETH_UPSMR_RMM 0x00001000
669#define UCC_GETH_UPSMR_CAM 0x00000400
670#define UCC_GETH_UPSMR_BRO 0x00000200
671
655/* UCC Transmit On Demand Register (UTODR) */ 672/* UCC Transmit On Demand Register (UTODR) */
656#define UCC_SLOW_TOD 0x8000 673#define UCC_SLOW_TOD 0x8000
657#define UCC_FAST_TOD 0x8000 674#define UCC_FAST_TOD 0x8000
diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index e0175beb4462..0aa0315fb7e8 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -18,7 +18,7 @@
18 */ 18 */
19 19
20#define RTAS_UNKNOWN_SERVICE (-1) 20#define RTAS_UNKNOWN_SERVICE (-1)
21#define RTAS_INSTANTIATE_MAX (1UL<<30) /* Don't instantiate rtas at/above this value */ 21#define RTAS_INSTANTIATE_MAX (1ULL<<30) /* Don't instantiate rtas at/above this value */
22 22
23/* Buffer size for ppc_rtas system call. */ 23/* Buffer size for ppc_rtas system call. */
24#define RTAS_RMOBUF_MAX (64 * 1024) 24#define RTAS_RMOBUF_MAX (64 * 1024)
diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h
index 803def236654..72353f6070a4 100644
--- a/arch/powerpc/include/asm/systbl.h
+++ b/arch/powerpc/include/asm/systbl.h
@@ -92,7 +92,7 @@ COMPAT_SYS_SPU(readlink)
92SYSCALL(uselib) 92SYSCALL(uselib)
93SYSCALL(swapon) 93SYSCALL(swapon)
94SYSCALL(reboot) 94SYSCALL(reboot)
95SYSX(sys_ni_syscall,compat_sys_old_readdir,old_readdir) 95SYSX(sys_ni_syscall,compat_sys_old_readdir,sys_old_readdir)
96SYSCALL_SPU(mmap) 96SYSCALL_SPU(mmap)
97SYSCALL_SPU(munmap) 97SYSCALL_SPU(munmap)
98SYSCALL_SPU(truncate) 98SYSCALL_SPU(truncate)
diff --git a/arch/powerpc/include/asm/types.h b/arch/powerpc/include/asm/types.h
index c004c13f291e..7ce27a52bb34 100644
--- a/arch/powerpc/include/asm/types.h
+++ b/arch/powerpc/include/asm/types.h
@@ -1,7 +1,12 @@
1#ifndef _ASM_POWERPC_TYPES_H 1#ifndef _ASM_POWERPC_TYPES_H
2#define _ASM_POWERPC_TYPES_H 2#define _ASM_POWERPC_TYPES_H
3 3
4#ifdef __powerpc64__ 4/*
5 * This is here because we used to use l64 for 64bit powerpc
6 * and we don't want to impact user mode with our change to ll64
7 * in the kernel.
8 */
9#if defined(__powerpc64__) && !defined(__KERNEL__)
5# include <asm-generic/int-l64.h> 10# include <asm-generic/int-l64.h>
6#else 11#else
7# include <asm-generic/int-ll64.h> 12# include <asm-generic/int-ll64.h>
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 9937fe44555f..19ee491e9e23 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -56,6 +56,10 @@
56#include "head_booke.h" 56#include "head_booke.h"
57#endif 57#endif
58 58
59#if defined(CONFIG_FSL_BOOKE)
60#include "../mm/mmu_decl.h"
61#endif
62
59int main(void) 63int main(void)
60{ 64{
61 DEFINE(THREAD, offsetof(struct task_struct, thread)); 65 DEFINE(THREAD, offsetof(struct task_struct, thread));
@@ -382,6 +386,9 @@ int main(void)
382 DEFINE(PGD_T_LOG2, PGD_T_LOG2); 386 DEFINE(PGD_T_LOG2, PGD_T_LOG2);
383 DEFINE(PTE_T_LOG2, PTE_T_LOG2); 387 DEFINE(PTE_T_LOG2, PTE_T_LOG2);
384#endif 388#endif
389#ifdef CONFIG_FSL_BOOKE
390 DEFINE(TLBCAM_SIZE, sizeof(struct tlbcam));
391#endif
385 392
386#ifdef CONFIG_KVM_EXIT_TIMING 393#ifdef CONFIG_KVM_EXIT_TIMING
387 DEFINE(VCPU_TIMING_EXIT_TBU, offsetof(struct kvm_vcpu, 394 DEFINE(VCPU_TIMING_EXIT_TBU, offsetof(struct kvm_vcpu,
diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c
index b33f0417a4bf..bb37b1d19a58 100644
--- a/arch/powerpc/kernel/cacheinfo.c
+++ b/arch/powerpc/kernel/cacheinfo.c
@@ -113,7 +113,7 @@ struct cache {
113 struct cache *next_local; /* next cache of >= level */ 113 struct cache *next_local; /* next cache of >= level */
114}; 114};
115 115
116static DEFINE_PER_CPU(struct cache_dir *, cache_dir); 116static DEFINE_PER_CPU(struct cache_dir *, cache_dir_pcpu);
117 117
118/* traversal/modification of this list occurs only at cpu hotplug time; 118/* traversal/modification of this list occurs only at cpu hotplug time;
119 * access is serialized by cpu hotplug locking 119 * access is serialized by cpu hotplug locking
@@ -468,9 +468,9 @@ static struct cache_dir *__cpuinit cacheinfo_create_cache_dir(unsigned int cpu_i
468 468
469 cache_dir->kobj = kobj; 469 cache_dir->kobj = kobj;
470 470
471 WARN_ON_ONCE(per_cpu(cache_dir, cpu_id) != NULL); 471 WARN_ON_ONCE(per_cpu(cache_dir_pcpu, cpu_id) != NULL);
472 472
473 per_cpu(cache_dir, cpu_id) = cache_dir; 473 per_cpu(cache_dir_pcpu, cpu_id) = cache_dir;
474 474
475 return cache_dir; 475 return cache_dir;
476err: 476err:
@@ -820,13 +820,13 @@ void cacheinfo_cpu_offline(unsigned int cpu_id)
820 820
821 /* Prevent userspace from seeing inconsistent state - remove 821 /* Prevent userspace from seeing inconsistent state - remove
822 * the sysfs hierarchy first */ 822 * the sysfs hierarchy first */
823 cache_dir = per_cpu(cache_dir, cpu_id); 823 cache_dir = per_cpu(cache_dir_pcpu, cpu_id);
824 824
825 /* careful, sysfs population may have failed */ 825 /* careful, sysfs population may have failed */
826 if (cache_dir) 826 if (cache_dir)
827 remove_cache_dir(cache_dir); 827 remove_cache_dir(cache_dir);
828 828
829 per_cpu(cache_dir, cpu_id) = NULL; 829 per_cpu(cache_dir_pcpu, cpu_id) = NULL;
830 830
831 /* clear the CPU's bit in its cache chain, possibly freeing 831 /* clear the CPU's bit in its cache chain, possibly freeing
832 * cache objects */ 832 * cache objects */
diff --git a/arch/powerpc/kernel/dma-iommu.c b/arch/powerpc/kernel/dma-iommu.c
index 14183af1b3fb..2983adac8cc3 100644
--- a/arch/powerpc/kernel/dma-iommu.c
+++ b/arch/powerpc/kernel/dma-iommu.c
@@ -79,10 +79,10 @@ static int dma_iommu_dma_supported(struct device *dev, u64 mask)
79 "Warning: IOMMU offset too big for device mask\n"); 79 "Warning: IOMMU offset too big for device mask\n");
80 if (tbl) 80 if (tbl)
81 printk(KERN_INFO 81 printk(KERN_INFO
82 "mask: 0x%08lx, table offset: 0x%08lx\n", 82 "mask: 0x%08llx, table offset: 0x%08lx\n",
83 mask, tbl->it_offset); 83 mask, tbl->it_offset);
84 else 84 else
85 printk(KERN_INFO "mask: 0x%08lx, table unavailable\n", 85 printk(KERN_INFO "mask: 0x%08llx, table unavailable\n",
86 mask); 86 mask);
87 return 0; 87 return 0;
88 } else 88 } else
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index b4bcf5a930fa..ebaedafc8e67 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -1518,6 +1518,15 @@ _GLOBAL(pmac_secondary_start)
1518 /* turn on 64-bit mode */ 1518 /* turn on 64-bit mode */
1519 bl .enable_64b_mode 1519 bl .enable_64b_mode
1520 1520
1521 li r0,0
1522 mfspr r3,SPRN_HID4
1523 rldimi r3,r0,40,23 /* clear bit 23 (rm_ci) */
1524 sync
1525 mtspr SPRN_HID4,r3
1526 isync
1527 sync
1528 slbia
1529
1521 /* get TOC pointer (real address) */ 1530 /* get TOC pointer (real address) */
1522 bl .relative_toc 1531 bl .relative_toc
1523 1532
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 11b549acc034..36ffb3504a4f 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -389,10 +389,6 @@ skpinv: addi r6,r6,1 /* Increment */
389#endif 389#endif
390#endif 390#endif
391 391
392 mfspr r3,SPRN_TLB1CFG
393 andi. r3,r3,0xfff
394 lis r4,num_tlbcam_entries@ha
395 stw r3,num_tlbcam_entries@l(r4)
396/* 392/*
397 * Decide what sort of machine this is and initialize the MMU. 393 * Decide what sort of machine this is and initialize the MMU.
398 */ 394 */
@@ -711,7 +707,7 @@ interrupt_base:
711 EXCEPTION(0x2060, PerformanceMonitor, performance_monitor_exception, EXC_XFER_STD) 707 EXCEPTION(0x2060, PerformanceMonitor, performance_monitor_exception, EXC_XFER_STD)
712 708
713#ifdef CONFIG_PPC_E500MC 709#ifdef CONFIG_PPC_E500MC
714 EXCEPTION(0x2070, Doorbell, unknown_exception, EXC_XFER_EE) 710 EXCEPTION(0x2070, Doorbell, unknown_exception, EXC_XFER_STD)
715#endif 711#endif
716 712
717 /* Debug Interrupt */ 713 /* Debug Interrupt */
@@ -909,7 +905,7 @@ KernelSPE:
909_GLOBAL(loadcam_entry) 905_GLOBAL(loadcam_entry)
910 lis r4,TLBCAM@ha 906 lis r4,TLBCAM@ha
911 addi r4,r4,TLBCAM@l 907 addi r4,r4,TLBCAM@l
912 mulli r5,r3,20 908 mulli r5,r3,TLBCAM_SIZE
913 add r3,r5,r4 909 add r3,r5,r4
914 lwz r4,0(r3) 910 lwz r4,0(r3)
915 mtspr SPRN_MAS0,r4 911 mtspr SPRN_MAS0,r4
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
index 1bfa706b96e7..fd51578e29dd 100644
--- a/arch/powerpc/kernel/iommu.c
+++ b/arch/powerpc/kernel/iommu.c
@@ -239,12 +239,12 @@ static void __iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr,
239 if (printk_ratelimit()) { 239 if (printk_ratelimit()) {
240 printk(KERN_INFO "iommu_free: invalid entry\n"); 240 printk(KERN_INFO "iommu_free: invalid entry\n");
241 printk(KERN_INFO "\tentry = 0x%lx\n", entry); 241 printk(KERN_INFO "\tentry = 0x%lx\n", entry);
242 printk(KERN_INFO "\tdma_addr = 0x%lx\n", (u64)dma_addr); 242 printk(KERN_INFO "\tdma_addr = 0x%llx\n", (u64)dma_addr);
243 printk(KERN_INFO "\tTable = 0x%lx\n", (u64)tbl); 243 printk(KERN_INFO "\tTable = 0x%llx\n", (u64)tbl);
244 printk(KERN_INFO "\tbus# = 0x%lx\n", (u64)tbl->it_busno); 244 printk(KERN_INFO "\tbus# = 0x%llx\n", (u64)tbl->it_busno);
245 printk(KERN_INFO "\tsize = 0x%lx\n", (u64)tbl->it_size); 245 printk(KERN_INFO "\tsize = 0x%llx\n", (u64)tbl->it_size);
246 printk(KERN_INFO "\tstartOff = 0x%lx\n", (u64)tbl->it_offset); 246 printk(KERN_INFO "\tstartOff = 0x%llx\n", (u64)tbl->it_offset);
247 printk(KERN_INFO "\tindex = 0x%lx\n", (u64)tbl->it_index); 247 printk(KERN_INFO "\tindex = 0x%llx\n", (u64)tbl->it_index);
248 WARN_ON(1); 248 WARN_ON(1);
249 } 249 }
250 return; 250 return;
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c
index d051e8cbcd03..182e0f642f36 100644
--- a/arch/powerpc/kernel/lparcfg.c
+++ b/arch/powerpc/kernel/lparcfg.c
@@ -240,7 +240,7 @@ static void parse_ppp_data(struct seq_file *m)
240 if (rc) 240 if (rc)
241 return; 241 return;
242 242
243 seq_printf(m, "partition_entitled_capacity=%ld\n", 243 seq_printf(m, "partition_entitled_capacity=%lld\n",
244 ppp_data.entitlement); 244 ppp_data.entitlement);
245 seq_printf(m, "group=%d\n", ppp_data.group_num); 245 seq_printf(m, "group=%d\n", ppp_data.group_num);
246 seq_printf(m, "system_active_processors=%d\n", 246 seq_printf(m, "system_active_processors=%d\n",
@@ -265,7 +265,7 @@ static void parse_ppp_data(struct seq_file *m)
265 ppp_data.unallocated_weight); 265 ppp_data.unallocated_weight);
266 seq_printf(m, "capacity_weight=%d\n", ppp_data.weight); 266 seq_printf(m, "capacity_weight=%d\n", ppp_data.weight);
267 seq_printf(m, "capped=%d\n", ppp_data.capped); 267 seq_printf(m, "capped=%d\n", ppp_data.capped);
268 seq_printf(m, "unallocated_capacity=%ld\n", 268 seq_printf(m, "unallocated_capacity=%lld\n",
269 ppp_data.unallocated_entitlement); 269 ppp_data.unallocated_entitlement);
270} 270}
271 271
@@ -509,10 +509,10 @@ static ssize_t update_ppp(u64 *entitlement, u8 *weight)
509 } else 509 } else
510 return -EINVAL; 510 return -EINVAL;
511 511
512 pr_debug("%s: current_entitled = %lu, current_weight = %u\n", 512 pr_debug("%s: current_entitled = %llu, current_weight = %u\n",
513 __func__, ppp_data.entitlement, ppp_data.weight); 513 __func__, ppp_data.entitlement, ppp_data.weight);
514 514
515 pr_debug("%s: new_entitled = %lu, new_weight = %u\n", 515 pr_debug("%s: new_entitled = %llu, new_weight = %u\n",
516 __func__, new_entitled, new_weight); 516 __func__, new_entitled, new_weight);
517 517
518 retval = plpar_hcall_norets(H_SET_PPP, new_entitled, new_weight); 518 retval = plpar_hcall_norets(H_SET_PPP, new_entitled, new_weight);
@@ -558,7 +558,7 @@ static ssize_t update_mpp(u64 *entitlement, u8 *weight)
558 pr_debug("%s: current_entitled = %lu, current_weight = %u\n", 558 pr_debug("%s: current_entitled = %lu, current_weight = %u\n",
559 __func__, mpp_data.entitled_mem, mpp_data.mem_weight); 559 __func__, mpp_data.entitled_mem, mpp_data.mem_weight);
560 560
561 pr_debug("%s: new_entitled = %lu, new_weight = %u\n", 561 pr_debug("%s: new_entitled = %llu, new_weight = %u\n",
562 __func__, new_entitled, new_weight); 562 __func__, new_entitled, new_weight);
563 563
564 rc = plpar_hcall_norets(H_SET_MPP, new_entitled, new_weight); 564 rc = plpar_hcall_norets(H_SET_MPP, new_entitled, new_weight);
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c
index b3abebb7ee64..d59e2b1bdcba 100644
--- a/arch/powerpc/kernel/machine_kexec.c
+++ b/arch/powerpc/kernel/machine_kexec.c
@@ -93,10 +93,35 @@ void __init reserve_crashkernel(void)
93 KDUMP_KERNELBASE); 93 KDUMP_KERNELBASE);
94 94
95 crashk_res.start = KDUMP_KERNELBASE; 95 crashk_res.start = KDUMP_KERNELBASE;
96#else
97 if (!crashk_res.start) {
98 /*
99 * unspecified address, choose a region of specified size
100 * can overlap with initrd (ignoring corruption when retained)
101 * ppc64 requires kernel and some stacks to be in first segemnt
102 */
103 crashk_res.start = KDUMP_KERNELBASE;
104 }
105
106 crash_base = PAGE_ALIGN(crashk_res.start);
107 if (crash_base != crashk_res.start) {
108 printk("Crash kernel base must be aligned to 0x%lx\n",
109 PAGE_SIZE);
110 crashk_res.start = crash_base;
111 }
112
96#endif 113#endif
97 crash_size = PAGE_ALIGN(crash_size); 114 crash_size = PAGE_ALIGN(crash_size);
98 crashk_res.end = crashk_res.start + crash_size - 1; 115 crashk_res.end = crashk_res.start + crash_size - 1;
99 116
117 /* The crash region must not overlap the current kernel */
118 if (overlaps_crashkernel(__pa(_stext), _end - _stext)) {
119 printk(KERN_WARNING
120 "Crash kernel can not overlap current kernel\n");
121 crashk_res.start = crashk_res.end = 0;
122 return;
123 }
124
100 /* Crash kernel trumps memory limit */ 125 /* Crash kernel trumps memory limit */
101 if (memory_limit && memory_limit <= crashk_res.end) { 126 if (memory_limit && memory_limit <= crashk_res.end) {
102 memory_limit = crashk_res.end + 1; 127 memory_limit = crashk_res.end + 1;
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 586962f65c2a..ea8eda8c87cf 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -470,7 +470,7 @@ int __devinit pcibios_map_io_space(struct pci_bus *bus)
470 if (bus->self) { 470 if (bus->self) {
471 pr_debug("IO mapping for PCI-PCI bridge %s\n", 471 pr_debug("IO mapping for PCI-PCI bridge %s\n",
472 pci_name(bus->self)); 472 pci_name(bus->self));
473 pr_debug(" virt=0x%016lx...0x%016lx\n", 473 pr_debug(" virt=0x%016llx...0x%016llx\n",
474 bus->resource[0]->start + _IO_BASE, 474 bus->resource[0]->start + _IO_BASE,
475 bus->resource[0]->end + _IO_BASE); 475 bus->resource[0]->end + _IO_BASE);
476 return 0; 476 return 0;
@@ -502,7 +502,7 @@ int __devinit pcibios_map_io_space(struct pci_bus *bus)
502 hose->io_base_phys - phys_page); 502 hose->io_base_phys - phys_page);
503 503
504 pr_debug("IO mapping for PHB %s\n", hose->dn->full_name); 504 pr_debug("IO mapping for PHB %s\n", hose->dn->full_name);
505 pr_debug(" phys=0x%016lx, virt=0x%p (alloc=0x%p)\n", 505 pr_debug(" phys=0x%016llx, virt=0x%p (alloc=0x%p)\n",
506 hose->io_base_phys, hose->io_base_virt, hose->io_base_alloc); 506 hose->io_base_phys, hose->io_base_virt, hose->io_base_alloc);
507 pr_debug(" size=0x%016lx (alloc=0x%016lx)\n", 507 pr_debug(" size=0x%016lx (alloc=0x%016lx)\n",
508 hose->pci_io_size, size_page); 508 hose->pci_io_size, size_page);
@@ -517,7 +517,7 @@ int __devinit pcibios_map_io_space(struct pci_bus *bus)
517 hose->io_resource.start += io_virt_offset; 517 hose->io_resource.start += io_virt_offset;
518 hose->io_resource.end += io_virt_offset; 518 hose->io_resource.end += io_virt_offset;
519 519
520 pr_debug(" hose->io_resource=0x%016lx...0x%016lx\n", 520 pr_debug(" hose->io_resource=0x%016llx...0x%016llx\n",
521 hose->io_resource.start, hose->io_resource.end); 521 hose->io_resource.start, hose->io_resource.end);
522 522
523 return 0; 523 return 0;
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index c09cffafb6ee..f00f83109ab3 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -590,6 +590,11 @@ static void __init check_cpu_slb_size(unsigned long node)
590{ 590{
591 u32 *slb_size_ptr; 591 u32 *slb_size_ptr;
592 592
593 slb_size_ptr = of_get_flat_dt_prop(node, "slb-size", NULL);
594 if (slb_size_ptr != NULL) {
595 mmu_slb_size = *slb_size_ptr;
596 return;
597 }
593 slb_size_ptr = of_get_flat_dt_prop(node, "ibm,slb-size", NULL); 598 slb_size_ptr = of_get_flat_dt_prop(node, "ibm,slb-size", NULL);
594 if (slb_size_ptr != NULL) { 599 if (slb_size_ptr != NULL) {
595 mmu_slb_size = *slb_size_ptr; 600 mmu_slb_size = *slb_size_ptr;
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index d8bd2161e738..2d34196bba8c 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -434,8 +434,8 @@ void __init setup_system(void)
434 printk("Starting Linux PPC64 %s\n", init_utsname()->version); 434 printk("Starting Linux PPC64 %s\n", init_utsname()->version);
435 435
436 printk("-----------------------------------------------------\n"); 436 printk("-----------------------------------------------------\n");
437 printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size); 437 printk("ppc64_pft_size = 0x%llx\n", ppc64_pft_size);
438 printk("physicalMemorySize = 0x%lx\n", lmb_phys_mem_size()); 438 printk("physicalMemorySize = 0x%llx\n", lmb_phys_mem_size());
439 if (ppc64_caches.dline_size != 0x80) 439 if (ppc64_caches.dline_size != 0x80)
440 printk("ppc64_caches.dcache_line_size = 0x%x\n", 440 printk("ppc64_caches.dcache_line_size = 0x%x\n",
441 ppc64_caches.dline_size); 441 ppc64_caches.dline_size);
@@ -493,7 +493,7 @@ static void __init emergency_stack_init(void)
493 * bringup, we need to get at them in real mode. This means they 493 * bringup, we need to get at them in real mode. This means they
494 * must also be within the RMO region. 494 * must also be within the RMO region.
495 */ 495 */
496 limit = min(0x10000000UL, lmb.rmo_size); 496 limit = min(0x10000000ULL, lmb.rmo_size);
497 497
498 for_each_possible_cpu(i) { 498 for_each_possible_cpu(i) {
499 unsigned long sp; 499 unsigned long sp;
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 04e8ecea9b40..295ccc5e86b1 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -87,7 +87,9 @@ SECTIONS
87 /* The dummy segment contents for the bug workaround mentioned above 87 /* The dummy segment contents for the bug workaround mentioned above
88 near PHDRS. */ 88 near PHDRS. */
89 .dummy : AT(ADDR(.dummy) - LOAD_OFFSET) { 89 .dummy : AT(ADDR(.dummy) - LOAD_OFFSET) {
90 LONG(0xf177) 90 LONG(0)
91 LONG(0)
92 LONG(0)
91 } :kernel :dummy 93 } :kernel :dummy
92 94
93/* 95/*
diff --git a/arch/powerpc/mm/fsl_booke_mmu.c b/arch/powerpc/mm/fsl_booke_mmu.c
index 23cee39534fd..1971e4ee3d6e 100644
--- a/arch/powerpc/mm/fsl_booke_mmu.c
+++ b/arch/powerpc/mm/fsl_booke_mmu.c
@@ -56,18 +56,11 @@
56 56
57extern void loadcam_entry(unsigned int index); 57extern void loadcam_entry(unsigned int index);
58unsigned int tlbcam_index; 58unsigned int tlbcam_index;
59unsigned int num_tlbcam_entries;
60static unsigned long __cam0, __cam1, __cam2; 59static unsigned long __cam0, __cam1, __cam2;
61 60
62#define NUM_TLBCAMS (16) 61#define NUM_TLBCAMS (16)
63 62
64struct tlbcam { 63struct tlbcam TLBCAM[NUM_TLBCAMS];
65 u32 MAS0;
66 u32 MAS1;
67 u32 MAS2;
68 u32 MAS3;
69 u32 MAS7;
70} TLBCAM[NUM_TLBCAMS];
71 64
72struct tlbcamrange { 65struct tlbcamrange {
73 unsigned long start; 66 unsigned long start;
diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h
index ad123bced404..d1f9c62dc177 100644
--- a/arch/powerpc/mm/mmu_decl.h
+++ b/arch/powerpc/mm/mmu_decl.h
@@ -75,6 +75,15 @@ extern void _tlbia(void);
75#endif /* CONFIG_PPC_MMU_NOHASH */ 75#endif /* CONFIG_PPC_MMU_NOHASH */
76 76
77#ifdef CONFIG_PPC32 77#ifdef CONFIG_PPC32
78
79struct tlbcam {
80 u32 MAS0;
81 u32 MAS1;
82 u32 MAS2;
83 u32 MAS3;
84 u32 MAS7;
85};
86
78extern void mapin_ram(void); 87extern void mapin_ram(void);
79extern int map_page(unsigned long va, phys_addr_t pa, int flags); 88extern int map_page(unsigned long va, phys_addr_t pa, int flags);
80extern void setbat(int index, unsigned long virt, phys_addr_t phys, 89extern void setbat(int index, unsigned long virt, phys_addr_t phys,
@@ -90,8 +99,6 @@ extern unsigned int rtas_data, rtas_size;
90struct hash_pte; 99struct hash_pte;
91extern struct hash_pte *Hash, *Hash_end; 100extern struct hash_pte *Hash, *Hash_end;
92extern unsigned long Hash_size, Hash_mask; 101extern unsigned long Hash_size, Hash_mask;
93
94extern unsigned int num_tlbcam_entries;
95#endif 102#endif
96 103
97extern unsigned long ioremap_bot; 104extern unsigned long ioremap_bot;
diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
index db44e02e045b..ba5194817f8a 100644
--- a/arch/powerpc/mm/slice.c
+++ b/arch/powerpc/mm/slice.c
@@ -710,9 +710,18 @@ int is_hugepage_only_range(struct mm_struct *mm, unsigned long addr,
710 unsigned long len) 710 unsigned long len)
711{ 711{
712 struct slice_mask mask, available; 712 struct slice_mask mask, available;
713 unsigned int psize = mm->context.user_psize;
713 714
714 mask = slice_range_to_mask(addr, len); 715 mask = slice_range_to_mask(addr, len);
715 available = slice_mask_for_size(mm, mm->context.user_psize); 716 available = slice_mask_for_size(mm, psize);
717#ifdef CONFIG_PPC_64K_PAGES
718 /* We need to account for 4k slices too */
719 if (psize == MMU_PAGE_64K) {
720 struct slice_mask compat_mask;
721 compat_mask = slice_mask_for_size(mm, MMU_PAGE_4K);
722 or_mask(available, compat_mask);
723 }
724#endif
716 725
717#if 0 /* too verbose */ 726#if 0 /* too verbose */
718 slice_dbg("is_hugepage_only_range(mm=%p, addr=%lx, len=%lx)\n", 727 slice_dbg("is_hugepage_only_range(mm=%p, addr=%lx, len=%lx)\n",
diff --git a/arch/powerpc/mm/stab.c b/arch/powerpc/mm/stab.c
index 60e6032a8088..98cd1dc2ae75 100644
--- a/arch/powerpc/mm/stab.c
+++ b/arch/powerpc/mm/stab.c
@@ -251,8 +251,8 @@ void __init stabs_alloc(void)
251 251
252 paca[cpu].stab_addr = newstab; 252 paca[cpu].stab_addr = newstab;
253 paca[cpu].stab_real = virt_to_abs(newstab); 253 paca[cpu].stab_real = virt_to_abs(newstab);
254 printk(KERN_INFO "Segment table for CPU %d at 0x%lx " 254 printk(KERN_INFO "Segment table for CPU %d at 0x%llx "
255 "virtual, 0x%lx absolute\n", 255 "virtual, 0x%llx absolute\n",
256 cpu, paca[cpu].stab_addr, paca[cpu].stab_real); 256 cpu, paca[cpu].stab_addr, paca[cpu].stab_real);
257 } 257 }
258} 258}
diff --git a/arch/powerpc/oprofile/op_model_pa6t.c b/arch/powerpc/oprofile/op_model_pa6t.c
index c40de461fd4e..42f778dff919 100644
--- a/arch/powerpc/oprofile/op_model_pa6t.c
+++ b/arch/powerpc/oprofile/op_model_pa6t.c
@@ -132,7 +132,7 @@ static int pa6t_reg_setup(struct op_counter_config *ctr,
132 for (pmc = 0; pmc < cur_cpu_spec->num_pmcs; pmc++) { 132 for (pmc = 0; pmc < cur_cpu_spec->num_pmcs; pmc++) {
133 /* counters are 40 bit. Move to cputable at some point? */ 133 /* counters are 40 bit. Move to cputable at some point? */
134 reset_value[pmc] = (0x1UL << 39) - ctr[pmc].count; 134 reset_value[pmc] = (0x1UL << 39) - ctr[pmc].count;
135 pr_debug("reset_value for pmc%u inited to 0x%lx\n", 135 pr_debug("reset_value for pmc%u inited to 0x%llx\n",
136 pmc, reset_value[pmc]); 136 pmc, reset_value[pmc]);
137 } 137 }
138 138
@@ -177,7 +177,7 @@ static int pa6t_start(struct op_counter_config *ctr)
177 177
178 oprofile_running = 1; 178 oprofile_running = 1;
179 179
180 pr_debug("start on cpu %d, mmcr0 %lx\n", smp_processor_id(), mmcr0); 180 pr_debug("start on cpu %d, mmcr0 %llx\n", smp_processor_id(), mmcr0);
181 181
182 return 0; 182 return 0;
183} 183}
@@ -193,7 +193,7 @@ static void pa6t_stop(void)
193 193
194 oprofile_running = 0; 194 oprofile_running = 0;
195 195
196 pr_debug("stop on cpu %d, mmcr0 %lx\n", smp_processor_id(), mmcr0); 196 pr_debug("stop on cpu %d, mmcr0 %llx\n", smp_processor_id(), mmcr0);
197} 197}
198 198
199/* handle the perfmon overflow vector */ 199/* handle the perfmon overflow vector */
diff --git a/arch/powerpc/platforms/512x/clock.c b/arch/powerpc/platforms/512x/clock.c
index f416014ee727..1bcff94eb924 100644
--- a/arch/powerpc/platforms/512x/clock.c
+++ b/arch/powerpc/platforms/512x/clock.c
@@ -56,12 +56,12 @@ static struct clk *mpc5121_clk_get(struct device *dev, const char *id)
56 int dev_match = 0; 56 int dev_match = 0;
57 int id_match = 0; 57 int id_match = 0;
58 58
59 if (dev == NULL && id == NULL) 59 if (dev == NULL || id == NULL)
60 return NULL; 60 return NULL;
61 61
62 mutex_lock(&clocks_mutex); 62 mutex_lock(&clocks_mutex);
63 list_for_each_entry(p, &clocks, node) { 63 list_for_each_entry(p, &clocks, node) {
64 if (dev && dev == p->dev) 64 if (dev == p->dev)
65 dev_match++; 65 dev_match++;
66 if (strcmp(id, p->name) == 0) 66 if (strcmp(id, p->name) == 0)
67 id_match++; 67 id_match++;
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_gpio.c b/arch/powerpc/platforms/52xx/mpc52xx_gpio.c
index 8a455ebce98d..07f89ae46d04 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_gpio.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_gpio.c
@@ -363,11 +363,8 @@ static int mpc52xx_gpt_gpio_get(struct gpio_chip *gc, unsigned int gpio)
363{ 363{
364 struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); 364 struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc);
365 struct mpc52xx_gpt __iomem *regs = mm_gc->regs; 365 struct mpc52xx_gpt __iomem *regs = mm_gc->regs;
366 unsigned int ret;
367 366
368 return (in_be32(&regs->status) & (1 << (31 - 23))) ? 1 : 0; 367 return (in_be32(&regs->status) & (1 << (31 - 23))) ? 1 : 0;
369
370 return ret;
371} 368}
372 369
373static void 370static void
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pic.c b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
index 72865e8e4b51..0a093f03c758 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pic.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
@@ -196,6 +196,7 @@ static void mpc52xx_extirq_ack(unsigned int virq)
196 196
197static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type) 197static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type)
198{ 198{
199 struct irq_desc *desc = get_irq_desc(virq);
199 u32 ctrl_reg, type; 200 u32 ctrl_reg, type;
200 int irq; 201 int irq;
201 int l2irq; 202 int l2irq;
@@ -222,6 +223,11 @@ static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type)
222 type = 0; 223 type = 0;
223 } 224 }
224 225
226 desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
227 desc->status |= flow_type & IRQ_TYPE_SENSE_MASK;
228 if (flow_type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW))
229 desc->status |= IRQ_LEVEL;
230
225 ctrl_reg = in_be32(&intr->ctrl); 231 ctrl_reg = in_be32(&intr->ctrl);
226 ctrl_reg &= ~(0x3 << (22 - (l2irq * 2))); 232 ctrl_reg &= ~(0x3 << (22 - (l2irq * 2)));
227 ctrl_reg |= (type << (22 - (l2irq * 2))); 233 ctrl_reg |= (type << (22 - (l2irq * 2)));
@@ -231,7 +237,7 @@ static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type)
231} 237}
232 238
233static struct irq_chip mpc52xx_extirq_irqchip = { 239static struct irq_chip mpc52xx_extirq_irqchip = {
234 .typename = " MPC52xx IRQ[0-3] ", 240 .typename = "MPC52xx External",
235 .mask = mpc52xx_extirq_mask, 241 .mask = mpc52xx_extirq_mask,
236 .unmask = mpc52xx_extirq_unmask, 242 .unmask = mpc52xx_extirq_unmask,
237 .ack = mpc52xx_extirq_ack, 243 .ack = mpc52xx_extirq_ack,
diff --git a/arch/powerpc/platforms/83xx/Makefile b/arch/powerpc/platforms/83xx/Makefile
index ba5028e29890..051777c542c7 100644
--- a/arch/powerpc/platforms/83xx/Makefile
+++ b/arch/powerpc/platforms/83xx/Makefile
@@ -3,6 +3,7 @@
3# 3#
4obj-y := misc.o usb.o 4obj-y := misc.o usb.o
5obj-$(CONFIG_SUSPEND) += suspend.o suspend-asm.o 5obj-$(CONFIG_SUSPEND) += suspend.o suspend-asm.o
6obj-$(CONFIG_MCU_MPC8349EMITX) += mcu_mpc8349emitx.o
6obj-$(CONFIG_MPC831x_RDB) += mpc831x_rdb.o 7obj-$(CONFIG_MPC831x_RDB) += mpc831x_rdb.o
7obj-$(CONFIG_MPC832x_RDB) += mpc832x_rdb.o 8obj-$(CONFIG_MPC832x_RDB) += mpc832x_rdb.o
8obj-$(CONFIG_MPC834x_MDS) += mpc834x_mds.o 9obj-$(CONFIG_MPC834x_MDS) += mpc834x_mds.o
diff --git a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
new file mode 100644
index 000000000000..82a9bcb858b6
--- /dev/null
+++ b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
@@ -0,0 +1,209 @@
1/*
2 * Power Management and GPIO expander driver for MPC8349E-mITX-compatible MCU
3 *
4 * Copyright (c) 2008 MontaVista Software, Inc.
5 *
6 * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 */
13
14#include <linux/init.h>
15#include <linux/kernel.h>
16#include <linux/module.h>
17#include <linux/device.h>
18#include <linux/mutex.h>
19#include <linux/i2c.h>
20#include <linux/gpio.h>
21#include <linux/of.h>
22#include <linux/of_gpio.h>
23#include <asm/prom.h>
24#include <asm/machdep.h>
25
26/*
27 * I don't have specifications for the MCU firmware, I found this register
28 * and bits positions by the trial&error method.
29 */
30#define MCU_REG_CTRL 0x20
31#define MCU_CTRL_POFF 0x40
32
33#define MCU_NUM_GPIO 2
34
35struct mcu {
36 struct mutex lock;
37 struct device_node *np;
38 struct i2c_client *client;
39 struct of_gpio_chip of_gc;
40 u8 reg_ctrl;
41};
42
43static struct mcu *glob_mcu;
44
45static void mcu_power_off(void)
46{
47 struct mcu *mcu = glob_mcu;
48
49 pr_info("Sending power-off request to the MCU...\n");
50 mutex_lock(&mcu->lock);
51 i2c_smbus_write_byte_data(glob_mcu->client, MCU_REG_CTRL,
52 mcu->reg_ctrl | MCU_CTRL_POFF);
53 mutex_unlock(&mcu->lock);
54}
55
56static void mcu_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
57{
58 struct of_gpio_chip *of_gc = to_of_gpio_chip(gc);
59 struct mcu *mcu = container_of(of_gc, struct mcu, of_gc);
60 u8 bit = 1 << (4 + gpio);
61
62 mutex_lock(&mcu->lock);
63 if (val)
64 mcu->reg_ctrl &= ~bit;
65 else
66 mcu->reg_ctrl |= bit;
67
68 i2c_smbus_write_byte_data(mcu->client, MCU_REG_CTRL, mcu->reg_ctrl);
69 mutex_unlock(&mcu->lock);
70}
71
72static int mcu_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
73{
74 mcu_gpio_set(gc, gpio, val);
75 return 0;
76}
77
78static int mcu_gpiochip_add(struct mcu *mcu)
79{
80 struct device_node *np;
81 struct of_gpio_chip *of_gc = &mcu->of_gc;
82 struct gpio_chip *gc = &of_gc->gc;
83 int ret;
84
85 np = of_find_compatible_node(NULL, NULL, "fsl,mcu-mpc8349emitx");
86 if (!np)
87 return -ENODEV;
88
89 gc->owner = THIS_MODULE;
90 gc->label = np->full_name;
91 gc->can_sleep = 1;
92 gc->ngpio = MCU_NUM_GPIO;
93 gc->base = -1;
94 gc->set = mcu_gpio_set;
95 gc->direction_output = mcu_gpio_dir_out;
96 of_gc->gpio_cells = 2;
97 of_gc->xlate = of_gpio_simple_xlate;
98
99 np->data = of_gc;
100 mcu->np = np;
101
102 /*
103 * We don't want to lose the node, its ->data and ->full_name...
104 * So, if succeeded, we don't put the node here.
105 */
106 ret = gpiochip_add(gc);
107 if (ret)
108 of_node_put(np);
109 return ret;
110}
111
112static int mcu_gpiochip_remove(struct mcu *mcu)
113{
114 int ret;
115
116 ret = gpiochip_remove(&mcu->of_gc.gc);
117 if (ret)
118 return ret;
119 of_node_put(mcu->np);
120
121 return 0;
122}
123
124static int __devinit mcu_probe(struct i2c_client *client,
125 const struct i2c_device_id *id)
126{
127 struct mcu *mcu;
128 int ret;
129
130 mcu = kzalloc(sizeof(*mcu), GFP_KERNEL);
131 if (!mcu)
132 return -ENOMEM;
133
134 mutex_init(&mcu->lock);
135 mcu->client = client;
136 i2c_set_clientdata(client, mcu);
137
138 ret = i2c_smbus_read_byte_data(mcu->client, MCU_REG_CTRL);
139 if (ret < 0)
140 goto err;
141 mcu->reg_ctrl = ret;
142
143 ret = mcu_gpiochip_add(mcu);
144 if (ret)
145 goto err;
146
147 /* XXX: this is potentially racy, but there is no lock for ppc_md */
148 if (!ppc_md.power_off) {
149 glob_mcu = mcu;
150 ppc_md.power_off = mcu_power_off;
151 dev_info(&client->dev, "will provide power-off service\n");
152 }
153
154 return 0;
155err:
156 kfree(mcu);
157 return ret;
158}
159
160static int __devexit mcu_remove(struct i2c_client *client)
161{
162 struct mcu *mcu = i2c_get_clientdata(client);
163 int ret;
164
165 if (glob_mcu == mcu) {
166 ppc_md.power_off = NULL;
167 glob_mcu = NULL;
168 }
169
170 ret = mcu_gpiochip_remove(mcu);
171 if (ret)
172 return ret;
173 i2c_set_clientdata(client, NULL);
174 kfree(mcu);
175 return 0;
176}
177
178static const struct i2c_device_id mcu_ids[] = {
179 { "mcu-mpc8349emitx", },
180 {},
181};
182MODULE_DEVICE_TABLE(i2c, mcu_ids);
183
184static struct i2c_driver mcu_driver = {
185 .driver = {
186 .name = "mcu-mpc8349emitx",
187 .owner = THIS_MODULE,
188 },
189 .probe = mcu_probe,
190 .remove = __devexit_p(mcu_remove),
191 .id_table = mcu_ids,
192};
193
194static int __init mcu_init(void)
195{
196 return i2c_add_driver(&mcu_driver);
197}
198module_init(mcu_init);
199
200static void __exit mcu_exit(void)
201{
202 i2c_del_driver(&mcu_driver);
203}
204module_exit(mcu_exit);
205
206MODULE_DESCRIPTION("Power Management and GPIO expander driver for "
207 "MPC8349E-mITX-compatible MCU");
208MODULE_AUTHOR("Anton Vorontsov <avorontsov@ru.mvista.com>");
209MODULE_LICENSE("GPL");
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index 47fe2bea9865..200b9cb900ea 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -323,4 +323,15 @@ config SIMPLE_GPIO
323 chip-selects, Ethernet/USB PHY's power and various other small 323 chip-selects, Ethernet/USB PHY's power and various other small
324 on-board peripherals. 324 on-board peripherals.
325 325
326config MCU_MPC8349EMITX
327 tristate "MPC8349E-mITX MCU driver"
328 depends on I2C && PPC_83xx
329 select GENERIC_GPIO
330 select ARCH_REQUIRE_GPIOLIB
331 help
332 Say Y here to enable soft power-off functionality on the Freescale
333 boards with the MPC8349E-mITX-compatible MCU chips. This driver will
334 also register MCU GPIOs with the generic GPIO API, so you'll able
335 to use MCU pins as GPIOs.
336
326endmenu 337endmenu
diff --git a/arch/powerpc/platforms/cell/beat_interrupt.c b/arch/powerpc/platforms/cell/beat_interrupt.c
index 192a93509372..72254848a228 100644
--- a/arch/powerpc/platforms/cell/beat_interrupt.c
+++ b/arch/powerpc/platforms/cell/beat_interrupt.c
@@ -99,7 +99,7 @@ static void beatic_end_irq(unsigned int irq_plug)
99 err = beat_downcount_of_interrupt(irq_plug); 99 err = beat_downcount_of_interrupt(irq_plug);
100 if (err != 0) { 100 if (err != 0) {
101 if ((err & 0xFFFFFFFF) != 0xFFFFFFF5) /* -11: wrong state */ 101 if ((err & 0xFFFFFFFF) != 0xFFFFFFF5) /* -11: wrong state */
102 panic("Failed to downcount IRQ! Error = %16lx", err); 102 panic("Failed to downcount IRQ! Error = %16llx", err);
103 103
104 printk(KERN_ERR "IRQ over-downcounted, plug %d\n", irq_plug); 104 printk(KERN_ERR "IRQ over-downcounted, plug %d\n", irq_plug);
105 } 105 }
diff --git a/arch/powerpc/platforms/cell/celleb_scc_epci.c b/arch/powerpc/platforms/cell/celleb_scc_epci.c
index 08c285b10e30..48ec88a38a12 100644
--- a/arch/powerpc/platforms/cell/celleb_scc_epci.c
+++ b/arch/powerpc/platforms/cell/celleb_scc_epci.c
@@ -405,7 +405,7 @@ static int __init celleb_setup_epci(struct device_node *node,
405 hose->cfg_addr = ioremap(r.start, (r.end - r.start + 1)); 405 hose->cfg_addr = ioremap(r.start, (r.end - r.start + 1));
406 if (!hose->cfg_addr) 406 if (!hose->cfg_addr)
407 goto error; 407 goto error;
408 pr_debug("EPCI: cfg_addr map 0x%016lx->0x%016lx + 0x%016lx\n", 408 pr_debug("EPCI: cfg_addr map 0x%016llx->0x%016lx + 0x%016llx\n",
409 r.start, (unsigned long)hose->cfg_addr, (r.end - r.start + 1)); 409 r.start, (unsigned long)hose->cfg_addr, (r.end - r.start + 1));
410 410
411 if (of_address_to_resource(node, 2, &r)) 411 if (of_address_to_resource(node, 2, &r))
@@ -413,7 +413,7 @@ static int __init celleb_setup_epci(struct device_node *node,
413 hose->cfg_data = ioremap(r.start, (r.end - r.start + 1)); 413 hose->cfg_data = ioremap(r.start, (r.end - r.start + 1));
414 if (!hose->cfg_data) 414 if (!hose->cfg_data)
415 goto error; 415 goto error;
416 pr_debug("EPCI: cfg_data map 0x%016lx->0x%016lx + 0x%016lx\n", 416 pr_debug("EPCI: cfg_data map 0x%016llx->0x%016lx + 0x%016llx\n",
417 r.start, (unsigned long)hose->cfg_data, (r.end - r.start + 1)); 417 r.start, (unsigned long)hose->cfg_data, (r.end - r.start + 1));
418 418
419 hose->ops = &celleb_epci_ops; 419 hose->ops = &celleb_epci_ops;
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index 88d94b59a7cb..ee5033eddf01 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -855,7 +855,7 @@ static int __init cell_iommu_init_disabled(void)
855 */ 855 */
856 if (np && size < lmb_end_of_DRAM()) { 856 if (np && size < lmb_end_of_DRAM()) {
857 printk(KERN_WARNING "iommu: force-enabled, dma window" 857 printk(KERN_WARNING "iommu: force-enabled, dma window"
858 " (%ldMB) smaller than total memory (%ldMB)\n", 858 " (%ldMB) smaller than total memory (%lldMB)\n",
859 size >> 20, lmb_end_of_DRAM() >> 20); 859 size >> 20, lmb_end_of_DRAM() >> 20);
860 return -ENODEV; 860 return -ENODEV;
861 } 861 }
@@ -985,7 +985,7 @@ static void cell_dma_dev_setup_fixed(struct device *dev)
985 addr = cell_iommu_get_fixed_address(dev) + dma_iommu_fixed_base; 985 addr = cell_iommu_get_fixed_address(dev) + dma_iommu_fixed_base;
986 archdata->dma_data = (void *)addr; 986 archdata->dma_data = (void *)addr;
987 987
988 dev_dbg(dev, "iommu: fixed addr = %lx\n", addr); 988 dev_dbg(dev, "iommu: fixed addr = %llx\n", addr);
989} 989}
990 990
991static void insert_16M_pte(unsigned long addr, unsigned long *ptab, 991static void insert_16M_pte(unsigned long addr, unsigned long *ptab,
diff --git a/arch/powerpc/platforms/cell/ras.c b/arch/powerpc/platforms/cell/ras.c
index 7b4cefa2199b..5f961c464cc4 100644
--- a/arch/powerpc/platforms/cell/ras.c
+++ b/arch/powerpc/platforms/cell/ras.c
@@ -38,16 +38,16 @@ static void dump_fir(int cpu)
38 /* Todo: do some nicer parsing of bits and based on them go down 38 /* Todo: do some nicer parsing of bits and based on them go down
39 * to other sub-units FIRs and not only IIC 39 * to other sub-units FIRs and not only IIC
40 */ 40 */
41 printk(KERN_ERR "Global Checkstop FIR : 0x%016lx\n", 41 printk(KERN_ERR "Global Checkstop FIR : 0x%016llx\n",
42 in_be64(&pregs->checkstop_fir)); 42 in_be64(&pregs->checkstop_fir));
43 printk(KERN_ERR "Global Recoverable FIR : 0x%016lx\n", 43 printk(KERN_ERR "Global Recoverable FIR : 0x%016llx\n",
44 in_be64(&pregs->checkstop_fir)); 44 in_be64(&pregs->checkstop_fir));
45 printk(KERN_ERR "Global MachineCheck FIR : 0x%016lx\n", 45 printk(KERN_ERR "Global MachineCheck FIR : 0x%016llx\n",
46 in_be64(&pregs->spec_att_mchk_fir)); 46 in_be64(&pregs->spec_att_mchk_fir));
47 47
48 if (iregs == NULL) 48 if (iregs == NULL)
49 return; 49 return;
50 printk(KERN_ERR "IOC FIR : 0x%016lx\n", 50 printk(KERN_ERR "IOC FIR : 0x%016llx\n",
51 in_be64(&iregs->ioc_fir)); 51 in_be64(&iregs->ioc_fir));
52 52
53} 53}
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index a5bdb89a17c3..e487ad68ac11 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -151,7 +151,7 @@ static inline void spu_load_slb(struct spu *spu, int slbe, struct spu_slb *slb)
151{ 151{
152 struct spu_priv2 __iomem *priv2 = spu->priv2; 152 struct spu_priv2 __iomem *priv2 = spu->priv2;
153 153
154 pr_debug("%s: adding SLB[%d] 0x%016lx 0x%016lx\n", 154 pr_debug("%s: adding SLB[%d] 0x%016llx 0x%016llx\n",
155 __func__, slbe, slb->vsid, slb->esid); 155 __func__, slbe, slb->vsid, slb->esid);
156 156
157 out_be64(&priv2->slb_index_W, slbe); 157 out_be64(&priv2->slb_index_W, slbe);
@@ -221,7 +221,7 @@ static int __spu_trap_data_map(struct spu *spu, unsigned long ea, u64 dsisr)
221{ 221{
222 int ret; 222 int ret;
223 223
224 pr_debug("%s, %lx, %lx\n", __func__, dsisr, ea); 224 pr_debug("%s, %llx, %lx\n", __func__, dsisr, ea);
225 225
226 /* 226 /*
227 * Handle kernel space hash faults immediately. User hash 227 * Handle kernel space hash faults immediately. User hash
diff --git a/arch/powerpc/platforms/cell/spu_callbacks.c b/arch/powerpc/platforms/cell/spu_callbacks.c
index 19f6bfdbb933..fec1495e6b12 100644
--- a/arch/powerpc/platforms/cell/spu_callbacks.c
+++ b/arch/powerpc/platforms/cell/spu_callbacks.c
@@ -54,7 +54,7 @@ long spu_sys_callback(struct spu_syscall_block *s)
54 long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6); 54 long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6);
55 55
56 if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) { 56 if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) {
57 pr_debug("%s: invalid syscall #%ld", __func__, s->nr_ret); 57 pr_debug("%s: invalid syscall #%lld", __func__, s->nr_ret);
58 return -ENOSYS; 58 return -ENOSYS;
59 } 59 }
60 60
diff --git a/arch/powerpc/platforms/cell/spufs/coredump.c b/arch/powerpc/platforms/cell/spufs/coredump.c
index af116aadba10..c4d4a19235e0 100644
--- a/arch/powerpc/platforms/cell/spufs/coredump.c
+++ b/arch/powerpc/platforms/cell/spufs/coredump.c
@@ -42,7 +42,7 @@ static ssize_t do_coredump_read(int num, struct spu_context *ctx, void *buffer,
42 return spufs_coredump_read[num].read(ctx, buffer, size, off); 42 return spufs_coredump_read[num].read(ctx, buffer, size, off);
43 43
44 data = spufs_coredump_read[num].get(ctx); 44 data = spufs_coredump_read[num].get(ctx);
45 ret = snprintf(buffer, size, "0x%.16lx", data); 45 ret = snprintf(buffer, size, "0x%.16llx", data);
46 if (ret >= size) 46 if (ret >= size)
47 return size; 47 return size;
48 return ++ret; /* count trailing NULL */ 48 return ++ret; /* count trailing NULL */
diff --git a/arch/powerpc/platforms/cell/spufs/fault.c b/arch/powerpc/platforms/cell/spufs/fault.c
index f093a581ac74..a4dd3ae7223a 100644
--- a/arch/powerpc/platforms/cell/spufs/fault.c
+++ b/arch/powerpc/platforms/cell/spufs/fault.c
@@ -132,7 +132,7 @@ int spufs_handle_class1(struct spu_context *ctx)
132 132
133 spuctx_switch_state(ctx, SPU_UTIL_IOWAIT); 133 spuctx_switch_state(ctx, SPU_UTIL_IOWAIT);
134 134
135 pr_debug("ctx %p: ea %016lx, dsisr %016lx state %d\n", ctx, ea, 135 pr_debug("ctx %p: ea %016llx, dsisr %016llx state %d\n", ctx, ea,
136 dsisr, ctx->state); 136 dsisr, ctx->state);
137 137
138 ctx->stats.hash_flt++; 138 ctx->stats.hash_flt++;
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index 7106b63d401b..0da7f2bf5ee1 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -1654,7 +1654,7 @@ out:
1654 1654
1655static int spufs_check_valid_dma(struct mfc_dma_command *cmd) 1655static int spufs_check_valid_dma(struct mfc_dma_command *cmd)
1656{ 1656{
1657 pr_debug("queueing DMA %x %lx %x %x %x\n", cmd->lsa, 1657 pr_debug("queueing DMA %x %llx %x %x %x\n", cmd->lsa,
1658 cmd->ea, cmd->size, cmd->tag, cmd->cmd); 1658 cmd->ea, cmd->size, cmd->tag, cmd->cmd);
1659 1659
1660 switch (cmd->cmd) { 1660 switch (cmd->cmd) {
@@ -1671,7 +1671,7 @@ static int spufs_check_valid_dma(struct mfc_dma_command *cmd)
1671 } 1671 }
1672 1672
1673 if ((cmd->lsa & 0xf) != (cmd->ea &0xf)) { 1673 if ((cmd->lsa & 0xf) != (cmd->ea &0xf)) {
1674 pr_debug("invalid DMA alignment, ea %lx lsa %x\n", 1674 pr_debug("invalid DMA alignment, ea %llx lsa %x\n",
1675 cmd->ea, cmd->lsa); 1675 cmd->ea, cmd->lsa);
1676 return -EIO; 1676 return -EIO;
1677 } 1677 }
@@ -2633,7 +2633,7 @@ static int spufs_show_ctx(struct seq_file *s, void *private)
2633 } 2633 }
2634 2634
2635 seq_printf(s, "%c flgs(%lx) sflgs(%lx) pri(%d) ts(%d) spu(%02d)" 2635 seq_printf(s, "%c flgs(%lx) sflgs(%lx) pri(%d) ts(%d) spu(%02d)"
2636 " %c %lx %lx %lx %lx %x %x\n", 2636 " %c %llx %llx %llx %llx %x %x\n",
2637 ctx->state == SPU_STATE_SAVED ? 'S' : 'R', 2637 ctx->state == SPU_STATE_SAVED ? 'S' : 'R',
2638 ctx->flags, 2638 ctx->flags,
2639 ctx->sched_flags, 2639 ctx->sched_flags,
diff --git a/arch/powerpc/platforms/fsl_uli1575.c b/arch/powerpc/platforms/fsl_uli1575.c
index 8c619963becc..1db6b9e037fc 100644
--- a/arch/powerpc/platforms/fsl_uli1575.c
+++ b/arch/powerpc/platforms/fsl_uli1575.c
@@ -249,6 +249,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5288, quirk_uli5288);
249DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229); 249DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229);
250DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x5249, quirk_final_uli5249); 250DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x5249, quirk_final_uli5249);
251DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x1575, quirk_final_uli1575); 251DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x1575, quirk_final_uli1575);
252DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229);
252 253
253static void __devinit hpcd_quirk_uli1575(struct pci_dev *dev) 254static void __devinit hpcd_quirk_uli1575(struct pci_dev *dev)
254{ 255{
diff --git a/arch/powerpc/platforms/iseries/iommu.c b/arch/powerpc/platforms/iseries/iommu.c
index bbe828f1b885..6ed75bffc8ab 100644
--- a/arch/powerpc/platforms/iseries/iommu.c
+++ b/arch/powerpc/platforms/iseries/iommu.c
@@ -66,7 +66,7 @@ static int tce_build_iSeries(struct iommu_table *tbl, long index, long npages,
66 66
67 rc = HvCallXm_setTce((u64)tbl->it_index, (u64)index, tce); 67 rc = HvCallXm_setTce((u64)tbl->it_index, (u64)index, tce);
68 if (rc) 68 if (rc)
69 panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%lx\n", 69 panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%llx\n",
70 rc); 70 rc);
71 index++; 71 index++;
72 uaddr += TCE_PAGE_SIZE; 72 uaddr += TCE_PAGE_SIZE;
@@ -81,7 +81,7 @@ static void tce_free_iSeries(struct iommu_table *tbl, long index, long npages)
81 while (npages--) { 81 while (npages--) {
82 rc = HvCallXm_setTce((u64)tbl->it_index, (u64)index, 0); 82 rc = HvCallXm_setTce((u64)tbl->it_index, (u64)index, 0);
83 if (rc) 83 if (rc)
84 panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%lx\n", 84 panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%llx\n",
85 rc); 85 rc);
86 index++; 86 index++;
87 } 87 }
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index 6b0711c15eca..bd8817b00fa4 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -53,7 +53,7 @@
53#include <asm/pmac_low_i2c.h> 53#include <asm/pmac_low_i2c.h>
54#include <asm/pmac_pfunc.h> 54#include <asm/pmac_pfunc.h>
55 55
56#define DEBUG 56#undef DEBUG
57 57
58#ifdef DEBUG 58#ifdef DEBUG
59#define DBG(fmt...) udbg_printf(fmt) 59#define DBG(fmt...) udbg_printf(fmt)
diff --git a/arch/powerpc/platforms/ps3/device-init.c b/arch/powerpc/platforms/ps3/device-init.c
index ca71a12b764c..bb028f165fb3 100644
--- a/arch/powerpc/platforms/ps3/device-init.c
+++ b/arch/powerpc/platforms/ps3/device-init.c
@@ -82,7 +82,7 @@ static int __init ps3_register_lpm_devices(void)
82 goto fail_rights; 82 goto fail_rights;
83 } 83 }
84 84
85 pr_debug("%s:%d: pu_id %lu, rights %lu(%lxh)\n", 85 pr_debug("%s:%d: pu_id %llu, rights %llu(%llxh)\n",
86 __func__, __LINE__, dev->lpm.pu_id, dev->lpm.rights, 86 __func__, __LINE__, dev->lpm.pu_id, dev->lpm.rights,
87 dev->lpm.rights); 87 dev->lpm.rights);
88 88
@@ -348,7 +348,7 @@ static int ps3_setup_storage_dev(const struct ps3_repository_device *repo,
348 return -ENODEV; 348 return -ENODEV;
349 } 349 }
350 350
351 pr_debug("%s:%u: (%u:%u:%u): port %lu blk_size %lu num_blocks %lu " 351 pr_debug("%s:%u: (%u:%u:%u): port %llu blk_size %llu num_blocks %llu "
352 "num_regions %u\n", __func__, __LINE__, repo->bus_index, 352 "num_regions %u\n", __func__, __LINE__, repo->bus_index,
353 repo->dev_index, repo->dev_type, port, blk_size, num_blocks, 353 repo->dev_index, repo->dev_type, port, blk_size, num_blocks,
354 num_regions); 354 num_regions);
@@ -394,7 +394,7 @@ static int ps3_setup_storage_dev(const struct ps3_repository_device *repo,
394 result = -ENODEV; 394 result = -ENODEV;
395 goto fail_read_region; 395 goto fail_read_region;
396 } 396 }
397 pr_debug("%s:%u: region %u: id %u start %lu size %lu\n", 397 pr_debug("%s:%u: region %u: id %u start %llu size %llu\n",
398 __func__, __LINE__, i, id, start, size); 398 __func__, __LINE__, i, id, start, size);
399 399
400 p->regions[i].id = id; 400 p->regions[i].id = id;
@@ -662,13 +662,13 @@ static void ps3_find_and_add_device(u64 bus_id, u64 dev_id)
662 if (rem) 662 if (rem)
663 break; 663 break;
664 } 664 }
665 pr_warning("%s:%u: device %lu:%lu not found\n", __func__, __LINE__, 665 pr_warning("%s:%u: device %llu:%llu not found\n", __func__, __LINE__,
666 bus_id, dev_id); 666 bus_id, dev_id);
667 return; 667 return;
668 668
669found: 669found:
670 if (retries) 670 if (retries)
671 pr_debug("%s:%u: device %lu:%lu found after %u retries\n", 671 pr_debug("%s:%u: device %llu:%llu found after %u retries\n",
672 __func__, __LINE__, bus_id, dev_id, retries); 672 __func__, __LINE__, bus_id, dev_id, retries);
673 673
674 ps3_setup_dynamic_device(&repo); 674 ps3_setup_dynamic_device(&repo);
@@ -715,14 +715,14 @@ static irqreturn_t ps3_notification_interrupt(int irq, void *data)
715 res = lv1_storage_get_async_status(PS3_NOTIFICATION_DEV_ID, &tag, 715 res = lv1_storage_get_async_status(PS3_NOTIFICATION_DEV_ID, &tag,
716 &status); 716 &status);
717 if (tag != dev->tag) 717 if (tag != dev->tag)
718 pr_err("%s:%u: tag mismatch, got %lx, expected %lx\n", 718 pr_err("%s:%u: tag mismatch, got %llx, expected %llx\n",
719 __func__, __LINE__, tag, dev->tag); 719 __func__, __LINE__, tag, dev->tag);
720 720
721 if (res) { 721 if (res) {
722 pr_err("%s:%u: res %d status 0x%lx\n", __func__, __LINE__, res, 722 pr_err("%s:%u: res %d status 0x%llx\n", __func__, __LINE__, res,
723 status); 723 status);
724 } else { 724 } else {
725 pr_debug("%s:%u: completed, status 0x%lx\n", __func__, 725 pr_debug("%s:%u: completed, status 0x%llx\n", __func__,
726 __LINE__, status); 726 __LINE__, status);
727 dev->lv1_status = status; 727 dev->lv1_status = status;
728 complete(&dev->done); 728 complete(&dev->done);
@@ -761,7 +761,7 @@ static int ps3_notification_read_write(struct ps3_notification_device *dev,
761 } 761 }
762 762
763 if (dev->lv1_status) { 763 if (dev->lv1_status) {
764 pr_err("%s:%u: %s not completed, status 0x%lx\n", __func__, 764 pr_err("%s:%u: %s not completed, status 0x%llx\n", __func__,
765 __LINE__, op, dev->lv1_status); 765 __LINE__, op, dev->lv1_status);
766 return -EIO; 766 return -EIO;
767 } 767 }
@@ -850,16 +850,16 @@ static int ps3_probe_thread(void *data)
850 if (res) 850 if (res)
851 break; 851 break;
852 852
853 pr_debug("%s:%u: notify event type 0x%lx bus id %lu dev id %lu" 853 pr_debug("%s:%u: notify event type 0x%llx bus id %llu dev id %llu"
854 " type %lu port %lu\n", __func__, __LINE__, 854 " type %llu port %llu\n", __func__, __LINE__,
855 notify_event->event_type, notify_event->bus_id, 855 notify_event->event_type, notify_event->bus_id,
856 notify_event->dev_id, notify_event->dev_type, 856 notify_event->dev_id, notify_event->dev_type,
857 notify_event->dev_port); 857 notify_event->dev_port);
858 858
859 if (notify_event->event_type != notify_region_probe || 859 if (notify_event->event_type != notify_region_probe ||
860 notify_event->bus_id != dev.sbd.bus_id) { 860 notify_event->bus_id != dev.sbd.bus_id) {
861 pr_warning("%s:%u: bad notify_event: event %lu, " 861 pr_warning("%s:%u: bad notify_event: event %llu, "
862 "dev_id %lu, dev_type %lu\n", 862 "dev_id %llu, dev_type %llu\n",
863 __func__, __LINE__, notify_event->event_type, 863 __func__, __LINE__, notify_event->event_type,
864 notify_event->dev_id, 864 notify_event->dev_id,
865 notify_event->dev_type); 865 notify_event->dev_type);
diff --git a/arch/powerpc/platforms/ps3/htab.c b/arch/powerpc/platforms/ps3/htab.c
index 6eb1d4d182c9..1e8a1e39dfe8 100644
--- a/arch/powerpc/platforms/ps3/htab.c
+++ b/arch/powerpc/platforms/ps3/htab.c
@@ -75,7 +75,7 @@ static long ps3_hpte_insert(unsigned long hpte_group, unsigned long va,
75 75
76 if (result) { 76 if (result) {
77 /* all entries bolted !*/ 77 /* all entries bolted !*/
78 pr_info("%s:result=%d va=%lx pa=%lx ix=%lx v=%lx r=%lx\n", 78 pr_info("%s:result=%d va=%lx pa=%lx ix=%lx v=%llx r=%llx\n",
79 __func__, result, va, pa, hpte_group, hpte_v, hpte_r); 79 __func__, result, va, pa, hpte_group, hpte_v, hpte_r);
80 BUG(); 80 BUG();
81 } 81 }
diff --git a/arch/powerpc/platforms/ps3/interrupt.c b/arch/powerpc/platforms/ps3/interrupt.c
index e59634f7af96..8ec5ccf76b19 100644
--- a/arch/powerpc/platforms/ps3/interrupt.c
+++ b/arch/powerpc/platforms/ps3/interrupt.c
@@ -60,6 +60,8 @@
60 * gives a usable range of plug values of {NUM_ISA_INTERRUPTS..63}. Note 60 * gives a usable range of plug values of {NUM_ISA_INTERRUPTS..63}. Note
61 * that there is no constraint on how many in this set an individual thread 61 * that there is no constraint on how many in this set an individual thread
62 * can acquire. 62 * can acquire.
63 *
64 * The mask is declared as unsigned long so we can use set/clear_bit on it.
63 */ 65 */
64 66
65#define PS3_BMP_MINALIGN 64 67#define PS3_BMP_MINALIGN 64
@@ -68,7 +70,7 @@ struct ps3_bmp {
68 struct { 70 struct {
69 u64 status; 71 u64 status;
70 u64 unused_1[3]; 72 u64 unused_1[3];
71 u64 mask; 73 unsigned long mask;
72 u64 unused_2[3]; 74 u64 unused_2[3];
73 }; 75 };
74 u64 ipi_debug_brk_mask; 76 u64 ipi_debug_brk_mask;
@@ -102,7 +104,7 @@ static void ps3_chip_mask(unsigned int virq)
102 struct ps3_private *pd = get_irq_chip_data(virq); 104 struct ps3_private *pd = get_irq_chip_data(virq);
103 unsigned long flags; 105 unsigned long flags;
104 106
105 pr_debug("%s:%d: thread_id %lu, virq %d\n", __func__, __LINE__, 107 pr_debug("%s:%d: thread_id %llu, virq %d\n", __func__, __LINE__,
106 pd->thread_id, virq); 108 pd->thread_id, virq);
107 109
108 local_irq_save(flags); 110 local_irq_save(flags);
@@ -123,7 +125,7 @@ static void ps3_chip_unmask(unsigned int virq)
123 struct ps3_private *pd = get_irq_chip_data(virq); 125 struct ps3_private *pd = get_irq_chip_data(virq);
124 unsigned long flags; 126 unsigned long flags;
125 127
126 pr_debug("%s:%d: thread_id %lu, virq %d\n", __func__, __LINE__, 128 pr_debug("%s:%d: thread_id %llu, virq %d\n", __func__, __LINE__,
127 pd->thread_id, virq); 129 pd->thread_id, virq);
128 130
129 local_irq_save(flags); 131 local_irq_save(flags);
@@ -221,7 +223,7 @@ static int ps3_virq_destroy(unsigned int virq)
221{ 223{
222 const struct ps3_private *pd = get_irq_chip_data(virq); 224 const struct ps3_private *pd = get_irq_chip_data(virq);
223 225
224 pr_debug("%s:%d: ppe_id %lu, thread_id %lu, virq %u\n", __func__, 226 pr_debug("%s:%d: ppe_id %llu, thread_id %llu, virq %u\n", __func__,
225 __LINE__, pd->ppe_id, pd->thread_id, virq); 227 __LINE__, pd->ppe_id, pd->thread_id, virq);
226 228
227 set_irq_chip_data(virq, NULL); 229 set_irq_chip_data(virq, NULL);
@@ -291,7 +293,7 @@ int ps3_irq_plug_destroy(unsigned int virq)
291 int result; 293 int result;
292 const struct ps3_private *pd = get_irq_chip_data(virq); 294 const struct ps3_private *pd = get_irq_chip_data(virq);
293 295
294 pr_debug("%s:%d: ppe_id %lu, thread_id %lu, virq %u\n", __func__, 296 pr_debug("%s:%d: ppe_id %llu, thread_id %llu, virq %u\n", __func__,
295 __LINE__, pd->ppe_id, pd->thread_id, virq); 297 __LINE__, pd->ppe_id, pd->thread_id, virq);
296 298
297 ps3_chip_mask(virq); 299 ps3_chip_mask(virq);
@@ -322,7 +324,7 @@ EXPORT_SYMBOL_GPL(ps3_irq_plug_destroy);
322int ps3_event_receive_port_setup(enum ps3_cpu_binding cpu, unsigned int *virq) 324int ps3_event_receive_port_setup(enum ps3_cpu_binding cpu, unsigned int *virq)
323{ 325{
324 int result; 326 int result;
325 unsigned long outlet; 327 u64 outlet;
326 328
327 result = lv1_construct_event_receive_port(&outlet); 329 result = lv1_construct_event_receive_port(&outlet);
328 330
@@ -468,7 +470,7 @@ int ps3_io_irq_setup(enum ps3_cpu_binding cpu, unsigned int interrupt_id,
468 unsigned int *virq) 470 unsigned int *virq)
469{ 471{
470 int result; 472 int result;
471 unsigned long outlet; 473 u64 outlet;
472 474
473 result = lv1_construct_io_irq_outlet(interrupt_id, &outlet); 475 result = lv1_construct_io_irq_outlet(interrupt_id, &outlet);
474 476
@@ -525,7 +527,7 @@ int ps3_vuart_irq_setup(enum ps3_cpu_binding cpu, void* virt_addr_bmp,
525 unsigned int *virq) 527 unsigned int *virq)
526{ 528{
527 int result; 529 int result;
528 unsigned long outlet; 530 u64 outlet;
529 u64 lpar_addr; 531 u64 lpar_addr;
530 532
531 BUG_ON(!is_kernel_addr((u64)virt_addr_bmp)); 533 BUG_ON(!is_kernel_addr((u64)virt_addr_bmp));
@@ -581,7 +583,7 @@ int ps3_spe_irq_setup(enum ps3_cpu_binding cpu, unsigned long spe_id,
581 unsigned int class, unsigned int *virq) 583 unsigned int class, unsigned int *virq)
582{ 584{
583 int result; 585 int result;
584 unsigned long outlet; 586 u64 outlet;
585 587
586 BUG_ON(class > 2); 588 BUG_ON(class > 2);
587 589
@@ -691,7 +693,7 @@ void __init ps3_register_ipi_debug_brk(unsigned int cpu, unsigned int virq)
691 693
692 pd->bmp.ipi_debug_brk_mask = 0x8000000000000000UL >> virq; 694 pd->bmp.ipi_debug_brk_mask = 0x8000000000000000UL >> virq;
693 695
694 pr_debug("%s:%d: cpu %u, virq %u, mask %lxh\n", __func__, __LINE__, 696 pr_debug("%s:%d: cpu %u, virq %u, mask %llxh\n", __func__, __LINE__,
695 cpu, virq, pd->bmp.ipi_debug_brk_mask); 697 cpu, virq, pd->bmp.ipi_debug_brk_mask);
696} 698}
697 699
@@ -710,7 +712,7 @@ static unsigned int ps3_get_irq(void)
710 plug &= 0x3f; 712 plug &= 0x3f;
711 713
712 if (unlikely(plug == NO_IRQ)) { 714 if (unlikely(plug == NO_IRQ)) {
713 pr_debug("%s:%d: no plug found: thread_id %lu\n", __func__, 715 pr_debug("%s:%d: no plug found: thread_id %llu\n", __func__,
714 __LINE__, pd->thread_id); 716 __LINE__, pd->thread_id);
715 dump_bmp(&per_cpu(ps3_private, 0)); 717 dump_bmp(&per_cpu(ps3_private, 0));
716 dump_bmp(&per_cpu(ps3_private, 1)); 718 dump_bmp(&per_cpu(ps3_private, 1));
@@ -745,7 +747,7 @@ void __init ps3_init_IRQ(void)
745 pd->thread_id = get_hard_smp_processor_id(cpu); 747 pd->thread_id = get_hard_smp_processor_id(cpu);
746 spin_lock_init(&pd->bmp.lock); 748 spin_lock_init(&pd->bmp.lock);
747 749
748 pr_debug("%s:%d: ppe_id %lu, thread_id %lu, bmp %lxh\n", 750 pr_debug("%s:%d: ppe_id %llu, thread_id %llu, bmp %lxh\n",
749 __func__, __LINE__, pd->ppe_id, pd->thread_id, 751 __func__, __LINE__, pd->ppe_id, pd->thread_id,
750 ps3_mm_phys_to_lpar(__pa(&pd->bmp))); 752 ps3_mm_phys_to_lpar(__pa(&pd->bmp)));
751 753
@@ -770,6 +772,6 @@ void ps3_shutdown_IRQ(int cpu)
770 lv1_get_logical_ppe_id(&ppe_id); 772 lv1_get_logical_ppe_id(&ppe_id);
771 result = lv1_configure_irq_state_bitmap(ppe_id, thread_id, 0); 773 result = lv1_configure_irq_state_bitmap(ppe_id, thread_id, 0);
772 774
773 DBG("%s:%d: lv1_configure_irq_state_bitmap (%lu:%lu/%d) %s\n", __func__, 775 DBG("%s:%d: lv1_configure_irq_state_bitmap (%llu:%llu/%d) %s\n", __func__,
774 __LINE__, ppe_id, thread_id, cpu, ps3_result(result)); 776 __LINE__, ppe_id, thread_id, cpu, ps3_result(result));
775} 777}
diff --git a/arch/powerpc/platforms/ps3/mm.c b/arch/powerpc/platforms/ps3/mm.c
index a4d49dd9e8a9..67de6bf3db3d 100644
--- a/arch/powerpc/platforms/ps3/mm.c
+++ b/arch/powerpc/platforms/ps3/mm.c
@@ -79,8 +79,8 @@ enum {
79 */ 79 */
80 80
81struct mem_region { 81struct mem_region {
82 unsigned long base; 82 u64 base;
83 unsigned long size; 83 u64 size;
84 unsigned long offset; 84 unsigned long offset;
85}; 85};
86 86
@@ -103,9 +103,9 @@ struct mem_region {
103 */ 103 */
104 104
105struct map { 105struct map {
106 unsigned long total; 106 u64 total;
107 unsigned long vas_id; 107 u64 vas_id;
108 unsigned long htab_size; 108 u64 htab_size;
109 struct mem_region rm; 109 struct mem_region rm;
110 struct mem_region r1; 110 struct mem_region r1;
111}; 111};
@@ -114,13 +114,13 @@ struct map {
114static void __maybe_unused _debug_dump_map(const struct map *m, 114static void __maybe_unused _debug_dump_map(const struct map *m,
115 const char *func, int line) 115 const char *func, int line)
116{ 116{
117 DBG("%s:%d: map.total = %lxh\n", func, line, m->total); 117 DBG("%s:%d: map.total = %llxh\n", func, line, m->total);
118 DBG("%s:%d: map.rm.size = %lxh\n", func, line, m->rm.size); 118 DBG("%s:%d: map.rm.size = %llxh\n", func, line, m->rm.size);
119 DBG("%s:%d: map.vas_id = %lu\n", func, line, m->vas_id); 119 DBG("%s:%d: map.vas_id = %llu\n", func, line, m->vas_id);
120 DBG("%s:%d: map.htab_size = %lxh\n", func, line, m->htab_size); 120 DBG("%s:%d: map.htab_size = %llxh\n", func, line, m->htab_size);
121 DBG("%s:%d: map.r1.base = %lxh\n", func, line, m->r1.base); 121 DBG("%s:%d: map.r1.base = %llxh\n", func, line, m->r1.base);
122 DBG("%s:%d: map.r1.offset = %lxh\n", func, line, m->r1.offset); 122 DBG("%s:%d: map.r1.offset = %lxh\n", func, line, m->r1.offset);
123 DBG("%s:%d: map.r1.size = %lxh\n", func, line, m->r1.size); 123 DBG("%s:%d: map.r1.size = %llxh\n", func, line, m->r1.size);
124} 124}
125 125
126static struct map map; 126static struct map map;
@@ -146,11 +146,11 @@ EXPORT_SYMBOL(ps3_mm_phys_to_lpar);
146void __init ps3_mm_vas_create(unsigned long* htab_size) 146void __init ps3_mm_vas_create(unsigned long* htab_size)
147{ 147{
148 int result; 148 int result;
149 unsigned long start_address; 149 u64 start_address;
150 unsigned long size; 150 u64 size;
151 unsigned long access_right; 151 u64 access_right;
152 unsigned long max_page_size; 152 u64 max_page_size;
153 unsigned long flags; 153 u64 flags;
154 154
155 result = lv1_query_logical_partition_address_region_info(0, 155 result = lv1_query_logical_partition_address_region_info(0,
156 &start_address, &size, &access_right, &max_page_size, 156 &start_address, &size, &access_right, &max_page_size,
@@ -164,7 +164,7 @@ void __init ps3_mm_vas_create(unsigned long* htab_size)
164 } 164 }
165 165
166 if (max_page_size < PAGE_SHIFT_16M) { 166 if (max_page_size < PAGE_SHIFT_16M) {
167 DBG("%s:%d: bad max_page_size %lxh\n", __func__, __LINE__, 167 DBG("%s:%d: bad max_page_size %llxh\n", __func__, __LINE__,
168 max_page_size); 168 max_page_size);
169 goto fail; 169 goto fail;
170 } 170 }
@@ -208,7 +208,7 @@ void ps3_mm_vas_destroy(void)
208{ 208{
209 int result; 209 int result;
210 210
211 DBG("%s:%d: map.vas_id = %lu\n", __func__, __LINE__, map.vas_id); 211 DBG("%s:%d: map.vas_id = %llu\n", __func__, __LINE__, map.vas_id);
212 212
213 if (map.vas_id) { 213 if (map.vas_id) {
214 result = lv1_select_virtual_address_space(0); 214 result = lv1_select_virtual_address_space(0);
@@ -235,15 +235,14 @@ void ps3_mm_vas_destroy(void)
235static int ps3_mm_region_create(struct mem_region *r, unsigned long size) 235static int ps3_mm_region_create(struct mem_region *r, unsigned long size)
236{ 236{
237 int result; 237 int result;
238 unsigned long muid; 238 u64 muid;
239 239
240 r->size = _ALIGN_DOWN(size, 1 << PAGE_SHIFT_16M); 240 r->size = _ALIGN_DOWN(size, 1 << PAGE_SHIFT_16M);
241 241
242 DBG("%s:%d requested %lxh\n", __func__, __LINE__, size); 242 DBG("%s:%d requested %lxh\n", __func__, __LINE__, size);
243 DBG("%s:%d actual %lxh\n", __func__, __LINE__, r->size); 243 DBG("%s:%d actual %llxh\n", __func__, __LINE__, r->size);
244 DBG("%s:%d difference %lxh (%luMB)\n", __func__, __LINE__, 244 DBG("%s:%d difference %llxh (%lluMB)\n", __func__, __LINE__,
245 (unsigned long)(size - r->size), 245 size - r->size, (size - r->size) / 1024 / 1024);
246 (size - r->size) / 1024 / 1024);
247 246
248 if (r->size == 0) { 247 if (r->size == 0) {
249 DBG("%s:%d: size == 0\n", __func__, __LINE__); 248 DBG("%s:%d: size == 0\n", __func__, __LINE__);
@@ -277,7 +276,7 @@ static void ps3_mm_region_destroy(struct mem_region *r)
277{ 276{
278 int result; 277 int result;
279 278
280 DBG("%s:%d: r->base = %lxh\n", __func__, __LINE__, r->base); 279 DBG("%s:%d: r->base = %llxh\n", __func__, __LINE__, r->base);
281 if (r->base) { 280 if (r->base) {
282 result = lv1_release_memory(r->base); 281 result = lv1_release_memory(r->base);
283 BUG_ON(result); 282 BUG_ON(result);
@@ -355,7 +354,7 @@ static unsigned long dma_sb_lpar_to_bus(struct ps3_dma_region *r,
355static void __maybe_unused _dma_dump_region(const struct ps3_dma_region *r, 354static void __maybe_unused _dma_dump_region(const struct ps3_dma_region *r,
356 const char *func, int line) 355 const char *func, int line)
357{ 356{
358 DBG("%s:%d: dev %lu:%lu\n", func, line, r->dev->bus_id, 357 DBG("%s:%d: dev %llu:%llu\n", func, line, r->dev->bus_id,
359 r->dev->dev_id); 358 r->dev->dev_id);
360 DBG("%s:%d: page_size %u\n", func, line, r->page_size); 359 DBG("%s:%d: page_size %u\n", func, line, r->page_size);
361 DBG("%s:%d: bus_addr %lxh\n", func, line, r->bus_addr); 360 DBG("%s:%d: bus_addr %lxh\n", func, line, r->bus_addr);
@@ -390,7 +389,7 @@ struct dma_chunk {
390static void _dma_dump_chunk (const struct dma_chunk* c, const char* func, 389static void _dma_dump_chunk (const struct dma_chunk* c, const char* func,
391 int line) 390 int line)
392{ 391{
393 DBG("%s:%d: r.dev %lu:%lu\n", func, line, 392 DBG("%s:%d: r.dev %llu:%llu\n", func, line,
394 c->region->dev->bus_id, c->region->dev->dev_id); 393 c->region->dev->bus_id, c->region->dev->dev_id);
395 DBG("%s:%d: r.bus_addr %lxh\n", func, line, c->region->bus_addr); 394 DBG("%s:%d: r.bus_addr %lxh\n", func, line, c->region->bus_addr);
396 DBG("%s:%d: r.page_size %u\n", func, line, c->region->page_size); 395 DBG("%s:%d: r.page_size %u\n", func, line, c->region->page_size);
@@ -596,7 +595,7 @@ static int dma_ioc0_map_pages(struct ps3_dma_region *r, unsigned long phys_addr,
596 595
597 /* build ioptes for the area */ 596 /* build ioptes for the area */
598 pages = len >> r->page_size; 597 pages = len >> r->page_size;
599 DBG("%s: pgsize=%#x len=%#lx pages=%#x iopteflag=%#lx\n", __func__, 598 DBG("%s: pgsize=%#x len=%#lx pages=%#x iopteflag=%#llx\n", __func__,
600 r->page_size, r->len, pages, iopte_flag); 599 r->page_size, r->len, pages, iopte_flag);
601 for (iopage = 0; iopage < pages; iopage++) { 600 for (iopage = 0; iopage < pages; iopage++) {
602 offset = (1 << r->page_size) * iopage; 601 offset = (1 << r->page_size) * iopage;
@@ -648,13 +647,14 @@ fail_alloc:
648static int dma_sb_region_create(struct ps3_dma_region *r) 647static int dma_sb_region_create(struct ps3_dma_region *r)
649{ 648{
650 int result; 649 int result;
650 u64 bus_addr;
651 651
652 DBG(" -> %s:%d:\n", __func__, __LINE__); 652 DBG(" -> %s:%d:\n", __func__, __LINE__);
653 653
654 BUG_ON(!r); 654 BUG_ON(!r);
655 655
656 if (!r->dev->bus_id) { 656 if (!r->dev->bus_id) {
657 pr_info("%s:%d: %lu:%lu no dma\n", __func__, __LINE__, 657 pr_info("%s:%d: %llu:%llu no dma\n", __func__, __LINE__,
658 r->dev->bus_id, r->dev->dev_id); 658 r->dev->bus_id, r->dev->dev_id);
659 return 0; 659 return 0;
660 } 660 }
@@ -671,7 +671,8 @@ static int dma_sb_region_create(struct ps3_dma_region *r)
671 671
672 result = lv1_allocate_device_dma_region(r->dev->bus_id, r->dev->dev_id, 672 result = lv1_allocate_device_dma_region(r->dev->bus_id, r->dev->dev_id,
673 roundup_pow_of_two(r->len), r->page_size, r->region_type, 673 roundup_pow_of_two(r->len), r->page_size, r->region_type,
674 &r->bus_addr); 674 &bus_addr);
675 r->bus_addr = bus_addr;
675 676
676 if (result) { 677 if (result) {
677 DBG("%s:%d: lv1_allocate_device_dma_region failed: %s\n", 678 DBG("%s:%d: lv1_allocate_device_dma_region failed: %s\n",
@@ -685,6 +686,7 @@ static int dma_sb_region_create(struct ps3_dma_region *r)
685static int dma_ioc0_region_create(struct ps3_dma_region *r) 686static int dma_ioc0_region_create(struct ps3_dma_region *r)
686{ 687{
687 int result; 688 int result;
689 u64 bus_addr;
688 690
689 INIT_LIST_HEAD(&r->chunk_list.head); 691 INIT_LIST_HEAD(&r->chunk_list.head);
690 spin_lock_init(&r->chunk_list.lock); 692 spin_lock_init(&r->chunk_list.lock);
@@ -692,7 +694,8 @@ static int dma_ioc0_region_create(struct ps3_dma_region *r)
692 result = lv1_allocate_io_segment(0, 694 result = lv1_allocate_io_segment(0,
693 r->len, 695 r->len,
694 r->page_size, 696 r->page_size,
695 &r->bus_addr); 697 &bus_addr);
698 r->bus_addr = bus_addr;
696 if (result) { 699 if (result) {
697 DBG("%s:%d: lv1_allocate_io_segment failed: %s\n", 700 DBG("%s:%d: lv1_allocate_io_segment failed: %s\n",
698 __func__, __LINE__, ps3_result(result)); 701 __func__, __LINE__, ps3_result(result));
@@ -720,7 +723,7 @@ static int dma_sb_region_free(struct ps3_dma_region *r)
720 BUG_ON(!r); 723 BUG_ON(!r);
721 724
722 if (!r->dev->bus_id) { 725 if (!r->dev->bus_id) {
723 pr_info("%s:%d: %lu:%lu no dma\n", __func__, __LINE__, 726 pr_info("%s:%d: %llu:%llu no dma\n", __func__, __LINE__,
724 r->dev->bus_id, r->dev->dev_id); 727 r->dev->bus_id, r->dev->dev_id);
725 return 0; 728 return 0;
726 } 729 }
@@ -777,7 +780,7 @@ static int dma_ioc0_region_free(struct ps3_dma_region *r)
777 */ 780 */
778 781
779static int dma_sb_map_area(struct ps3_dma_region *r, unsigned long virt_addr, 782static int dma_sb_map_area(struct ps3_dma_region *r, unsigned long virt_addr,
780 unsigned long len, unsigned long *bus_addr, 783 unsigned long len, dma_addr_t *bus_addr,
781 u64 iopte_flag) 784 u64 iopte_flag)
782{ 785{
783 int result; 786 int result;
@@ -800,7 +803,7 @@ static int dma_sb_map_area(struct ps3_dma_region *r, unsigned long virt_addr,
800 DBG("%s:%d lpar_addr %lxh\n", __func__, __LINE__, 803 DBG("%s:%d lpar_addr %lxh\n", __func__, __LINE__,
801 lpar_addr); 804 lpar_addr);
802 DBG("%s:%d len %lxh\n", __func__, __LINE__, len); 805 DBG("%s:%d len %lxh\n", __func__, __LINE__, len);
803 DBG("%s:%d bus_addr %lxh (%lxh)\n", __func__, __LINE__, 806 DBG("%s:%d bus_addr %llxh (%lxh)\n", __func__, __LINE__,
804 *bus_addr, len); 807 *bus_addr, len);
805 } 808 }
806 809
@@ -832,7 +835,7 @@ static int dma_sb_map_area(struct ps3_dma_region *r, unsigned long virt_addr,
832} 835}
833 836
834static int dma_ioc0_map_area(struct ps3_dma_region *r, unsigned long virt_addr, 837static int dma_ioc0_map_area(struct ps3_dma_region *r, unsigned long virt_addr,
835 unsigned long len, unsigned long *bus_addr, 838 unsigned long len, dma_addr_t *bus_addr,
836 u64 iopte_flag) 839 u64 iopte_flag)
837{ 840{
838 int result; 841 int result;
@@ -872,7 +875,7 @@ static int dma_ioc0_map_area(struct ps3_dma_region *r, unsigned long virt_addr,
872 return result; 875 return result;
873 } 876 }
874 *bus_addr = c->bus_addr + phys_addr - aligned_phys; 877 *bus_addr = c->bus_addr + phys_addr - aligned_phys;
875 DBG("%s: va=%#lx pa=%#lx a_pa=%#lx bus=%#lx\n", __func__, 878 DBG("%s: va=%#lx pa=%#lx a_pa=%#lx bus=%#llx\n", __func__,
876 virt_addr, phys_addr, aligned_phys, *bus_addr); 879 virt_addr, phys_addr, aligned_phys, *bus_addr);
877 c->usage_count = 1; 880 c->usage_count = 1;
878 881
@@ -889,7 +892,7 @@ static int dma_ioc0_map_area(struct ps3_dma_region *r, unsigned long virt_addr,
889 * This is the common dma unmap routine. 892 * This is the common dma unmap routine.
890 */ 893 */
891 894
892static int dma_sb_unmap_area(struct ps3_dma_region *r, unsigned long bus_addr, 895static int dma_sb_unmap_area(struct ps3_dma_region *r, dma_addr_t bus_addr,
893 unsigned long len) 896 unsigned long len)
894{ 897{
895 unsigned long flags; 898 unsigned long flags;
@@ -903,7 +906,7 @@ static int dma_sb_unmap_area(struct ps3_dma_region *r, unsigned long bus_addr,
903 1 << r->page_size); 906 1 << r->page_size);
904 unsigned long aligned_len = _ALIGN_UP(len + bus_addr 907 unsigned long aligned_len = _ALIGN_UP(len + bus_addr
905 - aligned_bus, 1 << r->page_size); 908 - aligned_bus, 1 << r->page_size);
906 DBG("%s:%d: not found: bus_addr %lxh\n", 909 DBG("%s:%d: not found: bus_addr %llxh\n",
907 __func__, __LINE__, bus_addr); 910 __func__, __LINE__, bus_addr);
908 DBG("%s:%d: not found: len %lxh\n", 911 DBG("%s:%d: not found: len %lxh\n",
909 __func__, __LINE__, len); 912 __func__, __LINE__, len);
@@ -926,12 +929,12 @@ static int dma_sb_unmap_area(struct ps3_dma_region *r, unsigned long bus_addr,
926} 929}
927 930
928static int dma_ioc0_unmap_area(struct ps3_dma_region *r, 931static int dma_ioc0_unmap_area(struct ps3_dma_region *r,
929 unsigned long bus_addr, unsigned long len) 932 dma_addr_t bus_addr, unsigned long len)
930{ 933{
931 unsigned long flags; 934 unsigned long flags;
932 struct dma_chunk *c; 935 struct dma_chunk *c;
933 936
934 DBG("%s: start a=%#lx l=%#lx\n", __func__, bus_addr, len); 937 DBG("%s: start a=%#llx l=%#lx\n", __func__, bus_addr, len);
935 spin_lock_irqsave(&r->chunk_list.lock, flags); 938 spin_lock_irqsave(&r->chunk_list.lock, flags);
936 c = dma_find_chunk(r, bus_addr, len); 939 c = dma_find_chunk(r, bus_addr, len);
937 940
@@ -941,7 +944,7 @@ static int dma_ioc0_unmap_area(struct ps3_dma_region *r,
941 unsigned long aligned_len = _ALIGN_UP(len + bus_addr 944 unsigned long aligned_len = _ALIGN_UP(len + bus_addr
942 - aligned_bus, 945 - aligned_bus,
943 1 << r->page_size); 946 1 << r->page_size);
944 DBG("%s:%d: not found: bus_addr %lxh\n", 947 DBG("%s:%d: not found: bus_addr %llxh\n",
945 __func__, __LINE__, bus_addr); 948 __func__, __LINE__, bus_addr);
946 DBG("%s:%d: not found: len %lxh\n", 949 DBG("%s:%d: not found: len %lxh\n",
947 __func__, __LINE__, len); 950 __func__, __LINE__, len);
@@ -975,7 +978,8 @@ static int dma_ioc0_unmap_area(struct ps3_dma_region *r,
975static int dma_sb_region_create_linear(struct ps3_dma_region *r) 978static int dma_sb_region_create_linear(struct ps3_dma_region *r)
976{ 979{
977 int result; 980 int result;
978 unsigned long virt_addr, len, tmp; 981 unsigned long virt_addr, len;
982 dma_addr_t tmp;
979 983
980 if (r->len > 16*1024*1024) { /* FIXME: need proper fix */ 984 if (r->len > 16*1024*1024) { /* FIXME: need proper fix */
981 /* force 16M dma pages for linear mapping */ 985 /* force 16M dma pages for linear mapping */
@@ -1027,7 +1031,8 @@ static int dma_sb_region_create_linear(struct ps3_dma_region *r)
1027static int dma_sb_region_free_linear(struct ps3_dma_region *r) 1031static int dma_sb_region_free_linear(struct ps3_dma_region *r)
1028{ 1032{
1029 int result; 1033 int result;
1030 unsigned long bus_addr, len, lpar_addr; 1034 dma_addr_t bus_addr;
1035 unsigned long len, lpar_addr;
1031 1036
1032 if (r->offset < map.rm.size) { 1037 if (r->offset < map.rm.size) {
1033 /* Unmap (part of) 1st RAM chunk */ 1038 /* Unmap (part of) 1st RAM chunk */
@@ -1072,7 +1077,7 @@ static int dma_sb_region_free_linear(struct ps3_dma_region *r)
1072 */ 1077 */
1073 1078
1074static int dma_sb_map_area_linear(struct ps3_dma_region *r, 1079static int dma_sb_map_area_linear(struct ps3_dma_region *r,
1075 unsigned long virt_addr, unsigned long len, unsigned long *bus_addr, 1080 unsigned long virt_addr, unsigned long len, dma_addr_t *bus_addr,
1076 u64 iopte_flag) 1081 u64 iopte_flag)
1077{ 1082{
1078 unsigned long phys_addr = is_kernel_addr(virt_addr) ? __pa(virt_addr) 1083 unsigned long phys_addr = is_kernel_addr(virt_addr) ? __pa(virt_addr)
@@ -1091,7 +1096,7 @@ static int dma_sb_map_area_linear(struct ps3_dma_region *r,
1091 */ 1096 */
1092 1097
1093static int dma_sb_unmap_area_linear(struct ps3_dma_region *r, 1098static int dma_sb_unmap_area_linear(struct ps3_dma_region *r,
1094 unsigned long bus_addr, unsigned long len) 1099 dma_addr_t bus_addr, unsigned long len)
1095{ 1100{
1096 return 0; 1101 return 0;
1097}; 1102};
@@ -1169,13 +1174,13 @@ int ps3_dma_region_free(struct ps3_dma_region *r)
1169EXPORT_SYMBOL(ps3_dma_region_free); 1174EXPORT_SYMBOL(ps3_dma_region_free);
1170 1175
1171int ps3_dma_map(struct ps3_dma_region *r, unsigned long virt_addr, 1176int ps3_dma_map(struct ps3_dma_region *r, unsigned long virt_addr,
1172 unsigned long len, unsigned long *bus_addr, 1177 unsigned long len, dma_addr_t *bus_addr,
1173 u64 iopte_flag) 1178 u64 iopte_flag)
1174{ 1179{
1175 return r->region_ops->map(r, virt_addr, len, bus_addr, iopte_flag); 1180 return r->region_ops->map(r, virt_addr, len, bus_addr, iopte_flag);
1176} 1181}
1177 1182
1178int ps3_dma_unmap(struct ps3_dma_region *r, unsigned long bus_addr, 1183int ps3_dma_unmap(struct ps3_dma_region *r, dma_addr_t bus_addr,
1179 unsigned long len) 1184 unsigned long len)
1180{ 1185{
1181 return r->region_ops->unmap(r, bus_addr, len); 1186 return r->region_ops->unmap(r, bus_addr, len);
diff --git a/arch/powerpc/platforms/ps3/os-area.c b/arch/powerpc/platforms/ps3/os-area.c
index 1d201782d4e5..e1c83c23b435 100644
--- a/arch/powerpc/platforms/ps3/os-area.c
+++ b/arch/powerpc/platforms/ps3/os-area.c
@@ -306,7 +306,7 @@ static void _dump_params(const struct os_area_params *p, const char *func,
306{ 306{
307 pr_debug("%s:%d: p.boot_flag: %u\n", func, line, p->boot_flag); 307 pr_debug("%s:%d: p.boot_flag: %u\n", func, line, p->boot_flag);
308 pr_debug("%s:%d: p.num_params: %u\n", func, line, p->num_params); 308 pr_debug("%s:%d: p.num_params: %u\n", func, line, p->num_params);
309 pr_debug("%s:%d: p.rtc_diff %ld\n", func, line, p->rtc_diff); 309 pr_debug("%s:%d: p.rtc_diff %lld\n", func, line, p->rtc_diff);
310 pr_debug("%s:%d: p.av_multi_out %u\n", func, line, p->av_multi_out); 310 pr_debug("%s:%d: p.av_multi_out %u\n", func, line, p->av_multi_out);
311 pr_debug("%s:%d: p.ctrl_button: %u\n", func, line, p->ctrl_button); 311 pr_debug("%s:%d: p.ctrl_button: %u\n", func, line, p->ctrl_button);
312 pr_debug("%s:%d: p.static_ip_addr: %u.%u.%u.%u\n", func, line, 312 pr_debug("%s:%d: p.static_ip_addr: %u.%u.%u.%u\n", func, line,
diff --git a/arch/powerpc/platforms/ps3/repository.c b/arch/powerpc/platforms/ps3/repository.c
index 22063adeb38b..5e304c292f68 100644
--- a/arch/powerpc/platforms/ps3/repository.c
+++ b/arch/powerpc/platforms/ps3/repository.c
@@ -44,7 +44,7 @@ static void _dump_field(const char *hdr, u64 n, const char *func, int line)
44 s[i] = (in[i] <= 126 && in[i] >= 32) ? in[i] : '.'; 44 s[i] = (in[i] <= 126 && in[i] >= 32) ? in[i] : '.';
45 s[i] = 0; 45 s[i] = 0;
46 46
47 pr_debug("%s:%d: %s%016lx : %s\n", func, line, hdr, n, s); 47 pr_debug("%s:%d: %s%016llx : %s\n", func, line, hdr, n, s);
48#endif 48#endif
49} 49}
50 50
@@ -70,8 +70,8 @@ static void _dump_node(unsigned int lpar_id, u64 n1, u64 n2, u64 n3, u64 n4,
70 _dump_field("n2: ", n2, func, line); 70 _dump_field("n2: ", n2, func, line);
71 _dump_field("n3: ", n3, func, line); 71 _dump_field("n3: ", n3, func, line);
72 _dump_field("n4: ", n4, func, line); 72 _dump_field("n4: ", n4, func, line);
73 pr_debug("%s:%d: v1: %016lx\n", func, line, v1); 73 pr_debug("%s:%d: v1: %016llx\n", func, line, v1);
74 pr_debug("%s:%d: v2: %016lx\n", func, line, v2); 74 pr_debug("%s:%d: v2: %016llx\n", func, line, v2);
75} 75}
76 76
77/** 77/**
@@ -149,10 +149,10 @@ static int read_node(unsigned int lpar_id, u64 n1, u64 n2, u64 n3, u64 n4,
149 *_v2 = v2; 149 *_v2 = v2;
150 150
151 if (v1 && !_v1) 151 if (v1 && !_v1)
152 pr_debug("%s:%d: warning: discarding non-zero v1: %016lx\n", 152 pr_debug("%s:%d: warning: discarding non-zero v1: %016llx\n",
153 __func__, __LINE__, v1); 153 __func__, __LINE__, v1);
154 if (v2 && !_v2) 154 if (v2 && !_v2)
155 pr_debug("%s:%d: warning: discarding non-zero v2: %016lx\n", 155 pr_debug("%s:%d: warning: discarding non-zero v2: %016llx\n",
156 __func__, __LINE__, v2); 156 __func__, __LINE__, v2);
157 157
158 return 0; 158 return 0;
@@ -327,7 +327,7 @@ int ps3_repository_find_device(struct ps3_repository_device *repo)
327 return result; 327 return result;
328 } 328 }
329 329
330 pr_debug("%s:%d: bus_type %u, bus_index %u, bus_id %lu, num_dev %u\n", 330 pr_debug("%s:%d: bus_type %u, bus_index %u, bus_id %llu, num_dev %u\n",
331 __func__, __LINE__, tmp.bus_type, tmp.bus_index, tmp.bus_id, 331 __func__, __LINE__, tmp.bus_type, tmp.bus_index, tmp.bus_id,
332 num_dev); 332 num_dev);
333 333
@@ -353,7 +353,7 @@ int ps3_repository_find_device(struct ps3_repository_device *repo)
353 return result; 353 return result;
354 } 354 }
355 355
356 pr_debug("%s:%d: found: dev_type %u, dev_index %u, dev_id %lu\n", 356 pr_debug("%s:%d: found: dev_type %u, dev_index %u, dev_id %llu\n",
357 __func__, __LINE__, tmp.dev_type, tmp.dev_index, tmp.dev_id); 357 __func__, __LINE__, tmp.dev_type, tmp.dev_index, tmp.dev_id);
358 358
359 *repo = tmp; 359 *repo = tmp;
@@ -367,7 +367,7 @@ int ps3_repository_find_device_by_id(struct ps3_repository_device *repo,
367 struct ps3_repository_device tmp; 367 struct ps3_repository_device tmp;
368 unsigned int num_dev; 368 unsigned int num_dev;
369 369
370 pr_debug(" -> %s:%u: find device by id %lu:%lu\n", __func__, __LINE__, 370 pr_debug(" -> %s:%u: find device by id %llu:%llu\n", __func__, __LINE__,
371 bus_id, dev_id); 371 bus_id, dev_id);
372 372
373 for (tmp.bus_index = 0; tmp.bus_index < 10; tmp.bus_index++) { 373 for (tmp.bus_index = 0; tmp.bus_index < 10; tmp.bus_index++) {
@@ -382,7 +382,7 @@ int ps3_repository_find_device_by_id(struct ps3_repository_device *repo,
382 if (tmp.bus_id == bus_id) 382 if (tmp.bus_id == bus_id)
383 goto found_bus; 383 goto found_bus;
384 384
385 pr_debug("%s:%u: skip, bus_id %lu\n", __func__, __LINE__, 385 pr_debug("%s:%u: skip, bus_id %llu\n", __func__, __LINE__,
386 tmp.bus_id); 386 tmp.bus_id);
387 } 387 }
388 pr_debug(" <- %s:%u: bus not found\n", __func__, __LINE__); 388 pr_debug(" <- %s:%u: bus not found\n", __func__, __LINE__);
@@ -416,7 +416,7 @@ found_bus:
416 if (tmp.dev_id == dev_id) 416 if (tmp.dev_id == dev_id)
417 goto found_dev; 417 goto found_dev;
418 418
419 pr_debug("%s:%u: skip, dev_id %lu\n", __func__, __LINE__, 419 pr_debug("%s:%u: skip, dev_id %llu\n", __func__, __LINE__,
420 tmp.dev_id); 420 tmp.dev_id);
421 } 421 }
422 pr_debug(" <- %s:%u: dev not found\n", __func__, __LINE__); 422 pr_debug(" <- %s:%u: dev not found\n", __func__, __LINE__);
@@ -430,7 +430,7 @@ found_dev:
430 return result; 430 return result;
431 } 431 }
432 432
433 pr_debug(" <- %s:%u: found: type (%u:%u) index (%u:%u) id (%lu:%lu)\n", 433 pr_debug(" <- %s:%u: found: type (%u:%u) index (%u:%u) id (%llu:%llu)\n",
434 __func__, __LINE__, tmp.bus_type, tmp.dev_type, tmp.bus_index, 434 __func__, __LINE__, tmp.bus_type, tmp.dev_type, tmp.bus_index,
435 tmp.dev_index, tmp.bus_id, tmp.dev_id); 435 tmp.dev_index, tmp.bus_id, tmp.dev_id);
436 *repo = tmp; 436 *repo = tmp;
diff --git a/arch/powerpc/platforms/ps3/setup.c b/arch/powerpc/platforms/ps3/setup.c
index 35f3e85cf60e..3331ccbb8d38 100644
--- a/arch/powerpc/platforms/ps3/setup.c
+++ b/arch/powerpc/platforms/ps3/setup.c
@@ -186,7 +186,7 @@ early_param("ps3flash", early_parse_ps3flash);
186#define prealloc_ps3flash_bounce_buffer() do { } while (0) 186#define prealloc_ps3flash_bounce_buffer() do { } while (0)
187#endif 187#endif
188 188
189static int ps3_set_dabr(u64 dabr) 189static int ps3_set_dabr(unsigned long dabr)
190{ 190{
191 enum {DABR_USER = 1, DABR_KERNEL = 2,}; 191 enum {DABR_USER = 1, DABR_KERNEL = 2,};
192 192
diff --git a/arch/powerpc/platforms/ps3/spu.c b/arch/powerpc/platforms/ps3/spu.c
index ccae3d446b98..b3c6a993f9f3 100644
--- a/arch/powerpc/platforms/ps3/spu.c
+++ b/arch/powerpc/platforms/ps3/spu.c
@@ -149,7 +149,7 @@ EXPORT_SYMBOL_GPL(ps3_get_spe_id);
149 149
150static unsigned long get_vas_id(void) 150static unsigned long get_vas_id(void)
151{ 151{
152 unsigned long id; 152 u64 id;
153 153
154 lv1_get_logical_ppe_id(&id); 154 lv1_get_logical_ppe_id(&id);
155 lv1_get_virtual_address_space_id_of_ppe(id, &id); 155 lv1_get_virtual_address_space_id_of_ppe(id, &id);
@@ -160,14 +160,18 @@ static unsigned long get_vas_id(void)
160static int __init construct_spu(struct spu *spu) 160static int __init construct_spu(struct spu *spu)
161{ 161{
162 int result; 162 int result;
163 unsigned long unused; 163 u64 unused;
164 u64 problem_phys;
165 u64 local_store_phys;
164 166
165 result = lv1_construct_logical_spe(PAGE_SHIFT, PAGE_SHIFT, PAGE_SHIFT, 167 result = lv1_construct_logical_spe(PAGE_SHIFT, PAGE_SHIFT, PAGE_SHIFT,
166 PAGE_SHIFT, PAGE_SHIFT, get_vas_id(), SPE_TYPE_LOGICAL, 168 PAGE_SHIFT, PAGE_SHIFT, get_vas_id(), SPE_TYPE_LOGICAL,
167 &spu_pdata(spu)->priv2_addr, &spu->problem_phys, 169 &spu_pdata(spu)->priv2_addr, &problem_phys,
168 &spu->local_store_phys, &unused, 170 &local_store_phys, &unused,
169 &spu_pdata(spu)->shadow_addr, 171 &spu_pdata(spu)->shadow_addr,
170 &spu_pdata(spu)->spe_id); 172 &spu_pdata(spu)->spe_id);
173 spu->problem_phys = problem_phys;
174 spu->local_store_phys = local_store_phys;
171 175
172 if (result) { 176 if (result) {
173 pr_debug("%s:%d: lv1_construct_logical_spe failed: %s\n", 177 pr_debug("%s:%d: lv1_construct_logical_spe failed: %s\n",
diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c
index ee0d22911621..58311a867851 100644
--- a/arch/powerpc/platforms/ps3/system-bus.c
+++ b/arch/powerpc/platforms/ps3/system-bus.c
@@ -182,7 +182,7 @@ int ps3_open_hv_device(struct ps3_system_bus_device *dev)
182 case PS3_MATCH_ID_SYSTEM_MANAGER: 182 case PS3_MATCH_ID_SYSTEM_MANAGER:
183 pr_debug("%s:%d: unsupported match_id: %u\n", __func__, 183 pr_debug("%s:%d: unsupported match_id: %u\n", __func__,
184 __LINE__, dev->match_id); 184 __LINE__, dev->match_id);
185 pr_debug("%s:%d: bus_id: %lu\n", __func__, __LINE__, 185 pr_debug("%s:%d: bus_id: %llu\n", __func__, __LINE__,
186 dev->bus_id); 186 dev->bus_id);
187 BUG(); 187 BUG();
188 return -EINVAL; 188 return -EINVAL;
@@ -220,7 +220,7 @@ int ps3_close_hv_device(struct ps3_system_bus_device *dev)
220 case PS3_MATCH_ID_SYSTEM_MANAGER: 220 case PS3_MATCH_ID_SYSTEM_MANAGER:
221 pr_debug("%s:%d: unsupported match_id: %u\n", __func__, 221 pr_debug("%s:%d: unsupported match_id: %u\n", __func__,
222 __LINE__, dev->match_id); 222 __LINE__, dev->match_id);
223 pr_debug("%s:%d: bus_id: %lu\n", __func__, __LINE__, 223 pr_debug("%s:%d: bus_id: %llu\n", __func__, __LINE__,
224 dev->bus_id); 224 dev->bus_id);
225 BUG(); 225 BUG();
226 return -EINVAL; 226 return -EINVAL;
@@ -240,7 +240,7 @@ EXPORT_SYMBOL_GPL(ps3_close_hv_device);
240static void _dump_mmio_region(const struct ps3_mmio_region* r, 240static void _dump_mmio_region(const struct ps3_mmio_region* r,
241 const char* func, int line) 241 const char* func, int line)
242{ 242{
243 pr_debug("%s:%d: dev %lu:%lu\n", func, line, r->dev->bus_id, 243 pr_debug("%s:%d: dev %llu:%llu\n", func, line, r->dev->bus_id,
244 r->dev->dev_id); 244 r->dev->dev_id);
245 pr_debug("%s:%d: bus_addr %lxh\n", func, line, r->bus_addr); 245 pr_debug("%s:%d: bus_addr %lxh\n", func, line, r->bus_addr);
246 pr_debug("%s:%d: len %lxh\n", func, line, r->len); 246 pr_debug("%s:%d: len %lxh\n", func, line, r->len);
@@ -250,9 +250,11 @@ static void _dump_mmio_region(const struct ps3_mmio_region* r,
250static int ps3_sb_mmio_region_create(struct ps3_mmio_region *r) 250static int ps3_sb_mmio_region_create(struct ps3_mmio_region *r)
251{ 251{
252 int result; 252 int result;
253 u64 lpar_addr;
253 254
254 result = lv1_map_device_mmio_region(r->dev->bus_id, r->dev->dev_id, 255 result = lv1_map_device_mmio_region(r->dev->bus_id, r->dev->dev_id,
255 r->bus_addr, r->len, r->page_size, &r->lpar_addr); 256 r->bus_addr, r->len, r->page_size, &lpar_addr);
257 r->lpar_addr = lpar_addr;
256 258
257 if (result) { 259 if (result) {
258 pr_debug("%s:%d: lv1_map_device_mmio_region failed: %s\n", 260 pr_debug("%s:%d: lv1_map_device_mmio_region failed: %s\n",
@@ -568,7 +570,7 @@ static dma_addr_t ps3_sb_map_page(struct device *_dev, struct page *page,
568{ 570{
569 struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev); 571 struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
570 int result; 572 int result;
571 unsigned long bus_addr; 573 dma_addr_t bus_addr;
572 void *ptr = page_address(page) + offset; 574 void *ptr = page_address(page) + offset;
573 575
574 result = ps3_dma_map(dev->d_region, (unsigned long)ptr, size, 576 result = ps3_dma_map(dev->d_region, (unsigned long)ptr, size,
@@ -590,7 +592,7 @@ static dma_addr_t ps3_ioc0_map_page(struct device *_dev, struct page *page,
590{ 592{
591 struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev); 593 struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
592 int result; 594 int result;
593 unsigned long bus_addr; 595 dma_addr_t bus_addr;
594 u64 iopte_flag; 596 u64 iopte_flag;
595 void *ptr = page_address(page) + offset; 597 void *ptr = page_address(page) + offset;
596 598
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index c90817acb472..3ee01b4f4257 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -127,10 +127,10 @@ static int tce_build_pSeriesLP(struct iommu_table *tbl, long tcenum,
127 } 127 }
128 128
129 if (rc && printk_ratelimit()) { 129 if (rc && printk_ratelimit()) {
130 printk("tce_build_pSeriesLP: plpar_tce_put failed. rc=%ld\n", rc); 130 printk("tce_build_pSeriesLP: plpar_tce_put failed. rc=%lld\n", rc);
131 printk("\tindex = 0x%lx\n", (u64)tbl->it_index); 131 printk("\tindex = 0x%llx\n", (u64)tbl->it_index);
132 printk("\ttcenum = 0x%lx\n", (u64)tcenum); 132 printk("\ttcenum = 0x%llx\n", (u64)tcenum);
133 printk("\ttce val = 0x%lx\n", tce ); 133 printk("\ttce val = 0x%llx\n", tce );
134 show_stack(current, (unsigned long *)__get_SP()); 134 show_stack(current, (unsigned long *)__get_SP());
135 } 135 }
136 136
@@ -210,10 +210,10 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
210 } 210 }
211 211
212 if (rc && printk_ratelimit()) { 212 if (rc && printk_ratelimit()) {
213 printk("tce_buildmulti_pSeriesLP: plpar_tce_put failed. rc=%ld\n", rc); 213 printk("tce_buildmulti_pSeriesLP: plpar_tce_put failed. rc=%lld\n", rc);
214 printk("\tindex = 0x%lx\n", (u64)tbl->it_index); 214 printk("\tindex = 0x%llx\n", (u64)tbl->it_index);
215 printk("\tnpages = 0x%lx\n", (u64)npages); 215 printk("\tnpages = 0x%llx\n", (u64)npages);
216 printk("\ttce[0] val = 0x%lx\n", tcep[0]); 216 printk("\ttce[0] val = 0x%llx\n", tcep[0]);
217 show_stack(current, (unsigned long *)__get_SP()); 217 show_stack(current, (unsigned long *)__get_SP());
218 } 218 }
219 return ret; 219 return ret;
@@ -227,9 +227,9 @@ static void tce_free_pSeriesLP(struct iommu_table *tbl, long tcenum, long npages
227 rc = plpar_tce_put((u64)tbl->it_index, (u64)tcenum << 12, 0); 227 rc = plpar_tce_put((u64)tbl->it_index, (u64)tcenum << 12, 0);
228 228
229 if (rc && printk_ratelimit()) { 229 if (rc && printk_ratelimit()) {
230 printk("tce_free_pSeriesLP: plpar_tce_put failed. rc=%ld\n", rc); 230 printk("tce_free_pSeriesLP: plpar_tce_put failed. rc=%lld\n", rc);
231 printk("\tindex = 0x%lx\n", (u64)tbl->it_index); 231 printk("\tindex = 0x%llx\n", (u64)tbl->it_index);
232 printk("\ttcenum = 0x%lx\n", (u64)tcenum); 232 printk("\ttcenum = 0x%llx\n", (u64)tcenum);
233 show_stack(current, (unsigned long *)__get_SP()); 233 show_stack(current, (unsigned long *)__get_SP());
234 } 234 }
235 235
@@ -246,9 +246,9 @@ static void tce_freemulti_pSeriesLP(struct iommu_table *tbl, long tcenum, long n
246 246
247 if (rc && printk_ratelimit()) { 247 if (rc && printk_ratelimit()) {
248 printk("tce_freemulti_pSeriesLP: plpar_tce_stuff failed\n"); 248 printk("tce_freemulti_pSeriesLP: plpar_tce_stuff failed\n");
249 printk("\trc = %ld\n", rc); 249 printk("\trc = %lld\n", rc);
250 printk("\tindex = 0x%lx\n", (u64)tbl->it_index); 250 printk("\tindex = 0x%llx\n", (u64)tbl->it_index);
251 printk("\tnpages = 0x%lx\n", (u64)npages); 251 printk("\tnpages = 0x%llx\n", (u64)npages);
252 show_stack(current, (unsigned long *)__get_SP()); 252 show_stack(current, (unsigned long *)__get_SP());
253 } 253 }
254} 254}
@@ -261,10 +261,9 @@ static unsigned long tce_get_pSeriesLP(struct iommu_table *tbl, long tcenum)
261 rc = plpar_tce_get((u64)tbl->it_index, (u64)tcenum << 12, &tce_ret); 261 rc = plpar_tce_get((u64)tbl->it_index, (u64)tcenum << 12, &tce_ret);
262 262
263 if (rc && printk_ratelimit()) { 263 if (rc && printk_ratelimit()) {
264 printk("tce_get_pSeriesLP: plpar_tce_get failed. rc=%ld\n", 264 printk("tce_get_pSeriesLP: plpar_tce_get failed. rc=%lld\n", rc);
265 rc); 265 printk("\tindex = 0x%llx\n", (u64)tbl->it_index);
266 printk("\tindex = 0x%lx\n", (u64)tbl->it_index); 266 printk("\ttcenum = 0x%llx\n", (u64)tcenum);
267 printk("\ttcenum = 0x%lx\n", (u64)tcenum);
268 show_stack(current, (unsigned long *)__get_SP()); 267 show_stack(current, (unsigned long *)__get_SP());
269 } 268 }
270 269
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index f611d0369cc8..9817f63723dd 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -28,63 +28,104 @@
28#include <sysdev/fsl_pci.h> 28#include <sysdev/fsl_pci.h>
29 29
30#if defined(CONFIG_PPC_85xx) || defined(CONFIG_PPC_86xx) 30#if defined(CONFIG_PPC_85xx) || defined(CONFIG_PPC_86xx)
31static int __init setup_one_atmu(struct ccsr_pci __iomem *pci,
32 unsigned int index, const struct resource *res,
33 resource_size_t offset)
34{
35 resource_size_t pci_addr = res->start - offset;
36 resource_size_t phys_addr = res->start;
37 resource_size_t size = res->end - res->start + 1;
38 u32 flags = 0x80044000; /* enable & mem R/W */
39 unsigned int i;
40
41 pr_debug("PCI MEM resource start 0x%016llx, size 0x%016llx.\n",
42 (u64)res->start, (u64)size);
43
44 if (res->flags & IORESOURCE_PREFETCH)
45 flags |= 0x10000000; /* enable relaxed ordering */
46
47 for (i = 0; size > 0; i++) {
48 unsigned int bits = min(__ilog2(size),
49 __ffs(pci_addr | phys_addr));
50
51 if (index + i >= 5)
52 return -1;
53
54 out_be32(&pci->pow[index + i].potar, pci_addr >> 12);
55 out_be32(&pci->pow[index + i].potear, (u64)pci_addr >> 44);
56 out_be32(&pci->pow[index + i].powbar, phys_addr >> 12);
57 out_be32(&pci->pow[index + i].powar, flags | (bits - 1));
58
59 pci_addr += (resource_size_t)1U << bits;
60 phys_addr += (resource_size_t)1U << bits;
61 size -= (resource_size_t)1U << bits;
62 }
63
64 return i;
65}
66
31/* atmu setup for fsl pci/pcie controller */ 67/* atmu setup for fsl pci/pcie controller */
32static void __init setup_pci_atmu(struct pci_controller *hose, 68static void __init setup_pci_atmu(struct pci_controller *hose,
33 struct resource *rsrc) 69 struct resource *rsrc)
34{ 70{
35 struct ccsr_pci __iomem *pci; 71 struct ccsr_pci __iomem *pci;
36 int i; 72 int i, j, n;
37 73
38 pr_debug("PCI memory map start 0x%016llx, size 0x%016llx\n", 74 pr_debug("PCI memory map start 0x%016llx, size 0x%016llx\n",
39 (u64)rsrc->start, (u64)rsrc->end - (u64)rsrc->start + 1); 75 (u64)rsrc->start, (u64)rsrc->end - (u64)rsrc->start + 1);
40 pci = ioremap(rsrc->start, rsrc->end - rsrc->start + 1); 76 pci = ioremap(rsrc->start, rsrc->end - rsrc->start + 1);
77 if (!pci) {
78 dev_err(hose->parent, "Unable to map ATMU registers\n");
79 return;
80 }
41 81
42 /* Disable all windows (except powar0 since its ignored) */ 82 /* Disable all windows (except powar0 since it's ignored) */
43 for(i = 1; i < 5; i++) 83 for(i = 1; i < 5; i++)
44 out_be32(&pci->pow[i].powar, 0); 84 out_be32(&pci->pow[i].powar, 0);
45 for(i = 0; i < 3; i++) 85 for(i = 0; i < 3; i++)
46 out_be32(&pci->piw[i].piwar, 0); 86 out_be32(&pci->piw[i].piwar, 0);
47 87
48 /* Setup outbound MEM window */ 88 /* Setup outbound MEM window */
49 for(i = 0; i < 3; i++) 89 for(i = 0, j = 1; i < 3; i++) {
50 if (hose->mem_resources[i].flags & IORESOURCE_MEM){ 90 if (!(hose->mem_resources[i].flags & IORESOURCE_MEM))
51 resource_size_t pci_addr_start = 91 continue;
52 hose->mem_resources[i].start - 92
53 hose->pci_mem_offset; 93 n = setup_one_atmu(pci, j, &hose->mem_resources[i],
54 pr_debug("PCI MEM resource start 0x%016llx, size 0x%016llx.\n", 94 hose->pci_mem_offset);
55 (u64)hose->mem_resources[i].start, 95
56 (u64)hose->mem_resources[i].end 96 if (n < 0 || j >= 5) {
57 - (u64)hose->mem_resources[i].start + 1); 97 pr_err("Ran out of outbound PCI ATMUs for resource %d!\n", i);
58 out_be32(&pci->pow[i+1].potar, (pci_addr_start >> 12)); 98 hose->mem_resources[i].flags |= IORESOURCE_DISABLED;
59 out_be32(&pci->pow[i+1].potear, 0); 99 } else
60 out_be32(&pci->pow[i+1].powbar, 100 j += n;
61 (hose->mem_resources[i].start >> 12)); 101 }
62 /* Enable, Mem R/W */
63 out_be32(&pci->pow[i+1].powar, 0x80044000
64 | (__ilog2(hose->mem_resources[i].end
65 - hose->mem_resources[i].start + 1) - 1));
66 }
67 102
68 /* Setup outbound IO window */ 103 /* Setup outbound IO window */
69 if (hose->io_resource.flags & IORESOURCE_IO){ 104 if (hose->io_resource.flags & IORESOURCE_IO) {
70 pr_debug("PCI IO resource start 0x%016llx, size 0x%016llx, " 105 if (j >= 5) {
71 "phy base 0x%016llx.\n", 106 pr_err("Ran out of outbound PCI ATMUs for IO resource\n");
72 (u64)hose->io_resource.start, 107 } else {
73 (u64)hose->io_resource.end - (u64)hose->io_resource.start + 1, 108 pr_debug("PCI IO resource start 0x%016llx, size 0x%016llx, "
74 (u64)hose->io_base_phys); 109 "phy base 0x%016llx.\n",
75 out_be32(&pci->pow[i+1].potar, (hose->io_resource.start >> 12)); 110 (u64)hose->io_resource.start,
76 out_be32(&pci->pow[i+1].potear, 0); 111 (u64)hose->io_resource.end - (u64)hose->io_resource.start + 1,
77 out_be32(&pci->pow[i+1].powbar, (hose->io_base_phys >> 12)); 112 (u64)hose->io_base_phys);
78 /* Enable, IO R/W */ 113 out_be32(&pci->pow[j].potar, (hose->io_resource.start >> 12));
79 out_be32(&pci->pow[i+1].powar, 0x80088000 114 out_be32(&pci->pow[j].potear, 0);
80 | (__ilog2(hose->io_resource.end 115 out_be32(&pci->pow[j].powbar, (hose->io_base_phys >> 12));
81 - hose->io_resource.start + 1) - 1)); 116 /* Enable, IO R/W */
117 out_be32(&pci->pow[j].powar, 0x80088000
118 | (__ilog2(hose->io_resource.end
119 - hose->io_resource.start + 1) - 1));
120 }
82 } 121 }
83 122
84 /* Setup 2G inbound Memory Window @ 1 */ 123 /* Setup 2G inbound Memory Window @ 1 */
85 out_be32(&pci->piw[2].pitar, 0x00000000); 124 out_be32(&pci->piw[2].pitar, 0x00000000);
86 out_be32(&pci->piw[2].piwbar,0x00000000); 125 out_be32(&pci->piw[2].piwbar,0x00000000);
87 out_be32(&pci->piw[2].piwar, PIWAR_2G); 126 out_be32(&pci->piw[2].piwar, PIWAR_2G);
127
128 iounmap(pci);
88} 129}
89 130
90static void __init setup_pci_cmd(struct pci_controller *hose) 131static void __init setup_pci_cmd(struct pci_controller *hose)
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 0afd21f9a222..532e205303a2 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -435,7 +435,7 @@ static void __init mpic_scan_ht_msi(struct mpic *mpic, u8 __iomem *devbase,
435 addr = addr | ((u64)readl(base + HT_MSI_ADDR_HI) << 32); 435 addr = addr | ((u64)readl(base + HT_MSI_ADDR_HI) << 32);
436 } 436 }
437 437
438 printk(KERN_DEBUG "mpic: - HT:%02x.%x %s MSI mapping found @ 0x%lx\n", 438 printk(KERN_DEBUG "mpic: - HT:%02x.%x %s MSI mapping found @ 0x%llx\n",
439 PCI_SLOT(devfn), PCI_FUNC(devfn), 439 PCI_SLOT(devfn), PCI_FUNC(devfn),
440 flags & HT_MSI_FLAGS_ENABLE ? "enabled" : "disabled", addr); 440 flags & HT_MSI_FLAGS_ENABLE ? "enabled" : "disabled", addr);
441 441
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index a94a3c3ae932..6b0a3538dc63 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -77,6 +77,7 @@ mainmenu "Linux Kernel Configuration"
77config S390 77config S390
78 def_bool y 78 def_bool y
79 select USE_GENERIC_SMP_HELPERS if SMP 79 select USE_GENERIC_SMP_HELPERS if SMP
80 select HAVE_SYSCALL_WRAPPERS
80 select HAVE_FUNCTION_TRACER 81 select HAVE_FUNCTION_TRACER
81 select HAVE_OPROFILE 82 select HAVE_OPROFILE
82 select HAVE_KPROBES 83 select HAVE_KPROBES
diff --git a/arch/s390/include/asm/Kbuild b/arch/s390/include/asm/Kbuild
index f2af4167bd5f..63a23415fba6 100644
--- a/arch/s390/include/asm/Kbuild
+++ b/arch/s390/include/asm/Kbuild
@@ -13,4 +13,3 @@ unifdef-y += cmb.h
13unifdef-y += debug.h 13unifdef-y += debug.h
14unifdef-y += chpid.h 14unifdef-y += chpid.h
15unifdef-y += schid.h 15unifdef-y += schid.h
16unifdef-y += swab.h
diff --git a/arch/s390/include/asm/byteorder.h b/arch/s390/include/asm/byteorder.h
index b95a2b2933fb..a332e59e26fc 100644
--- a/arch/s390/include/asm/byteorder.h
+++ b/arch/s390/include/asm/byteorder.h
@@ -1,7 +1,6 @@
1#ifndef _S390_BYTEORDER_H 1#ifndef _S390_BYTEORDER_H
2#define _S390_BYTEORDER_H 2#define _S390_BYTEORDER_H
3 3
4#include <asm/swab.h>
5#include <linux/byteorder/big_endian.h> 4#include <linux/byteorder/big_endian.h>
6 5
7#endif /* _S390_BYTEORDER_H */ 6#endif /* _S390_BYTEORDER_H */
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index fc2c97197a53..6035cd20c7a7 100644
--- a/arch/s390/kernel/compat_wrapper.S
+++ b/arch/s390/kernel/compat_wrapper.S
@@ -547,7 +547,7 @@ sys32_setdomainname_wrapper:
547 .globl sys32_newuname_wrapper 547 .globl sys32_newuname_wrapper
548sys32_newuname_wrapper: 548sys32_newuname_wrapper:
549 llgtr %r2,%r2 # struct new_utsname * 549 llgtr %r2,%r2 # struct new_utsname *
550 jg s390x_newuname # branch to system call 550 jg sys_s390_newuname # branch to system call
551 551
552 .globl compat_sys_adjtimex_wrapper 552 .globl compat_sys_adjtimex_wrapper
553compat_sys_adjtimex_wrapper: 553compat_sys_adjtimex_wrapper:
@@ -615,7 +615,7 @@ sys32_sysfs_wrapper:
615 .globl sys32_personality_wrapper 615 .globl sys32_personality_wrapper
616sys32_personality_wrapper: 616sys32_personality_wrapper:
617 llgfr %r2,%r2 # unsigned long 617 llgfr %r2,%r2 # unsigned long
618 jg s390x_personality # branch to system call 618 jg sys_s390_personality # branch to system call
619 619
620 .globl sys32_setfsuid16_wrapper 620 .globl sys32_setfsuid16_wrapper
621sys32_setfsuid16_wrapper: 621sys32_setfsuid16_wrapper:
diff --git a/arch/s390/kernel/entry.h b/arch/s390/kernel/entry.h
index a65afc91e8aa..950c59c6688b 100644
--- a/arch/s390/kernel/entry.h
+++ b/arch/s390/kernel/entry.h
@@ -30,23 +30,23 @@ struct fadvise64_64_args;
30struct old_sigaction; 30struct old_sigaction;
31struct sel_arg_struct; 31struct sel_arg_struct;
32 32
33long sys_pipe(unsigned long __user *fildes);
34long sys_mmap2(struct mmap_arg_struct __user *arg); 33long sys_mmap2(struct mmap_arg_struct __user *arg);
35long old_mmap(struct mmap_arg_struct __user *arg); 34long sys_s390_old_mmap(struct mmap_arg_struct __user *arg);
36long sys_ipc(uint call, int first, unsigned long second, 35long sys_ipc(uint call, int first, unsigned long second,
37 unsigned long third, void __user *ptr); 36 unsigned long third, void __user *ptr);
38long s390x_newuname(struct new_utsname __user *name); 37long sys_s390_newuname(struct new_utsname __user *name);
39long s390x_personality(unsigned long personality); 38long sys_s390_personality(unsigned long personality);
40long s390_fadvise64(int fd, u32 offset_high, u32 offset_low, 39long sys_s390_fadvise64(int fd, u32 offset_high, u32 offset_low,
41 size_t len, int advice); 40 size_t len, int advice);
42long s390_fadvise64_64(struct fadvise64_64_args __user *args); 41long sys_s390_fadvise64_64(struct fadvise64_64_args __user *args);
43long s390_fallocate(int fd, int mode, loff_t offset, u32 len_high, u32 len_low); 42long sys_s390_fallocate(int fd, int mode, loff_t offset, u32 len_high,
43 u32 len_low);
44long sys_fork(void); 44long sys_fork(void);
45long sys_clone(void); 45long sys_clone(void);
46long sys_vfork(void); 46long sys_vfork(void);
47void execve_tail(void); 47void execve_tail(void);
48long sys_execve(void); 48long sys_execve(void);
49int sys_sigsuspend(int history0, int history1, old_sigset_t mask); 49long sys_sigsuspend(int history0, int history1, old_sigset_t mask);
50long sys_sigaction(int sig, const struct old_sigaction __user *act, 50long sys_sigaction(int sig, const struct old_sigaction __user *act,
51 struct old_sigaction __user *oact); 51 struct old_sigaction __user *oact);
52long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss); 52long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss);
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index b6110bdf8dc2..5cd38a90e64d 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -39,6 +39,7 @@
39#include <linux/tick.h> 39#include <linux/tick.h>
40#include <linux/elfcore.h> 40#include <linux/elfcore.h>
41#include <linux/kernel_stat.h> 41#include <linux/kernel_stat.h>
42#include <linux/syscalls.h>
42#include <asm/uaccess.h> 43#include <asm/uaccess.h>
43#include <asm/pgtable.h> 44#include <asm/pgtable.h>
44#include <asm/system.h> 45#include <asm/system.h>
@@ -225,13 +226,13 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long new_stackp,
225 return 0; 226 return 0;
226} 227}
227 228
228asmlinkage long sys_fork(void) 229SYSCALL_DEFINE0(fork)
229{ 230{
230 struct pt_regs *regs = task_pt_regs(current); 231 struct pt_regs *regs = task_pt_regs(current);
231 return do_fork(SIGCHLD, regs->gprs[15], regs, 0, NULL, NULL); 232 return do_fork(SIGCHLD, regs->gprs[15], regs, 0, NULL, NULL);
232} 233}
233 234
234asmlinkage long sys_clone(void) 235SYSCALL_DEFINE0(clone)
235{ 236{
236 struct pt_regs *regs = task_pt_regs(current); 237 struct pt_regs *regs = task_pt_regs(current);
237 unsigned long clone_flags; 238 unsigned long clone_flags;
@@ -258,7 +259,7 @@ asmlinkage long sys_clone(void)
258 * do not have enough call-clobbered registers to hold all 259 * do not have enough call-clobbered registers to hold all
259 * the information you need. 260 * the information you need.
260 */ 261 */
261asmlinkage long sys_vfork(void) 262SYSCALL_DEFINE0(vfork)
262{ 263{
263 struct pt_regs *regs = task_pt_regs(current); 264 struct pt_regs *regs = task_pt_regs(current);
264 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, 265 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD,
@@ -278,7 +279,7 @@ asmlinkage void execve_tail(void)
278/* 279/*
279 * sys_execve() executes a new program. 280 * sys_execve() executes a new program.
280 */ 281 */
281asmlinkage long sys_execve(void) 282SYSCALL_DEFINE0(execve)
282{ 283{
283 struct pt_regs *regs = task_pt_regs(current); 284 struct pt_regs *regs = task_pt_regs(current);
284 char *filename; 285 char *filename;
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c
index 8e6812a22670..3cf74c3ccb69 100644
--- a/arch/s390/kernel/signal.c
+++ b/arch/s390/kernel/signal.c
@@ -25,6 +25,7 @@
25#include <linux/personality.h> 25#include <linux/personality.h>
26#include <linux/binfmts.h> 26#include <linux/binfmts.h>
27#include <linux/tracehook.h> 27#include <linux/tracehook.h>
28#include <linux/syscalls.h>
28#include <asm/ucontext.h> 29#include <asm/ucontext.h>
29#include <asm/uaccess.h> 30#include <asm/uaccess.h>
30#include <asm/lowcore.h> 31#include <asm/lowcore.h>
@@ -53,8 +54,7 @@ typedef struct
53/* 54/*
54 * Atomically swap in the new signal mask, and wait for a signal. 55 * Atomically swap in the new signal mask, and wait for a signal.
55 */ 56 */
56asmlinkage int 57SYSCALL_DEFINE3(sigsuspend, int, history0, int, history1, old_sigset_t, mask)
57sys_sigsuspend(int history0, int history1, old_sigset_t mask)
58{ 58{
59 mask &= _BLOCKABLE; 59 mask &= _BLOCKABLE;
60 spin_lock_irq(&current->sighand->siglock); 60 spin_lock_irq(&current->sighand->siglock);
@@ -70,9 +70,8 @@ sys_sigsuspend(int history0, int history1, old_sigset_t mask)
70 return -ERESTARTNOHAND; 70 return -ERESTARTNOHAND;
71} 71}
72 72
73asmlinkage long 73SYSCALL_DEFINE3(sigaction, int, sig, const struct old_sigaction __user *, act,
74sys_sigaction(int sig, const struct old_sigaction __user *act, 74 struct old_sigaction __user *, oact)
75 struct old_sigaction __user *oact)
76{ 75{
77 struct k_sigaction new_ka, old_ka; 76 struct k_sigaction new_ka, old_ka;
78 int ret; 77 int ret;
@@ -102,15 +101,13 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
102 return ret; 101 return ret;
103} 102}
104 103
105asmlinkage long 104SYSCALL_DEFINE2(sigaltstack, const stack_t __user *, uss,
106sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss) 105 stack_t __user *, uoss)
107{ 106{
108 struct pt_regs *regs = task_pt_regs(current); 107 struct pt_regs *regs = task_pt_regs(current);
109 return do_sigaltstack(uss, uoss, regs->gprs[15]); 108 return do_sigaltstack(uss, uoss, regs->gprs[15]);
110} 109}
111 110
112
113
114/* Returns non-zero on fault. */ 111/* Returns non-zero on fault. */
115static int save_sigregs(struct pt_regs *regs, _sigregs __user *sregs) 112static int save_sigregs(struct pt_regs *regs, _sigregs __user *sregs)
116{ 113{
@@ -164,7 +161,7 @@ static int restore_sigregs(struct pt_regs *regs, _sigregs __user *sregs)
164 return 0; 161 return 0;
165} 162}
166 163
167asmlinkage long sys_sigreturn(void) 164SYSCALL_DEFINE0(sigreturn)
168{ 165{
169 struct pt_regs *regs = task_pt_regs(current); 166 struct pt_regs *regs = task_pt_regs(current);
170 sigframe __user *frame = (sigframe __user *)regs->gprs[15]; 167 sigframe __user *frame = (sigframe __user *)regs->gprs[15];
@@ -191,7 +188,7 @@ badframe:
191 return 0; 188 return 0;
192} 189}
193 190
194asmlinkage long sys_rt_sigreturn(void) 191SYSCALL_DEFINE0(rt_sigreturn)
195{ 192{
196 struct pt_regs *regs = task_pt_regs(current); 193 struct pt_regs *regs = task_pt_regs(current);
197 rt_sigframe __user *frame = (rt_sigframe __user *)regs->gprs[15]; 194 rt_sigframe __user *frame = (rt_sigframe __user *)regs->gprs[15];
diff --git a/arch/s390/kernel/sys_s390.c b/arch/s390/kernel/sys_s390.c
index c34be4568b80..c7ae4b17e0e3 100644
--- a/arch/s390/kernel/sys_s390.c
+++ b/arch/s390/kernel/sys_s390.c
@@ -29,6 +29,7 @@
29#include <linux/personality.h> 29#include <linux/personality.h>
30#include <linux/unistd.h> 30#include <linux/unistd.h>
31#include <linux/ipc.h> 31#include <linux/ipc.h>
32#include <linux/syscalls.h>
32#include <asm/uaccess.h> 33#include <asm/uaccess.h>
33#include "entry.h" 34#include "entry.h"
34 35
@@ -74,7 +75,7 @@ struct mmap_arg_struct {
74 unsigned long offset; 75 unsigned long offset;
75}; 76};
76 77
77asmlinkage long sys_mmap2(struct mmap_arg_struct __user *arg) 78SYSCALL_DEFINE1(mmap2, struct mmap_arg_struct __user *, arg)
78{ 79{
79 struct mmap_arg_struct a; 80 struct mmap_arg_struct a;
80 int error = -EFAULT; 81 int error = -EFAULT;
@@ -86,7 +87,7 @@ out:
86 return error; 87 return error;
87} 88}
88 89
89asmlinkage long old_mmap(struct mmap_arg_struct __user *arg) 90SYSCALL_DEFINE1(s390_old_mmap, struct mmap_arg_struct __user *, arg)
90{ 91{
91 struct mmap_arg_struct a; 92 struct mmap_arg_struct a;
92 long error = -EFAULT; 93 long error = -EFAULT;
@@ -108,8 +109,8 @@ out:
108 * 109 *
109 * This is really horribly ugly. 110 * This is really horribly ugly.
110 */ 111 */
111asmlinkage long sys_ipc(uint call, int first, unsigned long second, 112SYSCALL_DEFINE5(ipc, uint, call, int, first, unsigned long, second,
112 unsigned long third, void __user *ptr) 113 unsigned long, third, void __user *, ptr)
113{ 114{
114 struct ipc_kludge tmp; 115 struct ipc_kludge tmp;
115 int ret; 116 int ret;
@@ -175,7 +176,7 @@ asmlinkage long sys_ipc(uint call, int first, unsigned long second,
175} 176}
176 177
177#ifdef CONFIG_64BIT 178#ifdef CONFIG_64BIT
178asmlinkage long s390x_newuname(struct new_utsname __user *name) 179SYSCALL_DEFINE1(s390_newuname, struct new_utsname __user *, name)
179{ 180{
180 int ret = sys_newuname(name); 181 int ret = sys_newuname(name);
181 182
@@ -186,7 +187,7 @@ asmlinkage long s390x_newuname(struct new_utsname __user *name)
186 return ret; 187 return ret;
187} 188}
188 189
189asmlinkage long s390x_personality(unsigned long personality) 190SYSCALL_DEFINE1(s390_personality, unsigned long, personality)
190{ 191{
191 int ret; 192 int ret;
192 193
@@ -205,15 +206,13 @@ asmlinkage long s390x_personality(unsigned long personality)
205 */ 206 */
206#ifndef CONFIG_64BIT 207#ifndef CONFIG_64BIT
207 208
208asmlinkage long 209SYSCALL_DEFINE5(s390_fadvise64, int, fd, u32, offset_high, u32, offset_low,
209s390_fadvise64(int fd, u32 offset_high, u32 offset_low, size_t len, int advice) 210 size_t, len, int, advice)
210{ 211{
211 return sys_fadvise64(fd, (u64) offset_high << 32 | offset_low, 212 return sys_fadvise64(fd, (u64) offset_high << 32 | offset_low,
212 len, advice); 213 len, advice);
213} 214}
214 215
215#endif
216
217struct fadvise64_64_args { 216struct fadvise64_64_args {
218 int fd; 217 int fd;
219 long long offset; 218 long long offset;
@@ -221,8 +220,7 @@ struct fadvise64_64_args {
221 int advice; 220 int advice;
222}; 221};
223 222
224asmlinkage long 223SYSCALL_DEFINE1(s390_fadvise64_64, struct fadvise64_64_args __user *, args)
225s390_fadvise64_64(struct fadvise64_64_args __user *args)
226{ 224{
227 struct fadvise64_64_args a; 225 struct fadvise64_64_args a;
228 226
@@ -231,7 +229,6 @@ s390_fadvise64_64(struct fadvise64_64_args __user *args)
231 return sys_fadvise64_64(a.fd, a.offset, a.len, a.advice); 229 return sys_fadvise64_64(a.fd, a.offset, a.len, a.advice);
232} 230}
233 231
234#ifndef CONFIG_64BIT
235/* 232/*
236 * This is a wrapper to call sys_fallocate(). For 31 bit s390 the last 233 * This is a wrapper to call sys_fallocate(). For 31 bit s390 the last
237 * 64 bit argument "len" is split into the upper and lower 32 bits. The 234 * 64 bit argument "len" is split into the upper and lower 32 bits. The
@@ -244,9 +241,19 @@ s390_fadvise64_64(struct fadvise64_64_args __user *args)
244 * to 241 * to
245 * %r2: fd, %r3: mode, %r4/%r5: offset, 96(%r15)-103(%r15): len 242 * %r2: fd, %r3: mode, %r4/%r5: offset, 96(%r15)-103(%r15): len
246 */ 243 */
247asmlinkage long s390_fallocate(int fd, int mode, loff_t offset, 244SYSCALL_DEFINE(s390_fallocate)(int fd, int mode, loff_t offset,
248 u32 len_high, u32 len_low) 245 u32 len_high, u32 len_low)
249{ 246{
250 return sys_fallocate(fd, mode, offset, ((u64)len_high << 32) | len_low); 247 return sys_fallocate(fd, mode, offset, ((u64)len_high << 32) | len_low);
251} 248}
249#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
250asmlinkage long SyS_s390_fallocate(long fd, long mode, loff_t offset,
251 long len_high, long len_low)
252{
253 return SYSC_s390_fallocate((int) fd, (int) mode, offset,
254 (u32) len_high, (u32) len_low);
255}
256SYSCALL_ALIAS(sys_s390_fallocate, SyS_s390_fallocate);
257#endif
258
252#endif 259#endif
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S
index 2d61787949d5..76d16e0140bb 100644
--- a/arch/s390/kernel/syscalls.S
+++ b/arch/s390/kernel/syscalls.S
@@ -98,7 +98,7 @@ SYSCALL(sys_uselib,sys_uselib,sys32_uselib_wrapper)
98SYSCALL(sys_swapon,sys_swapon,sys32_swapon_wrapper) 98SYSCALL(sys_swapon,sys_swapon,sys32_swapon_wrapper)
99SYSCALL(sys_reboot,sys_reboot,sys32_reboot_wrapper) 99SYSCALL(sys_reboot,sys_reboot,sys32_reboot_wrapper)
100SYSCALL(sys_ni_syscall,sys_ni_syscall,old32_readdir_wrapper) /* old readdir syscall */ 100SYSCALL(sys_ni_syscall,sys_ni_syscall,old32_readdir_wrapper) /* old readdir syscall */
101SYSCALL(old_mmap,old_mmap,old32_mmap_wrapper) /* 90 */ 101SYSCALL(sys_s390_old_mmap,sys_s390_old_mmap,old32_mmap_wrapper) /* 90 */
102SYSCALL(sys_munmap,sys_munmap,sys32_munmap_wrapper) 102SYSCALL(sys_munmap,sys_munmap,sys32_munmap_wrapper)
103SYSCALL(sys_truncate,sys_truncate,sys32_truncate_wrapper) 103SYSCALL(sys_truncate,sys_truncate,sys32_truncate_wrapper)
104SYSCALL(sys_ftruncate,sys_ftruncate,sys32_ftruncate_wrapper) 104SYSCALL(sys_ftruncate,sys_ftruncate,sys32_ftruncate_wrapper)
@@ -130,7 +130,7 @@ SYSCALL(sys_fsync,sys_fsync,sys32_fsync_wrapper)
130SYSCALL(sys_sigreturn,sys_sigreturn,sys32_sigreturn) 130SYSCALL(sys_sigreturn,sys_sigreturn,sys32_sigreturn)
131SYSCALL(sys_clone,sys_clone,sys32_clone) /* 120 */ 131SYSCALL(sys_clone,sys_clone,sys32_clone) /* 120 */
132SYSCALL(sys_setdomainname,sys_setdomainname,sys32_setdomainname_wrapper) 132SYSCALL(sys_setdomainname,sys_setdomainname,sys32_setdomainname_wrapper)
133SYSCALL(sys_newuname,s390x_newuname,sys32_newuname_wrapper) 133SYSCALL(sys_newuname,sys_s390_newuname,sys32_newuname_wrapper)
134NI_SYSCALL /* modify_ldt for i386 */ 134NI_SYSCALL /* modify_ldt for i386 */
135SYSCALL(sys_adjtimex,sys_adjtimex,compat_sys_adjtimex_wrapper) 135SYSCALL(sys_adjtimex,sys_adjtimex,compat_sys_adjtimex_wrapper)
136SYSCALL(sys_mprotect,sys_mprotect,sys32_mprotect_wrapper) /* 125 */ 136SYSCALL(sys_mprotect,sys_mprotect,sys32_mprotect_wrapper) /* 125 */
@@ -144,7 +144,7 @@ SYSCALL(sys_getpgid,sys_getpgid,sys32_getpgid_wrapper)
144SYSCALL(sys_fchdir,sys_fchdir,sys32_fchdir_wrapper) 144SYSCALL(sys_fchdir,sys_fchdir,sys32_fchdir_wrapper)
145SYSCALL(sys_bdflush,sys_bdflush,sys32_bdflush_wrapper) 145SYSCALL(sys_bdflush,sys_bdflush,sys32_bdflush_wrapper)
146SYSCALL(sys_sysfs,sys_sysfs,sys32_sysfs_wrapper) /* 135 */ 146SYSCALL(sys_sysfs,sys_sysfs,sys32_sysfs_wrapper) /* 135 */
147SYSCALL(sys_personality,s390x_personality,sys32_personality_wrapper) 147SYSCALL(sys_personality,sys_s390_personality,sys32_personality_wrapper)
148NI_SYSCALL /* for afs_syscall */ 148NI_SYSCALL /* for afs_syscall */
149SYSCALL(sys_setfsuid16,sys_ni_syscall,sys32_setfsuid16_wrapper) /* old setfsuid16 syscall */ 149SYSCALL(sys_setfsuid16,sys_ni_syscall,sys32_setfsuid16_wrapper) /* old setfsuid16 syscall */
150SYSCALL(sys_setfsgid16,sys_ni_syscall,sys32_setfsgid16_wrapper) /* old setfsgid16 syscall */ 150SYSCALL(sys_setfsgid16,sys_ni_syscall,sys32_setfsgid16_wrapper) /* old setfsgid16 syscall */
@@ -261,7 +261,7 @@ SYSCALL(sys_epoll_create,sys_epoll_create,sys_epoll_create_wrapper)
261SYSCALL(sys_epoll_ctl,sys_epoll_ctl,sys_epoll_ctl_wrapper) /* 250 */ 261SYSCALL(sys_epoll_ctl,sys_epoll_ctl,sys_epoll_ctl_wrapper) /* 250 */
262SYSCALL(sys_epoll_wait,sys_epoll_wait,sys_epoll_wait_wrapper) 262SYSCALL(sys_epoll_wait,sys_epoll_wait,sys_epoll_wait_wrapper)
263SYSCALL(sys_set_tid_address,sys_set_tid_address,sys32_set_tid_address_wrapper) 263SYSCALL(sys_set_tid_address,sys_set_tid_address,sys32_set_tid_address_wrapper)
264SYSCALL(s390_fadvise64,sys_fadvise64_64,sys32_fadvise64_wrapper) 264SYSCALL(sys_s390_fadvise64,sys_fadvise64_64,sys32_fadvise64_wrapper)
265SYSCALL(sys_timer_create,sys_timer_create,sys32_timer_create_wrapper) 265SYSCALL(sys_timer_create,sys_timer_create,sys32_timer_create_wrapper)
266SYSCALL(sys_timer_settime,sys_timer_settime,sys32_timer_settime_wrapper) /* 255 */ 266SYSCALL(sys_timer_settime,sys_timer_settime,sys32_timer_settime_wrapper) /* 255 */
267SYSCALL(sys_timer_gettime,sys_timer_gettime,sys32_timer_gettime_wrapper) 267SYSCALL(sys_timer_gettime,sys_timer_gettime,sys32_timer_gettime_wrapper)
@@ -272,7 +272,7 @@ SYSCALL(sys_clock_gettime,sys_clock_gettime,sys32_clock_gettime_wrapper) /* 260
272SYSCALL(sys_clock_getres,sys_clock_getres,sys32_clock_getres_wrapper) 272SYSCALL(sys_clock_getres,sys_clock_getres,sys32_clock_getres_wrapper)
273SYSCALL(sys_clock_nanosleep,sys_clock_nanosleep,sys32_clock_nanosleep_wrapper) 273SYSCALL(sys_clock_nanosleep,sys_clock_nanosleep,sys32_clock_nanosleep_wrapper)
274NI_SYSCALL /* reserved for vserver */ 274NI_SYSCALL /* reserved for vserver */
275SYSCALL(s390_fadvise64_64,sys_ni_syscall,sys32_fadvise64_64_wrapper) 275SYSCALL(sys_s390_fadvise64_64,sys_ni_syscall,sys32_fadvise64_64_wrapper)
276SYSCALL(sys_statfs64,sys_statfs64,compat_sys_statfs64_wrapper) 276SYSCALL(sys_statfs64,sys_statfs64,compat_sys_statfs64_wrapper)
277SYSCALL(sys_fstatfs64,sys_fstatfs64,compat_sys_fstatfs64_wrapper) 277SYSCALL(sys_fstatfs64,sys_fstatfs64,compat_sys_fstatfs64_wrapper)
278SYSCALL(sys_remap_file_pages,sys_remap_file_pages,sys32_remap_file_pages_wrapper) 278SYSCALL(sys_remap_file_pages,sys_remap_file_pages,sys32_remap_file_pages_wrapper)
@@ -322,7 +322,7 @@ NI_SYSCALL /* 310 sys_move_pages */
322SYSCALL(sys_getcpu,sys_getcpu,sys_getcpu_wrapper) 322SYSCALL(sys_getcpu,sys_getcpu,sys_getcpu_wrapper)
323SYSCALL(sys_epoll_pwait,sys_epoll_pwait,compat_sys_epoll_pwait_wrapper) 323SYSCALL(sys_epoll_pwait,sys_epoll_pwait,compat_sys_epoll_pwait_wrapper)
324SYSCALL(sys_utimes,sys_utimes,compat_sys_utimes_wrapper) 324SYSCALL(sys_utimes,sys_utimes,compat_sys_utimes_wrapper)
325SYSCALL(s390_fallocate,sys_fallocate,sys_fallocate_wrapper) 325SYSCALL(sys_s390_fallocate,sys_fallocate,sys_fallocate_wrapper)
326SYSCALL(sys_utimensat,sys_utimensat,compat_sys_utimensat_wrapper) /* 315 */ 326SYSCALL(sys_utimensat,sys_utimensat,compat_sys_utimensat_wrapper) /* 315 */
327SYSCALL(sys_signalfd,sys_signalfd,compat_sys_signalfd_wrapper) 327SYSCALL(sys_signalfd,sys_signalfd,compat_sys_signalfd_wrapper)
328NI_SYSCALL /* 317 old sys_timer_fd */ 328NI_SYSCALL /* 317 old sys_timer_fd */
diff --git a/arch/sh/include/asm/Kbuild b/arch/sh/include/asm/Kbuild
index f1a2a0d1c79c..43910cdf78a5 100644
--- a/arch/sh/include/asm/Kbuild
+++ b/arch/sh/include/asm/Kbuild
@@ -6,4 +6,3 @@ unifdef-y += unistd_32.h
6unifdef-y += unistd_64.h 6unifdef-y += unistd_64.h
7unifdef-y += posix_types_32.h 7unifdef-y += posix_types_32.h
8unifdef-y += posix_types_64.h 8unifdef-y += posix_types_64.h
9unifdef-y += swab.h
diff --git a/arch/sh/include/asm/byteorder.h b/arch/sh/include/asm/byteorder.h
index e95c41a5c8cc..db2f5d7cb17d 100644
--- a/arch/sh/include/asm/byteorder.h
+++ b/arch/sh/include/asm/byteorder.h
@@ -1,8 +1,6 @@
1#ifndef __ASM_SH_BYTEORDER_H 1#ifndef __ASM_SH_BYTEORDER_H
2#define __ASM_SH_BYTEORDER_H 2#define __ASM_SH_BYTEORDER_H
3 3
4#include <asm/swab.h>
5
6#ifdef __LITTLE_ENDIAN__ 4#ifdef __LITTLE_ENDIAN__
7#include <linux/byteorder/little_endian.h> 5#include <linux/byteorder/little_endian.h>
8#else 6#else
diff --git a/arch/sh/include/asm/syscalls_32.h b/arch/sh/include/asm/syscalls_32.h
index 104c5e686106..8b30200305c3 100644
--- a/arch/sh/include/asm/syscalls_32.h
+++ b/arch/sh/include/asm/syscalls_32.h
@@ -36,9 +36,9 @@ asmlinkage int sys_sigreturn(unsigned long r4, unsigned long r5,
36asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5, 36asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5,
37 unsigned long r6, unsigned long r7, 37 unsigned long r6, unsigned long r7,
38 struct pt_regs __regs); 38 struct pt_regs __regs);
39asmlinkage int sys_pipe(unsigned long r4, unsigned long r5, 39asmlinkage int sys_sh_pipe(unsigned long r4, unsigned long r5,
40 unsigned long r6, unsigned long r7, 40 unsigned long r6, unsigned long r7,
41 struct pt_regs __regs); 41 struct pt_regs __regs);
42asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char __user *buf, 42asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char __user *buf,
43 size_t count, long dummy, loff_t pos); 43 size_t count, long dummy, loff_t pos);
44asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char __user *buf, 44asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char __user *buf,
diff --git a/arch/sh/kernel/sys_sh32.c b/arch/sh/kernel/sys_sh32.c
index dbba1e1833d4..63ba12836eae 100644
--- a/arch/sh/kernel/sys_sh32.c
+++ b/arch/sh/kernel/sys_sh32.c
@@ -22,7 +22,7 @@
22 * sys_pipe() is the normal C calling standard for creating 22 * sys_pipe() is the normal C calling standard for creating
23 * a pipe. It's not the way Unix traditionally does this, though. 23 * a pipe. It's not the way Unix traditionally does this, though.
24 */ 24 */
25asmlinkage int sys_pipe(unsigned long r4, unsigned long r5, 25asmlinkage int sys_sh_pipe(unsigned long r4, unsigned long r5,
26 unsigned long r6, unsigned long r7, 26 unsigned long r6, unsigned long r7,
27 struct pt_regs __regs) 27 struct pt_regs __regs)
28{ 28{
diff --git a/arch/sh/kernel/syscalls_32.S b/arch/sh/kernel/syscalls_32.S
index 0af693e65764..e67c1733e1b9 100644
--- a/arch/sh/kernel/syscalls_32.S
+++ b/arch/sh/kernel/syscalls_32.S
@@ -58,7 +58,7 @@ ENTRY(sys_call_table)
58 .long sys_mkdir 58 .long sys_mkdir
59 .long sys_rmdir /* 40 */ 59 .long sys_rmdir /* 40 */
60 .long sys_dup 60 .long sys_dup
61 .long sys_pipe 61 .long sys_sh_pipe
62 .long sys_times 62 .long sys_times
63 .long sys_ni_syscall /* old prof syscall holder */ 63 .long sys_ni_syscall /* old prof syscall holder */
64 .long sys_brk /* 45 */ 64 .long sys_brk /* 45 */
@@ -105,7 +105,7 @@ ENTRY(sys_call_table)
105 .long sys_uselib 105 .long sys_uselib
106 .long sys_swapon 106 .long sys_swapon
107 .long sys_reboot 107 .long sys_reboot
108 .long old_readdir 108 .long sys_old_readdir
109 .long old_mmap /* 90 */ 109 .long old_mmap /* 90 */
110 .long sys_munmap 110 .long sys_munmap
111 .long sys_truncate 111 .long sys_truncate
diff --git a/arch/sh/kernel/syscalls_64.S b/arch/sh/kernel/syscalls_64.S
index 0b436aa3cad7..557cb91f5caf 100644
--- a/arch/sh/kernel/syscalls_64.S
+++ b/arch/sh/kernel/syscalls_64.S
@@ -109,7 +109,7 @@ sys_call_table:
109 .long sys_uselib 109 .long sys_uselib
110 .long sys_swapon 110 .long sys_swapon
111 .long sys_reboot 111 .long sys_reboot
112 .long old_readdir 112 .long sys_old_readdir
113 .long old_mmap /* 90 */ 113 .long old_mmap /* 90 */
114 .long sys_munmap 114 .long sys_munmap
115 .long sys_truncate 115 .long sys_truncate
diff --git a/arch/sparc/include/asm/Kbuild b/arch/sparc/include/asm/Kbuild
index 95e38a43dff0..deeb0fba8029 100644
--- a/arch/sparc/include/asm/Kbuild
+++ b/arch/sparc/include/asm/Kbuild
@@ -17,4 +17,3 @@ header-y += traps.h
17header-y += uctx.h 17header-y += uctx.h
18header-y += utrap.h 18header-y += utrap.h
19header-y += watchdog.h 19header-y += watchdog.h
20header-y += swab.h
diff --git a/arch/sparc/include/asm/byteorder.h b/arch/sparc/include/asm/byteorder.h
index 48a047cd6fa9..ccc1b6b7de6c 100644
--- a/arch/sparc/include/asm/byteorder.h
+++ b/arch/sparc/include/asm/byteorder.h
@@ -1,7 +1,6 @@
1#ifndef _SPARC_BYTEORDER_H 1#ifndef _SPARC_BYTEORDER_H
2#define _SPARC_BYTEORDER_H 2#define _SPARC_BYTEORDER_H
3 3
4#include <asm/swab.h>
5#include <linux/byteorder/big_endian.h> 4#include <linux/byteorder/big_endian.h>
6 5
7#endif /* _SPARC_BYTEORDER_H */ 6#endif /* _SPARC_BYTEORDER_H */
diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S
index faf9ccd9ef5d..f41ecc5ac0b4 100644
--- a/arch/sparc/kernel/entry.S
+++ b/arch/sparc/kernel/entry.S
@@ -1088,8 +1088,8 @@ sunos_execv:
1088 ld [%sp + STACKFRAME_SZ + PT_I0], %o0 1088 ld [%sp + STACKFRAME_SZ + PT_I0], %o0
1089 1089
1090 .align 4 1090 .align 4
1091 .globl sys_pipe 1091 .globl sys_sparc_pipe
1092sys_pipe: 1092sys_sparc_pipe:
1093 mov %o7, %l5 1093 mov %o7, %l5
1094 add %sp, STACKFRAME_SZ, %o0 ! pt_regs *regs arg 1094 add %sp, STACKFRAME_SZ, %o0 ! pt_regs *regs arg
1095 call sparc_pipe 1095 call sparc_pipe
diff --git a/arch/sparc/kernel/sparc_ksyms_64.c b/arch/sparc/kernel/sparc_ksyms_64.c
index da8f804feb49..0f26066a08d9 100644
--- a/arch/sparc/kernel/sparc_ksyms_64.c
+++ b/arch/sparc/kernel/sparc_ksyms_64.c
@@ -9,7 +9,6 @@
9#include <linux/pci.h> 9#include <linux/pci.h>
10#include <linux/init.h> 10#include <linux/init.h>
11 11
12#include <asm/spinlock.h>
13#include <asm/system.h> 12#include <asm/system.h>
14#include <asm/cpudata.h> 13#include <asm/cpudata.h>
15#include <asm/uaccess.h> 14#include <asm/uaccess.h>
@@ -23,16 +22,6 @@ struct poll {
23 short revents; 22 short revents;
24}; 23};
25 24
26/* used by various drivers */
27#ifdef CONFIG_SMP
28/* Out of line rw-locking implementation. */
29EXPORT_SYMBOL(__read_lock);
30EXPORT_SYMBOL(__read_unlock);
31EXPORT_SYMBOL(__write_lock);
32EXPORT_SYMBOL(__write_unlock);
33EXPORT_SYMBOL(__write_trylock);
34#endif /* CONFIG_SMP */
35
36/* from helpers.S */ 25/* from helpers.S */
37EXPORT_SYMBOL(__flushw_user); 26EXPORT_SYMBOL(__flushw_user);
38EXPORT_SYMBOL_GPL(real_hard_smp_processor_id); 27EXPORT_SYMBOL_GPL(real_hard_smp_processor_id);
diff --git a/arch/sparc/kernel/syscalls.S b/arch/sparc/kernel/syscalls.S
index 7a6786a71363..87f5a3b8a253 100644
--- a/arch/sparc/kernel/syscalls.S
+++ b/arch/sparc/kernel/syscalls.S
@@ -20,7 +20,7 @@ execve_merge:
20 add %sp, PTREGS_OFF, %o0 20 add %sp, PTREGS_OFF, %o0
21 21
22 .align 32 22 .align 32
23sys_pipe: 23sys_sparc_pipe:
24 ba,pt %xcc, sparc_pipe 24 ba,pt %xcc, sparc_pipe
25 add %sp, PTREGS_OFF, %o0 25 add %sp, PTREGS_OFF, %o0
26sys_nis_syscall: 26sys_nis_syscall:
diff --git a/arch/sparc/kernel/systbls_32.S b/arch/sparc/kernel/systbls_32.S
index 7d0807586442..dccc95df0c7f 100644
--- a/arch/sparc/kernel/systbls_32.S
+++ b/arch/sparc/kernel/systbls_32.S
@@ -24,7 +24,7 @@ sys_call_table:
24/*25*/ .long sys_vmsplice, sys_ptrace, sys_alarm, sys_sigaltstack, sys_pause 24/*25*/ .long sys_vmsplice, sys_ptrace, sys_alarm, sys_sigaltstack, sys_pause
25/*30*/ .long sys_utime, sys_lchown, sys_fchown, sys_access, sys_nice 25/*30*/ .long sys_utime, sys_lchown, sys_fchown, sys_access, sys_nice
26/*35*/ .long sys_chown, sys_sync, sys_kill, sys_newstat, sys_sendfile 26/*35*/ .long sys_chown, sys_sync, sys_kill, sys_newstat, sys_sendfile
27/*40*/ .long sys_newlstat, sys_dup, sys_pipe, sys_times, sys_getuid 27/*40*/ .long sys_newlstat, sys_dup, sys_sparc_pipe, sys_times, sys_getuid
28/*45*/ .long sys_umount, sys_setgid16, sys_getgid16, sys_signal, sys_geteuid16 28/*45*/ .long sys_umount, sys_setgid16, sys_getgid16, sys_signal, sys_geteuid16
29/*50*/ .long sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, sys_ioctl 29/*50*/ .long sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, sys_ioctl
30/*55*/ .long sys_reboot, sys_mmap2, sys_symlink, sys_readlink, sys_execve 30/*55*/ .long sys_reboot, sys_mmap2, sys_symlink, sys_readlink, sys_execve
@@ -56,7 +56,7 @@ sys_call_table:
56/*185*/ .long sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sys_newuname 56/*185*/ .long sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sys_newuname
57/*190*/ .long sys_init_module, sys_personality, sparc_remap_file_pages, sys_epoll_create, sys_epoll_ctl 57/*190*/ .long sys_init_module, sys_personality, sparc_remap_file_pages, sys_epoll_create, sys_epoll_ctl
58/*195*/ .long sys_epoll_wait, sys_ioprio_set, sys_getppid, sparc_sigaction, sys_sgetmask 58/*195*/ .long sys_epoll_wait, sys_ioprio_set, sys_getppid, sparc_sigaction, sys_sgetmask
59/*200*/ .long sys_ssetmask, sys_sigsuspend, sys_newlstat, sys_uselib, old_readdir 59/*200*/ .long sys_ssetmask, sys_sigsuspend, sys_newlstat, sys_uselib, sys_old_readdir
60/*205*/ .long sys_readahead, sys_socketcall, sys_syslog, sys_lookup_dcookie, sys_fadvise64 60/*205*/ .long sys_readahead, sys_socketcall, sys_syslog, sys_lookup_dcookie, sys_fadvise64
61/*210*/ .long sys_fadvise64_64, sys_tgkill, sys_waitpid, sys_swapoff, sys_sysinfo 61/*210*/ .long sys_fadvise64_64, sys_tgkill, sys_waitpid, sys_swapoff, sys_sysinfo
62/*215*/ .long sys_ipc, sys_sigreturn, sys_clone, sys_ioprio_get, sys_adjtimex 62/*215*/ .long sys_ipc, sys_sigreturn, sys_clone, sys_ioprio_get, sys_adjtimex
diff --git a/arch/sparc/kernel/systbls_64.S b/arch/sparc/kernel/systbls_64.S
index 9fc78cf354bd..e6007bb37046 100644
--- a/arch/sparc/kernel/systbls_64.S
+++ b/arch/sparc/kernel/systbls_64.S
@@ -26,7 +26,7 @@ sys_call_table32:
26/*25*/ .word sys32_vmsplice, compat_sys_ptrace, sys_alarm, sys32_sigaltstack, sys_pause 26/*25*/ .word sys32_vmsplice, compat_sys_ptrace, sys_alarm, sys32_sigaltstack, sys_pause
27/*30*/ .word compat_sys_utime, sys_lchown, sys_fchown, sys32_access, sys32_nice 27/*30*/ .word compat_sys_utime, sys_lchown, sys_fchown, sys32_access, sys32_nice
28 .word sys_chown, sys_sync, sys32_kill, compat_sys_newstat, sys32_sendfile 28 .word sys_chown, sys_sync, sys32_kill, compat_sys_newstat, sys32_sendfile
29/*40*/ .word compat_sys_newlstat, sys_dup, sys_pipe, compat_sys_times, sys_getuid 29/*40*/ .word compat_sys_newlstat, sys_dup, sys_sparc_pipe, compat_sys_times, sys_getuid
30 .word sys32_umount, sys_setgid16, sys_getgid16, sys32_signal, sys_geteuid16 30 .word sys32_umount, sys_setgid16, sys_getgid16, sys32_signal, sys_geteuid16
31/*50*/ .word sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, compat_sys_ioctl 31/*50*/ .word sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, compat_sys_ioctl
32 .word sys32_reboot, sys32_mmap2, sys_symlink, sys32_readlink, sys32_execve 32 .word sys32_reboot, sys32_mmap2, sys_symlink, sys32_readlink, sys32_execve
@@ -100,7 +100,7 @@ sys_call_table:
100/*25*/ .word sys_vmsplice, sys_ptrace, sys_alarm, sys_sigaltstack, sys_nis_syscall 100/*25*/ .word sys_vmsplice, sys_ptrace, sys_alarm, sys_sigaltstack, sys_nis_syscall
101/*30*/ .word sys_utime, sys_nis_syscall, sys_nis_syscall, sys_access, sys_nice 101/*30*/ .word sys_utime, sys_nis_syscall, sys_nis_syscall, sys_access, sys_nice
102 .word sys_nis_syscall, sys_sync, sys_kill, sys_newstat, sys_sendfile64 102 .word sys_nis_syscall, sys_sync, sys_kill, sys_newstat, sys_sendfile64
103/*40*/ .word sys_newlstat, sys_dup, sys_pipe, sys_times, sys_nis_syscall 103/*40*/ .word sys_newlstat, sys_dup, sys_sparc_pipe, sys_times, sys_nis_syscall
104 .word sys_umount, sys_setgid, sys_getgid, sys_signal, sys_geteuid 104 .word sys_umount, sys_setgid, sys_getgid, sys_signal, sys_geteuid
105/*50*/ .word sys_getegid, sys_acct, sys_memory_ordering, sys_nis_syscall, sys_ioctl 105/*50*/ .word sys_getegid, sys_acct, sys_memory_ordering, sys_nis_syscall, sys_ioctl
106 .word sys_reboot, sys_nis_syscall, sys_symlink, sys_readlink, sys_execve 106 .word sys_reboot, sys_nis_syscall, sys_symlink, sys_readlink, sys_execve
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index 8078955845ae..cdf4a9623237 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -307,10 +307,10 @@ config X86_CMPXCHG
307 307
308config X86_L1_CACHE_SHIFT 308config X86_L1_CACHE_SHIFT
309 int 309 int
310 default "7" if MPENTIUM4 || X86_GENERIC || GENERIC_CPU || MPSC 310 default "7" if MPENTIUM4 || MPSC
311 default "4" if X86_ELAN || M486 || M386 || MGEODEGX1 311 default "4" if X86_ELAN || M486 || M386 || MGEODEGX1
312 default "5" if MWINCHIP3D || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX 312 default "5" if MWINCHIP3D || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX
313 default "6" if MK7 || MK8 || MPENTIUMM || MCORE2 || MVIAC7 313 default "6" if MK7 || MK8 || MPENTIUMM || MCORE2 || MVIAC7 || X86_GENERIC || GENERIC_CPU
314 314
315config X86_XADD 315config X86_XADD
316 def_bool y 316 def_bool y
diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild
index a9f8a814a1f7..4a8e80cdcfa5 100644
--- a/arch/x86/include/asm/Kbuild
+++ b/arch/x86/include/asm/Kbuild
@@ -22,4 +22,3 @@ unifdef-y += unistd_32.h
22unifdef-y += unistd_64.h 22unifdef-y += unistd_64.h
23unifdef-y += vm86.h 23unifdef-y += vm86.h
24unifdef-y += vsyscall.h 24unifdef-y += vsyscall.h
25unifdef-y += swab.h
diff --git a/arch/x86/include/asm/byteorder.h b/arch/x86/include/asm/byteorder.h
index 7c49917e3d9d..b13a7a88f3eb 100644
--- a/arch/x86/include/asm/byteorder.h
+++ b/arch/x86/include/asm/byteorder.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_X86_BYTEORDER_H 1#ifndef _ASM_X86_BYTEORDER_H
2#define _ASM_X86_BYTEORDER_H 2#define _ASM_X86_BYTEORDER_H
3 3
4#include <asm/swab.h>
5#include <linux/byteorder/little_endian.h> 4#include <linux/byteorder/little_endian.h>
6 5
7#endif /* _ASM_X86_BYTEORDER_H */ 6#endif /* _ASM_X86_BYTEORDER_H */
diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c
index 884d985b8b82..e948b28a5a9a 100644
--- a/arch/x86/kernel/kprobes.c
+++ b/arch/x86/kernel/kprobes.c
@@ -446,7 +446,7 @@ void __kprobes arch_prepare_kretprobe(struct kretprobe_instance *ri,
446static void __kprobes setup_singlestep(struct kprobe *p, struct pt_regs *regs, 446static void __kprobes setup_singlestep(struct kprobe *p, struct pt_regs *regs,
447 struct kprobe_ctlblk *kcb) 447 struct kprobe_ctlblk *kcb)
448{ 448{
449#if !defined(CONFIG_PREEMPT) || defined(CONFIG_PM) 449#if !defined(CONFIG_PREEMPT) || defined(CONFIG_FREEZER)
450 if (p->ainsn.boostable == 1 && !p->post_handler) { 450 if (p->ainsn.boostable == 1 && !p->post_handler) {
451 /* Boost up -- we can execute copied instructions directly */ 451 /* Boost up -- we can execute copied instructions directly */
452 reset_current_kprobe(); 452 reset_current_kprobe();
diff --git a/arch/x86/kernel/syscall_table_32.S b/arch/x86/kernel/syscall_table_32.S
index d44395ff34c3..e2e86a08f31d 100644
--- a/arch/x86/kernel/syscall_table_32.S
+++ b/arch/x86/kernel/syscall_table_32.S
@@ -88,7 +88,7 @@ ENTRY(sys_call_table)
88 .long sys_uselib 88 .long sys_uselib
89 .long sys_swapon 89 .long sys_swapon
90 .long sys_reboot 90 .long sys_reboot
91 .long old_readdir 91 .long sys_old_readdir
92 .long old_mmap /* 90 */ 92 .long old_mmap /* 90 */
93 .long sys_munmap 93 .long sys_munmap
94 .long sys_truncate 94 .long sys_truncate
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 37242c405f16..65709a6aa6ee 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -92,8 +92,8 @@ static inline int notify_page_fault(struct pt_regs *regs)
92 * 92 *
93 * Opcode checker based on code by Richard Brunner 93 * Opcode checker based on code by Richard Brunner
94 */ 94 */
95static int is_prefetch(struct pt_regs *regs, unsigned long addr, 95static int is_prefetch(struct pt_regs *regs, unsigned long error_code,
96 unsigned long error_code) 96 unsigned long addr)
97{ 97{
98 unsigned char *instr; 98 unsigned char *instr;
99 int scan_more = 1; 99 int scan_more = 1;
@@ -410,15 +410,15 @@ static void show_fault_oops(struct pt_regs *regs, unsigned long error_code,
410} 410}
411 411
412#ifdef CONFIG_X86_64 412#ifdef CONFIG_X86_64
413static noinline void pgtable_bad(unsigned long address, struct pt_regs *regs, 413static noinline void pgtable_bad(struct pt_regs *regs,
414 unsigned long error_code) 414 unsigned long error_code, unsigned long address)
415{ 415{
416 unsigned long flags = oops_begin(); 416 unsigned long flags = oops_begin();
417 int sig = SIGKILL; 417 int sig = SIGKILL;
418 struct task_struct *tsk; 418 struct task_struct *tsk = current;
419 419
420 printk(KERN_ALERT "%s: Corrupted page table at address %lx\n", 420 printk(KERN_ALERT "%s: Corrupted page table at address %lx\n",
421 current->comm, address); 421 tsk->comm, address);
422 dump_pagetable(address); 422 dump_pagetable(address);
423 tsk = current; 423 tsk = current;
424 tsk->thread.cr2 = address; 424 tsk->thread.cr2 = address;
@@ -430,6 +430,196 @@ static noinline void pgtable_bad(unsigned long address, struct pt_regs *regs,
430} 430}
431#endif 431#endif
432 432
433static noinline void no_context(struct pt_regs *regs,
434 unsigned long error_code, unsigned long address)
435{
436 struct task_struct *tsk = current;
437 unsigned long *stackend;
438
439#ifdef CONFIG_X86_64
440 unsigned long flags;
441 int sig;
442#endif
443
444 /* Are we prepared to handle this kernel fault? */
445 if (fixup_exception(regs))
446 return;
447
448 /*
449 * X86_32
450 * Valid to do another page fault here, because if this fault
451 * had been triggered by is_prefetch fixup_exception would have
452 * handled it.
453 *
454 * X86_64
455 * Hall of shame of CPU/BIOS bugs.
456 */
457 if (is_prefetch(regs, error_code, address))
458 return;
459
460 if (is_errata93(regs, address))
461 return;
462
463 /*
464 * Oops. The kernel tried to access some bad page. We'll have to
465 * terminate things with extreme prejudice.
466 */
467#ifdef CONFIG_X86_32
468 bust_spinlocks(1);
469#else
470 flags = oops_begin();
471#endif
472
473 show_fault_oops(regs, error_code, address);
474
475 stackend = end_of_stack(tsk);
476 if (*stackend != STACK_END_MAGIC)
477 printk(KERN_ALERT "Thread overran stack, or stack corrupted\n");
478
479 tsk->thread.cr2 = address;
480 tsk->thread.trap_no = 14;
481 tsk->thread.error_code = error_code;
482
483#ifdef CONFIG_X86_32
484 die("Oops", regs, error_code);
485 bust_spinlocks(0);
486 do_exit(SIGKILL);
487#else
488 sig = SIGKILL;
489 if (__die("Oops", regs, error_code))
490 sig = 0;
491 /* Executive summary in case the body of the oops scrolled away */
492 printk(KERN_EMERG "CR2: %016lx\n", address);
493 oops_end(flags, regs, sig);
494#endif
495}
496
497static void __bad_area_nosemaphore(struct pt_regs *regs,
498 unsigned long error_code, unsigned long address,
499 int si_code)
500{
501 struct task_struct *tsk = current;
502
503 /* User mode accesses just cause a SIGSEGV */
504 if (error_code & PF_USER) {
505 /*
506 * It's possible to have interrupts off here.
507 */
508 local_irq_enable();
509
510 /*
511 * Valid to do another page fault here because this one came
512 * from user space.
513 */
514 if (is_prefetch(regs, error_code, address))
515 return;
516
517 if (is_errata100(regs, address))
518 return;
519
520 if (show_unhandled_signals && unhandled_signal(tsk, SIGSEGV) &&
521 printk_ratelimit()) {
522 printk(
523 "%s%s[%d]: segfault at %lx ip %p sp %p error %lx",
524 task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG,
525 tsk->comm, task_pid_nr(tsk), address,
526 (void *) regs->ip, (void *) regs->sp, error_code);
527 print_vma_addr(" in ", regs->ip);
528 printk("\n");
529 }
530
531 tsk->thread.cr2 = address;
532 /* Kernel addresses are always protection faults */
533 tsk->thread.error_code = error_code | (address >= TASK_SIZE);
534 tsk->thread.trap_no = 14;
535 force_sig_info_fault(SIGSEGV, si_code, address, tsk);
536 return;
537 }
538
539 if (is_f00f_bug(regs, address))
540 return;
541
542 no_context(regs, error_code, address);
543}
544
545static noinline void bad_area_nosemaphore(struct pt_regs *regs,
546 unsigned long error_code, unsigned long address)
547{
548 __bad_area_nosemaphore(regs, error_code, address, SEGV_MAPERR);
549}
550
551static void __bad_area(struct pt_regs *regs,
552 unsigned long error_code, unsigned long address,
553 int si_code)
554{
555 struct mm_struct *mm = current->mm;
556
557 /*
558 * Something tried to access memory that isn't in our memory map..
559 * Fix it, but check if it's kernel or user first..
560 */
561 up_read(&mm->mmap_sem);
562
563 __bad_area_nosemaphore(regs, error_code, address, si_code);
564}
565
566static noinline void bad_area(struct pt_regs *regs,
567 unsigned long error_code, unsigned long address)
568{
569 __bad_area(regs, error_code, address, SEGV_MAPERR);
570}
571
572static noinline void bad_area_access_error(struct pt_regs *regs,
573 unsigned long error_code, unsigned long address)
574{
575 __bad_area(regs, error_code, address, SEGV_ACCERR);
576}
577
578/* TODO: fixup for "mm-invoke-oom-killer-from-page-fault.patch" */
579static void out_of_memory(struct pt_regs *regs,
580 unsigned long error_code, unsigned long address)
581{
582 /*
583 * We ran out of memory, call the OOM killer, and return the userspace
584 * (which will retry the fault, or kill us if we got oom-killed).
585 */
586 up_read(&current->mm->mmap_sem);
587 pagefault_out_of_memory();
588}
589
590static void do_sigbus(struct pt_regs *regs,
591 unsigned long error_code, unsigned long address)
592{
593 struct task_struct *tsk = current;
594 struct mm_struct *mm = tsk->mm;
595
596 up_read(&mm->mmap_sem);
597
598 /* Kernel mode? Handle exceptions or die */
599 if (!(error_code & PF_USER))
600 no_context(regs, error_code, address);
601#ifdef CONFIG_X86_32
602 /* User space => ok to do another page fault */
603 if (is_prefetch(regs, error_code, address))
604 return;
605#endif
606 tsk->thread.cr2 = address;
607 tsk->thread.error_code = error_code;
608 tsk->thread.trap_no = 14;
609 force_sig_info_fault(SIGBUS, BUS_ADRERR, address, tsk);
610}
611
612static noinline void mm_fault_error(struct pt_regs *regs,
613 unsigned long error_code, unsigned long address, unsigned int fault)
614{
615 if (fault & VM_FAULT_OOM)
616 out_of_memory(regs, error_code, address);
617 else if (fault & VM_FAULT_SIGBUS)
618 do_sigbus(regs, error_code, address);
619 else
620 BUG();
621}
622
433static int spurious_fault_check(unsigned long error_code, pte_t *pte) 623static int spurious_fault_check(unsigned long error_code, pte_t *pte)
434{ 624{
435 if ((error_code & PF_WRITE) && !pte_write(*pte)) 625 if ((error_code & PF_WRITE) && !pte_write(*pte))
@@ -449,8 +639,8 @@ static int spurious_fault_check(unsigned long error_code, pte_t *pte)
449 * There are no security implications to leaving a stale TLB when 639 * There are no security implications to leaving a stale TLB when
450 * increasing the permissions on a page. 640 * increasing the permissions on a page.
451 */ 641 */
452static int spurious_fault(unsigned long address, 642static noinline int spurious_fault(unsigned long error_code,
453 unsigned long error_code) 643 unsigned long address)
454{ 644{
455 pgd_t *pgd; 645 pgd_t *pgd;
456 pud_t *pud; 646 pud_t *pud;
@@ -495,7 +685,7 @@ static int spurious_fault(unsigned long address,
495 * 685 *
496 * This assumes no large pages in there. 686 * This assumes no large pages in there.
497 */ 687 */
498static int vmalloc_fault(unsigned long address) 688static noinline int vmalloc_fault(unsigned long address)
499{ 689{
500#ifdef CONFIG_X86_32 690#ifdef CONFIG_X86_32
501 unsigned long pgd_paddr; 691 unsigned long pgd_paddr;
@@ -574,6 +764,25 @@ static int vmalloc_fault(unsigned long address)
574 764
575int show_unhandled_signals = 1; 765int show_unhandled_signals = 1;
576 766
767static inline int access_error(unsigned long error_code, int write,
768 struct vm_area_struct *vma)
769{
770 if (write) {
771 /* write, present and write, not present */
772 if (unlikely(!(vma->vm_flags & VM_WRITE)))
773 return 1;
774 } else if (unlikely(error_code & PF_PROT)) {
775 /* read, present */
776 return 1;
777 } else {
778 /* read, not present */
779 if (unlikely(!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE))))
780 return 1;
781 }
782
783 return 0;
784}
785
577/* 786/*
578 * This routine handles page faults. It determines the address, 787 * This routine handles page faults. It determines the address,
579 * and the problem, and then passes it off to one of the appropriate 788 * and the problem, and then passes it off to one of the appropriate
@@ -584,18 +793,12 @@ asmlinkage
584#endif 793#endif
585void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code) 794void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
586{ 795{
796 unsigned long address;
587 struct task_struct *tsk; 797 struct task_struct *tsk;
588 struct mm_struct *mm; 798 struct mm_struct *mm;
589 struct vm_area_struct *vma; 799 struct vm_area_struct *vma;
590 unsigned long address; 800 int write;
591 int write, si_code;
592 int fault; 801 int fault;
593 unsigned long *stackend;
594
595#ifdef CONFIG_X86_64
596 unsigned long flags;
597 int sig;
598#endif
599 802
600 tsk = current; 803 tsk = current;
601 mm = tsk->mm; 804 mm = tsk->mm;
@@ -604,9 +807,7 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
604 /* get the address */ 807 /* get the address */
605 address = read_cr2(); 808 address = read_cr2();
606 809
607 si_code = SEGV_MAPERR; 810 if (unlikely(notify_page_fault(regs)))
608
609 if (notify_page_fault(regs))
610 return; 811 return;
611 if (unlikely(kmmio_fault(regs, address))) 812 if (unlikely(kmmio_fault(regs, address)))
612 return; 813 return;
@@ -634,17 +835,17 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
634 return; 835 return;
635 836
636 /* Can handle a stale RO->RW TLB */ 837 /* Can handle a stale RO->RW TLB */
637 if (spurious_fault(address, error_code)) 838 if (spurious_fault(error_code, address))
638 return; 839 return;
639 840
640 /* 841 /*
641 * Don't take the mm semaphore here. If we fixup a prefetch 842 * Don't take the mm semaphore here. If we fixup a prefetch
642 * fault we could otherwise deadlock. 843 * fault we could otherwise deadlock.
643 */ 844 */
644 goto bad_area_nosemaphore; 845 bad_area_nosemaphore(regs, error_code, address);
846 return;
645 } 847 }
646 848
647
648 /* 849 /*
649 * It's safe to allow irq's after cr2 has been saved and the 850 * It's safe to allow irq's after cr2 has been saved and the
650 * vmalloc fault has been handled. 851 * vmalloc fault has been handled.
@@ -660,15 +861,17 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
660 861
661#ifdef CONFIG_X86_64 862#ifdef CONFIG_X86_64
662 if (unlikely(error_code & PF_RSVD)) 863 if (unlikely(error_code & PF_RSVD))
663 pgtable_bad(address, regs, error_code); 864 pgtable_bad(regs, error_code, address);
664#endif 865#endif
665 866
666 /* 867 /*
667 * If we're in an interrupt, have no user context or are running in an 868 * If we're in an interrupt, have no user context or are running in an
668 * atomic region then we must not take the fault. 869 * atomic region then we must not take the fault.
669 */ 870 */
670 if (unlikely(in_atomic() || !mm)) 871 if (unlikely(in_atomic() || !mm)) {
671 goto bad_area_nosemaphore; 872 bad_area_nosemaphore(regs, error_code, address);
873 return;
874 }
672 875
673 /* 876 /*
674 * When running in the kernel we expect faults to occur only to 877 * When running in the kernel we expect faults to occur only to
@@ -686,20 +889,26 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
686 * source. If this is invalid we can skip the address space check, 889 * source. If this is invalid we can skip the address space check,
687 * thus avoiding the deadlock. 890 * thus avoiding the deadlock.
688 */ 891 */
689 if (!down_read_trylock(&mm->mmap_sem)) { 892 if (unlikely(!down_read_trylock(&mm->mmap_sem))) {
690 if ((error_code & PF_USER) == 0 && 893 if ((error_code & PF_USER) == 0 &&
691 !search_exception_tables(regs->ip)) 894 !search_exception_tables(regs->ip)) {
692 goto bad_area_nosemaphore; 895 bad_area_nosemaphore(regs, error_code, address);
896 return;
897 }
693 down_read(&mm->mmap_sem); 898 down_read(&mm->mmap_sem);
694 } 899 }
695 900
696 vma = find_vma(mm, address); 901 vma = find_vma(mm, address);
697 if (!vma) 902 if (unlikely(!vma)) {
698 goto bad_area; 903 bad_area(regs, error_code, address);
699 if (vma->vm_start <= address) 904 return;
905 }
906 if (likely(vma->vm_start <= address))
700 goto good_area; 907 goto good_area;
701 if (!(vma->vm_flags & VM_GROWSDOWN)) 908 if (unlikely(!(vma->vm_flags & VM_GROWSDOWN))) {
702 goto bad_area; 909 bad_area(regs, error_code, address);
910 return;
911 }
703 if (error_code & PF_USER) { 912 if (error_code & PF_USER) {
704 /* 913 /*
705 * Accessing the stack below %sp is always a bug. 914 * Accessing the stack below %sp is always a bug.
@@ -707,31 +916,25 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
707 * and pusha to work. ("enter $65535,$31" pushes 916 * and pusha to work. ("enter $65535,$31" pushes
708 * 32 pointers and then decrements %sp by 65535.) 917 * 32 pointers and then decrements %sp by 65535.)
709 */ 918 */
710 if (address + 65536 + 32 * sizeof(unsigned long) < regs->sp) 919 if (unlikely(address + 65536 + 32 * sizeof(unsigned long) < regs->sp)) {
711 goto bad_area; 920 bad_area(regs, error_code, address);
921 return;
922 }
712 } 923 }
713 if (expand_stack(vma, address)) 924 if (unlikely(expand_stack(vma, address))) {
714 goto bad_area; 925 bad_area(regs, error_code, address);
715/* 926 return;
716 * Ok, we have a good vm_area for this memory access, so 927 }
717 * we can handle it.. 928
718 */ 929 /*
930 * Ok, we have a good vm_area for this memory access, so
931 * we can handle it..
932 */
719good_area: 933good_area:
720 si_code = SEGV_ACCERR; 934 write = error_code & PF_WRITE;
721 write = 0; 935 if (unlikely(access_error(error_code, write, vma))) {
722 switch (error_code & (PF_PROT|PF_WRITE)) { 936 bad_area_access_error(regs, error_code, address);
723 default: /* 3: write, present */ 937 return;
724 /* fall through */
725 case PF_WRITE: /* write, not present */
726 if (!(vma->vm_flags & VM_WRITE))
727 goto bad_area;
728 write++;
729 break;
730 case PF_PROT: /* read, present */
731 goto bad_area;
732 case 0: /* read, not present */
733 if (!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)))
734 goto bad_area;
735 } 938 }
736 939
737 /* 940 /*
@@ -741,11 +944,8 @@ good_area:
741 */ 944 */
742 fault = handle_mm_fault(mm, vma, address, write); 945 fault = handle_mm_fault(mm, vma, address, write);
743 if (unlikely(fault & VM_FAULT_ERROR)) { 946 if (unlikely(fault & VM_FAULT_ERROR)) {
744 if (fault & VM_FAULT_OOM) 947 mm_fault_error(regs, error_code, address, fault);
745 goto out_of_memory; 948 return;
746 else if (fault & VM_FAULT_SIGBUS)
747 goto do_sigbus;
748 BUG();
749 } 949 }
750 if (fault & VM_FAULT_MAJOR) 950 if (fault & VM_FAULT_MAJOR)
751 tsk->maj_flt++; 951 tsk->maj_flt++;
@@ -763,132 +963,6 @@ good_area:
763 } 963 }
764#endif 964#endif
765 up_read(&mm->mmap_sem); 965 up_read(&mm->mmap_sem);
766 return;
767
768/*
769 * Something tried to access memory that isn't in our memory map..
770 * Fix it, but check if it's kernel or user first..
771 */
772bad_area:
773 up_read(&mm->mmap_sem);
774
775bad_area_nosemaphore:
776 /* User mode accesses just cause a SIGSEGV */
777 if (error_code & PF_USER) {
778 /*
779 * It's possible to have interrupts off here.
780 */
781 local_irq_enable();
782
783 /*
784 * Valid to do another page fault here because this one came
785 * from user space.
786 */
787 if (is_prefetch(regs, address, error_code))
788 return;
789
790 if (is_errata100(regs, address))
791 return;
792
793 if (show_unhandled_signals && unhandled_signal(tsk, SIGSEGV) &&
794 printk_ratelimit()) {
795 printk(
796 "%s%s[%d]: segfault at %lx ip %p sp %p error %lx",
797 task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG,
798 tsk->comm, task_pid_nr(tsk), address,
799 (void *) regs->ip, (void *) regs->sp, error_code);
800 print_vma_addr(" in ", regs->ip);
801 printk("\n");
802 }
803
804 tsk->thread.cr2 = address;
805 /* Kernel addresses are always protection faults */
806 tsk->thread.error_code = error_code | (address >= TASK_SIZE);
807 tsk->thread.trap_no = 14;
808 force_sig_info_fault(SIGSEGV, si_code, address, tsk);
809 return;
810 }
811
812 if (is_f00f_bug(regs, address))
813 return;
814
815no_context:
816 /* Are we prepared to handle this kernel fault? */
817 if (fixup_exception(regs))
818 return;
819
820 /*
821 * X86_32
822 * Valid to do another page fault here, because if this fault
823 * had been triggered by is_prefetch fixup_exception would have
824 * handled it.
825 *
826 * X86_64
827 * Hall of shame of CPU/BIOS bugs.
828 */
829 if (is_prefetch(regs, address, error_code))
830 return;
831
832 if (is_errata93(regs, address))
833 return;
834
835/*
836 * Oops. The kernel tried to access some bad page. We'll have to
837 * terminate things with extreme prejudice.
838 */
839#ifdef CONFIG_X86_32
840 bust_spinlocks(1);
841#else
842 flags = oops_begin();
843#endif
844
845 show_fault_oops(regs, error_code, address);
846
847 stackend = end_of_stack(tsk);
848 if (*stackend != STACK_END_MAGIC)
849 printk(KERN_ALERT "Thread overran stack, or stack corrupted\n");
850
851 tsk->thread.cr2 = address;
852 tsk->thread.trap_no = 14;
853 tsk->thread.error_code = error_code;
854
855#ifdef CONFIG_X86_32
856 die("Oops", regs, error_code);
857 bust_spinlocks(0);
858 do_exit(SIGKILL);
859#else
860 sig = SIGKILL;
861 if (__die("Oops", regs, error_code))
862 sig = 0;
863 /* Executive summary in case the body of the oops scrolled away */
864 printk(KERN_EMERG "CR2: %016lx\n", address);
865 oops_end(flags, regs, sig);
866#endif
867
868out_of_memory:
869 /*
870 * We ran out of memory, call the OOM killer, and return the userspace
871 * (which will retry the fault, or kill us if we got oom-killed).
872 */
873 up_read(&mm->mmap_sem);
874 pagefault_out_of_memory();
875 return;
876
877do_sigbus:
878 up_read(&mm->mmap_sem);
879
880 /* Kernel mode? Handle exceptions or die */
881 if (!(error_code & PF_USER))
882 goto no_context;
883#ifdef CONFIG_X86_32
884 /* User space => ok to do another page fault */
885 if (is_prefetch(regs, address, error_code))
886 return;
887#endif
888 tsk->thread.cr2 = address;
889 tsk->thread.error_code = error_code;
890 tsk->thread.trap_no = 14;
891 force_sig_info_fault(SIGBUS, BUS_ADRERR, address, tsk);
892} 966}
893 967
894DEFINE_SPINLOCK(pgd_lock); 968DEFINE_SPINLOCK(pgd_lock);
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 4cf30dee8161..e89d24815f26 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -555,12 +555,10 @@ repeat:
555 if (!pte_val(old_pte)) { 555 if (!pte_val(old_pte)) {
556 if (!primary) 556 if (!primary)
557 return 0; 557 return 0;
558 558 WARN(1, KERN_WARNING "CPA: called for zero pte. "
559 /* 559 "vaddr = %lx cpa->vaddr = %lx\n", address,
560 * Special error value returned, indicating that the mapping 560 *cpa->vaddr);
561 * did not exist at this address. 561 return -EINVAL;
562 */
563 return -EFAULT;
564 } 562 }
565 563
566 if (level == PG_LEVEL_4K) { 564 if (level == PG_LEVEL_4K) {
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
index 3be399013de6..c9488513fd70 100644
--- a/arch/x86/mm/pat.c
+++ b/arch/x86/mm/pat.c
@@ -522,35 +522,6 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size)
522} 522}
523#endif /* CONFIG_STRICT_DEVMEM */ 523#endif /* CONFIG_STRICT_DEVMEM */
524 524
525/*
526 * Change the memory type for the physial address range in kernel identity
527 * mapping space if that range is a part of identity map.
528 */
529static int kernel_map_sync_memtype(u64 base, unsigned long size,
530 unsigned long flags)
531{
532 unsigned long id_sz;
533 int ret;
534
535 if (!pat_enabled || base >= __pa(high_memory))
536 return 0;
537
538 id_sz = (__pa(high_memory) < base + size) ?
539 __pa(high_memory) - base :
540 size;
541
542 ret = ioremap_change_attr((unsigned long)__va(base), id_sz, flags);
543 /*
544 * -EFAULT return means that the addr was not valid and did not have
545 * any identity mapping. That case is a success for
546 * kernel_map_sync_memtype.
547 */
548 if (ret == -EFAULT)
549 ret = 0;
550
551 return ret;
552}
553
554int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn, 525int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn,
555 unsigned long size, pgprot_t *vma_prot) 526 unsigned long size, pgprot_t *vma_prot)
556{ 527{
@@ -601,7 +572,9 @@ int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn,
601 if (retval < 0) 572 if (retval < 0)
602 return 0; 573 return 0;
603 574
604 if (kernel_map_sync_memtype(offset, size, flags)) { 575 if (((pfn < max_low_pfn_mapped) ||
576 (pfn >= (1UL<<(32 - PAGE_SHIFT)) && pfn < max_pfn_mapped)) &&
577 ioremap_change_attr((unsigned long)__va(offset), size, flags) < 0) {
605 free_memtype(offset, offset + size); 578 free_memtype(offset, offset + size);
606 printk(KERN_INFO 579 printk(KERN_INFO
607 "%s:%d /dev/mem ioremap_change_attr failed %s for %Lx-%Lx\n", 580 "%s:%d /dev/mem ioremap_change_attr failed %s for %Lx-%Lx\n",
@@ -649,7 +622,7 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot,
649 int strict_prot) 622 int strict_prot)
650{ 623{
651 int is_ram = 0; 624 int is_ram = 0;
652 int ret; 625 int id_sz, ret;
653 unsigned long flags; 626 unsigned long flags;
654 unsigned long want_flags = (pgprot_val(*vma_prot) & _PAGE_CACHE_MASK); 627 unsigned long want_flags = (pgprot_val(*vma_prot) & _PAGE_CACHE_MASK);
655 628
@@ -690,7 +663,15 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot,
690 flags); 663 flags);
691 } 664 }
692 665
693 if (kernel_map_sync_memtype(paddr, size, flags)) { 666 /* Need to keep identity mapping in sync */
667 if (paddr >= __pa(high_memory))
668 return 0;
669
670 id_sz = (__pa(high_memory) < paddr + size) ?
671 __pa(high_memory) - paddr :
672 size;
673
674 if (ioremap_change_attr((unsigned long)__va(paddr), id_sz, flags) < 0) {
694 free_memtype(paddr, paddr + size); 675 free_memtype(paddr, paddr + size);
695 printk(KERN_ERR 676 printk(KERN_ERR
696 "%s:%d reserve_pfn_range ioremap_change_attr failed %s " 677 "%s:%d reserve_pfn_range ioremap_change_attr failed %s "
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index b3ca1b940654..72a6d4ebe34d 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -29,7 +29,7 @@ DEFINE_PER_CPU_SHARED_ALIGNED(struct tlb_state, cpu_tlbstate)
29 * To avoid global state use 8 different call vectors. 29 * To avoid global state use 8 different call vectors.
30 * Each CPU uses a specific vector to trigger flushes on other 30 * Each CPU uses a specific vector to trigger flushes on other
31 * CPUs. Depending on the received vector the target CPUs look into 31 * CPUs. Depending on the received vector the target CPUs look into
32 * the right per cpu variable for the flush data. 32 * the right array slot for the flush data.
33 * 33 *
34 * With more than 8 CPUs they are hashed to the 8 available 34 * With more than 8 CPUs they are hashed to the 8 available
35 * vectors. The limited global vector space forces us to this right now. 35 * vectors. The limited global vector space forces us to this right now.
@@ -44,13 +44,13 @@ union smp_flush_state {
44 spinlock_t tlbstate_lock; 44 spinlock_t tlbstate_lock;
45 DECLARE_BITMAP(flush_cpumask, NR_CPUS); 45 DECLARE_BITMAP(flush_cpumask, NR_CPUS);
46 }; 46 };
47 char pad[SMP_CACHE_BYTES]; 47 char pad[CONFIG_X86_INTERNODE_CACHE_BYTES];
48} ____cacheline_aligned; 48} ____cacheline_internodealigned_in_smp;
49 49
50/* State is put into the per CPU data section, but padded 50/* State is put into the per CPU data section, but padded
51 to a full cache line because other CPUs can access it and we don't 51 to a full cache line because other CPUs can access it and we don't
52 want false sharing in the per cpu data segment. */ 52 want false sharing in the per cpu data segment. */
53static DEFINE_PER_CPU(union smp_flush_state, flush_state); 53static union smp_flush_state flush_state[NUM_INVALIDATE_TLB_VECTORS];
54 54
55/* 55/*
56 * We cannot call mmdrop() because we are in interrupt context, 56 * We cannot call mmdrop() because we are in interrupt context,
@@ -135,7 +135,7 @@ void smp_invalidate_interrupt(struct pt_regs *regs)
135 * Use that to determine where the sender put the data. 135 * Use that to determine where the sender put the data.
136 */ 136 */
137 sender = ~regs->orig_ax - INVALIDATE_TLB_VECTOR_START; 137 sender = ~regs->orig_ax - INVALIDATE_TLB_VECTOR_START;
138 f = &per_cpu(flush_state, sender); 138 f = &flush_state[sender];
139 139
140 if (!cpumask_test_cpu(cpu, to_cpumask(f->flush_cpumask))) 140 if (!cpumask_test_cpu(cpu, to_cpumask(f->flush_cpumask)))
141 goto out; 141 goto out;
@@ -173,7 +173,7 @@ static void flush_tlb_others_ipi(const struct cpumask *cpumask,
173 173
174 /* Caller has disabled preemption */ 174 /* Caller has disabled preemption */
175 sender = smp_processor_id() % NUM_INVALIDATE_TLB_VECTORS; 175 sender = smp_processor_id() % NUM_INVALIDATE_TLB_VECTORS;
176 f = &per_cpu(flush_state, sender); 176 f = &flush_state[sender];
177 177
178 /* 178 /*
179 * Could avoid this lock when 179 * Could avoid this lock when
@@ -227,8 +227,8 @@ static int __cpuinit init_smp_flush(void)
227{ 227{
228 int i; 228 int i;
229 229
230 for_each_possible_cpu(i) 230 for (i = 0; i < ARRAY_SIZE(flush_state); i++)
231 spin_lock_init(&per_cpu(flush_state, i).tlbstate_lock); 231 spin_lock_init(&flush_state[i].tlbstate_lock);
232 232
233 return 0; 233 return 0;
234} 234}
diff --git a/arch/xtensa/include/asm/Kbuild b/arch/xtensa/include/asm/Kbuild
index 58c02a454130..c68e1680da01 100644
--- a/arch/xtensa/include/asm/Kbuild
+++ b/arch/xtensa/include/asm/Kbuild
@@ -1,3 +1 @@
1include include/asm-generic/Kbuild.asm include include/asm-generic/Kbuild.asm
2
3unifdef-y += swab.h
diff --git a/arch/xtensa/include/asm/byteorder.h b/arch/xtensa/include/asm/byteorder.h
index 329b94591ca4..54eb6315349c 100644
--- a/arch/xtensa/include/asm/byteorder.h
+++ b/arch/xtensa/include/asm/byteorder.h
@@ -1,8 +1,6 @@
1#ifndef _XTENSA_BYTEORDER_H 1#ifndef _XTENSA_BYTEORDER_H
2#define _XTENSA_BYTEORDER_H 2#define _XTENSA_BYTEORDER_H
3 3
4#include <asm/swab.h>
5
6#ifdef __XTENSA_EL__ 4#ifdef __XTENSA_EL__
7#include <linux/byteorder/little_endian.h> 5#include <linux/byteorder/little_endian.h>
8#elif defined(__XTENSA_EB__) 6#elif defined(__XTENSA_EB__)