aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/kernel/alpha_ksyms.c1
-rw-r--r--arch/alpha/mm/init.c1
-rw-r--r--arch/arm/plat-omap/dma.c2
-rw-r--r--arch/arm26/kernel/armksyms.c1
-rw-r--r--arch/cris/kernel/crisksyms.c2
-rw-r--r--arch/cris/kernel/process.c28
-rw-r--r--arch/frv/Kconfig4
-rw-r--r--arch/frv/boot/Makefile4
-rw-r--r--arch/frv/kernel/frv_ksyms.c2
-rw-r--r--arch/frv/kernel/process.c22
-rw-r--r--arch/h8300/kernel/gpio.c4
-rw-r--r--arch/h8300/kernel/h8300_ksyms.c3
-rw-r--r--arch/h8300/kernel/process.c28
-rw-r--r--arch/h8300/platform/h8300h/ptrace_h8300h.c12
-rw-r--r--arch/h8300/platform/h8s/ints.c4
-rw-r--r--arch/h8300/platform/h8s/ints_h8s.c4
-rw-r--r--arch/i386/Kconfig37
-rw-r--r--arch/i386/Makefile10
-rw-r--r--arch/i386/boot/Makefile2
-rw-r--r--arch/i386/boot/install.sh14
-rw-r--r--arch/i386/boot/video.S5
-rw-r--r--arch/i386/kernel/Makefile1
-rw-r--r--arch/i386/kernel/crash.c50
-rw-r--r--arch/i386/kernel/crash_dump.c74
-rw-r--r--arch/i386/kernel/kprobes.c10
-rw-r--r--arch/i386/kernel/setup.c2
-rw-r--r--arch/i386/kernel/traps.c61
-rw-r--r--arch/ia64/Makefile3
-rw-r--r--arch/ia64/ia32/Makefile4
-rw-r--r--arch/ia64/ia32/ia32_entry.S2
-rw-r--r--arch/ia64/ia32/ia32_ioctl.c45
-rw-r--r--arch/ia64/ia32/sys_ia32.c28
-rw-r--r--arch/ia64/kernel/kprobes.c4
-rw-r--r--arch/m32r/Kconfig4
-rw-r--r--arch/m32r/kernel/m32r_ksyms.c3
-rw-r--r--arch/m32r/kernel/process.c8
-rw-r--r--arch/m68k/kernel/m68k_ksyms.c2
-rw-r--r--arch/m68knommu/kernel/m68k_ksyms.c2
-rw-r--r--arch/m68knommu/kernel/process.c46
-rw-r--r--arch/mips/kernel/Makefile3
-rw-r--r--arch/mips/kernel/ioctl32.c50
-rw-r--r--arch/parisc/kernel/Makefile3
-rw-r--r--arch/parisc/kernel/ioctl32.c60
-rw-r--r--arch/powerpc/Kconfig11
-rw-r--r--arch/powerpc/Makefile6
-rw-r--r--arch/powerpc/configs/ppc64_defconfig2
-rw-r--r--arch/powerpc/kernel/Makefile5
-rw-r--r--arch/powerpc/kernel/ioctl32.c45
-rw-r--r--arch/powerpc/kernel/kprobes.c15
-rw-r--r--arch/powerpc/kernel/pci_64.c2
-rw-r--r--arch/powerpc/kernel/ppc_ksyms.c1
-rw-r--r--arch/powerpc/kernel/rtas_pci.c2
-rw-r--r--arch/powerpc/kernel/setup_32.c2
-rw-r--r--arch/powerpc/kernel/setup_64.c2
-rw-r--r--arch/powerpc/kernel/sys_ppc32.c56
-rw-r--r--arch/powerpc/kernel/systbl.S8
-rw-r--r--arch/powerpc/mm/pgtable_64.c2
-rw-r--r--arch/powerpc/platforms/cell/spufs/inode.c2
-rw-r--r--arch/powerpc/platforms/maple/setup.c3
-rw-r--r--arch/powerpc/platforms/pseries/Makefile2
-rw-r--r--arch/powerpc/platforms/pseries/eeh.c489
-rw-r--r--arch/powerpc/platforms/pseries/eeh_cache.c316
-rw-r--r--arch/powerpc/platforms/pseries/eeh_driver.c376
-rw-r--r--arch/powerpc/platforms/pseries/eeh_event.c39
-rw-r--r--arch/ppc/Makefile3
-rw-r--r--arch/ppc/kernel/machine_kexec.c6
-rw-r--r--arch/s390/Kconfig5
-rw-r--r--arch/s390/kernel/Makefile3
-rw-r--r--arch/s390/kernel/compat_ioctl.c81
-rw-r--r--arch/s390/kernel/compat_linux.c32
-rw-r--r--arch/s390/kernel/compat_wrapper.S2
-rw-r--r--arch/s390/kernel/crash.c2
-rw-r--r--arch/s390/kernel/process.c21
-rw-r--r--arch/s390/kernel/s390_ksyms.c1
-rw-r--r--arch/sh/kernel/process.c20
-rw-r--r--arch/sh/kernel/sh_ksyms.c2
-rw-r--r--arch/sh64/Kconfig4
-rw-r--r--arch/sh64/kernel/process.c20
-rw-r--r--arch/sh64/kernel/sh_ksyms.c2
-rw-r--r--arch/sparc/kernel/sparc_ksyms.c2
-rw-r--r--arch/sparc64/kernel/Makefile4
-rw-r--r--arch/sparc64/kernel/binfmt_aout32.c2
-rw-r--r--arch/sparc64/kernel/ioctl32.c39
-rw-r--r--arch/sparc64/kernel/kprobes.c10
-rw-r--r--arch/sparc64/kernel/sparc64_ksyms.c2
-rw-r--r--arch/sparc64/kernel/sys_sparc32.c36
-rw-r--r--arch/sparc64/kernel/systbls.S4
-rw-r--r--arch/um/drivers/chan_kern.c6
-rw-r--r--arch/um/kernel/time.c7
-rw-r--r--arch/v850/kernel/process.c24
-rw-r--r--arch/v850/kernel/v850_ksyms.c2
-rw-r--r--arch/x86_64/Kconfig36
-rw-r--r--arch/x86_64/Makefile5
-rw-r--r--arch/x86_64/boot/Makefile2
-rw-r--r--arch/x86_64/boot/install.sh40
-rw-r--r--arch/x86_64/ia32/Makefile4
-rw-r--r--arch/x86_64/ia32/ia32_ioctl.c79
-rw-r--r--arch/x86_64/ia32/ia32entry.S2
-rw-r--r--arch/x86_64/ia32/sys_ia32.c19
-rw-r--r--arch/x86_64/kernel/Makefile1
-rw-r--r--arch/x86_64/kernel/crash.c156
-rw-r--r--arch/x86_64/kernel/crash_dump.c47
-rw-r--r--arch/x86_64/kernel/e820.c21
-rw-r--r--arch/x86_64/kernel/kprobes.c7
-rw-r--r--arch/x86_64/kernel/setup.c36
-rw-r--r--arch/x86_64/kernel/x8664_ksyms.c1
-rw-r--r--arch/xtensa/Kconfig4
107 files changed, 1357 insertions, 1486 deletions
diff --git a/arch/alpha/kernel/alpha_ksyms.c b/arch/alpha/kernel/alpha_ksyms.c
index f3e98f837784..1898ea79d0e2 100644
--- a/arch/alpha/kernel/alpha_ksyms.c
+++ b/arch/alpha/kernel/alpha_ksyms.c
@@ -40,7 +40,6 @@
40#include <asm/unistd.h> 40#include <asm/unistd.h>
41 41
42extern struct hwrpb_struct *hwrpb; 42extern struct hwrpb_struct *hwrpb;
43extern void dump_thread(struct pt_regs *, struct user *);
44extern spinlock_t rtc_lock; 43extern spinlock_t rtc_lock;
45 44
46/* these are C runtime functions with special calling conventions: */ 45/* these are C runtime functions with special calling conventions: */
diff --git a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c
index 90752f6d8867..486d7945583d 100644
--- a/arch/alpha/mm/init.c
+++ b/arch/alpha/mm/init.c
@@ -7,6 +7,7 @@
7/* 2.3.x zone allocator, 1999 Andrea Arcangeli <andrea@suse.de> */ 7/* 2.3.x zone allocator, 1999 Andrea Arcangeli <andrea@suse.de> */
8 8
9#include <linux/config.h> 9#include <linux/config.h>
10#include <linux/pagemap.h>
10#include <linux/signal.h> 11#include <linux/signal.h>
11#include <linux/sched.h> 12#include <linux/sched.h>
12#include <linux/kernel.h> 13#include <linux/kernel.h>
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index f5cc21ad0956..a4e5ac77f6df 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -64,7 +64,7 @@ static int dma_chan_count;
64static spinlock_t dma_chan_lock; 64static spinlock_t dma_chan_lock;
65static struct omap_dma_lch dma_chan[OMAP_LOGICAL_DMA_CH_COUNT]; 65static struct omap_dma_lch dma_chan[OMAP_LOGICAL_DMA_CH_COUNT];
66 66
67const static u8 omap1_dma_irq[OMAP_LOGICAL_DMA_CH_COUNT] = { 67static const u8 omap1_dma_irq[OMAP_LOGICAL_DMA_CH_COUNT] = {
68 INT_DMA_CH0_6, INT_DMA_CH1_7, INT_DMA_CH2_8, INT_DMA_CH3, 68 INT_DMA_CH0_6, INT_DMA_CH1_7, INT_DMA_CH2_8, INT_DMA_CH3,
69 INT_DMA_CH4, INT_DMA_CH5, INT_1610_DMA_CH6, INT_1610_DMA_CH7, 69 INT_DMA_CH4, INT_DMA_CH5, INT_1610_DMA_CH6, INT_1610_DMA_CH7,
70 INT_1610_DMA_CH8, INT_1610_DMA_CH9, INT_1610_DMA_CH10, 70 INT_1610_DMA_CH8, INT_1610_DMA_CH9, INT_1610_DMA_CH10,
diff --git a/arch/arm26/kernel/armksyms.c b/arch/arm26/kernel/armksyms.c
index 35514b398e2e..811a6376c624 100644
--- a/arch/arm26/kernel/armksyms.c
+++ b/arch/arm26/kernel/armksyms.c
@@ -35,7 +35,6 @@
35#include <asm/checksum.h> 35#include <asm/checksum.h>
36#include <asm/mach-types.h> 36#include <asm/mach-types.h>
37 37
38extern void dump_thread(struct pt_regs *, struct user *);
39extern int dump_fpu(struct pt_regs *, struct user_fp_struct *); 38extern int dump_fpu(struct pt_regs *, struct user_fp_struct *);
40extern void inswb(unsigned int port, void *to, int len); 39extern void inswb(unsigned int port, void *to, int len);
41extern void outswb(unsigned int port, const void *to, int len); 40extern void outswb(unsigned int port, const void *to, int len);
diff --git a/arch/cris/kernel/crisksyms.c b/arch/cris/kernel/crisksyms.c
index 85833d704ebb..de39725da920 100644
--- a/arch/cris/kernel/crisksyms.c
+++ b/arch/cris/kernel/crisksyms.c
@@ -21,7 +21,6 @@
21#include <asm/pgtable.h> 21#include <asm/pgtable.h>
22#include <asm/fasttimer.h> 22#include <asm/fasttimer.h>
23 23
24extern void dump_thread(struct pt_regs *, struct user *);
25extern unsigned long get_cmos_time(void); 24extern unsigned long get_cmos_time(void);
26extern void __Udiv(void); 25extern void __Udiv(void);
27extern void __Umod(void); 26extern void __Umod(void);
@@ -33,7 +32,6 @@ extern void __lshrdi3(void);
33extern void iounmap(volatile void * __iomem); 32extern void iounmap(volatile void * __iomem);
34 33
35/* Platform dependent support */ 34/* Platform dependent support */
36EXPORT_SYMBOL(dump_thread);
37EXPORT_SYMBOL(kernel_thread); 35EXPORT_SYMBOL(kernel_thread);
38EXPORT_SYMBOL(get_cmos_time); 36EXPORT_SYMBOL(get_cmos_time);
39EXPORT_SYMBOL(loops_per_usec); 37EXPORT_SYMBOL(loops_per_usec);
diff --git a/arch/cris/kernel/process.c b/arch/cris/kernel/process.c
index 7c80afb10460..4ab3e87115b6 100644
--- a/arch/cris/kernel/process.c
+++ b/arch/cris/kernel/process.c
@@ -257,34 +257,6 @@ void flush_thread(void)
257{ 257{
258} 258}
259 259
260/*
261 * fill in the user structure for a core dump..
262 */
263void dump_thread(struct pt_regs * regs, struct user * dump)
264{
265#if 0
266 int i;
267
268 /* changed the size calculations - should hopefully work better. lbt */
269 dump->magic = CMAGIC;
270 dump->start_code = 0;
271 dump->start_stack = regs->esp & ~(PAGE_SIZE - 1);
272 dump->u_tsize = ((unsigned long) current->mm->end_code) >> PAGE_SHIFT;
273 dump->u_dsize = ((unsigned long) (current->mm->brk + (PAGE_SIZE-1))) >> PAGE_SHIFT;
274 dump->u_dsize -= dump->u_tsize;
275 dump->u_ssize = 0;
276 for (i = 0; i < 8; i++)
277 dump->u_debugreg[i] = current->debugreg[i];
278
279 if (dump->start_stack < TASK_SIZE)
280 dump->u_ssize = ((unsigned long) (TASK_SIZE - dump->start_stack)) >> PAGE_SHIFT;
281
282 dump->regs = *regs;
283
284 dump->u_fpvalid = dump_fpu (regs, &dump->i387);
285#endif
286}
287
288/* Fill in the fpu structure for a core dump. */ 260/* Fill in the fpu structure for a core dump. */
289int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu) 261int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
290{ 262{
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig
index 61261b78ced7..60a617aff8ba 100644
--- a/arch/frv/Kconfig
+++ b/arch/frv/Kconfig
@@ -6,10 +6,6 @@ config FRV
6 bool 6 bool
7 default y 7 default y
8 8
9config UID16
10 bool
11 default y
12
13config RWSEM_GENERIC_SPINLOCK 9config RWSEM_GENERIC_SPINLOCK
14 bool 10 bool
15 default y 11 default y
diff --git a/arch/frv/boot/Makefile b/arch/frv/boot/Makefile
index d75e0d771366..5dfc93fd945a 100644
--- a/arch/frv/boot/Makefile
+++ b/arch/frv/boot/Makefile
@@ -57,10 +57,10 @@ initrd:
57# installation 57# installation
58# 58#
59install: $(CONFIGURE) Image 59install: $(CONFIGURE) Image
60 sh ./install.sh $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) Image $(TOPDIR)/System.map "$(INSTALL_PATH)" 60 sh ./install.sh $(KERNELRELEASE) Image $(TOPDIR)/System.map "$(INSTALL_PATH)"
61 61
62zinstall: $(CONFIGURE) zImage 62zinstall: $(CONFIGURE) zImage
63 sh ./install.sh $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) zImage $(TOPDIR)/System.map "$(INSTALL_PATH)" 63 sh ./install.sh $(KERNELRELEASE) zImage $(TOPDIR)/System.map "$(INSTALL_PATH)"
64 64
65# 65#
66# miscellany 66# miscellany
diff --git a/arch/frv/kernel/frv_ksyms.c b/arch/frv/kernel/frv_ksyms.c
index 5f118c89d091..0f1c6cbc4f50 100644
--- a/arch/frv/kernel/frv_ksyms.c
+++ b/arch/frv/kernel/frv_ksyms.c
@@ -18,7 +18,6 @@
18#include <asm/hardirq.h> 18#include <asm/hardirq.h>
19#include <asm/cacheflush.h> 19#include <asm/cacheflush.h>
20 20
21extern void dump_thread(struct pt_regs *, struct user *);
22extern long __memcpy_user(void *dst, const void *src, size_t count); 21extern long __memcpy_user(void *dst, const void *src, size_t count);
23extern long __memset_user(void *dst, const void *src, size_t count); 22extern long __memset_user(void *dst, const void *src, size_t count);
24 23
@@ -27,7 +26,6 @@ extern long __memset_user(void *dst, const void *src, size_t count);
27EXPORT_SYMBOL(__ioremap); 26EXPORT_SYMBOL(__ioremap);
28EXPORT_SYMBOL(iounmap); 27EXPORT_SYMBOL(iounmap);
29 28
30EXPORT_SYMBOL(dump_thread);
31EXPORT_SYMBOL(strnlen); 29EXPORT_SYMBOL(strnlen);
32EXPORT_SYMBOL(strrchr); 30EXPORT_SYMBOL(strrchr);
33EXPORT_SYMBOL(strstr); 31EXPORT_SYMBOL(strstr);
diff --git a/arch/frv/kernel/process.c b/arch/frv/kernel/process.c
index 54a452136f00..c4488379ac3b 100644
--- a/arch/frv/kernel/process.c
+++ b/arch/frv/kernel/process.c
@@ -244,28 +244,6 @@ int copy_thread(int nr, unsigned long clone_flags,
244} /* end copy_thread() */ 244} /* end copy_thread() */
245 245
246/* 246/*
247 * fill in the user structure for a core dump..
248 */
249void dump_thread(struct pt_regs *regs, struct user *dump)
250{
251#if 0
252 /* changed the size calculations - should hopefully work better. lbt */
253 dump->magic = CMAGIC;
254 dump->start_code = 0;
255 dump->start_stack = user_stack(regs) & ~(PAGE_SIZE - 1);
256 dump->u_tsize = ((unsigned long) current->mm->end_code) >> PAGE_SHIFT;
257 dump->u_dsize = ((unsigned long) (current->mm->brk + (PAGE_SIZE-1))) >> PAGE_SHIFT;
258 dump->u_dsize -= dump->u_tsize;
259 dump->u_ssize = 0;
260
261 if (dump->start_stack < TASK_SIZE)
262 dump->u_ssize = ((unsigned long) (TASK_SIZE - dump->start_stack)) >> PAGE_SHIFT;
263
264 dump->regs = *(struct user_context *) regs;
265#endif
266}
267
268/*
269 * sys_execve() executes a new program. 247 * sys_execve() executes a new program.
270 */ 248 */
271asmlinkage int sys_execve(char *name, char **argv, char **envp) 249asmlinkage int sys_execve(char *name, char **argv, char **envp)
diff --git a/arch/h8300/kernel/gpio.c b/arch/h8300/kernel/gpio.c
index 795682b873e2..d195568ca8a2 100644
--- a/arch/h8300/kernel/gpio.c
+++ b/arch/h8300/kernel/gpio.c
@@ -122,7 +122,7 @@ int h8300_get_gpio_dir(int port_bit)
122static char *port_status(int portno) 122static char *port_status(int portno)
123{ 123{
124 static char result[10]; 124 static char result[10];
125 const static char io[2]={'I','O'}; 125 static const char io[2]={'I','O'};
126 char *rp; 126 char *rp;
127 int c; 127 int c;
128 unsigned char used,ddr; 128 unsigned char used,ddr;
@@ -143,7 +143,7 @@ static int gpio_proc_read(char *buf, char **start, off_t offset,
143 int len, int *unused_i, void *unused_v) 143 int len, int *unused_i, void *unused_v)
144{ 144{
145 int c,outlen; 145 int c,outlen;
146 const static char port_name[]="123456789ABCDEFGH"; 146 static const char port_name[]="123456789ABCDEFGH";
147 outlen = 0; 147 outlen = 0;
148 for (c = 0; c < MAX_PORT; c++) { 148 for (c = 0; c < MAX_PORT; c++) {
149 if (ddrs[c] == NULL) 149 if (ddrs[c] == NULL)
diff --git a/arch/h8300/kernel/h8300_ksyms.c b/arch/h8300/kernel/h8300_ksyms.c
index 5a630233112f..3e0d80ea4464 100644
--- a/arch/h8300/kernel/h8300_ksyms.c
+++ b/arch/h8300/kernel/h8300_ksyms.c
@@ -22,11 +22,8 @@
22//asmlinkage long long __lshrdi3 (long long, int); 22//asmlinkage long long __lshrdi3 (long long, int);
23extern char h8300_debug_device[]; 23extern char h8300_debug_device[];
24 24
25extern void dump_thread(struct pt_regs *, struct user *);
26
27/* platform dependent support */ 25/* platform dependent support */
28 26
29EXPORT_SYMBOL(dump_thread);
30EXPORT_SYMBOL(strnlen); 27EXPORT_SYMBOL(strnlen);
31EXPORT_SYMBOL(strrchr); 28EXPORT_SYMBOL(strrchr);
32EXPORT_SYMBOL(strstr); 29EXPORT_SYMBOL(strstr);
diff --git a/arch/h8300/kernel/process.c b/arch/h8300/kernel/process.c
index fe21adf3e75e..585ed5efd0f7 100644
--- a/arch/h8300/kernel/process.c
+++ b/arch/h8300/kernel/process.c
@@ -208,34 +208,6 @@ int copy_thread(int nr, unsigned long clone_flags,
208} 208}
209 209
210/* 210/*
211 * fill in the user structure for a core dump..
212 */
213void dump_thread(struct pt_regs * regs, struct user * dump)
214{
215/* changed the size calculations - should hopefully work better. lbt */
216 dump->magic = CMAGIC;
217 dump->start_code = 0;
218 dump->start_stack = rdusp() & ~(PAGE_SIZE - 1);
219 dump->u_tsize = ((unsigned long) current->mm->end_code) >> PAGE_SHIFT;
220 dump->u_dsize = ((unsigned long) (current->mm->brk +
221 (PAGE_SIZE-1))) >> PAGE_SHIFT;
222 dump->u_dsize -= dump->u_tsize;
223 dump->u_ssize = 0;
224
225 dump->u_ar0 = (struct user_regs_struct *)(((int)(&dump->regs)) -((int)(dump)));
226 dump->regs.er0 = regs->er0;
227 dump->regs.er1 = regs->er1;
228 dump->regs.er2 = regs->er2;
229 dump->regs.er3 = regs->er3;
230 dump->regs.er4 = regs->er4;
231 dump->regs.er5 = regs->er5;
232 dump->regs.er6 = regs->er6;
233 dump->regs.orig_er0 = regs->orig_er0;
234 dump->regs.ccr = regs->ccr;
235 dump->regs.pc = regs->pc;
236}
237
238/*
239 * sys_execve() executes a new program. 211 * sys_execve() executes a new program.
240 */ 212 */
241asmlinkage int sys_execve(char *name, char **argv, char **envp,int dummy,...) 213asmlinkage int sys_execve(char *name, char **argv, char **envp,int dummy,...)
diff --git a/arch/h8300/platform/h8300h/ptrace_h8300h.c b/arch/h8300/platform/h8300h/ptrace_h8300h.c
index 6ac93c05a1ae..746b1ae672a1 100644
--- a/arch/h8300/platform/h8300h/ptrace_h8300h.c
+++ b/arch/h8300/platform/h8300h/ptrace_h8300h.c
@@ -98,7 +98,7 @@ struct optable {
98 .type = jmp, \ 98 .type = jmp, \
99 } 99 }
100 100
101const static struct optable optable_0[] = { 101static const struct optable optable_0[] = {
102 OPTABLE(0x00,0xff, 1,none), /* 0x00 */ 102 OPTABLE(0x00,0xff, 1,none), /* 0x00 */
103 OPTABLE(0x01,0xff,-1,none), /* 0x01 */ 103 OPTABLE(0x01,0xff,-1,none), /* 0x01 */
104 OPTABLE(0x02,0xfe, 1,none), /* 0x02-0x03 */ 104 OPTABLE(0x02,0xfe, 1,none), /* 0x02-0x03 */
@@ -131,31 +131,31 @@ const static struct optable optable_0[] = {
131 OPTABLE(0x80,0x80, 1,none), /* 0x80-0xff */ 131 OPTABLE(0x80,0x80, 1,none), /* 0x80-0xff */
132}; 132};
133 133
134const static struct optable optable_1[] = { 134static const struct optable optable_1[] = {
135 OPTABLE(0x00,0xff,-3,none), /* 0x0100 */ 135 OPTABLE(0x00,0xff,-3,none), /* 0x0100 */
136 OPTABLE(0x40,0xf0,-3,none), /* 0x0140-0x14f */ 136 OPTABLE(0x40,0xf0,-3,none), /* 0x0140-0x14f */
137 OPTABLE(0x80,0xf0, 1,none), /* 0x0180-0x018f */ 137 OPTABLE(0x80,0xf0, 1,none), /* 0x0180-0x018f */
138 OPTABLE(0xc0,0xc0, 2,none), /* 0x01c0-0x01ff */ 138 OPTABLE(0xc0,0xc0, 2,none), /* 0x01c0-0x01ff */
139}; 139};
140 140
141const static struct optable optable_2[] = { 141static const struct optable optable_2[] = {
142 OPTABLE(0x00,0x20, 2,none), /* 0x6a0?/0x6a8?/0x6b0?/0x6b8? */ 142 OPTABLE(0x00,0x20, 2,none), /* 0x6a0?/0x6a8?/0x6b0?/0x6b8? */
143 OPTABLE(0x20,0x20, 3,none), /* 0x6a2?/0x6aa?/0x6b2?/0x6ba? */ 143 OPTABLE(0x20,0x20, 3,none), /* 0x6a2?/0x6aa?/0x6b2?/0x6ba? */
144}; 144};
145 145
146const static struct optable optable_3[] = { 146static const struct optable optable_3[] = {
147 OPTABLE(0x69,0xfb, 2,none), /* 0x010069/0x01006d/014069/0x01406d */ 147 OPTABLE(0x69,0xfb, 2,none), /* 0x010069/0x01006d/014069/0x01406d */
148 OPTABLE(0x6b,0xff,-4,none), /* 0x01006b/0x01406b */ 148 OPTABLE(0x6b,0xff,-4,none), /* 0x01006b/0x01406b */
149 OPTABLE(0x6f,0xff, 3,none), /* 0x01006f/0x01406f */ 149 OPTABLE(0x6f,0xff, 3,none), /* 0x01006f/0x01406f */
150 OPTABLE(0x78,0xff, 5,none), /* 0x010078/0x014078 */ 150 OPTABLE(0x78,0xff, 5,none), /* 0x010078/0x014078 */
151}; 151};
152 152
153const static struct optable optable_4[] = { 153static const struct optable optable_4[] = {
154 OPTABLE(0x00,0x78, 3,none), /* 0x0100690?/0x01006d0?/0140690/0x01406d0?/0x0100698?/0x01006d8?/0140698?/0x01406d8? */ 154 OPTABLE(0x00,0x78, 3,none), /* 0x0100690?/0x01006d0?/0140690/0x01406d0?/0x0100698?/0x01006d8?/0140698?/0x01406d8? */
155 OPTABLE(0x20,0x78, 4,none), /* 0x0100692?/0x01006d2?/0140692/0x01406d2?/0x010069a?/0x01006da?/014069a?/0x01406da? */ 155 OPTABLE(0x20,0x78, 4,none), /* 0x0100692?/0x01006d2?/0140692/0x01406d2?/0x010069a?/0x01006da?/014069a?/0x01406da? */
156}; 156};
157 157
158const static struct optables_list { 158static const struct optables_list {
159 const struct optable *ptr; 159 const struct optable *ptr;
160 int size; 160 int size;
161} optables[] = { 161} optables[] = {
diff --git a/arch/h8300/platform/h8s/ints.c b/arch/h8300/platform/h8s/ints.c
index 5441cdd12a39..f6ed663bdde0 100644
--- a/arch/h8300/platform/h8s/ints.c
+++ b/arch/h8300/platform/h8s/ints.c
@@ -52,7 +52,7 @@ struct irq_pins {
52 unsigned char bit_no; 52 unsigned char bit_no;
53}; 53};
54/* ISTR = 0 */ 54/* ISTR = 0 */
55const static struct irq_pins irq_assign_table0[16]={ 55static const struct irq_pins irq_assign_table0[16]={
56 {H8300_GPIO_P5,H8300_GPIO_B0},{H8300_GPIO_P5,H8300_GPIO_B1}, 56 {H8300_GPIO_P5,H8300_GPIO_B0},{H8300_GPIO_P5,H8300_GPIO_B1},
57 {H8300_GPIO_P5,H8300_GPIO_B2},{H8300_GPIO_P5,H8300_GPIO_B3}, 57 {H8300_GPIO_P5,H8300_GPIO_B2},{H8300_GPIO_P5,H8300_GPIO_B3},
58 {H8300_GPIO_P5,H8300_GPIO_B4},{H8300_GPIO_P5,H8300_GPIO_B5}, 58 {H8300_GPIO_P5,H8300_GPIO_B4},{H8300_GPIO_P5,H8300_GPIO_B5},
@@ -63,7 +63,7 @@ const static struct irq_pins irq_assign_table0[16]={
63 {H8300_GPIO_PF,H8300_GPIO_B1},{H8300_GPIO_PF,H8300_GPIO_B2}, 63 {H8300_GPIO_PF,H8300_GPIO_B1},{H8300_GPIO_PF,H8300_GPIO_B2},
64}; 64};
65/* ISTR = 1 */ 65/* ISTR = 1 */
66const static struct irq_pins irq_assign_table1[16]={ 66static const struct irq_pins irq_assign_table1[16]={
67 {H8300_GPIO_P8,H8300_GPIO_B0},{H8300_GPIO_P8,H8300_GPIO_B1}, 67 {H8300_GPIO_P8,H8300_GPIO_B0},{H8300_GPIO_P8,H8300_GPIO_B1},
68 {H8300_GPIO_P8,H8300_GPIO_B2},{H8300_GPIO_P8,H8300_GPIO_B3}, 68 {H8300_GPIO_P8,H8300_GPIO_B2},{H8300_GPIO_P8,H8300_GPIO_B3},
69 {H8300_GPIO_P8,H8300_GPIO_B4},{H8300_GPIO_P8,H8300_GPIO_B5}, 69 {H8300_GPIO_P8,H8300_GPIO_B4},{H8300_GPIO_P8,H8300_GPIO_B5},
diff --git a/arch/h8300/platform/h8s/ints_h8s.c b/arch/h8300/platform/h8s/ints_h8s.c
index f53de493e3e8..8268dfd12f1f 100644
--- a/arch/h8300/platform/h8s/ints_h8s.c
+++ b/arch/h8300/platform/h8s/ints_h8s.c
@@ -42,7 +42,7 @@ struct irq_pins {
42 unsigned char bit_no; 42 unsigned char bit_no;
43} __attribute__((aligned(1),packed)); 43} __attribute__((aligned(1),packed));
44/* ISTR = 0 */ 44/* ISTR = 0 */
45const static struct irq_pins irq_assign_table0[16]={ 45static const struct irq_pins irq_assign_table0[16]={
46 {H8300_GPIO_P5,H8300_GPIO_B0},{H8300_GPIO_P5,H8300_GPIO_B1}, 46 {H8300_GPIO_P5,H8300_GPIO_B0},{H8300_GPIO_P5,H8300_GPIO_B1},
47 {H8300_GPIO_P5,H8300_GPIO_B2},{H8300_GPIO_P5,H8300_GPIO_B3}, 47 {H8300_GPIO_P5,H8300_GPIO_B2},{H8300_GPIO_P5,H8300_GPIO_B3},
48 {H8300_GPIO_P5,H8300_GPIO_B4},{H8300_GPIO_P5,H8300_GPIO_B5}, 48 {H8300_GPIO_P5,H8300_GPIO_B4},{H8300_GPIO_P5,H8300_GPIO_B5},
@@ -53,7 +53,7 @@ const static struct irq_pins irq_assign_table0[16]={
53 {H8300_GPIO_PF,H8300_GPIO_B1},{H8300_GPIO_PF,H8300_GPIO_B2}, 53 {H8300_GPIO_PF,H8300_GPIO_B1},{H8300_GPIO_PF,H8300_GPIO_B2},
54}; 54};
55/* ISTR = 1 */ 55/* ISTR = 1 */
56const static struct irq_pins irq_assign_table1[16]={ 56static const struct irq_pins irq_assign_table1[16]={
57 {H8300_GPIO_P8,H8300_GPIO_B0},{H8300_GPIO_P8,H8300_GPIO_B1}, 57 {H8300_GPIO_P8,H8300_GPIO_B0},{H8300_GPIO_P8,H8300_GPIO_B1},
58 {H8300_GPIO_P8,H8300_GPIO_B2},{H8300_GPIO_P8,H8300_GPIO_B3}, 58 {H8300_GPIO_P8,H8300_GPIO_B2},{H8300_GPIO_P8,H8300_GPIO_B3},
59 {H8300_GPIO_P8,H8300_GPIO_B4},{H8300_GPIO_P8,H8300_GPIO_B5}, 59 {H8300_GPIO_P8,H8300_GPIO_B4},{H8300_GPIO_P8,H8300_GPIO_B5},
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index d849c6870e3a..815878ebd30f 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -645,17 +645,6 @@ config SECCOMP
645 645
646source kernel/Kconfig.hz 646source kernel/Kconfig.hz
647 647
648config PHYSICAL_START
649 hex "Physical address where the kernel is loaded" if EMBEDDED
650 default "0x100000"
651 help
652 This gives the physical address where the kernel is loaded.
653 Primarily used in the case of kexec on panic where the
654 fail safe kernel needs to run at a different address than
655 the panic-ed kernel.
656
657 Don't change this unless you know what you are doing.
658
659config KEXEC 648config KEXEC
660 bool "kexec system call (EXPERIMENTAL)" 649 bool "kexec system call (EXPERIMENTAL)"
661 depends on EXPERIMENTAL 650 depends on EXPERIMENTAL
@@ -675,11 +664,31 @@ config KEXEC
675 664
676config CRASH_DUMP 665config CRASH_DUMP
677 bool "kernel crash dumps (EXPERIMENTAL)" 666 bool "kernel crash dumps (EXPERIMENTAL)"
678 depends on EMBEDDED
679 depends on EXPERIMENTAL 667 depends on EXPERIMENTAL
680 depends on HIGHMEM 668 depends on HIGHMEM
681 help 669 help
682 Generate crash dump after being started by kexec. 670 Generate crash dump after being started by kexec.
671
672config PHYSICAL_START
673 hex "Physical address where the kernel is loaded" if (EMBEDDED || CRASH_DUMP)
674
675 default "0x1000000" if CRASH_DUMP
676 default "0x100000"
677 help
678 This gives the physical address where the kernel is loaded. Normally
679 for regular kernels this value is 0x100000 (1MB). But in the case
680 of kexec on panic the fail safe kernel needs to run at a different
681 address than the panic-ed kernel. This option is used to set the load
682 address for kernels used to capture crash dump on being kexec'ed
683 after panic. The default value for crash dump kernels is
684 0x1000000 (16MB). This can also be set based on the "X" value as
685 specified in the "crashkernel=YM@XM" command line boot parameter
686 passed to the panic-ed kernel. Typically this parameter is set as
687 crashkernel=64M@16M. Please take a look at
688 Documentation/kdump/kdump.txt for more details about crash dumps.
689
690 Don't change this unless you know what you are doing.
691
683endmenu 692endmenu
684 693
685 694
@@ -1051,3 +1060,7 @@ config X86_TRAMPOLINE
1051 bool 1060 bool
1052 depends on X86_SMP || (X86_VOYAGER && SMP) 1061 depends on X86_SMP || (X86_VOYAGER && SMP)
1053 default y 1062 default y
1063
1064config KTIME_SCALAR
1065 bool
1066 default y
diff --git a/arch/i386/Makefile b/arch/i386/Makefile
index b84119f9cc63..d3c0409d201c 100644
--- a/arch/i386/Makefile
+++ b/arch/i386/Makefile
@@ -37,7 +37,10 @@ CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2)
37# CPU-specific tuning. Anything which can be shared with UML should go here. 37# CPU-specific tuning. Anything which can be shared with UML should go here.
38include $(srctree)/arch/i386/Makefile.cpu 38include $(srctree)/arch/i386/Makefile.cpu
39 39
40cflags-$(CONFIG_REGPARM) += -mregparm=3 40# -mregparm=3 works ok on gcc-3.0 and later
41#
42cflags-$(CONFIG_REGPARM) += $(shell if [ $(call cc-version) -ge 0300 ] ; then \
43 echo "-mregparm=3"; fi ;)
41 44
42# Disable unit-at-a-time mode, it makes gcc use a lot more stack 45# Disable unit-at-a-time mode, it makes gcc use a lot more stack
43# due to the lack of sharing of stacklots. 46# due to the lack of sharing of stacklots.
@@ -100,7 +103,7 @@ AFLAGS += $(mflags-y)
100boot := arch/i386/boot 103boot := arch/i386/boot
101 104
102.PHONY: zImage bzImage compressed zlilo bzlilo \ 105.PHONY: zImage bzImage compressed zlilo bzlilo \
103 zdisk bzdisk fdimage fdimage144 fdimage288 install kernel_install 106 zdisk bzdisk fdimage fdimage144 fdimage288 install
104 107
105all: bzImage 108all: bzImage
106 109
@@ -122,8 +125,7 @@ zdisk bzdisk: vmlinux
122fdimage fdimage144 fdimage288: vmlinux 125fdimage fdimage144 fdimage288: vmlinux
123 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@ 126 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@
124 127
125install: vmlinux 128install:
126install kernel_install:
127 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install 129 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install
128 130
129archclean: 131archclean:
diff --git a/arch/i386/boot/Makefile b/arch/i386/boot/Makefile
index 1e71382d413a..0fea75dd4e31 100644
--- a/arch/i386/boot/Makefile
+++ b/arch/i386/boot/Makefile
@@ -100,5 +100,5 @@ zlilo: $(BOOTIMAGE)
100 cp System.map $(INSTALL_PATH)/ 100 cp System.map $(INSTALL_PATH)/
101 if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi 101 if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
102 102
103install: $(BOOTIMAGE) 103install:
104 sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $< System.map "$(INSTALL_PATH)" 104 sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $< System.map "$(INSTALL_PATH)"
diff --git a/arch/i386/boot/install.sh b/arch/i386/boot/install.sh
index f17b40dfc0f4..5e44c736eea8 100644
--- a/arch/i386/boot/install.sh
+++ b/arch/i386/boot/install.sh
@@ -19,6 +19,20 @@
19# $4 - default install path (blank if root directory) 19# $4 - default install path (blank if root directory)
20# 20#
21 21
22verify () {
23 if [ ! -f "$1" ]; then
24 echo "" 1>&2
25 echo " *** Missing file: $1" 1>&2
26 echo ' *** You need to run "make" before "make install".' 1>&2
27 echo "" 1>&2
28 exit 1
29 fi
30}
31
32# Make sure the files actually exist
33verify "$2"
34verify "$3"
35
22# User may have a custom install script 36# User may have a custom install script
23 37
24if [ -x ~/bin/${CROSS_COMPILE}installkernel ]; then exec ~/bin/${CROSS_COMPILE}installkernel "$@"; fi 38if [ -x ~/bin/${CROSS_COMPILE}installkernel ]; then exec ~/bin/${CROSS_COMPILE}installkernel "$@"; fi
diff --git a/arch/i386/boot/video.S b/arch/i386/boot/video.S
index 92f669470142..2ac40c8244c4 100644
--- a/arch/i386/boot/video.S
+++ b/arch/i386/boot/video.S
@@ -97,7 +97,6 @@
97#define PARAM_VESAPM_OFF 0x30 97#define PARAM_VESAPM_OFF 0x30
98#define PARAM_LFB_PAGES 0x32 98#define PARAM_LFB_PAGES 0x32
99#define PARAM_VESA_ATTRIB 0x34 99#define PARAM_VESA_ATTRIB 0x34
100#define PARAM_CAPABILITIES 0x36
101 100
102/* Define DO_STORE according to CONFIG_VIDEO_RETAIN */ 101/* Define DO_STORE according to CONFIG_VIDEO_RETAIN */
103#ifdef CONFIG_VIDEO_RETAIN 102#ifdef CONFIG_VIDEO_RETAIN
@@ -234,10 +233,6 @@ mopar_gr:
234 movw 18(%di), %ax 233 movw 18(%di), %ax
235 movl %eax, %fs:(PARAM_LFB_SIZE) 234 movl %eax, %fs:(PARAM_LFB_SIZE)
236 235
237# store mode capabilities
238 movl 10(%di), %eax
239 movl %eax, %fs:(PARAM_CAPABILITIES)
240
241# switching the DAC to 8-bit is for <= 8 bpp only 236# switching the DAC to 8-bit is for <= 8 bpp only
242 movw %fs:(PARAM_LFB_DEPTH), %ax 237 movw %fs:(PARAM_LFB_DEPTH), %ax
243 cmpw $8, %ax 238 cmpw $8, %ax
diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile
index be1880bb75b4..60c3f76dfca4 100644
--- a/arch/i386/kernel/Makefile
+++ b/arch/i386/kernel/Makefile
@@ -25,6 +25,7 @@ obj-$(CONFIG_X86_LOCAL_APIC) += apic.o nmi.o
25obj-$(CONFIG_X86_IO_APIC) += io_apic.o 25obj-$(CONFIG_X86_IO_APIC) += io_apic.o
26obj-$(CONFIG_X86_REBOOTFIXUPS) += reboot_fixups.o 26obj-$(CONFIG_X86_REBOOTFIXUPS) += reboot_fixups.o
27obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o crash.o 27obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o crash.o
28obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
28obj-$(CONFIG_X86_NUMAQ) += numaq.o 29obj-$(CONFIG_X86_NUMAQ) += numaq.o
29obj-$(CONFIG_X86_SUMMIT_NUMA) += summit.o 30obj-$(CONFIG_X86_SUMMIT_NUMA) += summit.o
30obj-$(CONFIG_KPROBES) += kprobes.o 31obj-$(CONFIG_KPROBES) += kprobes.o
diff --git a/arch/i386/kernel/crash.c b/arch/i386/kernel/crash.c
index 0248e084017c..d49dbe8dc96b 100644
--- a/arch/i386/kernel/crash.c
+++ b/arch/i386/kernel/crash.c
@@ -25,7 +25,6 @@
25#include <mach_ipi.h> 25#include <mach_ipi.h>
26 26
27 27
28note_buf_t crash_notes[NR_CPUS];
29/* This keeps a track of which one is crashing cpu. */ 28/* This keeps a track of which one is crashing cpu. */
30static int crashing_cpu; 29static int crashing_cpu;
31 30
@@ -72,7 +71,9 @@ static void crash_save_this_cpu(struct pt_regs *regs, int cpu)
72 * squirrelled away. ELF notes happen to provide 71 * squirrelled away. ELF notes happen to provide
73 * all of that that no need to invent something new. 72 * all of that that no need to invent something new.
74 */ 73 */
75 buf = &crash_notes[cpu][0]; 74 buf = (u32*)per_cpu_ptr(crash_notes, cpu);
75 if (!buf)
76 return;
76 memset(&prstatus, 0, sizeof(prstatus)); 77 memset(&prstatus, 0, sizeof(prstatus));
77 prstatus.pr_pid = current->pid; 78 prstatus.pr_pid = current->pid;
78 elf_core_copy_regs(&prstatus.pr_reg, regs); 79 elf_core_copy_regs(&prstatus.pr_reg, regs);
@@ -81,51 +82,12 @@ static void crash_save_this_cpu(struct pt_regs *regs, int cpu)
81 final_note(buf); 82 final_note(buf);
82} 83}
83 84
84static void crash_get_current_regs(struct pt_regs *regs) 85static void crash_save_self(struct pt_regs *regs)
85{
86 __asm__ __volatile__("movl %%ebx,%0" : "=m"(regs->ebx));
87 __asm__ __volatile__("movl %%ecx,%0" : "=m"(regs->ecx));
88 __asm__ __volatile__("movl %%edx,%0" : "=m"(regs->edx));
89 __asm__ __volatile__("movl %%esi,%0" : "=m"(regs->esi));
90 __asm__ __volatile__("movl %%edi,%0" : "=m"(regs->edi));
91 __asm__ __volatile__("movl %%ebp,%0" : "=m"(regs->ebp));
92 __asm__ __volatile__("movl %%eax,%0" : "=m"(regs->eax));
93 __asm__ __volatile__("movl %%esp,%0" : "=m"(regs->esp));
94 __asm__ __volatile__("movw %%ss, %%ax;" :"=a"(regs->xss));
95 __asm__ __volatile__("movw %%cs, %%ax;" :"=a"(regs->xcs));
96 __asm__ __volatile__("movw %%ds, %%ax;" :"=a"(regs->xds));
97 __asm__ __volatile__("movw %%es, %%ax;" :"=a"(regs->xes));
98 __asm__ __volatile__("pushfl; popl %0" :"=m"(regs->eflags));
99
100 regs->eip = (unsigned long)current_text_addr();
101}
102
103/* CPU does not save ss and esp on stack if execution is already
104 * running in kernel mode at the time of NMI occurrence. This code
105 * fixes it.
106 */
107static void crash_setup_regs(struct pt_regs *newregs, struct pt_regs *oldregs)
108{
109 memcpy(newregs, oldregs, sizeof(*newregs));
110 newregs->esp = (unsigned long)&(oldregs->esp);
111 __asm__ __volatile__("xorl %eax, %eax;");
112 __asm__ __volatile__ ("movw %%ss, %%ax;" :"=a"(newregs->xss));
113}
114
115/* We may have saved_regs from where the error came from
116 * or it is NULL if via a direct panic().
117 */
118static void crash_save_self(struct pt_regs *saved_regs)
119{ 86{
120 struct pt_regs regs;
121 int cpu; 87 int cpu;
122 88
123 cpu = smp_processor_id(); 89 cpu = smp_processor_id();
124 if (saved_regs) 90 crash_save_this_cpu(regs, cpu);
125 crash_setup_regs(&regs, saved_regs);
126 else
127 crash_get_current_regs(&regs);
128 crash_save_this_cpu(&regs, cpu);
129} 91}
130 92
131#ifdef CONFIG_SMP 93#ifdef CONFIG_SMP
@@ -144,7 +106,7 @@ static int crash_nmi_callback(struct pt_regs *regs, int cpu)
144 local_irq_disable(); 106 local_irq_disable();
145 107
146 if (!user_mode(regs)) { 108 if (!user_mode(regs)) {
147 crash_setup_regs(&fixed_regs, regs); 109 crash_fixup_ss_esp(&fixed_regs, regs);
148 regs = &fixed_regs; 110 regs = &fixed_regs;
149 } 111 }
150 crash_save_this_cpu(regs, cpu); 112 crash_save_this_cpu(regs, cpu);
diff --git a/arch/i386/kernel/crash_dump.c b/arch/i386/kernel/crash_dump.c
new file mode 100644
index 000000000000..3f532df488bc
--- /dev/null
+++ b/arch/i386/kernel/crash_dump.c
@@ -0,0 +1,74 @@
1/*
2 * kernel/crash_dump.c - Memory preserving reboot related code.
3 *
4 * Created by: Hariprasad Nellitheertha (hari@in.ibm.com)
5 * Copyright (C) IBM Corporation, 2004. All rights reserved
6 */
7
8#include <linux/errno.h>
9#include <linux/highmem.h>
10#include <linux/crash_dump.h>
11
12#include <asm/uaccess.h>
13
14static void *kdump_buf_page;
15
16/**
17 * copy_oldmem_page - copy one page from "oldmem"
18 * @pfn: page frame number to be copied
19 * @buf: target memory address for the copy; this can be in kernel address
20 * space or user address space (see @userbuf)
21 * @csize: number of bytes to copy
22 * @offset: offset in bytes into the page (based on pfn) to begin the copy
23 * @userbuf: if set, @buf is in user address space, use copy_to_user(),
24 * otherwise @buf is in kernel address space, use memcpy().
25 *
26 * Copy a page from "oldmem". For this page, there is no pte mapped
27 * in the current kernel. We stitch up a pte, similar to kmap_atomic.
28 *
29 * Calling copy_to_user() in atomic context is not desirable. Hence first
30 * copying the data to a pre-allocated kernel page and then copying to user
31 * space in non-atomic context.
32 */
33ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
34 size_t csize, unsigned long offset, int userbuf)
35{
36 void *vaddr;
37
38 if (!csize)
39 return 0;
40
41 vaddr = kmap_atomic_pfn(pfn, KM_PTE0);
42
43 if (!userbuf) {
44 memcpy(buf, (vaddr + offset), csize);
45 kunmap_atomic(vaddr, KM_PTE0);
46 } else {
47 if (!kdump_buf_page) {
48 printk(KERN_WARNING "Kdump: Kdump buffer page not"
49 " allocated\n");
50 return -EFAULT;
51 }
52 copy_page(kdump_buf_page, vaddr);
53 kunmap_atomic(vaddr, KM_PTE0);
54 if (copy_to_user(buf, (kdump_buf_page + offset), csize))
55 return -EFAULT;
56 }
57
58 return csize;
59}
60
61static int __init kdump_buf_page_init(void)
62{
63 int ret = 0;
64
65 kdump_buf_page = kmalloc(PAGE_SIZE, GFP_KERNEL);
66 if (!kdump_buf_page) {
67 printk(KERN_WARNING "Kdump: Failed to allocate kdump buffer"
68 " page\n");
69 ret = -ENOMEM;
70 }
71
72 return ret;
73}
74arch_initcall(kdump_buf_page_init);
diff --git a/arch/i386/kernel/kprobes.c b/arch/i386/kernel/kprobes.c
index 19edcd526ba4..2f372dbd34fd 100644
--- a/arch/i386/kernel/kprobes.c
+++ b/arch/i386/kernel/kprobes.c
@@ -58,13 +58,9 @@ static inline int is_IF_modifier(kprobe_opcode_t opcode)
58 58
59int __kprobes arch_prepare_kprobe(struct kprobe *p) 59int __kprobes arch_prepare_kprobe(struct kprobe *p)
60{ 60{
61 return 0;
62}
63
64void __kprobes arch_copy_kprobe(struct kprobe *p)
65{
66 memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t)); 61 memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t));
67 p->opcode = *p->addr; 62 p->opcode = *p->addr;
63 return 0;
68} 64}
69 65
70void __kprobes arch_arm_kprobe(struct kprobe *p) 66void __kprobes arch_arm_kprobe(struct kprobe *p)
@@ -81,10 +77,6 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)
81 (unsigned long) p->addr + sizeof(kprobe_opcode_t)); 77 (unsigned long) p->addr + sizeof(kprobe_opcode_t));
82} 78}
83 79
84void __kprobes arch_remove_kprobe(struct kprobe *p)
85{
86}
87
88static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb) 80static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb)
89{ 81{
90 kcb->prev_kprobe.kp = kprobe_running(); 82 kcb->prev_kprobe.kp = kprobe_running();
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 27c956db0461..f685637a100d 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -898,7 +898,7 @@ static void __init parse_cmdline_early (char ** cmdline_p)
898 } 898 }
899 } 899 }
900#endif 900#endif
901#ifdef CONFIG_CRASH_DUMP 901#ifdef CONFIG_PROC_VMCORE
902 /* elfcorehdr= specifies the location of elf core header 902 /* elfcorehdr= specifies the location of elf core header
903 * stored by the crashed kernel. 903 * stored by the crashed kernel.
904 */ 904 */
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index 53ad954e3ba4..b9f0030a2ebb 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -120,7 +120,7 @@ static inline unsigned long print_context_stack(struct thread_info *tinfo,
120#ifdef CONFIG_FRAME_POINTER 120#ifdef CONFIG_FRAME_POINTER
121 while (valid_stack_ptr(tinfo, (void *)ebp)) { 121 while (valid_stack_ptr(tinfo, (void *)ebp)) {
122 addr = *(unsigned long *)(ebp + 4); 122 addr = *(unsigned long *)(ebp + 4);
123 printk(" [<%08lx>] ", addr); 123 printk(KERN_EMERG " [<%08lx>] ", addr);
124 print_symbol("%s", addr); 124 print_symbol("%s", addr);
125 printk("\n"); 125 printk("\n");
126 ebp = *(unsigned long *)ebp; 126 ebp = *(unsigned long *)ebp;
@@ -129,7 +129,7 @@ static inline unsigned long print_context_stack(struct thread_info *tinfo,
129 while (valid_stack_ptr(tinfo, stack)) { 129 while (valid_stack_ptr(tinfo, stack)) {
130 addr = *stack++; 130 addr = *stack++;
131 if (__kernel_text_address(addr)) { 131 if (__kernel_text_address(addr)) {
132 printk(" [<%08lx>]", addr); 132 printk(KERN_EMERG " [<%08lx>]", addr);
133 print_symbol(" %s", addr); 133 print_symbol(" %s", addr);
134 printk("\n"); 134 printk("\n");
135 } 135 }
@@ -161,7 +161,7 @@ void show_trace(struct task_struct *task, unsigned long * stack)
161 stack = (unsigned long*)context->previous_esp; 161 stack = (unsigned long*)context->previous_esp;
162 if (!stack) 162 if (!stack)
163 break; 163 break;
164 printk(" =======================\n"); 164 printk(KERN_EMERG " =======================\n");
165 } 165 }
166} 166}
167 167
@@ -178,14 +178,15 @@ void show_stack(struct task_struct *task, unsigned long *esp)
178 } 178 }
179 179
180 stack = esp; 180 stack = esp;
181 printk(KERN_EMERG);
181 for(i = 0; i < kstack_depth_to_print; i++) { 182 for(i = 0; i < kstack_depth_to_print; i++) {
182 if (kstack_end(stack)) 183 if (kstack_end(stack))
183 break; 184 break;
184 if (i && ((i % 8) == 0)) 185 if (i && ((i % 8) == 0))
185 printk("\n "); 186 printk("\n" KERN_EMERG " ");
186 printk("%08lx ", *stack++); 187 printk("%08lx ", *stack++);
187 } 188 }
188 printk("\nCall Trace:\n"); 189 printk("\n" KERN_EMERG "Call Trace:\n");
189 show_trace(task, esp); 190 show_trace(task, esp);
190} 191}
191 192
@@ -216,18 +217,18 @@ void show_registers(struct pt_regs *regs)
216 ss = regs->xss & 0xffff; 217 ss = regs->xss & 0xffff;
217 } 218 }
218 print_modules(); 219 print_modules();
219 printk("CPU: %d\nEIP: %04x:[<%08lx>] %s VLI\nEFLAGS: %08lx" 220 printk(KERN_EMERG "CPU: %d\nEIP: %04x:[<%08lx>] %s VLI\n"
220 " (%s) \n", 221 "EFLAGS: %08lx (%s) \n",
221 smp_processor_id(), 0xffff & regs->xcs, regs->eip, 222 smp_processor_id(), 0xffff & regs->xcs, regs->eip,
222 print_tainted(), regs->eflags, system_utsname.release); 223 print_tainted(), regs->eflags, system_utsname.release);
223 print_symbol("EIP is at %s\n", regs->eip); 224 print_symbol(KERN_EMERG "EIP is at %s\n", regs->eip);
224 printk("eax: %08lx ebx: %08lx ecx: %08lx edx: %08lx\n", 225 printk(KERN_EMERG "eax: %08lx ebx: %08lx ecx: %08lx edx: %08lx\n",
225 regs->eax, regs->ebx, regs->ecx, regs->edx); 226 regs->eax, regs->ebx, regs->ecx, regs->edx);
226 printk("esi: %08lx edi: %08lx ebp: %08lx esp: %08lx\n", 227 printk(KERN_EMERG "esi: %08lx edi: %08lx ebp: %08lx esp: %08lx\n",
227 regs->esi, regs->edi, regs->ebp, esp); 228 regs->esi, regs->edi, regs->ebp, esp);
228 printk("ds: %04x es: %04x ss: %04x\n", 229 printk(KERN_EMERG "ds: %04x es: %04x ss: %04x\n",
229 regs->xds & 0xffff, regs->xes & 0xffff, ss); 230 regs->xds & 0xffff, regs->xes & 0xffff, ss);
230 printk("Process %s (pid: %d, threadinfo=%p task=%p)", 231 printk(KERN_EMERG "Process %s (pid: %d, threadinfo=%p task=%p)",
231 current->comm, current->pid, current_thread_info(), current); 232 current->comm, current->pid, current_thread_info(), current);
232 /* 233 /*
233 * When in-kernel, we also print out the stack and code at the 234 * When in-kernel, we also print out the stack and code at the
@@ -236,10 +237,10 @@ void show_registers(struct pt_regs *regs)
236 if (in_kernel) { 237 if (in_kernel) {
237 u8 __user *eip; 238 u8 __user *eip;
238 239
239 printk("\nStack: "); 240 printk("\n" KERN_EMERG "Stack: ");
240 show_stack(NULL, (unsigned long*)esp); 241 show_stack(NULL, (unsigned long*)esp);
241 242
242 printk("Code: "); 243 printk(KERN_EMERG "Code: ");
243 244
244 eip = (u8 __user *)regs->eip - 43; 245 eip = (u8 __user *)regs->eip - 43;
245 for (i = 0; i < 64; i++, eip++) { 246 for (i = 0; i < 64; i++, eip++) {
@@ -280,15 +281,15 @@ static void handle_BUG(struct pt_regs *regs)
280 (unsigned long)file < PAGE_OFFSET || __get_user(c, file)) 281 (unsigned long)file < PAGE_OFFSET || __get_user(c, file))
281 file = "<bad filename>"; 282 file = "<bad filename>";
282 283
283 printk("------------[ cut here ]------------\n"); 284 printk(KERN_EMERG "------------[ cut here ]------------\n");
284 printk(KERN_ALERT "kernel BUG at %s:%d!\n", file, line); 285 printk(KERN_EMERG "kernel BUG at %s:%d!\n", file, line);
285 286
286no_bug: 287no_bug:
287 return; 288 return;
288 289
289 /* Here we know it was a BUG but file-n-line is unavailable */ 290 /* Here we know it was a BUG but file-n-line is unavailable */
290bug: 291bug:
291 printk("Kernel BUG\n"); 292 printk(KERN_EMERG "Kernel BUG\n");
292} 293}
293 294
294/* This is gone through when something in the kernel 295/* This is gone through when something in the kernel
@@ -321,16 +322,20 @@ void die(const char * str, struct pt_regs * regs, long err)
321 if (++die.lock_owner_depth < 3) { 322 if (++die.lock_owner_depth < 3) {
322 int nl = 0; 323 int nl = 0;
323 handle_BUG(regs); 324 handle_BUG(regs);
324 printk(KERN_ALERT "%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); 325 printk(KERN_EMERG "%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter);
325#ifdef CONFIG_PREEMPT 326#ifdef CONFIG_PREEMPT
326 printk("PREEMPT "); 327 printk(KERN_EMERG "PREEMPT ");
327 nl = 1; 328 nl = 1;
328#endif 329#endif
329#ifdef CONFIG_SMP 330#ifdef CONFIG_SMP
331 if (!nl)
332 printk(KERN_EMERG);
330 printk("SMP "); 333 printk("SMP ");
331 nl = 1; 334 nl = 1;
332#endif 335#endif
333#ifdef CONFIG_DEBUG_PAGEALLOC 336#ifdef CONFIG_DEBUG_PAGEALLOC
337 if (!nl)
338 printk(KERN_EMERG);
334 printk("DEBUG_PAGEALLOC"); 339 printk("DEBUG_PAGEALLOC");
335 nl = 1; 340 nl = 1;
336#endif 341#endif
@@ -339,7 +344,7 @@ void die(const char * str, struct pt_regs * regs, long err)
339 notify_die(DIE_OOPS, (char *)str, regs, err, 255, SIGSEGV); 344 notify_die(DIE_OOPS, (char *)str, regs, err, 255, SIGSEGV);
340 show_registers(regs); 345 show_registers(regs);
341 } else 346 } else
342 printk(KERN_ERR "Recursive die() failure, output suppressed\n"); 347 printk(KERN_EMERG "Recursive die() failure, output suppressed\n");
343 348
344 bust_spinlocks(0); 349 bust_spinlocks(0);
345 die.lock_owner = -1; 350 die.lock_owner = -1;
@@ -527,8 +532,10 @@ gp_in_kernel:
527 532
528static void mem_parity_error(unsigned char reason, struct pt_regs * regs) 533static void mem_parity_error(unsigned char reason, struct pt_regs * regs)
529{ 534{
530 printk("Uhhuh. NMI received. Dazed and confused, but trying to continue\n"); 535 printk(KERN_EMERG "Uhhuh. NMI received. Dazed and confused, but trying "
531 printk("You probably have a hardware problem with your RAM chips\n"); 536 "to continue\n");
537 printk(KERN_EMERG "You probably have a hardware problem with your RAM "
538 "chips\n");
532 539
533 /* Clear and disable the memory parity error line. */ 540 /* Clear and disable the memory parity error line. */
534 clear_mem_error(reason); 541 clear_mem_error(reason);
@@ -538,7 +545,7 @@ static void io_check_error(unsigned char reason, struct pt_regs * regs)
538{ 545{
539 unsigned long i; 546 unsigned long i;
540 547
541 printk("NMI: IOCK error (debug interrupt?)\n"); 548 printk(KERN_EMERG "NMI: IOCK error (debug interrupt?)\n");
542 show_registers(regs); 549 show_registers(regs);
543 550
544 /* Re-enable the IOCK line, wait for a few seconds */ 551 /* Re-enable the IOCK line, wait for a few seconds */
@@ -580,11 +587,11 @@ void die_nmi (struct pt_regs *regs, const char *msg)
580 * to get a message out. 587 * to get a message out.
581 */ 588 */
582 bust_spinlocks(1); 589 bust_spinlocks(1);
583 printk(msg); 590 printk(KERN_EMERG "%s", msg);
584 printk(" on CPU%d, eip %08lx, registers:\n", 591 printk(" on CPU%d, eip %08lx, registers:\n",
585 smp_processor_id(), regs->eip); 592 smp_processor_id(), regs->eip);
586 show_registers(regs); 593 show_registers(regs);
587 printk("console shuts up ...\n"); 594 printk(KERN_EMERG "console shuts up ...\n");
588 console_silent(); 595 console_silent();
589 spin_unlock(&nmi_print_lock); 596 spin_unlock(&nmi_print_lock);
590 bust_spinlocks(0); 597 bust_spinlocks(0);
@@ -990,8 +997,8 @@ asmlinkage void math_state_restore(struct pt_regs regs)
990 997
991asmlinkage void math_emulate(long arg) 998asmlinkage void math_emulate(long arg)
992{ 999{
993 printk("math-emulation not enabled and no coprocessor found.\n"); 1000 printk(KERN_EMERG "math-emulation not enabled and no coprocessor found.\n");
994 printk("killing %s.\n",current->comm); 1001 printk(KERN_EMERG "killing %s.\n",current->comm);
995 force_sig(SIGFPE,current); 1002 force_sig(SIGFPE,current);
996 schedule(); 1003 schedule();
997} 1004}
diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile
index 57b047c27e46..f722e1a25948 100644
--- a/arch/ia64/Makefile
+++ b/arch/ia64/Makefile
@@ -25,7 +25,6 @@ cflags-y := -pipe $(EXTRA) -ffixed-r13 -mfixed-range=f12-f15,f32-f127 \
25 -falign-functions=32 -frename-registers -fno-optimize-sibling-calls 25 -falign-functions=32 -frename-registers -fno-optimize-sibling-calls
26CFLAGS_KERNEL := -mconstant-gp 26CFLAGS_KERNEL := -mconstant-gp
27 27
28GCC_VERSION := $(call cc-version)
29GAS_STATUS = $(shell $(srctree)/arch/ia64/scripts/check-gas "$(CC)" "$(OBJDUMP)") 28GAS_STATUS = $(shell $(srctree)/arch/ia64/scripts/check-gas "$(CC)" "$(OBJDUMP)")
30CPPFLAGS += $(shell $(srctree)/arch/ia64/scripts/toolchain-flags "$(CC)" "$(OBJDUMP)" "$(READELF)") 29CPPFLAGS += $(shell $(srctree)/arch/ia64/scripts/toolchain-flags "$(CC)" "$(OBJDUMP)" "$(READELF)")
31 30
@@ -37,7 +36,7 @@ $(error Sorry, you need a newer version of the assember, one that is built from
37 ftp://ftp.hpl.hp.com/pub/linux-ia64/gas-030124.tar.gz) 36 ftp://ftp.hpl.hp.com/pub/linux-ia64/gas-030124.tar.gz)
38endif 37endif
39 38
40ifeq ($(GCC_VERSION),0304) 39ifeq ($(call cc-version),0304)
41 cflags-$(CONFIG_ITANIUM) += -mtune=merced 40 cflags-$(CONFIG_ITANIUM) += -mtune=merced
42 cflags-$(CONFIG_MCKINLEY) += -mtune=mckinley 41 cflags-$(CONFIG_MCKINLEY) += -mtune=mckinley
43endif 42endif
diff --git a/arch/ia64/ia32/Makefile b/arch/ia64/ia32/Makefile
index 2ed90da81166..61cb60affd95 100644
--- a/arch/ia64/ia32/Makefile
+++ b/arch/ia64/ia32/Makefile
@@ -2,11 +2,9 @@
2# Makefile for the ia32 kernel emulation subsystem. 2# Makefile for the ia32 kernel emulation subsystem.
3# 3#
4 4
5obj-y := ia32_entry.o sys_ia32.o ia32_ioctl.o ia32_signal.o \ 5obj-y := ia32_entry.o sys_ia32.o ia32_signal.o \
6 ia32_support.o ia32_traps.o binfmt_elf32.o ia32_ldt.o 6 ia32_support.o ia32_traps.o binfmt_elf32.o ia32_ldt.o
7 7
8CFLAGS_ia32_ioctl.o += -Ifs/
9
10# Don't let GCC uses f16-f31 so that save_ia32_fpstate_live() and 8# Don't let GCC uses f16-f31 so that save_ia32_fpstate_live() and
11# restore_ia32_fpstate_live() can be sure the live register contain user-level state. 9# restore_ia32_fpstate_live() can be sure the live register contain user-level state.
12CFLAGS_ia32_signal.o += -mfixed-range=f16-f31 10CFLAGS_ia32_signal.o += -mfixed-range=f16-f31
diff --git a/arch/ia64/ia32/ia32_entry.S b/arch/ia64/ia32/ia32_entry.S
index 494fad6bf376..95fe04400f6b 100644
--- a/arch/ia64/ia32/ia32_entry.S
+++ b/arch/ia64/ia32/ia32_entry.S
@@ -469,7 +469,7 @@ ia32_syscall_table:
469 data8 sys32_epoll_wait 469 data8 sys32_epoll_wait
470 data8 sys_remap_file_pages 470 data8 sys_remap_file_pages
471 data8 sys_set_tid_address 471 data8 sys_set_tid_address
472 data8 sys32_timer_create 472 data8 compat_sys_timer_create
473 data8 compat_sys_timer_settime /* 260 */ 473 data8 compat_sys_timer_settime /* 260 */
474 data8 compat_sys_timer_gettime 474 data8 compat_sys_timer_gettime
475 data8 sys_timer_getoverrun 475 data8 sys_timer_getoverrun
diff --git a/arch/ia64/ia32/ia32_ioctl.c b/arch/ia64/ia32/ia32_ioctl.c
deleted file mode 100644
index 88739394f6df..000000000000
--- a/arch/ia64/ia32/ia32_ioctl.c
+++ /dev/null
@@ -1,45 +0,0 @@
1/*
2 * IA32 Architecture-specific ioctl shim code
3 *
4 * Copyright (C) 2000 VA Linux Co
5 * Copyright (C) 2000 Don Dugger <n0ano@valinux.com>
6 * Copyright (C) 2001-2003 Hewlett-Packard Co
7 * David Mosberger-Tang <davidm@hpl.hp.com>
8 */
9
10#include <linux/signal.h> /* argh, msdos_fs.h isn't self-contained... */
11#include <linux/syscalls.h>
12#include "ia32priv.h"
13
14#define INCLUDES
15#include "compat_ioctl.c"
16
17#define IOCTL_NR(a) ((a) & ~(_IOC_SIZEMASK << _IOC_SIZESHIFT))
18
19#define DO_IOCTL(fd, cmd, arg) ({ \
20 int _ret; \
21 mm_segment_t _old_fs = get_fs(); \
22 \
23 set_fs(KERNEL_DS); \
24 _ret = sys_ioctl(fd, cmd, (unsigned long)arg); \
25 set_fs(_old_fs); \
26 _ret; \
27})
28
29#define CODE
30#include "compat_ioctl.c"
31
32#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl)
33#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl_trans_handler_t)(handler), NULL },
34#define IOCTL_TABLE_START \
35 struct ioctl_trans ioctl_start[] = {
36#define IOCTL_TABLE_END \
37 };
38
39IOCTL_TABLE_START
40#define DECLARES
41#include "compat_ioctl.c"
42#include <linux/compat_ioctl.h>
43IOCTL_TABLE_END
44
45int ioctl_table_size = ARRAY_SIZE(ioctl_start);
diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c
index 9f8e8d558873..5ea38286d8d5 100644
--- a/arch/ia64/ia32/sys_ia32.c
+++ b/arch/ia64/ia32/sys_ia32.c
@@ -2553,34 +2553,6 @@ sys32_get_thread_area (struct ia32_user_desc __user *u_info)
2553 return 0; 2553 return 0;
2554} 2554}
2555 2555
2556asmlinkage long
2557sys32_timer_create(u32 clock, struct compat_sigevent __user *se32, timer_t __user *timer_id)
2558{
2559 struct sigevent se;
2560 mm_segment_t oldfs;
2561 timer_t t;
2562 long err;
2563
2564 if (se32 == NULL)
2565 return sys_timer_create(clock, NULL, timer_id);
2566
2567 if (get_compat_sigevent(&se, se32))
2568 return -EFAULT;
2569
2570 if (!access_ok(VERIFY_WRITE,timer_id,sizeof(timer_t)))
2571 return -EFAULT;
2572
2573 oldfs = get_fs();
2574 set_fs(KERNEL_DS);
2575 err = sys_timer_create(clock, (struct sigevent __user *) &se, (timer_t __user *) &t);
2576 set_fs(oldfs);
2577
2578 if (!err)
2579 err = __put_user (t, timer_id);
2580
2581 return err;
2582}
2583
2584long sys32_fadvise64_64(int fd, __u32 offset_low, __u32 offset_high, 2556long sys32_fadvise64_64(int fd, __u32 offset_low, __u32 offset_high,
2585 __u32 len_low, __u32 len_high, int advice) 2557 __u32 len_low, __u32 len_high, int advice)
2586{ 2558{
diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c
index 89a70400c4f6..4de7f6759093 100644
--- a/arch/ia64/kernel/kprobes.c
+++ b/arch/ia64/kernel/kprobes.c
@@ -467,10 +467,6 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)
467 flush_icache_range(arm_addr, arm_addr + sizeof(bundle_t)); 467 flush_icache_range(arm_addr, arm_addr + sizeof(bundle_t));
468} 468}
469 469
470void __kprobes arch_remove_kprobe(struct kprobe *p)
471{
472}
473
474/* 470/*
475 * We are resuming execution after a single step fault, so the pt_regs 471 * We are resuming execution after a single step fault, so the pt_regs
476 * structure reflects the register state after we executed the instruction 472 * structure reflects the register state after we executed the instruction
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig
index fae67bbb52f6..a3dcc3fab4b7 100644
--- a/arch/m32r/Kconfig
+++ b/arch/m32r/Kconfig
@@ -12,10 +12,6 @@ config M32R
12config SBUS 12config SBUS
13 bool 13 bool
14 14
15config UID16
16 bool
17 default n
18
19config GENERIC_ISA_DMA 15config GENERIC_ISA_DMA
20 bool 16 bool
21 default y 17 default y
diff --git a/arch/m32r/kernel/m32r_ksyms.c b/arch/m32r/kernel/m32r_ksyms.c
index e5ec134d81d9..dbc8a392105f 100644
--- a/arch/m32r/kernel/m32r_ksyms.c
+++ b/arch/m32r/kernel/m32r_ksyms.c
@@ -18,8 +18,6 @@
18#include <asm/irq.h> 18#include <asm/irq.h>
19#include <asm/tlbflush.h> 19#include <asm/tlbflush.h>
20 20
21extern void dump_thread(struct pt_regs *, struct user *);
22
23#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_HD) || defined(CONFIG_BLK_DEV_IDE_MODULE) || defined(CONFIG_BLK_DEV_HD_MODULE) 21#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_HD) || defined(CONFIG_BLK_DEV_IDE_MODULE) || defined(CONFIG_BLK_DEV_HD_MODULE)
24extern struct drive_info_struct drive_info; 22extern struct drive_info_struct drive_info;
25EXPORT_SYMBOL(drive_info); 23EXPORT_SYMBOL(drive_info);
@@ -27,7 +25,6 @@ EXPORT_SYMBOL(drive_info);
27 25
28/* platform dependent support */ 26/* platform dependent support */
29EXPORT_SYMBOL(boot_cpu_data); 27EXPORT_SYMBOL(boot_cpu_data);
30EXPORT_SYMBOL(dump_thread);
31EXPORT_SYMBOL(dump_fpu); 28EXPORT_SYMBOL(dump_fpu);
32EXPORT_SYMBOL(__ioremap); 29EXPORT_SYMBOL(__ioremap);
33EXPORT_SYMBOL(iounmap); 30EXPORT_SYMBOL(iounmap);
diff --git a/arch/m32r/kernel/process.c b/arch/m32r/kernel/process.c
index 3bf55d92933f..2a1f250349b7 100644
--- a/arch/m32r/kernel/process.c
+++ b/arch/m32r/kernel/process.c
@@ -261,14 +261,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long spu,
261} 261}
262 262
263/* 263/*
264 * fill in the user structure for a core dump..
265 */
266void dump_thread(struct pt_regs * regs, struct user * dump)
267{
268 /* M32R_FIXME */
269}
270
271/*
272 * Capture the user space registers if the task is not running (in user space) 264 * Capture the user space registers if the task is not running (in user space)
273 */ 265 */
274int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs) 266int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs)
diff --git a/arch/m68k/kernel/m68k_ksyms.c b/arch/m68k/kernel/m68k_ksyms.c
index 73e2f5e168dd..3d7f2000b714 100644
--- a/arch/m68k/kernel/m68k_ksyms.c
+++ b/arch/m68k/kernel/m68k_ksyms.c
@@ -23,8 +23,6 @@ asmlinkage long long __lshrdi3 (long long, int);
23asmlinkage long long __muldi3 (long long, long long); 23asmlinkage long long __muldi3 (long long, long long);
24extern char m68k_debug_device[]; 24extern char m68k_debug_device[];
25 25
26extern void dump_thread(struct pt_regs *, struct user *);
27
28/* platform dependent support */ 26/* platform dependent support */
29 27
30EXPORT_SYMBOL(m68k_machtype); 28EXPORT_SYMBOL(m68k_machtype);
diff --git a/arch/m68knommu/kernel/m68k_ksyms.c b/arch/m68knommu/kernel/m68k_ksyms.c
index b2c62eeb3bab..eddb8d3e130a 100644
--- a/arch/m68knommu/kernel/m68k_ksyms.c
+++ b/arch/m68knommu/kernel/m68k_ksyms.c
@@ -18,7 +18,6 @@
18#include <asm/checksum.h> 18#include <asm/checksum.h>
19#include <asm/current.h> 19#include <asm/current.h>
20 20
21extern void dump_thread(struct pt_regs *, struct user *);
22extern int dump_fpu(struct pt_regs *, elf_fpregset_t *); 21extern int dump_fpu(struct pt_regs *, elf_fpregset_t *);
23 22
24/* platform dependent support */ 23/* platform dependent support */
@@ -26,7 +25,6 @@ extern int dump_fpu(struct pt_regs *, elf_fpregset_t *);
26EXPORT_SYMBOL(__ioremap); 25EXPORT_SYMBOL(__ioremap);
27EXPORT_SYMBOL(iounmap); 26EXPORT_SYMBOL(iounmap);
28EXPORT_SYMBOL(dump_fpu); 27EXPORT_SYMBOL(dump_fpu);
29EXPORT_SYMBOL(dump_thread);
30EXPORT_SYMBOL(strnlen); 28EXPORT_SYMBOL(strnlen);
31EXPORT_SYMBOL(strrchr); 29EXPORT_SYMBOL(strrchr);
32EXPORT_SYMBOL(strstr); 30EXPORT_SYMBOL(strstr);
diff --git a/arch/m68knommu/kernel/process.c b/arch/m68knommu/kernel/process.c
index 82e7ec888806..8b3cf57ba706 100644
--- a/arch/m68knommu/kernel/process.c
+++ b/arch/m68knommu/kernel/process.c
@@ -276,52 +276,6 @@ int dump_fpu(struct pt_regs *regs, struct user_m68kfp_struct *fpu)
276} 276}
277 277
278/* 278/*
279 * fill in the user structure for a core dump..
280 */
281void dump_thread(struct pt_regs * regs, struct user * dump)
282{
283 struct switch_stack *sw;
284
285 /* changed the size calculations - should hopefully work better. lbt */
286 dump->magic = CMAGIC;
287 dump->start_code = 0;
288 dump->start_stack = rdusp() & ~(PAGE_SIZE - 1);
289 dump->u_tsize = ((unsigned long) current->mm->end_code) >> PAGE_SHIFT;
290 dump->u_dsize = ((unsigned long) (current->mm->brk +
291 (PAGE_SIZE-1))) >> PAGE_SHIFT;
292 dump->u_dsize -= dump->u_tsize;
293 dump->u_ssize = 0;
294
295 if (dump->start_stack < TASK_SIZE)
296 dump->u_ssize = ((unsigned long) (TASK_SIZE - dump->start_stack)) >> PAGE_SHIFT;
297
298 dump->u_ar0 = (struct user_regs_struct *)((int)&dump->regs - (int)dump);
299 sw = ((struct switch_stack *)regs) - 1;
300 dump->regs.d1 = regs->d1;
301 dump->regs.d2 = regs->d2;
302 dump->regs.d3 = regs->d3;
303 dump->regs.d4 = regs->d4;
304 dump->regs.d5 = regs->d5;
305 dump->regs.d6 = sw->d6;
306 dump->regs.d7 = sw->d7;
307 dump->regs.a0 = regs->a0;
308 dump->regs.a1 = regs->a1;
309 dump->regs.a2 = regs->a2;
310 dump->regs.a3 = sw->a3;
311 dump->regs.a4 = sw->a4;
312 dump->regs.a5 = sw->a5;
313 dump->regs.a6 = sw->a6;
314 dump->regs.d0 = regs->d0;
315 dump->regs.orig_d0 = regs->orig_d0;
316 dump->regs.stkadj = regs->stkadj;
317 dump->regs.sr = regs->sr;
318 dump->regs.pc = regs->pc;
319 dump->regs.fmtvec = (regs->format << 12) | regs->vector;
320 /* dump floating point stuff */
321 dump->u_fpvalid = dump_fpu (regs, &dump->m68kfp);
322}
323
324/*
325 * Generic dumping code. Used for panic and debug. 279 * Generic dumping code. Used for panic and debug.
326 */ 280 */
327void dump(struct pt_regs *fp) 281void dump(struct pt_regs *fp)
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index 72f2126ad19d..f36c4f20ee8a 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -50,7 +50,7 @@ obj-$(CONFIG_MIPS_BOARDS_GEN) += irq-msc01.o
50obj-$(CONFIG_32BIT) += scall32-o32.o 50obj-$(CONFIG_32BIT) += scall32-o32.o
51obj-$(CONFIG_64BIT) += scall64-64.o 51obj-$(CONFIG_64BIT) += scall64-64.o
52obj-$(CONFIG_BINFMT_IRIX) += binfmt_irix.o 52obj-$(CONFIG_BINFMT_IRIX) += binfmt_irix.o
53obj-$(CONFIG_MIPS32_COMPAT) += ioctl32.o linux32.o signal32.o 53obj-$(CONFIG_MIPS32_COMPAT) += linux32.o signal32.o
54obj-$(CONFIG_MIPS32_N32) += binfmt_elfn32.o scall64-n32.o signal_n32.o 54obj-$(CONFIG_MIPS32_N32) += binfmt_elfn32.o scall64-n32.o signal_n32.o
55obj-$(CONFIG_MIPS32_O32) += binfmt_elfo32.o scall64-o32.o ptrace32.o 55obj-$(CONFIG_MIPS32_O32) += binfmt_elfo32.o scall64-o32.o ptrace32.o
56 56
@@ -60,6 +60,5 @@ obj-$(CONFIG_PROC_FS) += proc.o
60obj-$(CONFIG_64BIT) += cpu-bugs64.o 60obj-$(CONFIG_64BIT) += cpu-bugs64.o
61 61
62CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(CFLAGS) -Wa,-mdaddi -c -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi) 62CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(CFLAGS) -Wa,-mdaddi -c -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi)
63CFLAGS_ioctl32.o += -Ifs/
64 63
65EXTRA_AFLAGS := $(CFLAGS) 64EXTRA_AFLAGS := $(CFLAGS)
diff --git a/arch/mips/kernel/ioctl32.c b/arch/mips/kernel/ioctl32.c
deleted file mode 100644
index 9ea1fc748864..000000000000
--- a/arch/mips/kernel/ioctl32.c
+++ /dev/null
@@ -1,50 +0,0 @@
1/*
2 * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
3 *
4 * Copyright (C) 2000 Silicon Graphics, Inc.
5 * Written by Ulf Carlsson (ulfc@engr.sgi.com)
6 * Copyright (C) 2000, 2004 Ralf Baechle
7 * Copyright (C) 2002, 2003 Maciej W. Rozycki
8 */
9#define INCLUDES
10#include "compat_ioctl.c"
11
12#include <linux/config.h>
13#include <linux/types.h>
14#include <linux/compat.h>
15#include <linux/ioctl32.h>
16#include <linux/syscalls.h>
17
18#ifdef CONFIG_SIBYTE_TBPROF
19#include <asm/sibyte/trace_prof.h>
20#endif
21
22#define A(__x) ((unsigned long)(__x))
23
24long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
25
26#define CODE
27#include "compat_ioctl.c"
28
29#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl)
30#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl_trans_handler_t)(handler), NULL },
31#define IOCTL_TABLE_START \
32 struct ioctl_trans ioctl_start[] = {
33#define IOCTL_TABLE_END \
34 };
35
36IOCTL_TABLE_START
37
38#include <linux/compat_ioctl.h>
39#define DECLARES
40#include "compat_ioctl.c"
41
42/*HANDLE_IOCTL(RTC_IRQP_READ, w_long)
43COMPATIBLE_IOCTL(RTC_IRQP_SET)
44HANDLE_IOCTL(RTC_EPOCH_READ, w_long)
45COMPATIBLE_IOCTL(RTC_EPOCH_SET)
46*/
47
48IOCTL_TABLE_END
49
50int ioctl_table_size = ARRAY_SIZE(ioctl_start);
diff --git a/arch/parisc/kernel/Makefile b/arch/parisc/kernel/Makefile
index 171f9c239f60..27827bc3717e 100644
--- a/arch/parisc/kernel/Makefile
+++ b/arch/parisc/kernel/Makefile
@@ -6,7 +6,6 @@ extra-y := init_task.o head.o vmlinux.lds
6 6
7AFLAGS_entry.o := -traditional 7AFLAGS_entry.o := -traditional
8AFLAGS_pacache.o := -traditional 8AFLAGS_pacache.o := -traditional
9CFLAGS_ioctl32.o := -Ifs/
10 9
11obj-y := cache.o pacache.o setup.o traps.o time.o irq.o \ 10obj-y := cache.o pacache.o setup.o traps.o time.o irq.o \
12 pa7300lc.o syscall.o entry.o sys_parisc.o firmware.o \ 11 pa7300lc.o syscall.o entry.o sys_parisc.o firmware.o \
@@ -19,6 +18,6 @@ obj-$(CONFIG_SMP) += smp.o
19obj-$(CONFIG_PA11) += pci-dma.o 18obj-$(CONFIG_PA11) += pci-dma.o
20obj-$(CONFIG_PCI) += pci.o 19obj-$(CONFIG_PCI) += pci.o
21obj-$(CONFIG_MODULES) += module.o 20obj-$(CONFIG_MODULES) += module.o
22obj-$(CONFIG_64BIT) += binfmt_elf32.o sys_parisc32.o ioctl32.o signal32.o 21obj-$(CONFIG_64BIT) += binfmt_elf32.o sys_parisc32.o signal32.o
23# only supported for PCX-W/U in 64-bit mode at the moment 22# only supported for PCX-W/U in 64-bit mode at the moment
24obj-$(CONFIG_64BIT) += perf.o perf_asm.o 23obj-$(CONFIG_64BIT) += perf.o perf_asm.o
diff --git a/arch/parisc/kernel/ioctl32.c b/arch/parisc/kernel/ioctl32.c
deleted file mode 100644
index 4eada1bb27f0..000000000000
--- a/arch/parisc/kernel/ioctl32.c
+++ /dev/null
@@ -1,60 +0,0 @@
1/* $Id: ioctl32.c,v 1.5 2002/10/18 00:21:43 varenet Exp $
2 * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
3 *
4 * Copyright (C) 1997-2000 Jakub Jelinek (jakub@redhat.com)
5 * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be)
6 *
7 * These routines maintain argument size conversion between 32bit and 64bit
8 * ioctls.
9 */
10
11#include <linux/syscalls.h>
12
13#define INCLUDES
14#include "compat_ioctl.c"
15
16#include <asm/perf.h>
17#include <asm/ioctls.h>
18
19#define CODE
20#include "compat_ioctl.c"
21
22#define HANDLE_IOCTL(cmd, handler) { cmd, (ioctl_trans_handler_t)handler, NULL },
23#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL(cmd, sys_ioctl)
24
25#define IOCTL_TABLE_START struct ioctl_trans ioctl_start[] = {
26#define IOCTL_TABLE_END };
27
28IOCTL_TABLE_START
29#include <linux/compat_ioctl.h>
30
31#define DECLARES
32#include "compat_ioctl.c"
33
34/* And these ioctls need translation */
35HANDLE_IOCTL(SIOCGPPPSTATS, dev_ifsioc)
36HANDLE_IOCTL(SIOCGPPPCSTATS, dev_ifsioc)
37HANDLE_IOCTL(SIOCGPPPVER, dev_ifsioc)
38
39#if defined(CONFIG_GEN_RTC)
40COMPATIBLE_IOCTL(RTC_AIE_ON)
41COMPATIBLE_IOCTL(RTC_AIE_OFF)
42COMPATIBLE_IOCTL(RTC_UIE_ON)
43COMPATIBLE_IOCTL(RTC_UIE_OFF)
44COMPATIBLE_IOCTL(RTC_PIE_ON)
45COMPATIBLE_IOCTL(RTC_PIE_OFF)
46COMPATIBLE_IOCTL(RTC_WIE_ON)
47COMPATIBLE_IOCTL(RTC_WIE_OFF)
48COMPATIBLE_IOCTL(RTC_ALM_SET) /* struct rtc_time only has ints */
49COMPATIBLE_IOCTL(RTC_ALM_READ) /* struct rtc_time only has ints */
50COMPATIBLE_IOCTL(RTC_RD_TIME) /* struct rtc_time only has ints */
51COMPATIBLE_IOCTL(RTC_SET_TIME) /* struct rtc_time only has ints */
52HANDLE_IOCTL(RTC_IRQP_READ, w_long)
53COMPATIBLE_IOCTL(RTC_IRQP_SET)
54HANDLE_IOCTL(RTC_EPOCH_READ, w_long)
55COMPATIBLE_IOCTL(RTC_EPOCH_SET)
56#endif
57
58IOCTL_TABLE_END
59
60int ioctl_table_size = ARRAY_SIZE(ioctl_start);
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 28004f002ec9..935d96571515 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -275,6 +275,7 @@ config PPC_PSERIES
275 select PPC_I8259 275 select PPC_I8259
276 select PPC_RTAS 276 select PPC_RTAS
277 select RTAS_ERROR_LOGGING 277 select RTAS_ERROR_LOGGING
278 select PPC_UDBG_16550
278 default y 279 default y
279 280
280config PPC_CHRP 281config PPC_CHRP
@@ -284,6 +285,7 @@ config PPC_CHRP
284 select PPC_INDIRECT_PCI 285 select PPC_INDIRECT_PCI
285 select PPC_RTAS 286 select PPC_RTAS
286 select PPC_MPC106 287 select PPC_MPC106
288 select PPC_UDBG_16550
287 default y 289 default y
288 290
289config PPC_PMAC 291config PPC_PMAC
@@ -306,6 +308,7 @@ config PPC_PREP
306 depends on PPC_MULTIPLATFORM && PPC32 && BROKEN 308 depends on PPC_MULTIPLATFORM && PPC32 && BROKEN
307 select PPC_I8259 309 select PPC_I8259
308 select PPC_INDIRECT_PCI 310 select PPC_INDIRECT_PCI
311 select PPC_UDBG_16550
309 default y 312 default y
310 313
311config PPC_MAPLE 314config PPC_MAPLE
@@ -314,6 +317,7 @@ config PPC_MAPLE
314 select U3_DART 317 select U3_DART
315 select MPIC_BROKEN_U3 318 select MPIC_BROKEN_U3
316 select GENERIC_TBSYNC 319 select GENERIC_TBSYNC
320 select PPC_UDBG_16550
317 default n 321 default n
318 help 322 help
319 This option enables support for the Maple 970FX Evaluation Board. 323 This option enables support for the Maple 970FX Evaluation Board.
@@ -324,6 +328,7 @@ config PPC_CELL
324 depends on PPC_MULTIPLATFORM && PPC64 328 depends on PPC_MULTIPLATFORM && PPC64
325 select PPC_RTAS 329 select PPC_RTAS
326 select MMIO_NVRAM 330 select MMIO_NVRAM
331 select PPC_UDBG_16550
327 332
328config PPC_OF 333config PPC_OF
329 def_bool y 334 def_bool y
@@ -370,6 +375,10 @@ config MPIC_BROKEN_U3
370 depends on PPC_MAPLE 375 depends on PPC_MAPLE
371 default y 376 default y
372 377
378config PPC_UDBG_16550
379 bool
380 default n
381
373config CELL_IIC 382config CELL_IIC
374 depends on PPC_CELL 383 depends on PPC_CELL
375 bool 384 bool
@@ -403,7 +412,7 @@ config PPC_MPC106
403 412
404config GENERIC_TBSYNC 413config GENERIC_TBSYNC
405 bool 414 bool
406 default y if CONFIG_PPC32 && CONFIG_SMP 415 default y if PPC32 && SMP
407 default n 416 default n
408 417
409source "drivers/cpufreq/Kconfig" 418source "drivers/cpufreq/Kconfig"
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 5f80e58e5cb3..d3654a264ef7 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -76,8 +76,7 @@ LINUXINCLUDE += $(LINUXINCLUDE-y)
76CHECKFLAGS += -m$(SZ) -D__powerpc__ -D__powerpc$(SZ)__ 76CHECKFLAGS += -m$(SZ) -D__powerpc__ -D__powerpc$(SZ)__
77 77
78ifeq ($(CONFIG_PPC64),y) 78ifeq ($(CONFIG_PPC64),y)
79GCC_VERSION := $(call cc-version) 79GCC_BROKEN_VEC := $(shell if [ $(call cc-version) -lt 0400 ] ; then echo "y"; fi)
80GCC_BROKEN_VEC := $(shell if [ $(GCC_VERSION) -lt 0400 ] ; then echo "y"; fi)
81 80
82ifeq ($(CONFIG_POWER4_ONLY),y) 81ifeq ($(CONFIG_POWER4_ONLY),y)
83ifeq ($(CONFIG_ALTIVEC),y) 82ifeq ($(CONFIG_ALTIVEC),y)
@@ -189,10 +188,9 @@ TOUT := .tmp_gas_check
189# Ensure this is binutils 2.12.1 (or 2.12.90.0.7) or later for altivec 188# Ensure this is binutils 2.12.1 (or 2.12.90.0.7) or later for altivec
190# instructions. 189# instructions.
191# gcc-3.4 and binutils-2.14 are a fatal combination. 190# gcc-3.4 and binutils-2.14 are a fatal combination.
192GCC_VERSION := $(call cc-version)
193 191
194checkbin: 192checkbin:
195 @if test "$(GCC_VERSION)" = "0304" ; then \ 193 @if test "$(call cc-version)" = "0304" ; then \
196 if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \ 194 if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \
197 echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \ 195 echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \
198 echo 'correctly with gcc-3.4 and your version of binutils.'; \ 196 echo 'correctly with gcc-3.4 and your version of binutils.'; \
diff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/ppc64_defconfig
index 509399eab6f5..347f4391db8d 100644
--- a/arch/powerpc/configs/ppc64_defconfig
+++ b/arch/powerpc/configs/ppc64_defconfig
@@ -861,7 +861,7 @@ CONFIG_SERIAL_CORE=y
861CONFIG_SERIAL_CORE_CONSOLE=y 861CONFIG_SERIAL_CORE_CONSOLE=y
862# CONFIG_SERIAL_PMACZILOG is not set 862# CONFIG_SERIAL_PMACZILOG is not set
863CONFIG_SERIAL_ICOM=m 863CONFIG_SERIAL_ICOM=m
864CONFIG_SERIAL_JSM=m 864# CONFIG_SERIAL_JSM is not set
865CONFIG_UNIX98_PTYS=y 865CONFIG_UNIX98_PTYS=y
866CONFIG_LEGACY_PTYS=y 866CONFIG_LEGACY_PTYS=y
867CONFIG_LEGACY_PTY_COUNT=256 867CONFIG_LEGACY_PTY_COUNT=256
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 6e03b595b6c8..144e284d21dd 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -4,7 +4,6 @@
4 4
5ifeq ($(CONFIG_PPC64),y) 5ifeq ($(CONFIG_PPC64),y)
6EXTRA_CFLAGS += -mno-minimal-toc 6EXTRA_CFLAGS += -mno-minimal-toc
7CFLAGS_ioctl32.o += -Ifs/
8endif 7endif
9ifeq ($(CONFIG_PPC32),y) 8ifeq ($(CONFIG_PPC32),y)
10CFLAGS_prom_init.o += -fPIC 9CFLAGS_prom_init.o += -fPIC
@@ -16,7 +15,7 @@ obj-y := semaphore.o cputable.o ptrace.o syscalls.o \
16obj-y += vdso32/ 15obj-y += vdso32/
17obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \ 16obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \
18 signal_64.o ptrace32.o systbl.o \ 17 signal_64.o ptrace32.o systbl.o \
19 paca.o ioctl32.o cpu_setup_power4.o \ 18 paca.o cpu_setup_power4.o \
20 firmware.o sysfs.o idle_64.o 19 firmware.o sysfs.o idle_64.o
21obj-$(CONFIG_PPC64) += vdso64/ 20obj-$(CONFIG_PPC64) += vdso64/
22obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o 21obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o
@@ -55,7 +54,7 @@ obj-$(CONFIG_BOOTX_TEXT) += btext.o
55obj-$(CONFIG_6xx) += idle_6xx.o 54obj-$(CONFIG_6xx) += idle_6xx.o
56obj-$(CONFIG_SMP) += smp.o 55obj-$(CONFIG_SMP) += smp.o
57obj-$(CONFIG_KPROBES) += kprobes.o 56obj-$(CONFIG_KPROBES) += kprobes.o
58obj-$(CONFIG_SERIAL_8250) += legacy_serial.o udbg_16550.o 57obj-$(CONFIG_PPC_UDBG_16550) += legacy_serial.o udbg_16550.o
59module-$(CONFIG_PPC64) += module_64.o 58module-$(CONFIG_PPC64) += module_64.o
60obj-$(CONFIG_MODULES) += $(module-y) 59obj-$(CONFIG_MODULES) += $(module-y)
61 60
diff --git a/arch/powerpc/kernel/ioctl32.c b/arch/powerpc/kernel/ioctl32.c
deleted file mode 100644
index 0fa3d27fef01..000000000000
--- a/arch/powerpc/kernel/ioctl32.c
+++ /dev/null
@@ -1,45 +0,0 @@
1/*
2 * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
3 *
4 * Based on sparc64 ioctl32.c by:
5 *
6 * Copyright (C) 1997-2000 Jakub Jelinek (jakub@redhat.com)
7 * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be)
8 *
9 * ppc64 changes:
10 *
11 * Copyright (C) 2000 Ken Aaker (kdaaker@rchland.vnet.ibm.com)
12 * Copyright (C) 2001 Anton Blanchard (antonb@au.ibm.com)
13 *
14 * These routines maintain argument size conversion between 32bit and 64bit
15 * ioctls.
16 *
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License
19 * as published by the Free Software Foundation; either version
20 * 2 of the License, or (at your option) any later version.
21 */
22
23#define INCLUDES
24#include "compat_ioctl.c"
25#include <linux/syscalls.h>
26
27#define CODE
28#include "compat_ioctl.c"
29
30#define HANDLE_IOCTL(cmd,handler) { cmd, (ioctl_trans_handler_t)handler, NULL },
31#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL(cmd,sys_ioctl)
32
33#define IOCTL_TABLE_START \
34 struct ioctl_trans ioctl_start[] = {
35#define IOCTL_TABLE_END \
36 };
37
38IOCTL_TABLE_START
39#include <linux/compat_ioctl.h>
40#define DECLARES
41#include "compat_ioctl.c"
42
43IOCTL_TABLE_END
44
45int ioctl_table_size = ARRAY_SIZE(ioctl_start);
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c
index 5368f9c2e6bf..27b0c40601fb 100644
--- a/arch/powerpc/kernel/kprobes.c
+++ b/arch/powerpc/kernel/kprobes.c
@@ -35,7 +35,6 @@
35#include <asm/kdebug.h> 35#include <asm/kdebug.h>
36#include <asm/sstep.h> 36#include <asm/sstep.h>
37 37
38static DECLARE_MUTEX(kprobe_mutex);
39DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; 38DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
40DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); 39DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
41 40
@@ -54,19 +53,17 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
54 53
55 /* insn must be on a special executable page on ppc64 */ 54 /* insn must be on a special executable page on ppc64 */
56 if (!ret) { 55 if (!ret) {
57 down(&kprobe_mutex);
58 p->ainsn.insn = get_insn_slot(); 56 p->ainsn.insn = get_insn_slot();
59 up(&kprobe_mutex);
60 if (!p->ainsn.insn) 57 if (!p->ainsn.insn)
61 ret = -ENOMEM; 58 ret = -ENOMEM;
62 } 59 }
63 return ret;
64}
65 60
66void __kprobes arch_copy_kprobe(struct kprobe *p) 61 if (!ret) {
67{ 62 memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t));
68 memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t)); 63 p->opcode = *p->addr;
69 p->opcode = *p->addr; 64 }
65
66 return ret;
70} 67}
71 68
72void __kprobes arch_arm_kprobe(struct kprobe *p) 69void __kprobes arch_arm_kprobe(struct kprobe *p)
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index fc60a773af7d..ba21a6c4f467 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -381,7 +381,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,
381 dev->subsystem_vendor = get_int_prop(node, "subsystem-vendor-id", 0); 381 dev->subsystem_vendor = get_int_prop(node, "subsystem-vendor-id", 0);
382 dev->subsystem_device = get_int_prop(node, "subsystem-id", 0); 382 dev->subsystem_device = get_int_prop(node, "subsystem-id", 0);
383 383
384 dev->cfg_size = 256; /*pci_cfg_space_size(dev);*/ 384 dev->cfg_size = pci_cfg_space_size(dev);
385 385
386 sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(bus), 386 sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(bus),
387 dev->bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn)); 387 dev->bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn));
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index b2758148a0de..16d9a904f3cb 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -244,7 +244,6 @@ EXPORT_SYMBOL(set_context);
244extern long mol_trampoline; 244extern long mol_trampoline;
245EXPORT_SYMBOL(mol_trampoline); /* For MOL */ 245EXPORT_SYMBOL(mol_trampoline); /* For MOL */
246EXPORT_SYMBOL(flush_hash_pages); /* For MOL */ 246EXPORT_SYMBOL(flush_hash_pages); /* For MOL */
247EXPORT_SYMBOL_GPL(__handle_mm_fault); /* For MOL */
248#ifdef CONFIG_SMP 247#ifdef CONFIG_SMP
249extern int mmu_hash_lock; 248extern int mmu_hash_lock;
250EXPORT_SYMBOL(mmu_hash_lock); /* For MOL */ 249EXPORT_SYMBOL(mmu_hash_lock); /* For MOL */
diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c
index 45b8109951fe..5579f6559912 100644
--- a/arch/powerpc/kernel/rtas_pci.c
+++ b/arch/powerpc/kernel/rtas_pci.c
@@ -72,7 +72,7 @@ static int of_device_available(struct device_node * dn)
72 return 0; 72 return 0;
73} 73}
74 74
75static int rtas_read_config(struct pci_dn *pdn, int where, int size, u32 *val) 75int rtas_read_config(struct pci_dn *pdn, int where, int size, u32 *val)
76{ 76{
77 int returnval = -1; 77 int returnval = -1;
78 unsigned long buid, addr; 78 unsigned long buid, addr;
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index e5d285adb496..db72a92943bf 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -299,9 +299,7 @@ void __init setup_arch(char **cmdline_p)
299 if (ppc_md.init_early) 299 if (ppc_md.init_early)
300 ppc_md.init_early(); 300 ppc_md.init_early();
301 301
302#ifdef CONFIG_SERIAL_8250
303 find_legacy_serial_ports(); 302 find_legacy_serial_ports();
304#endif
305 finish_device_tree(); 303 finish_device_tree();
306 304
307 smp_setup_cpu_maps(); 305 smp_setup_cpu_maps();
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 81567e931260..c4b76961d6de 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -472,9 +472,7 @@ void __init setup_system(void)
472 * hash table management for us, thus ioremap works. We do that early 472 * hash table management for us, thus ioremap works. We do that early
473 * so that further code can be debugged 473 * so that further code can be debugged
474 */ 474 */
475#ifdef CONFIG_SERIAL_8250
476 find_legacy_serial_ports(); 475 find_legacy_serial_ports();
477#endif
478 476
479 /* 477 /*
480 * "Finish" the device-tree, that is do the actual parsing of 478 * "Finish" the device-tree, that is do the actual parsing of
diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c
index 9c921d1c4084..475249dc2350 100644
--- a/arch/powerpc/kernel/sys_ppc32.c
+++ b/arch/powerpc/kernel/sys_ppc32.c
@@ -552,30 +552,6 @@ asmlinkage long compat_sys_sched_rr_get_interval(u32 pid, struct compat_timespec
552 return ret; 552 return ret;
553} 553}
554 554
555asmlinkage int compat_sys_pciconfig_read(u32 bus, u32 dfn, u32 off, u32 len, u32 ubuf)
556{
557 return sys_pciconfig_read((unsigned long) bus,
558 (unsigned long) dfn,
559 (unsigned long) off,
560 (unsigned long) len,
561 compat_ptr(ubuf));
562}
563
564asmlinkage int compat_sys_pciconfig_write(u32 bus, u32 dfn, u32 off, u32 len, u32 ubuf)
565{
566 return sys_pciconfig_write((unsigned long) bus,
567 (unsigned long) dfn,
568 (unsigned long) off,
569 (unsigned long) len,
570 compat_ptr(ubuf));
571}
572
573asmlinkage int compat_sys_pciconfig_iobase(u32 which, u32 in_bus, u32 in_devfn)
574{
575 return sys_pciconfig_iobase(which, in_bus, in_devfn);
576}
577
578
579/* Note: it is necessary to treat mode as an unsigned int, 555/* Note: it is necessary to treat mode as an unsigned int,
580 * with the corresponding cast to a signed int to insure that the 556 * with the corresponding cast to a signed int to insure that the
581 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 557 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -956,38 +932,6 @@ long ppc32_fadvise64(int fd, u32 unused, u32 offset_high, u32 offset_low,
956 advice); 932 advice);
957} 933}
958 934
959long ppc32_timer_create(clockid_t clock,
960 struct compat_sigevent __user *ev32,
961 timer_t __user *timer_id)
962{
963 sigevent_t event;
964 timer_t t;
965 long err;
966 mm_segment_t savefs;
967
968 if (ev32 == NULL)
969 return sys_timer_create(clock, NULL, timer_id);
970
971 if (get_compat_sigevent(&event, ev32))
972 return -EFAULT;
973
974 if (!access_ok(VERIFY_WRITE, timer_id, sizeof(timer_t)))
975 return -EFAULT;
976
977 savefs = get_fs();
978 set_fs(KERNEL_DS);
979 /* The __user pointer casts are valid due to the set_fs() */
980 err = sys_timer_create(clock,
981 (sigevent_t __user *) &event,
982 (timer_t __user *) &t);
983 set_fs(savefs);
984
985 if (err == 0)
986 err = __put_user(t, timer_id);
987
988 return err;
989}
990
991asmlinkage long compat_sys_add_key(const char __user *_type, 935asmlinkage long compat_sys_add_key(const char __user *_type,
992 const char __user *_description, 936 const char __user *_description,
993 const void __user *_payload, 937 const void __user *_payload,
diff --git a/arch/powerpc/kernel/systbl.S b/arch/powerpc/kernel/systbl.S
index 65463a1076e8..68013179a503 100644
--- a/arch/powerpc/kernel/systbl.S
+++ b/arch/powerpc/kernel/systbl.S
@@ -239,9 +239,9 @@ SYS32ONLY(ftruncate64)
239SYSX(sys_ni_syscall,sys_stat64,sys_stat64) 239SYSX(sys_ni_syscall,sys_stat64,sys_stat64)
240SYSX(sys_ni_syscall,sys_lstat64,sys_lstat64) 240SYSX(sys_ni_syscall,sys_lstat64,sys_lstat64)
241SYSX(sys_ni_syscall,sys_fstat64,sys_fstat64) 241SYSX(sys_ni_syscall,sys_fstat64,sys_fstat64)
242COMPAT_SYS(pciconfig_read) 242SYSCALL(pciconfig_read)
243COMPAT_SYS(pciconfig_write) 243SYSCALL(pciconfig_write)
244COMPAT_SYS(pciconfig_iobase) 244SYSCALL(pciconfig_iobase)
245SYSCALL(ni_syscall) 245SYSCALL(ni_syscall)
246SYSCALL(getdents64) 246SYSCALL(getdents64)
247SYSCALL(pivot_root) 247SYSCALL(pivot_root)
@@ -281,7 +281,7 @@ SYSCALL(epoll_create)
281SYSCALL(epoll_ctl) 281SYSCALL(epoll_ctl)
282SYSCALL(epoll_wait) 282SYSCALL(epoll_wait)
283SYSCALL(remap_file_pages) 283SYSCALL(remap_file_pages)
284SYSX(sys_timer_create,ppc32_timer_create,sys_timer_create) 284SYSX(sys_timer_create,compat_sys_timer_create,sys_timer_create)
285COMPAT_SYS(timer_settime) 285COMPAT_SYS(timer_settime)
286COMPAT_SYS(timer_gettime) 286COMPAT_SYS(timer_gettime)
287SYSCALL(timer_getoverrun) 287SYSCALL(timer_getoverrun)
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index 2ffca63602c5..7b278d83739e 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -174,7 +174,7 @@ void __iomem * __ioremap(unsigned long addr, unsigned long size,
174 pa = addr & PAGE_MASK; 174 pa = addr & PAGE_MASK;
175 size = PAGE_ALIGN(addr + size) - pa; 175 size = PAGE_ALIGN(addr + size) - pa;
176 176
177 if (size == 0) 177 if ((size == 0) || (pa == 0))
178 return NULL; 178 return NULL;
179 179
180 if (mem_init_done) { 180 if (mem_init_done) {
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index d2ba358c6e38..b3962c3a0348 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -138,7 +138,7 @@ static void spufs_prune_dir(struct dentry *dir)
138{ 138{
139 struct dentry *dentry, *tmp; 139 struct dentry *dentry, *tmp;
140 mutex_lock(&dir->d_inode->i_mutex); 140 mutex_lock(&dir->d_inode->i_mutex);
141 list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_child) { 141 list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_u.d_child) {
142 spin_lock(&dcache_lock); 142 spin_lock(&dcache_lock);
143 spin_lock(&dentry->d_lock); 143 spin_lock(&dentry->d_lock);
144 if (!(d_unhashed(dentry)) && dentry->d_inode) { 144 if (!(d_unhashed(dentry)) && dentry->d_inode) {
diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c
index dd73e38bfb7d..a1cb4d236720 100644
--- a/arch/powerpc/platforms/maple/setup.c
+++ b/arch/powerpc/platforms/maple/setup.c
@@ -71,9 +71,6 @@
71#define DBG(fmt...) 71#define DBG(fmt...)
72#endif 72#endif
73 73
74extern void generic_find_legacy_serial_ports(u64 *physport,
75 unsigned int *default_speed);
76
77static void maple_restart(char *cmd) 74static void maple_restart(char *cmd)
78{ 75{
79 unsigned int maple_nvram_base; 76 unsigned int maple_nvram_base;
diff --git a/arch/powerpc/platforms/pseries/Makefile b/arch/powerpc/platforms/pseries/Makefile
index 6accdd155505..61616d144072 100644
--- a/arch/powerpc/platforms/pseries/Makefile
+++ b/arch/powerpc/platforms/pseries/Makefile
@@ -4,7 +4,7 @@ obj-$(CONFIG_SMP) += smp.o
4obj-$(CONFIG_IBMVIO) += vio.o 4obj-$(CONFIG_IBMVIO) += vio.o
5obj-$(CONFIG_XICS) += xics.o 5obj-$(CONFIG_XICS) += xics.o
6obj-$(CONFIG_SCANLOG) += scanlog.o 6obj-$(CONFIG_SCANLOG) += scanlog.o
7obj-$(CONFIG_EEH) += eeh.o eeh_event.o 7obj-$(CONFIG_EEH) += eeh.o eeh_cache.o eeh_driver.o eeh_event.o
8 8
9obj-$(CONFIG_HVC_CONSOLE) += hvconsole.o 9obj-$(CONFIG_HVC_CONSOLE) += hvconsole.o
10obj-$(CONFIG_HVCS) += hvcserver.o 10obj-$(CONFIG_HVCS) += hvcserver.o
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index 7fbfd16d72b7..17cea7f2afd3 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -76,15 +76,14 @@
76 */ 76 */
77#define EEH_MAX_FAILS 100000 77#define EEH_MAX_FAILS 100000
78 78
79/* Misc forward declaraions */
80static void eeh_save_bars(struct pci_dev * pdev, struct pci_dn *pdn);
81
82/* RTAS tokens */ 79/* RTAS tokens */
83static int ibm_set_eeh_option; 80static int ibm_set_eeh_option;
84static int ibm_set_slot_reset; 81static int ibm_set_slot_reset;
85static int ibm_read_slot_reset_state; 82static int ibm_read_slot_reset_state;
86static int ibm_read_slot_reset_state2; 83static int ibm_read_slot_reset_state2;
87static int ibm_slot_error_detail; 84static int ibm_slot_error_detail;
85static int ibm_get_config_addr_info;
86static int ibm_configure_bridge;
88 87
89int eeh_subsystem_enabled; 88int eeh_subsystem_enabled;
90EXPORT_SYMBOL(eeh_subsystem_enabled); 89EXPORT_SYMBOL(eeh_subsystem_enabled);
@@ -98,308 +97,23 @@ static DEFINE_SPINLOCK(slot_errbuf_lock);
98static int eeh_error_buf_size; 97static int eeh_error_buf_size;
99 98
100/* System monitoring statistics */ 99/* System monitoring statistics */
101static DEFINE_PER_CPU(unsigned long, no_device); 100static unsigned long no_device;
102static DEFINE_PER_CPU(unsigned long, no_dn); 101static unsigned long no_dn;
103static DEFINE_PER_CPU(unsigned long, no_cfg_addr); 102static unsigned long no_cfg_addr;
104static DEFINE_PER_CPU(unsigned long, ignored_check); 103static unsigned long ignored_check;
105static DEFINE_PER_CPU(unsigned long, total_mmio_ffs); 104static unsigned long total_mmio_ffs;
106static DEFINE_PER_CPU(unsigned long, false_positives); 105static unsigned long false_positives;
107static DEFINE_PER_CPU(unsigned long, ignored_failures); 106static unsigned long ignored_failures;
108static DEFINE_PER_CPU(unsigned long, slot_resets); 107static unsigned long slot_resets;
109
110/**
111 * The pci address cache subsystem. This subsystem places
112 * PCI device address resources into a red-black tree, sorted
113 * according to the address range, so that given only an i/o
114 * address, the corresponding PCI device can be **quickly**
115 * found. It is safe to perform an address lookup in an interrupt
116 * context; this ability is an important feature.
117 *
118 * Currently, the only customer of this code is the EEH subsystem;
119 * thus, this code has been somewhat tailored to suit EEH better.
120 * In particular, the cache does *not* hold the addresses of devices
121 * for which EEH is not enabled.
122 *
123 * (Implementation Note: The RB tree seems to be better/faster
124 * than any hash algo I could think of for this problem, even
125 * with the penalty of slow pointer chases for d-cache misses).
126 */
127struct pci_io_addr_range
128{
129 struct rb_node rb_node;
130 unsigned long addr_lo;
131 unsigned long addr_hi;
132 struct pci_dev *pcidev;
133 unsigned int flags;
134};
135
136static struct pci_io_addr_cache
137{
138 struct rb_root rb_root;
139 spinlock_t piar_lock;
140} pci_io_addr_cache_root;
141
142static inline struct pci_dev *__pci_get_device_by_addr(unsigned long addr)
143{
144 struct rb_node *n = pci_io_addr_cache_root.rb_root.rb_node;
145
146 while (n) {
147 struct pci_io_addr_range *piar;
148 piar = rb_entry(n, struct pci_io_addr_range, rb_node);
149
150 if (addr < piar->addr_lo) {
151 n = n->rb_left;
152 } else {
153 if (addr > piar->addr_hi) {
154 n = n->rb_right;
155 } else {
156 pci_dev_get(piar->pcidev);
157 return piar->pcidev;
158 }
159 }
160 }
161
162 return NULL;
163}
164
165/**
166 * pci_get_device_by_addr - Get device, given only address
167 * @addr: mmio (PIO) phys address or i/o port number
168 *
169 * Given an mmio phys address, or a port number, find a pci device
170 * that implements this address. Be sure to pci_dev_put the device
171 * when finished. I/O port numbers are assumed to be offset
172 * from zero (that is, they do *not* have pci_io_addr added in).
173 * It is safe to call this function within an interrupt.
174 */
175static struct pci_dev *pci_get_device_by_addr(unsigned long addr)
176{
177 struct pci_dev *dev;
178 unsigned long flags;
179
180 spin_lock_irqsave(&pci_io_addr_cache_root.piar_lock, flags);
181 dev = __pci_get_device_by_addr(addr);
182 spin_unlock_irqrestore(&pci_io_addr_cache_root.piar_lock, flags);
183 return dev;
184}
185
186#ifdef DEBUG
187/*
188 * Handy-dandy debug print routine, does nothing more
189 * than print out the contents of our addr cache.
190 */
191static void pci_addr_cache_print(struct pci_io_addr_cache *cache)
192{
193 struct rb_node *n;
194 int cnt = 0;
195
196 n = rb_first(&cache->rb_root);
197 while (n) {
198 struct pci_io_addr_range *piar;
199 piar = rb_entry(n, struct pci_io_addr_range, rb_node);
200 printk(KERN_DEBUG "PCI: %s addr range %d [%lx-%lx]: %s\n",
201 (piar->flags & IORESOURCE_IO) ? "i/o" : "mem", cnt,
202 piar->addr_lo, piar->addr_hi, pci_name(piar->pcidev));
203 cnt++;
204 n = rb_next(n);
205 }
206}
207#endif
208
209/* Insert address range into the rb tree. */
210static struct pci_io_addr_range *
211pci_addr_cache_insert(struct pci_dev *dev, unsigned long alo,
212 unsigned long ahi, unsigned int flags)
213{
214 struct rb_node **p = &pci_io_addr_cache_root.rb_root.rb_node;
215 struct rb_node *parent = NULL;
216 struct pci_io_addr_range *piar;
217
218 /* Walk tree, find a place to insert into tree */
219 while (*p) {
220 parent = *p;
221 piar = rb_entry(parent, struct pci_io_addr_range, rb_node);
222 if (ahi < piar->addr_lo) {
223 p = &parent->rb_left;
224 } else if (alo > piar->addr_hi) {
225 p = &parent->rb_right;
226 } else {
227 if (dev != piar->pcidev ||
228 alo != piar->addr_lo || ahi != piar->addr_hi) {
229 printk(KERN_WARNING "PIAR: overlapping address range\n");
230 }
231 return piar;
232 }
233 }
234 piar = (struct pci_io_addr_range *)kmalloc(sizeof(struct pci_io_addr_range), GFP_ATOMIC);
235 if (!piar)
236 return NULL;
237 108
238 piar->addr_lo = alo; 109#define IS_BRIDGE(class_code) (((class_code)<<16) == PCI_BASE_CLASS_BRIDGE)
239 piar->addr_hi = ahi;
240 piar->pcidev = dev;
241 piar->flags = flags;
242
243#ifdef DEBUG
244 printk(KERN_DEBUG "PIAR: insert range=[%lx:%lx] dev=%s\n",
245 alo, ahi, pci_name (dev));
246#endif
247
248 rb_link_node(&piar->rb_node, parent, p);
249 rb_insert_color(&piar->rb_node, &pci_io_addr_cache_root.rb_root);
250
251 return piar;
252}
253
254static void __pci_addr_cache_insert_device(struct pci_dev *dev)
255{
256 struct device_node *dn;
257 struct pci_dn *pdn;
258 int i;
259 int inserted = 0;
260
261 dn = pci_device_to_OF_node(dev);
262 if (!dn) {
263 printk(KERN_WARNING "PCI: no pci dn found for dev=%s\n", pci_name(dev));
264 return;
265 }
266
267 /* Skip any devices for which EEH is not enabled. */
268 pdn = PCI_DN(dn);
269 if (!(pdn->eeh_mode & EEH_MODE_SUPPORTED) ||
270 pdn->eeh_mode & EEH_MODE_NOCHECK) {
271#ifdef DEBUG
272 printk(KERN_INFO "PCI: skip building address cache for=%s - %s\n",
273 pci_name(dev), pdn->node->full_name);
274#endif
275 return;
276 }
277
278 /* The cache holds a reference to the device... */
279 pci_dev_get(dev);
280
281 /* Walk resources on this device, poke them into the tree */
282 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
283 unsigned long start = pci_resource_start(dev,i);
284 unsigned long end = pci_resource_end(dev,i);
285 unsigned int flags = pci_resource_flags(dev,i);
286
287 /* We are interested only bus addresses, not dma or other stuff */
288 if (0 == (flags & (IORESOURCE_IO | IORESOURCE_MEM)))
289 continue;
290 if (start == 0 || ~start == 0 || end == 0 || ~end == 0)
291 continue;
292 pci_addr_cache_insert(dev, start, end, flags);
293 inserted = 1;
294 }
295
296 /* If there was nothing to add, the cache has no reference... */
297 if (!inserted)
298 pci_dev_put(dev);
299}
300
301/**
302 * pci_addr_cache_insert_device - Add a device to the address cache
303 * @dev: PCI device whose I/O addresses we are interested in.
304 *
305 * In order to support the fast lookup of devices based on addresses,
306 * we maintain a cache of devices that can be quickly searched.
307 * This routine adds a device to that cache.
308 */
309static void pci_addr_cache_insert_device(struct pci_dev *dev)
310{
311 unsigned long flags;
312
313 spin_lock_irqsave(&pci_io_addr_cache_root.piar_lock, flags);
314 __pci_addr_cache_insert_device(dev);
315 spin_unlock_irqrestore(&pci_io_addr_cache_root.piar_lock, flags);
316}
317
318static inline void __pci_addr_cache_remove_device(struct pci_dev *dev)
319{
320 struct rb_node *n;
321 int removed = 0;
322
323restart:
324 n = rb_first(&pci_io_addr_cache_root.rb_root);
325 while (n) {
326 struct pci_io_addr_range *piar;
327 piar = rb_entry(n, struct pci_io_addr_range, rb_node);
328
329 if (piar->pcidev == dev) {
330 rb_erase(n, &pci_io_addr_cache_root.rb_root);
331 removed = 1;
332 kfree(piar);
333 goto restart;
334 }
335 n = rb_next(n);
336 }
337
338 /* The cache no longer holds its reference to this device... */
339 if (removed)
340 pci_dev_put(dev);
341}
342
343/**
344 * pci_addr_cache_remove_device - remove pci device from addr cache
345 * @dev: device to remove
346 *
347 * Remove a device from the addr-cache tree.
348 * This is potentially expensive, since it will walk
349 * the tree multiple times (once per resource).
350 * But so what; device removal doesn't need to be that fast.
351 */
352static void pci_addr_cache_remove_device(struct pci_dev *dev)
353{
354 unsigned long flags;
355
356 spin_lock_irqsave(&pci_io_addr_cache_root.piar_lock, flags);
357 __pci_addr_cache_remove_device(dev);
358 spin_unlock_irqrestore(&pci_io_addr_cache_root.piar_lock, flags);
359}
360
361/**
362 * pci_addr_cache_build - Build a cache of I/O addresses
363 *
364 * Build a cache of pci i/o addresses. This cache will be used to
365 * find the pci device that corresponds to a given address.
366 * This routine scans all pci busses to build the cache.
367 * Must be run late in boot process, after the pci controllers
368 * have been scaned for devices (after all device resources are known).
369 */
370void __init pci_addr_cache_build(void)
371{
372 struct device_node *dn;
373 struct pci_dev *dev = NULL;
374
375 if (!eeh_subsystem_enabled)
376 return;
377
378 spin_lock_init(&pci_io_addr_cache_root.piar_lock);
379
380 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
381 /* Ignore PCI bridges ( XXX why ??) */
382 if ((dev->class >> 16) == PCI_BASE_CLASS_BRIDGE) {
383 continue;
384 }
385 pci_addr_cache_insert_device(dev);
386
387 /* Save the BAR's; firmware doesn't restore these after EEH reset */
388 dn = pci_device_to_OF_node(dev);
389 eeh_save_bars(dev, PCI_DN(dn));
390 }
391
392#ifdef DEBUG
393 /* Verify tree built up above, echo back the list of addrs. */
394 pci_addr_cache_print(&pci_io_addr_cache_root);
395#endif
396}
397 110
398/* --------------------------------------------------------------- */ 111/* --------------------------------------------------------------- */
399/* Above lies the PCI Address Cache. Below lies the EEH event infrastructure */ 112/* Below lies the EEH event infrastructure */
400 113
401void eeh_slot_error_detail (struct pci_dn *pdn, int severity) 114void eeh_slot_error_detail (struct pci_dn *pdn, int severity)
402{ 115{
116 int config_addr;
403 unsigned long flags; 117 unsigned long flags;
404 int rc; 118 int rc;
405 119
@@ -407,8 +121,13 @@ void eeh_slot_error_detail (struct pci_dn *pdn, int severity)
407 spin_lock_irqsave(&slot_errbuf_lock, flags); 121 spin_lock_irqsave(&slot_errbuf_lock, flags);
408 memset(slot_errbuf, 0, eeh_error_buf_size); 122 memset(slot_errbuf, 0, eeh_error_buf_size);
409 123
124 /* Use PE configuration address, if present */
125 config_addr = pdn->eeh_config_addr;
126 if (pdn->eeh_pe_config_addr)
127 config_addr = pdn->eeh_pe_config_addr;
128
410 rc = rtas_call(ibm_slot_error_detail, 129 rc = rtas_call(ibm_slot_error_detail,
411 8, 1, NULL, pdn->eeh_config_addr, 130 8, 1, NULL, config_addr,
412 BUID_HI(pdn->phb->buid), 131 BUID_HI(pdn->phb->buid),
413 BUID_LO(pdn->phb->buid), NULL, 0, 132 BUID_LO(pdn->phb->buid), NULL, 0,
414 virt_to_phys(slot_errbuf), 133 virt_to_phys(slot_errbuf),
@@ -428,6 +147,7 @@ void eeh_slot_error_detail (struct pci_dn *pdn, int severity)
428static int read_slot_reset_state(struct pci_dn *pdn, int rets[]) 147static int read_slot_reset_state(struct pci_dn *pdn, int rets[])
429{ 148{
430 int token, outputs; 149 int token, outputs;
150 int config_addr;
431 151
432 if (ibm_read_slot_reset_state2 != RTAS_UNKNOWN_SERVICE) { 152 if (ibm_read_slot_reset_state2 != RTAS_UNKNOWN_SERVICE) {
433 token = ibm_read_slot_reset_state2; 153 token = ibm_read_slot_reset_state2;
@@ -438,7 +158,12 @@ static int read_slot_reset_state(struct pci_dn *pdn, int rets[])
438 outputs = 3; 158 outputs = 3;
439 } 159 }
440 160
441 return rtas_call(token, 3, outputs, rets, pdn->eeh_config_addr, 161 /* Use PE configuration address, if present */
162 config_addr = pdn->eeh_config_addr;
163 if (pdn->eeh_pe_config_addr)
164 config_addr = pdn->eeh_pe_config_addr;
165
166 return rtas_call(token, 3, outputs, rets, config_addr,
442 BUID_HI(pdn->phb->buid), BUID_LO(pdn->phb->buid)); 167 BUID_HI(pdn->phb->buid), BUID_LO(pdn->phb->buid));
443} 168}
444 169
@@ -462,7 +187,7 @@ static inline unsigned long eeh_token_to_phys(unsigned long token)
462/** 187/**
463 * Return the "partitionable endpoint" (pe) under which this device lies 188 * Return the "partitionable endpoint" (pe) under which this device lies
464 */ 189 */
465static struct device_node * find_device_pe(struct device_node *dn) 190struct device_node * find_device_pe(struct device_node *dn)
466{ 191{
467 while ((dn->parent) && PCI_DN(dn->parent) && 192 while ((dn->parent) && PCI_DN(dn->parent) &&
468 (PCI_DN(dn->parent)->eeh_mode & EEH_MODE_SUPPORTED)) { 193 (PCI_DN(dn->parent)->eeh_mode & EEH_MODE_SUPPORTED)) {
@@ -485,6 +210,11 @@ static void __eeh_mark_slot (struct device_node *dn, int mode_flag)
485 if (PCI_DN(dn)) { 210 if (PCI_DN(dn)) {
486 PCI_DN(dn)->eeh_mode |= mode_flag; 211 PCI_DN(dn)->eeh_mode |= mode_flag;
487 212
213 /* Mark the pci device driver too */
214 struct pci_dev *dev = PCI_DN(dn)->pcidev;
215 if (dev && dev->driver)
216 dev->error_state = pci_channel_io_frozen;
217
488 if (dn->child) 218 if (dn->child)
489 __eeh_mark_slot (dn->child, mode_flag); 219 __eeh_mark_slot (dn->child, mode_flag);
490 } 220 }
@@ -495,6 +225,11 @@ static void __eeh_mark_slot (struct device_node *dn, int mode_flag)
495void eeh_mark_slot (struct device_node *dn, int mode_flag) 225void eeh_mark_slot (struct device_node *dn, int mode_flag)
496{ 226{
497 dn = find_device_pe (dn); 227 dn = find_device_pe (dn);
228
229 /* Back up one, since config addrs might be shared */
230 if (PCI_DN(dn) && PCI_DN(dn)->eeh_pe_config_addr)
231 dn = dn->parent;
232
498 PCI_DN(dn)->eeh_mode |= mode_flag; 233 PCI_DN(dn)->eeh_mode |= mode_flag;
499 __eeh_mark_slot (dn->child, mode_flag); 234 __eeh_mark_slot (dn->child, mode_flag);
500} 235}
@@ -516,7 +251,13 @@ void eeh_clear_slot (struct device_node *dn, int mode_flag)
516{ 251{
517 unsigned long flags; 252 unsigned long flags;
518 spin_lock_irqsave(&confirm_error_lock, flags); 253 spin_lock_irqsave(&confirm_error_lock, flags);
254
519 dn = find_device_pe (dn); 255 dn = find_device_pe (dn);
256
257 /* Back up one, since config addrs might be shared */
258 if (PCI_DN(dn) && PCI_DN(dn)->eeh_pe_config_addr)
259 dn = dn->parent;
260
520 PCI_DN(dn)->eeh_mode &= ~mode_flag; 261 PCI_DN(dn)->eeh_mode &= ~mode_flag;
521 PCI_DN(dn)->eeh_check_count = 0; 262 PCI_DN(dn)->eeh_check_count = 0;
522 __eeh_clear_slot (dn->child, mode_flag); 263 __eeh_clear_slot (dn->child, mode_flag);
@@ -544,15 +285,16 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
544 int rets[3]; 285 int rets[3];
545 unsigned long flags; 286 unsigned long flags;
546 struct pci_dn *pdn; 287 struct pci_dn *pdn;
288 enum pci_channel_state state;
547 int rc = 0; 289 int rc = 0;
548 290
549 __get_cpu_var(total_mmio_ffs)++; 291 total_mmio_ffs++;
550 292
551 if (!eeh_subsystem_enabled) 293 if (!eeh_subsystem_enabled)
552 return 0; 294 return 0;
553 295
554 if (!dn) { 296 if (!dn) {
555 __get_cpu_var(no_dn)++; 297 no_dn++;
556 return 0; 298 return 0;
557 } 299 }
558 pdn = PCI_DN(dn); 300 pdn = PCI_DN(dn);
@@ -560,7 +302,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
560 /* Access to IO BARs might get this far and still not want checking. */ 302 /* Access to IO BARs might get this far and still not want checking. */
561 if (!(pdn->eeh_mode & EEH_MODE_SUPPORTED) || 303 if (!(pdn->eeh_mode & EEH_MODE_SUPPORTED) ||
562 pdn->eeh_mode & EEH_MODE_NOCHECK) { 304 pdn->eeh_mode & EEH_MODE_NOCHECK) {
563 __get_cpu_var(ignored_check)++; 305 ignored_check++;
564#ifdef DEBUG 306#ifdef DEBUG
565 printk ("EEH:ignored check (%x) for %s %s\n", 307 printk ("EEH:ignored check (%x) for %s %s\n",
566 pdn->eeh_mode, pci_name (dev), dn->full_name); 308 pdn->eeh_mode, pci_name (dev), dn->full_name);
@@ -568,8 +310,8 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
568 return 0; 310 return 0;
569 } 311 }
570 312
571 if (!pdn->eeh_config_addr) { 313 if (!pdn->eeh_config_addr && !pdn->eeh_pe_config_addr) {
572 __get_cpu_var(no_cfg_addr)++; 314 no_cfg_addr++;
573 return 0; 315 return 0;
574 } 316 }
575 317
@@ -611,7 +353,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
611 if (ret != 0) { 353 if (ret != 0) {
612 printk(KERN_WARNING "EEH: read_slot_reset_state() failed; rc=%d dn=%s\n", 354 printk(KERN_WARNING "EEH: read_slot_reset_state() failed; rc=%d dn=%s\n",
613 ret, dn->full_name); 355 ret, dn->full_name);
614 __get_cpu_var(false_positives)++; 356 false_positives++;
615 rc = 0; 357 rc = 0;
616 goto dn_unlock; 358 goto dn_unlock;
617 } 359 }
@@ -620,14 +362,14 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
620 if (rets[1] != 1) { 362 if (rets[1] != 1) {
621 printk(KERN_WARNING "EEH: event on unsupported device, rc=%d dn=%s\n", 363 printk(KERN_WARNING "EEH: event on unsupported device, rc=%d dn=%s\n",
622 ret, dn->full_name); 364 ret, dn->full_name);
623 __get_cpu_var(false_positives)++; 365 false_positives++;
624 rc = 0; 366 rc = 0;
625 goto dn_unlock; 367 goto dn_unlock;
626 } 368 }
627 369
628 /* If not the kind of error we know about, punt. */ 370 /* If not the kind of error we know about, punt. */
629 if (rets[0] != 2 && rets[0] != 4 && rets[0] != 5) { 371 if (rets[0] != 2 && rets[0] != 4 && rets[0] != 5) {
630 __get_cpu_var(false_positives)++; 372 false_positives++;
631 rc = 0; 373 rc = 0;
632 goto dn_unlock; 374 goto dn_unlock;
633 } 375 }
@@ -635,12 +377,12 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
635 /* Note that config-io to empty slots may fail; 377 /* Note that config-io to empty slots may fail;
636 * we recognize empty because they don't have children. */ 378 * we recognize empty because they don't have children. */
637 if ((rets[0] == 5) && (dn->child == NULL)) { 379 if ((rets[0] == 5) && (dn->child == NULL)) {
638 __get_cpu_var(false_positives)++; 380 false_positives++;
639 rc = 0; 381 rc = 0;
640 goto dn_unlock; 382 goto dn_unlock;
641 } 383 }
642 384
643 __get_cpu_var(slot_resets)++; 385 slot_resets++;
644 386
645 /* Avoid repeated reports of this failure, including problems 387 /* Avoid repeated reports of this failure, including problems
646 * with other functions on this device, and functions under 388 * with other functions on this device, and functions under
@@ -648,8 +390,13 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
648 eeh_mark_slot (dn, EEH_MODE_ISOLATED); 390 eeh_mark_slot (dn, EEH_MODE_ISOLATED);
649 spin_unlock_irqrestore(&confirm_error_lock, flags); 391 spin_unlock_irqrestore(&confirm_error_lock, flags);
650 392
651 eeh_send_failure_event (dn, dev, rets[0], rets[2]); 393 state = pci_channel_io_normal;
652 394 if ((rets[0] == 2) || (rets[0] == 4))
395 state = pci_channel_io_frozen;
396 if (rets[0] == 5)
397 state = pci_channel_io_perm_failure;
398 eeh_send_failure_event (dn, dev, state, rets[2]);
399
653 /* Most EEH events are due to device driver bugs. Having 400 /* Most EEH events are due to device driver bugs. Having
654 * a stack trace will help the device-driver authors figure 401 * a stack trace will help the device-driver authors figure
655 * out what happened. So print that out. */ 402 * out what happened. So print that out. */
@@ -685,7 +432,7 @@ unsigned long eeh_check_failure(const volatile void __iomem *token, unsigned lon
685 addr = eeh_token_to_phys((unsigned long __force) token); 432 addr = eeh_token_to_phys((unsigned long __force) token);
686 dev = pci_get_device_by_addr(addr); 433 dev = pci_get_device_by_addr(addr);
687 if (!dev) { 434 if (!dev) {
688 __get_cpu_var(no_device)++; 435 no_device++;
689 return val; 436 return val;
690 } 437 }
691 438
@@ -716,11 +463,16 @@ eeh_slot_availability(struct pci_dn *pdn)
716 if (rc) return rc; 463 if (rc) return rc;
717 464
718 if (rets[1] == 0) return -1; /* EEH is not supported */ 465 if (rets[1] == 0) return -1; /* EEH is not supported */
719 if (rets[0] == 0) return 0; /* Oll Korrect */ 466 if (rets[0] == 0) return 0; /* Oll Korrect */
720 if (rets[0] == 5) { 467 if (rets[0] == 5) {
721 if (rets[2] == 0) return -1; /* permanently unavailable */ 468 if (rets[2] == 0) return -1; /* permanently unavailable */
722 return rets[2]; /* number of millisecs to wait */ 469 return rets[2]; /* number of millisecs to wait */
723 } 470 }
471 if (rets[0] == 1)
472 return 250;
473
474 printk (KERN_ERR "EEH: Slot unavailable: rc=%d, rets=%d %d %d\n",
475 rc, rets[0], rets[1], rets[2]);
724 return -1; 476 return -1;
725} 477}
726 478
@@ -737,6 +489,7 @@ eeh_slot_availability(struct pci_dn *pdn)
737static void 489static void
738rtas_pci_slot_reset(struct pci_dn *pdn, int state) 490rtas_pci_slot_reset(struct pci_dn *pdn, int state)
739{ 491{
492 int config_addr;
740 int rc; 493 int rc;
741 494
742 BUG_ON (pdn==NULL); 495 BUG_ON (pdn==NULL);
@@ -747,8 +500,13 @@ rtas_pci_slot_reset(struct pci_dn *pdn, int state)
747 return; 500 return;
748 } 501 }
749 502
503 /* Use PE configuration address, if present */
504 config_addr = pdn->eeh_config_addr;
505 if (pdn->eeh_pe_config_addr)
506 config_addr = pdn->eeh_pe_config_addr;
507
750 rc = rtas_call(ibm_set_slot_reset,4,1, NULL, 508 rc = rtas_call(ibm_set_slot_reset,4,1, NULL,
751 pdn->eeh_config_addr, 509 config_addr,
752 BUID_HI(pdn->phb->buid), 510 BUID_HI(pdn->phb->buid),
753 BUID_LO(pdn->phb->buid), 511 BUID_LO(pdn->phb->buid),
754 state); 512 state);
@@ -761,9 +519,11 @@ rtas_pci_slot_reset(struct pci_dn *pdn, int state)
761 519
762/** rtas_set_slot_reset -- assert the pci #RST line for 1/4 second 520/** rtas_set_slot_reset -- assert the pci #RST line for 1/4 second
763 * dn -- device node to be reset. 521 * dn -- device node to be reset.
522 *
523 * Return 0 if success, else a non-zero value.
764 */ 524 */
765 525
766void 526int
767rtas_set_slot_reset(struct pci_dn *pdn) 527rtas_set_slot_reset(struct pci_dn *pdn)
768{ 528{
769 int i, rc; 529 int i, rc;
@@ -793,10 +553,21 @@ rtas_set_slot_reset(struct pci_dn *pdn)
793 * ready to be used; if not, wait for recovery. */ 553 * ready to be used; if not, wait for recovery. */
794 for (i=0; i<10; i++) { 554 for (i=0; i<10; i++) {
795 rc = eeh_slot_availability (pdn); 555 rc = eeh_slot_availability (pdn);
796 if (rc <= 0) break; 556 if (rc < 0)
557 printk (KERN_ERR "EEH: failed (%d) to reset slot %s\n", rc, pdn->node->full_name);
558 if (rc == 0)
559 return 0;
560 if (rc < 0)
561 return -1;
797 562
798 msleep (rc+100); 563 msleep (rc+100);
799 } 564 }
565
566 rc = eeh_slot_availability (pdn);
567 if (rc)
568 printk (KERN_ERR "EEH: timeout resetting slot %s\n", pdn->node->full_name);
569
570 return rc;
800} 571}
801 572
802/* ------------------------------------------------------- */ 573/* ------------------------------------------------------- */
@@ -851,7 +622,7 @@ void eeh_restore_bars(struct pci_dn *pdn)
851 if (!pdn) 622 if (!pdn)
852 return; 623 return;
853 624
854 if (! pdn->eeh_is_bridge) 625 if ((pdn->eeh_mode & EEH_MODE_SUPPORTED) && !IS_BRIDGE(pdn->class_code))
855 __restore_bars (pdn); 626 __restore_bars (pdn);
856 627
857 dn = pdn->node->child; 628 dn = pdn->node->child;
@@ -869,30 +640,30 @@ void eeh_restore_bars(struct pci_dn *pdn)
869 * PCI devices are added individuallly; but, for the restore, 640 * PCI devices are added individuallly; but, for the restore,
870 * an entire slot is reset at a time. 641 * an entire slot is reset at a time.
871 */ 642 */
872static void eeh_save_bars(struct pci_dev * pdev, struct pci_dn *pdn) 643static void eeh_save_bars(struct pci_dn *pdn)
873{ 644{
874 int i; 645 int i;
875 646
876 if (!pdev || !pdn ) 647 if (!pdn )
877 return; 648 return;
878 649
879 for (i = 0; i < 16; i++) 650 for (i = 0; i < 16; i++)
880 pci_read_config_dword(pdev, i * 4, &pdn->config_space[i]); 651 rtas_read_config(pdn, i * 4, 4, &pdn->config_space[i]);
881
882 if (pdev->hdr_type == PCI_HEADER_TYPE_BRIDGE)
883 pdn->eeh_is_bridge = 1;
884} 652}
885 653
886void 654void
887rtas_configure_bridge(struct pci_dn *pdn) 655rtas_configure_bridge(struct pci_dn *pdn)
888{ 656{
889 int token = rtas_token ("ibm,configure-bridge"); 657 int config_addr;
890 int rc; 658 int rc;
891 659
892 if (token == RTAS_UNKNOWN_SERVICE) 660 /* Use PE configuration address, if present */
893 return; 661 config_addr = pdn->eeh_config_addr;
894 rc = rtas_call(token,3,1, NULL, 662 if (pdn->eeh_pe_config_addr)
895 pdn->eeh_config_addr, 663 config_addr = pdn->eeh_pe_config_addr;
664
665 rc = rtas_call(ibm_configure_bridge,3,1, NULL,
666 config_addr,
896 BUID_HI(pdn->phb->buid), 667 BUID_HI(pdn->phb->buid),
897 BUID_LO(pdn->phb->buid)); 668 BUID_LO(pdn->phb->buid));
898 if (rc) { 669 if (rc) {
@@ -927,6 +698,7 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
927 int enable; 698 int enable;
928 struct pci_dn *pdn = PCI_DN(dn); 699 struct pci_dn *pdn = PCI_DN(dn);
929 700
701 pdn->class_code = 0;
930 pdn->eeh_mode = 0; 702 pdn->eeh_mode = 0;
931 pdn->eeh_check_count = 0; 703 pdn->eeh_check_count = 0;
932 pdn->eeh_freeze_count = 0; 704 pdn->eeh_freeze_count = 0;
@@ -943,6 +715,7 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
943 pdn->eeh_mode |= EEH_MODE_NOCHECK; 715 pdn->eeh_mode |= EEH_MODE_NOCHECK;
944 return NULL; 716 return NULL;
945 } 717 }
718 pdn->class_code = *class_code;
946 719
947 /* 720 /*
948 * Now decide if we are going to "Disable" EEH checking 721 * Now decide if we are going to "Disable" EEH checking
@@ -953,8 +726,10 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
953 * But there are a few cases like display devices that make sense. 726 * But there are a few cases like display devices that make sense.
954 */ 727 */
955 enable = 1; /* i.e. we will do checking */ 728 enable = 1; /* i.e. we will do checking */
729#if 0
956 if ((*class_code >> 16) == PCI_BASE_CLASS_DISPLAY) 730 if ((*class_code >> 16) == PCI_BASE_CLASS_DISPLAY)
957 enable = 0; 731 enable = 0;
732#endif
958 733
959 if (!enable) 734 if (!enable)
960 pdn->eeh_mode |= EEH_MODE_NOCHECK; 735 pdn->eeh_mode |= EEH_MODE_NOCHECK;
@@ -973,8 +748,22 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
973 eeh_subsystem_enabled = 1; 748 eeh_subsystem_enabled = 1;
974 pdn->eeh_mode |= EEH_MODE_SUPPORTED; 749 pdn->eeh_mode |= EEH_MODE_SUPPORTED;
975 pdn->eeh_config_addr = regs[0]; 750 pdn->eeh_config_addr = regs[0];
751
752 /* If the newer, better, ibm,get-config-addr-info is supported,
753 * then use that instead. */
754 pdn->eeh_pe_config_addr = 0;
755 if (ibm_get_config_addr_info != RTAS_UNKNOWN_SERVICE) {
756 unsigned int rets[2];
757 ret = rtas_call (ibm_get_config_addr_info, 4, 2, rets,
758 pdn->eeh_config_addr,
759 info->buid_hi, info->buid_lo,
760 0);
761 if (ret == 0)
762 pdn->eeh_pe_config_addr = rets[0];
763 }
976#ifdef DEBUG 764#ifdef DEBUG
977 printk(KERN_DEBUG "EEH: %s: eeh enabled\n", dn->full_name); 765 printk(KERN_DEBUG "EEH: %s: eeh enabled, config=%x pe_config=%x\n",
766 dn->full_name, pdn->eeh_config_addr, pdn->eeh_pe_config_addr);
978#endif 767#endif
979 } else { 768 } else {
980 769
@@ -993,6 +782,7 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
993 dn->full_name); 782 dn->full_name);
994 } 783 }
995 784
785 eeh_save_bars(pdn);
996 return NULL; 786 return NULL;
997} 787}
998 788
@@ -1026,6 +816,8 @@ void __init eeh_init(void)
1026 ibm_read_slot_reset_state2 = rtas_token("ibm,read-slot-reset-state2"); 816 ibm_read_slot_reset_state2 = rtas_token("ibm,read-slot-reset-state2");
1027 ibm_read_slot_reset_state = rtas_token("ibm,read-slot-reset-state"); 817 ibm_read_slot_reset_state = rtas_token("ibm,read-slot-reset-state");
1028 ibm_slot_error_detail = rtas_token("ibm,slot-error-detail"); 818 ibm_slot_error_detail = rtas_token("ibm,slot-error-detail");
819 ibm_get_config_addr_info = rtas_token("ibm,get-config-addr-info");
820 ibm_configure_bridge = rtas_token ("ibm,configure-bridge");
1029 821
1030 if (ibm_set_eeh_option == RTAS_UNKNOWN_SERVICE) 822 if (ibm_set_eeh_option == RTAS_UNKNOWN_SERVICE)
1031 return; 823 return;
@@ -1080,12 +872,10 @@ void eeh_add_device_early(struct device_node *dn)
1080 if (!dn || !PCI_DN(dn)) 872 if (!dn || !PCI_DN(dn))
1081 return; 873 return;
1082 phb = PCI_DN(dn)->phb; 874 phb = PCI_DN(dn)->phb;
1083 if (NULL == phb || 0 == phb->buid) { 875
1084 printk(KERN_WARNING "EEH: Expected buid but found none for %s\n", 876 /* USB Bus children of PCI devices will not have BUID's */
1085 dn->full_name); 877 if (NULL == phb || 0 == phb->buid)
1086 dump_stack();
1087 return; 878 return;
1088 }
1089 879
1090 info.buid_hi = BUID_HI(phb->buid); 880 info.buid_hi = BUID_HI(phb->buid);
1091 info.buid_lo = BUID_LO(phb->buid); 881 info.buid_lo = BUID_LO(phb->buid);
@@ -1127,7 +917,6 @@ void eeh_add_device_late(struct pci_dev *dev)
1127 pdn->pcidev = dev; 917 pdn->pcidev = dev;
1128 918
1129 pci_addr_cache_insert_device (dev); 919 pci_addr_cache_insert_device (dev);
1130 eeh_save_bars(dev, pdn);
1131} 920}
1132EXPORT_SYMBOL_GPL(eeh_add_device_late); 921EXPORT_SYMBOL_GPL(eeh_add_device_late);
1133 922
@@ -1175,25 +964,9 @@ EXPORT_SYMBOL_GPL(eeh_remove_bus_device);
1175 964
1176static int proc_eeh_show(struct seq_file *m, void *v) 965static int proc_eeh_show(struct seq_file *m, void *v)
1177{ 966{
1178 unsigned int cpu;
1179 unsigned long ffs = 0, positives = 0, failures = 0;
1180 unsigned long resets = 0;
1181 unsigned long no_dev = 0, no_dn = 0, no_cfg = 0, no_check = 0;
1182
1183 for_each_cpu(cpu) {
1184 ffs += per_cpu(total_mmio_ffs, cpu);
1185 positives += per_cpu(false_positives, cpu);
1186 failures += per_cpu(ignored_failures, cpu);
1187 resets += per_cpu(slot_resets, cpu);
1188 no_dev += per_cpu(no_device, cpu);
1189 no_dn += per_cpu(no_dn, cpu);
1190 no_cfg += per_cpu(no_cfg_addr, cpu);
1191 no_check += per_cpu(ignored_check, cpu);
1192 }
1193
1194 if (0 == eeh_subsystem_enabled) { 967 if (0 == eeh_subsystem_enabled) {
1195 seq_printf(m, "EEH Subsystem is globally disabled\n"); 968 seq_printf(m, "EEH Subsystem is globally disabled\n");
1196 seq_printf(m, "eeh_total_mmio_ffs=%ld\n", ffs); 969 seq_printf(m, "eeh_total_mmio_ffs=%ld\n", total_mmio_ffs);
1197 } else { 970 } else {
1198 seq_printf(m, "EEH Subsystem is enabled\n"); 971 seq_printf(m, "EEH Subsystem is enabled\n");
1199 seq_printf(m, 972 seq_printf(m,
@@ -1205,8 +978,10 @@ static int proc_eeh_show(struct seq_file *m, void *v)
1205 "eeh_false_positives=%ld\n" 978 "eeh_false_positives=%ld\n"
1206 "eeh_ignored_failures=%ld\n" 979 "eeh_ignored_failures=%ld\n"
1207 "eeh_slot_resets=%ld\n", 980 "eeh_slot_resets=%ld\n",
1208 no_dev, no_dn, no_cfg, no_check, 981 no_device, no_dn, no_cfg_addr,
1209 ffs, positives, failures, resets); 982 ignored_check, total_mmio_ffs,
983 false_positives, ignored_failures,
984 slot_resets);
1210 } 985 }
1211 986
1212 return 0; 987 return 0;
diff --git a/arch/powerpc/platforms/pseries/eeh_cache.c b/arch/powerpc/platforms/pseries/eeh_cache.c
new file mode 100644
index 000000000000..d4a402c5866c
--- /dev/null
+++ b/arch/powerpc/platforms/pseries/eeh_cache.c
@@ -0,0 +1,316 @@
1/*
2 * eeh_cache.c
3 * PCI address cache; allows the lookup of PCI devices based on I/O address
4 *
5 * Copyright (C) 2004 Linas Vepstas <linas@austin.ibm.com> IBM Corporation
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22#include <linux/list.h>
23#include <linux/pci.h>
24#include <linux/rbtree.h>
25#include <linux/spinlock.h>
26#include <asm/atomic.h>
27#include <asm/pci-bridge.h>
28#include <asm/ppc-pci.h>
29
30#undef DEBUG
31
32/**
33 * The pci address cache subsystem. This subsystem places
34 * PCI device address resources into a red-black tree, sorted
35 * according to the address range, so that given only an i/o
36 * address, the corresponding PCI device can be **quickly**
37 * found. It is safe to perform an address lookup in an interrupt
38 * context; this ability is an important feature.
39 *
40 * Currently, the only customer of this code is the EEH subsystem;
41 * thus, this code has been somewhat tailored to suit EEH better.
42 * In particular, the cache does *not* hold the addresses of devices
43 * for which EEH is not enabled.
44 *
45 * (Implementation Note: The RB tree seems to be better/faster
46 * than any hash algo I could think of for this problem, even
47 * with the penalty of slow pointer chases for d-cache misses).
48 */
49struct pci_io_addr_range
50{
51 struct rb_node rb_node;
52 unsigned long addr_lo;
53 unsigned long addr_hi;
54 struct pci_dev *pcidev;
55 unsigned int flags;
56};
57
58static struct pci_io_addr_cache
59{
60 struct rb_root rb_root;
61 spinlock_t piar_lock;
62} pci_io_addr_cache_root;
63
64static inline struct pci_dev *__pci_get_device_by_addr(unsigned long addr)
65{
66 struct rb_node *n = pci_io_addr_cache_root.rb_root.rb_node;
67
68 while (n) {
69 struct pci_io_addr_range *piar;
70 piar = rb_entry(n, struct pci_io_addr_range, rb_node);
71
72 if (addr < piar->addr_lo) {
73 n = n->rb_left;
74 } else {
75 if (addr > piar->addr_hi) {
76 n = n->rb_right;
77 } else {
78 pci_dev_get(piar->pcidev);
79 return piar->pcidev;
80 }
81 }
82 }
83
84 return NULL;
85}
86
87/**
88 * pci_get_device_by_addr - Get device, given only address
89 * @addr: mmio (PIO) phys address or i/o port number
90 *
91 * Given an mmio phys address, or a port number, find a pci device
92 * that implements this address. Be sure to pci_dev_put the device
93 * when finished. I/O port numbers are assumed to be offset
94 * from zero (that is, they do *not* have pci_io_addr added in).
95 * It is safe to call this function within an interrupt.
96 */
97struct pci_dev *pci_get_device_by_addr(unsigned long addr)
98{
99 struct pci_dev *dev;
100 unsigned long flags;
101
102 spin_lock_irqsave(&pci_io_addr_cache_root.piar_lock, flags);
103 dev = __pci_get_device_by_addr(addr);
104 spin_unlock_irqrestore(&pci_io_addr_cache_root.piar_lock, flags);
105 return dev;
106}
107
108#ifdef DEBUG
109/*
110 * Handy-dandy debug print routine, does nothing more
111 * than print out the contents of our addr cache.
112 */
113static void pci_addr_cache_print(struct pci_io_addr_cache *cache)
114{
115 struct rb_node *n;
116 int cnt = 0;
117
118 n = rb_first(&cache->rb_root);
119 while (n) {
120 struct pci_io_addr_range *piar;
121 piar = rb_entry(n, struct pci_io_addr_range, rb_node);
122 printk(KERN_DEBUG "PCI: %s addr range %d [%lx-%lx]: %s\n",
123 (piar->flags & IORESOURCE_IO) ? "i/o" : "mem", cnt,
124 piar->addr_lo, piar->addr_hi, pci_name(piar->pcidev));
125 cnt++;
126 n = rb_next(n);
127 }
128}
129#endif
130
131/* Insert address range into the rb tree. */
132static struct pci_io_addr_range *
133pci_addr_cache_insert(struct pci_dev *dev, unsigned long alo,
134 unsigned long ahi, unsigned int flags)
135{
136 struct rb_node **p = &pci_io_addr_cache_root.rb_root.rb_node;
137 struct rb_node *parent = NULL;
138 struct pci_io_addr_range *piar;
139
140 /* Walk tree, find a place to insert into tree */
141 while (*p) {
142 parent = *p;
143 piar = rb_entry(parent, struct pci_io_addr_range, rb_node);
144 if (ahi < piar->addr_lo) {
145 p = &parent->rb_left;
146 } else if (alo > piar->addr_hi) {
147 p = &parent->rb_right;
148 } else {
149 if (dev != piar->pcidev ||
150 alo != piar->addr_lo || ahi != piar->addr_hi) {
151 printk(KERN_WARNING "PIAR: overlapping address range\n");
152 }
153 return piar;
154 }
155 }
156 piar = (struct pci_io_addr_range *)kmalloc(sizeof(struct pci_io_addr_range), GFP_ATOMIC);
157 if (!piar)
158 return NULL;
159
160 piar->addr_lo = alo;
161 piar->addr_hi = ahi;
162 piar->pcidev = dev;
163 piar->flags = flags;
164
165#ifdef DEBUG
166 printk(KERN_DEBUG "PIAR: insert range=[%lx:%lx] dev=%s\n",
167 alo, ahi, pci_name (dev));
168#endif
169
170 rb_link_node(&piar->rb_node, parent, p);
171 rb_insert_color(&piar->rb_node, &pci_io_addr_cache_root.rb_root);
172
173 return piar;
174}
175
176static void __pci_addr_cache_insert_device(struct pci_dev *dev)
177{
178 struct device_node *dn;
179 struct pci_dn *pdn;
180 int i;
181 int inserted = 0;
182
183 dn = pci_device_to_OF_node(dev);
184 if (!dn) {
185 printk(KERN_WARNING "PCI: no pci dn found for dev=%s\n", pci_name(dev));
186 return;
187 }
188
189 /* Skip any devices for which EEH is not enabled. */
190 pdn = PCI_DN(dn);
191 if (!(pdn->eeh_mode & EEH_MODE_SUPPORTED) ||
192 pdn->eeh_mode & EEH_MODE_NOCHECK) {
193#ifdef DEBUG
194 printk(KERN_INFO "PCI: skip building address cache for=%s - %s\n",
195 pci_name(dev), pdn->node->full_name);
196#endif
197 return;
198 }
199
200 /* The cache holds a reference to the device... */
201 pci_dev_get(dev);
202
203 /* Walk resources on this device, poke them into the tree */
204 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
205 unsigned long start = pci_resource_start(dev,i);
206 unsigned long end = pci_resource_end(dev,i);
207 unsigned int flags = pci_resource_flags(dev,i);
208
209 /* We are interested only bus addresses, not dma or other stuff */
210 if (0 == (flags & (IORESOURCE_IO | IORESOURCE_MEM)))
211 continue;
212 if (start == 0 || ~start == 0 || end == 0 || ~end == 0)
213 continue;
214 pci_addr_cache_insert(dev, start, end, flags);
215 inserted = 1;
216 }
217
218 /* If there was nothing to add, the cache has no reference... */
219 if (!inserted)
220 pci_dev_put(dev);
221}
222
223/**
224 * pci_addr_cache_insert_device - Add a device to the address cache
225 * @dev: PCI device whose I/O addresses we are interested in.
226 *
227 * In order to support the fast lookup of devices based on addresses,
228 * we maintain a cache of devices that can be quickly searched.
229 * This routine adds a device to that cache.
230 */
231void pci_addr_cache_insert_device(struct pci_dev *dev)
232{
233 unsigned long flags;
234
235 spin_lock_irqsave(&pci_io_addr_cache_root.piar_lock, flags);
236 __pci_addr_cache_insert_device(dev);
237 spin_unlock_irqrestore(&pci_io_addr_cache_root.piar_lock, flags);
238}
239
240static inline void __pci_addr_cache_remove_device(struct pci_dev *dev)
241{
242 struct rb_node *n;
243 int removed = 0;
244
245restart:
246 n = rb_first(&pci_io_addr_cache_root.rb_root);
247 while (n) {
248 struct pci_io_addr_range *piar;
249 piar = rb_entry(n, struct pci_io_addr_range, rb_node);
250
251 if (piar->pcidev == dev) {
252 rb_erase(n, &pci_io_addr_cache_root.rb_root);
253 removed = 1;
254 kfree(piar);
255 goto restart;
256 }
257 n = rb_next(n);
258 }
259
260 /* The cache no longer holds its reference to this device... */
261 if (removed)
262 pci_dev_put(dev);
263}
264
265/**
266 * pci_addr_cache_remove_device - remove pci device from addr cache
267 * @dev: device to remove
268 *
269 * Remove a device from the addr-cache tree.
270 * This is potentially expensive, since it will walk
271 * the tree multiple times (once per resource).
272 * But so what; device removal doesn't need to be that fast.
273 */
274void pci_addr_cache_remove_device(struct pci_dev *dev)
275{
276 unsigned long flags;
277
278 spin_lock_irqsave(&pci_io_addr_cache_root.piar_lock, flags);
279 __pci_addr_cache_remove_device(dev);
280 spin_unlock_irqrestore(&pci_io_addr_cache_root.piar_lock, flags);
281}
282
283/**
284 * pci_addr_cache_build - Build a cache of I/O addresses
285 *
286 * Build a cache of pci i/o addresses. This cache will be used to
287 * find the pci device that corresponds to a given address.
288 * This routine scans all pci busses to build the cache.
289 * Must be run late in boot process, after the pci controllers
290 * have been scaned for devices (after all device resources are known).
291 */
292void __init pci_addr_cache_build(void)
293{
294 struct device_node *dn;
295 struct pci_dev *dev = NULL;
296
297 spin_lock_init(&pci_io_addr_cache_root.piar_lock);
298
299 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
300 /* Ignore PCI bridges */
301 if ((dev->class >> 16) == PCI_BASE_CLASS_BRIDGE)
302 continue;
303
304 pci_addr_cache_insert_device(dev);
305
306 dn = pci_device_to_OF_node(dev);
307 pci_dev_get (dev); /* matching put is in eeh_remove_device() */
308 PCI_DN(dn)->pcidev = dev;
309 }
310
311#ifdef DEBUG
312 /* Verify tree built up above, echo back the list of addrs. */
313 pci_addr_cache_print(&pci_io_addr_cache_root);
314#endif
315}
316
diff --git a/arch/powerpc/platforms/pseries/eeh_driver.c b/arch/powerpc/platforms/pseries/eeh_driver.c
new file mode 100644
index 000000000000..6373372932ba
--- /dev/null
+++ b/arch/powerpc/platforms/pseries/eeh_driver.c
@@ -0,0 +1,376 @@
1/*
2 * PCI Error Recovery Driver for RPA-compliant PPC64 platform.
3 * Copyright (C) 2004, 2005 Linas Vepstas <linas@linas.org>
4 *
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or (at
10 * your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
15 * NON INFRINGEMENT. See the GNU General Public License for more
16 * details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 *
22 * Send feedback to <linas@us.ibm.com>
23 *
24 */
25#include <linux/delay.h>
26#include <linux/irq.h>
27#include <linux/interrupt.h>
28#include <linux/notifier.h>
29#include <linux/pci.h>
30#include <asm/eeh.h>
31#include <asm/eeh_event.h>
32#include <asm/ppc-pci.h>
33#include <asm/pci-bridge.h>
34#include <asm/prom.h>
35#include <asm/rtas.h>
36
37
38static inline const char * pcid_name (struct pci_dev *pdev)
39{
40 if (pdev->dev.driver)
41 return pdev->dev.driver->name;
42 return "";
43}
44
45#ifdef DEBUG
46static void print_device_node_tree (struct pci_dn *pdn, int dent)
47{
48 int i;
49 if (!pdn) return;
50 for (i=0;i<dent; i++)
51 printk(" ");
52 printk("dn=%s mode=%x \tcfg_addr=%x pe_addr=%x \tfull=%s\n",
53 pdn->node->name, pdn->eeh_mode, pdn->eeh_config_addr,
54 pdn->eeh_pe_config_addr, pdn->node->full_name);
55 dent += 3;
56 struct device_node *pc = pdn->node->child;
57 while (pc) {
58 print_device_node_tree(PCI_DN(pc), dent);
59 pc = pc->sibling;
60 }
61}
62#endif
63
64/**
65 * irq_in_use - return true if this irq is being used
66 */
67static int irq_in_use(unsigned int irq)
68{
69 int rc = 0;
70 unsigned long flags;
71 struct irq_desc *desc = irq_desc + irq;
72
73 spin_lock_irqsave(&desc->lock, flags);
74 if (desc->action)
75 rc = 1;
76 spin_unlock_irqrestore(&desc->lock, flags);
77 return rc;
78}
79
80/* ------------------------------------------------------- */
81/** eeh_report_error - report an EEH error to each device,
82 * collect up and merge the device responses.
83 */
84
85static void eeh_report_error(struct pci_dev *dev, void *userdata)
86{
87 enum pci_ers_result rc, *res = userdata;
88 struct pci_driver *driver = dev->driver;
89
90 dev->error_state = pci_channel_io_frozen;
91
92 if (!driver)
93 return;
94
95 if (irq_in_use (dev->irq)) {
96 struct device_node *dn = pci_device_to_OF_node(dev);
97 PCI_DN(dn)->eeh_mode |= EEH_MODE_IRQ_DISABLED;
98 disable_irq_nosync(dev->irq);
99 }
100 if (!driver->err_handler)
101 return;
102 if (!driver->err_handler->error_detected)
103 return;
104
105 rc = driver->err_handler->error_detected (dev, pci_channel_io_frozen);
106 if (*res == PCI_ERS_RESULT_NONE) *res = rc;
107 if (*res == PCI_ERS_RESULT_NEED_RESET) return;
108 if (*res == PCI_ERS_RESULT_DISCONNECT &&
109 rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
110}
111
112/** eeh_report_reset -- tell this device that the pci slot
113 * has been reset.
114 */
115
116static void eeh_report_reset(struct pci_dev *dev, void *userdata)
117{
118 struct pci_driver *driver = dev->driver;
119 struct device_node *dn = pci_device_to_OF_node(dev);
120
121 if (!driver)
122 return;
123
124 if ((PCI_DN(dn)->eeh_mode) & EEH_MODE_IRQ_DISABLED) {
125 PCI_DN(dn)->eeh_mode &= ~EEH_MODE_IRQ_DISABLED;
126 enable_irq(dev->irq);
127 }
128 if (!driver->err_handler)
129 return;
130 if (!driver->err_handler->slot_reset)
131 return;
132
133 driver->err_handler->slot_reset(dev);
134}
135
136static void eeh_report_resume(struct pci_dev *dev, void *userdata)
137{
138 struct pci_driver *driver = dev->driver;
139
140 dev->error_state = pci_channel_io_normal;
141
142 if (!driver)
143 return;
144 if (!driver->err_handler)
145 return;
146 if (!driver->err_handler->resume)
147 return;
148
149 driver->err_handler->resume(dev);
150}
151
152static void eeh_report_failure(struct pci_dev *dev, void *userdata)
153{
154 struct pci_driver *driver = dev->driver;
155
156 dev->error_state = pci_channel_io_perm_failure;
157
158 if (!driver)
159 return;
160
161 if (irq_in_use (dev->irq)) {
162 struct device_node *dn = pci_device_to_OF_node(dev);
163 PCI_DN(dn)->eeh_mode |= EEH_MODE_IRQ_DISABLED;
164 disable_irq_nosync(dev->irq);
165 }
166 if (!driver->err_handler)
167 return;
168 if (!driver->err_handler->error_detected)
169 return;
170 driver->err_handler->error_detected(dev, pci_channel_io_perm_failure);
171}
172
173/* ------------------------------------------------------- */
174/**
175 * handle_eeh_events -- reset a PCI device after hard lockup.
176 *
177 * pSeries systems will isolate a PCI slot if the PCI-Host
178 * bridge detects address or data parity errors, DMA's
179 * occuring to wild addresses (which usually happen due to
180 * bugs in device drivers or in PCI adapter firmware).
181 * Slot isolations also occur if #SERR, #PERR or other misc
182 * PCI-related errors are detected.
183 *
184 * Recovery process consists of unplugging the device driver
185 * (which generated hotplug events to userspace), then issuing
186 * a PCI #RST to the device, then reconfiguring the PCI config
187 * space for all bridges & devices under this slot, and then
188 * finally restarting the device drivers (which cause a second
189 * set of hotplug events to go out to userspace).
190 */
191
192/**
193 * eeh_reset_device() -- perform actual reset of a pci slot
194 * Args: bus: pointer to the pci bus structure corresponding
195 * to the isolated slot. A non-null value will
196 * cause all devices under the bus to be removed
197 * and then re-added.
198 * pe_dn: pointer to a "Partionable Endpoint" device node.
199 * This is the top-level structure on which pci
200 * bus resets can be performed.
201 */
202
203static int eeh_reset_device (struct pci_dn *pe_dn, struct pci_bus *bus)
204{
205 int rc;
206 if (bus)
207 pcibios_remove_pci_devices(bus);
208
209 /* Reset the pci controller. (Asserts RST#; resets config space).
210 * Reconfigure bridges and devices. Don't try to bring the system
211 * up if the reset failed for some reason. */
212 rc = rtas_set_slot_reset(pe_dn);
213 if (rc)
214 return rc;
215
216 /* New-style config addrs might be shared across multiple devices,
217 * Walk over all functions on this device */
218 if (pe_dn->eeh_pe_config_addr) {
219 struct device_node *pe = pe_dn->node;
220 pe = pe->parent->child;
221 while (pe) {
222 struct pci_dn *ppe = PCI_DN(pe);
223 if (pe_dn->eeh_pe_config_addr == ppe->eeh_pe_config_addr) {
224 rtas_configure_bridge(ppe);
225 eeh_restore_bars(ppe);
226 }
227 pe = pe->sibling;
228 }
229 } else {
230 rtas_configure_bridge(pe_dn);
231 eeh_restore_bars(pe_dn);
232 }
233
234 /* Give the system 5 seconds to finish running the user-space
235 * hotplug shutdown scripts, e.g. ifdown for ethernet. Yes,
236 * this is a hack, but if we don't do this, and try to bring
237 * the device up before the scripts have taken it down,
238 * potentially weird things happen.
239 */
240 if (bus) {
241 ssleep (5);
242 pcibios_add_pci_devices(bus);
243 }
244
245 return 0;
246}
247
248/* The longest amount of time to wait for a pci device
249 * to come back on line, in seconds.
250 */
251#define MAX_WAIT_FOR_RECOVERY 15
252
253void handle_eeh_events (struct eeh_event *event)
254{
255 struct device_node *frozen_dn;
256 struct pci_dn *frozen_pdn;
257 struct pci_bus *frozen_bus;
258 int rc = 0;
259 enum pci_ers_result result = PCI_ERS_RESULT_NONE;
260
261 frozen_dn = find_device_pe(event->dn);
262 frozen_bus = pcibios_find_pci_bus(frozen_dn);
263
264 if (!frozen_dn) {
265 printk(KERN_ERR "EEH: Error: Cannot find partition endpoint for %s\n",
266 pci_name(event->dev));
267 return;
268 }
269
270 /* There are two different styles for coming up with the PE.
271 * In the old style, it was the highest EEH-capable device
272 * which was always an EADS pci bridge. In the new style,
273 * there might not be any EADS bridges, and even when there are,
274 * the firmware marks them as "EEH incapable". So another
275 * two-step is needed to find the pci bus.. */
276 if (!frozen_bus)
277 frozen_bus = pcibios_find_pci_bus (frozen_dn->parent);
278
279 if (!frozen_bus) {
280 printk(KERN_ERR "EEH: Cannot find PCI bus for %s\n",
281 frozen_dn->full_name);
282 return;
283 }
284
285#if 0
286 /* We may get "permanent failure" messages on empty slots.
287 * These are false alarms. Empty slots have no child dn. */
288 if ((event->state == pci_channel_io_perm_failure) && (frozen_device == NULL))
289 return;
290#endif
291
292 frozen_pdn = PCI_DN(frozen_dn);
293 frozen_pdn->eeh_freeze_count++;
294
295 if (frozen_pdn->eeh_freeze_count > EEH_MAX_ALLOWED_FREEZES)
296 goto hard_fail;
297
298 /* If the reset state is a '5' and the time to reset is 0 (infinity)
299 * or is more then 15 seconds, then mark this as a permanent failure.
300 */
301 if ((event->state == pci_channel_io_perm_failure) &&
302 ((event->time_unavail <= 0) ||
303 (event->time_unavail > MAX_WAIT_FOR_RECOVERY*1000)))
304 goto hard_fail;
305
306 eeh_slot_error_detail(frozen_pdn, 1 /* Temporary Error */);
307 printk(KERN_WARNING
308 "EEH: This PCI device has failed %d times since last reboot: %s - %s\n",
309 frozen_pdn->eeh_freeze_count,
310 pci_name (frozen_pdn->pcidev),
311 pcid_name(frozen_pdn->pcidev));
312
313 /* Walk the various device drivers attached to this slot through
314 * a reset sequence, giving each an opportunity to do what it needs
315 * to accomplish the reset. Each child gets a report of the
316 * status ... if any child can't handle the reset, then the entire
317 * slot is dlpar removed and added.
318 */
319 pci_walk_bus(frozen_bus, eeh_report_error, &result);
320
321 /* If all device drivers were EEH-unaware, then shut
322 * down all of the device drivers, and hope they
323 * go down willingly, without panicing the system.
324 */
325 if (result == PCI_ERS_RESULT_NONE) {
326 rc = eeh_reset_device(frozen_pdn, frozen_bus);
327 if (rc)
328 goto hard_fail;
329 }
330
331 /* If any device called out for a reset, then reset the slot */
332 if (result == PCI_ERS_RESULT_NEED_RESET) {
333 rc = eeh_reset_device(frozen_pdn, NULL);
334 if (rc)
335 goto hard_fail;
336 pci_walk_bus(frozen_bus, eeh_report_reset, 0);
337 }
338
339 /* If all devices reported they can proceed, the re-enable PIO */
340 if (result == PCI_ERS_RESULT_CAN_RECOVER) {
341 /* XXX Not supported; we brute-force reset the device */
342 rc = eeh_reset_device(frozen_pdn, NULL);
343 if (rc)
344 goto hard_fail;
345 pci_walk_bus(frozen_bus, eeh_report_reset, 0);
346 }
347
348 /* Tell all device drivers that they can resume operations */
349 pci_walk_bus(frozen_bus, eeh_report_resume, 0);
350
351 return;
352
353hard_fail:
354 /*
355 * About 90% of all real-life EEH failures in the field
356 * are due to poorly seated PCI cards. Only 10% or so are
357 * due to actual, failed cards.
358 */
359 printk(KERN_ERR
360 "EEH: PCI device %s - %s has failed %d times \n"
361 "and has been permanently disabled. Please try reseating\n"
362 "this device or replacing it.\n",
363 pci_name (frozen_pdn->pcidev),
364 pcid_name(frozen_pdn->pcidev),
365 frozen_pdn->eeh_freeze_count);
366
367 eeh_slot_error_detail(frozen_pdn, 2 /* Permanent Error */);
368
369 /* Notify all devices that they're about to go down. */
370 pci_walk_bus(frozen_bus, eeh_report_failure, 0);
371
372 /* Shut down the device drivers for good. */
373 pcibios_remove_pci_devices(frozen_bus);
374}
375
376/* ---------- end of file ---------- */
diff --git a/arch/powerpc/platforms/pseries/eeh_event.c b/arch/powerpc/platforms/pseries/eeh_event.c
index 92497333c2b6..9a9961f27480 100644
--- a/arch/powerpc/platforms/pseries/eeh_event.c
+++ b/arch/powerpc/platforms/pseries/eeh_event.c
@@ -21,6 +21,7 @@
21#include <linux/list.h> 21#include <linux/list.h>
22#include <linux/pci.h> 22#include <linux/pci.h>
23#include <asm/eeh_event.h> 23#include <asm/eeh_event.h>
24#include <asm/ppc-pci.h>
24 25
25/** Overview: 26/** Overview:
26 * EEH error states may be detected within exception handlers; 27 * EEH error states may be detected within exception handlers;
@@ -37,31 +38,6 @@ static void eeh_thread_launcher(void *);
37DECLARE_WORK(eeh_event_wq, eeh_thread_launcher, NULL); 38DECLARE_WORK(eeh_event_wq, eeh_thread_launcher, NULL);
38 39
39/** 40/**
40 * eeh_panic - call panic() for an eeh event that cannot be handled.
41 * The philosophy of this routine is that it is better to panic and
42 * halt the OS than it is to risk possible data corruption by
43 * oblivious device drivers that don't know better.
44 *
45 * @dev pci device that had an eeh event
46 * @reset_state current reset state of the device slot
47 */
48static void eeh_panic(struct pci_dev *dev, int reset_state)
49{
50 /*
51 * Since the panic_on_oops sysctl is used to halt the system
52 * in light of potential corruption, we can use it here.
53 */
54 if (panic_on_oops) {
55 panic("EEH: MMIO failure (%d) on device:%s\n", reset_state,
56 pci_name(dev));
57 }
58 else {
59 printk(KERN_INFO "EEH: Ignored MMIO failure (%d) on device:%s\n",
60 reset_state, pci_name(dev));
61 }
62}
63
64/**
65 * eeh_event_handler - dispatch EEH events. The detection of a frozen 41 * eeh_event_handler - dispatch EEH events. The detection of a frozen
66 * slot can occur inside an interrupt, where it can be hard to do 42 * slot can occur inside an interrupt, where it can be hard to do
67 * anything about it. The goal of this routine is to pull these 43 * anything about it. The goal of this routine is to pull these
@@ -82,10 +58,16 @@ static int eeh_event_handler(void * dummy)
82 58
83 spin_lock_irqsave(&eeh_eventlist_lock, flags); 59 spin_lock_irqsave(&eeh_eventlist_lock, flags);
84 event = NULL; 60 event = NULL;
61
62 /* Unqueue the event, get ready to process. */
85 if (!list_empty(&eeh_eventlist)) { 63 if (!list_empty(&eeh_eventlist)) {
86 event = list_entry(eeh_eventlist.next, struct eeh_event, list); 64 event = list_entry(eeh_eventlist.next, struct eeh_event, list);
87 list_del(&event->list); 65 list_del(&event->list);
88 } 66 }
67
68 if (event)
69 eeh_mark_slot(event->dn, EEH_MODE_RECOVERING);
70
89 spin_unlock_irqrestore(&eeh_eventlist_lock, flags); 71 spin_unlock_irqrestore(&eeh_eventlist_lock, flags);
90 if (event == NULL) 72 if (event == NULL)
91 break; 73 break;
@@ -93,8 +75,11 @@ static int eeh_event_handler(void * dummy)
93 printk(KERN_INFO "EEH: Detected PCI bus error on device %s\n", 75 printk(KERN_INFO "EEH: Detected PCI bus error on device %s\n",
94 pci_name(event->dev)); 76 pci_name(event->dev));
95 77
96 eeh_panic (event->dev, event->state); 78 handle_eeh_events(event);
79
80 eeh_clear_slot(event->dn, EEH_MODE_RECOVERING);
97 81
82 pci_dev_put(event->dev);
98 kfree(event); 83 kfree(event);
99 } 84 }
100 85
@@ -122,7 +107,7 @@ static void eeh_thread_launcher(void *dummy)
122 */ 107 */
123int eeh_send_failure_event (struct device_node *dn, 108int eeh_send_failure_event (struct device_node *dn,
124 struct pci_dev *dev, 109 struct pci_dev *dev,
125 int state, 110 enum pci_channel_state state,
126 int time_unavail) 111 int time_unavail)
127{ 112{
128 unsigned long flags; 113 unsigned long flags;
diff --git a/arch/ppc/Makefile b/arch/ppc/Makefile
index e719a4933af1..98e940beeb3b 100644
--- a/arch/ppc/Makefile
+++ b/arch/ppc/Makefile
@@ -128,10 +128,9 @@ TOUT := .tmp_gas_check
128# Ensure this is binutils 2.12.1 (or 2.12.90.0.7) or later for altivec 128# Ensure this is binutils 2.12.1 (or 2.12.90.0.7) or later for altivec
129# instructions. 129# instructions.
130# gcc-3.4 and binutils-2.14 are a fatal combination. 130# gcc-3.4 and binutils-2.14 are a fatal combination.
131GCC_VERSION := $(call cc-version)
132 131
133checkbin: 132checkbin:
134 @if test "$(GCC_VERSION)" = "0304" ; then \ 133 @if test "$(call cc-version)" = "0304" ; then \
135 if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \ 134 if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \
136 echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \ 135 echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \
137 echo 'correctly with gcc-3.4 and your version of binutils.'; \ 136 echo 'correctly with gcc-3.4 and your version of binutils.'; \
diff --git a/arch/ppc/kernel/machine_kexec.c b/arch/ppc/kernel/machine_kexec.c
index a882b0dbe8de..84d65a87191e 100644
--- a/arch/ppc/kernel/machine_kexec.c
+++ b/arch/ppc/kernel/machine_kexec.c
@@ -28,12 +28,6 @@ typedef NORET_TYPE void (*relocate_new_kernel_t)(
28const extern unsigned char relocate_new_kernel[]; 28const extern unsigned char relocate_new_kernel[];
29const extern unsigned int relocate_new_kernel_size; 29const extern unsigned int relocate_new_kernel_size;
30 30
31/*
32 * Provide a dummy crash_notes definition while crash dump arrives to ppc.
33 * This prevents breakage of crash_notes attribute in kernel/ksysfs.c.
34 */
35note_buf_t crash_notes[NR_CPUS];
36
37void machine_shutdown(void) 31void machine_shutdown(void)
38{ 32{
39 if (ppc_md.machine_shutdown) 33 if (ppc_md.machine_shutdown)
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 6fe532d82417..b66602ad7b33 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -27,11 +27,6 @@ config S390
27 bool 27 bool
28 default y 28 default y
29 29
30config UID16
31 bool
32 default y
33 depends on !64BIT
34
35source "init/Kconfig" 30source "init/Kconfig"
36 31
37menu "Base setup" 32menu "Base setup"
diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
index 4865e4b49464..9269b5788fac 100644
--- a/arch/s390/kernel/Makefile
+++ b/arch/s390/kernel/Makefile
@@ -17,8 +17,7 @@ obj-$(CONFIG_MODULES) += s390_ksyms.o module.o
17obj-$(CONFIG_SMP) += smp.o 17obj-$(CONFIG_SMP) += smp.o
18 18
19obj-$(CONFIG_COMPAT) += compat_linux.o compat_signal.o \ 19obj-$(CONFIG_COMPAT) += compat_linux.o compat_signal.o \
20 compat_ioctl.o compat_wrapper.o \ 20 compat_wrapper.o compat_exec_domain.o
21 compat_exec_domain.o
22obj-$(CONFIG_BINFMT_ELF32) += binfmt_elf32.o 21obj-$(CONFIG_BINFMT_ELF32) += binfmt_elf32.o
23 22
24obj-$(CONFIG_VIRT_TIMER) += vtime.o 23obj-$(CONFIG_VIRT_TIMER) += vtime.o
diff --git a/arch/s390/kernel/compat_ioctl.c b/arch/s390/kernel/compat_ioctl.c
deleted file mode 100644
index 6504c4e69986..000000000000
--- a/arch/s390/kernel/compat_ioctl.c
+++ /dev/null
@@ -1,81 +0,0 @@
1/*
2 * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
3 *
4 * S390 version
5 * Copyright (C) 2000-2003 IBM Deutschland Entwicklung GmbH, IBM Corporation
6 * Author(s): Gerhard Tonn (ton@de.ibm.com)
7 * Arnd Bergmann (arndb@de.ibm.com)
8 *
9 * Original implementation from 32-bit Sparc compat code which is
10 * Copyright (C) 2000 Silicon Graphics, Inc.
11 * Written by Ulf Carlsson (ulfc@engr.sgi.com)
12 */
13
14#include "compat_linux.h"
15#define INCLUDES
16#define CODE
17#include "../../../fs/compat_ioctl.c"
18#include <asm/dasd.h>
19#include <asm/cmb.h>
20#include <asm/tape390.h>
21#include <asm/ccwdev.h>
22#include "../../../drivers/s390/char/raw3270.h"
23
24static int do_ioctl32_pointer(unsigned int fd, unsigned int cmd,
25 unsigned long arg, struct file *f)
26{
27 return sys_ioctl(fd, cmd, (unsigned long)compat_ptr(arg));
28}
29
30static int do_ioctl32_ulong(unsigned int fd, unsigned int cmd,
31 unsigned long arg, struct file *f)
32{
33 return sys_ioctl(fd, cmd, arg);
34}
35
36#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),(ioctl_trans_handler_t)do_ioctl32_pointer)
37#define ULONG_IOCTL(cmd) HANDLE_IOCTL((cmd),(ioctl_trans_handler_t)do_ioctl32_ulong)
38#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl_trans_handler_t)(handler), NULL },
39
40struct ioctl_trans ioctl_start[] = {
41/* architecture independent ioctls */
42#include <linux/compat_ioctl.h>
43#define DECLARES
44#include "../../../fs/compat_ioctl.c"
45
46/* s390 only ioctls */
47COMPATIBLE_IOCTL(DASDAPIVER)
48COMPATIBLE_IOCTL(BIODASDDISABLE)
49COMPATIBLE_IOCTL(BIODASDENABLE)
50COMPATIBLE_IOCTL(BIODASDRSRV)
51COMPATIBLE_IOCTL(BIODASDRLSE)
52COMPATIBLE_IOCTL(BIODASDSLCK)
53COMPATIBLE_IOCTL(BIODASDINFO)
54COMPATIBLE_IOCTL(BIODASDINFO2)
55COMPATIBLE_IOCTL(BIODASDFMT)
56COMPATIBLE_IOCTL(BIODASDPRRST)
57COMPATIBLE_IOCTL(BIODASDQUIESCE)
58COMPATIBLE_IOCTL(BIODASDRESUME)
59COMPATIBLE_IOCTL(BIODASDPRRD)
60COMPATIBLE_IOCTL(BIODASDPSRD)
61COMPATIBLE_IOCTL(BIODASDGATTR)
62COMPATIBLE_IOCTL(BIODASDSATTR)
63COMPATIBLE_IOCTL(BIODASDCMFENABLE)
64COMPATIBLE_IOCTL(BIODASDCMFDISABLE)
65COMPATIBLE_IOCTL(BIODASDREADALLCMB)
66
67COMPATIBLE_IOCTL(TUBICMD)
68COMPATIBLE_IOCTL(TUBOCMD)
69COMPATIBLE_IOCTL(TUBGETI)
70COMPATIBLE_IOCTL(TUBGETO)
71COMPATIBLE_IOCTL(TUBSETMOD)
72COMPATIBLE_IOCTL(TUBGETMOD)
73
74COMPATIBLE_IOCTL(TAPE390_DISPLAY)
75
76/* s390 doesn't need handlers here */
77COMPATIBLE_IOCTL(TIOCGSERIAL)
78COMPATIBLE_IOCTL(TIOCSSERIAL)
79};
80
81int ioctl_table_size = ARRAY_SIZE(ioctl_start);
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
index 41b197a3f3a3..cd3b3c3e7a9f 100644
--- a/arch/s390/kernel/compat_linux.c
+++ b/arch/s390/kernel/compat_linux.c
@@ -1014,38 +1014,6 @@ asmlinkage long sys32_clone(struct pt_regs regs)
1014} 1014}
1015 1015
1016/* 1016/*
1017 * Wrapper function for sys_timer_create.
1018 */
1019extern asmlinkage long
1020sys_timer_create(clockid_t, struct sigevent *, timer_t *);
1021
1022asmlinkage long
1023sys32_timer_create(clockid_t which_clock, struct compat_sigevent *se32,
1024 timer_t *timer_id)
1025{
1026 struct sigevent se;
1027 timer_t ktimer_id;
1028 mm_segment_t old_fs;
1029 long ret;
1030
1031 if (se32 == NULL)
1032 return sys_timer_create(which_clock, NULL, timer_id);
1033
1034 if (get_compat_sigevent(&se, se32))
1035 return -EFAULT;
1036
1037 old_fs = get_fs();
1038 set_fs(KERNEL_DS);
1039 ret = sys_timer_create(which_clock, &se, &ktimer_id);
1040 set_fs(old_fs);
1041
1042 if (!ret)
1043 ret = put_user (ktimer_id, timer_id);
1044
1045 return ret;
1046}
1047
1048/*
1049 * 31 bit emulation wrapper functions for sys_fadvise64/fadvise64_64. 1017 * 31 bit emulation wrapper functions for sys_fadvise64/fadvise64_64.
1050 * These need to rewrite the advise values for POSIX_FADV_{DONTNEED,NOREUSE} 1018 * These need to rewrite the advise values for POSIX_FADV_{DONTNEED,NOREUSE}
1051 * because the 31 bit values differ from the 64 bit values. 1019 * because the 31 bit values differ from the 64 bit values.
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index 23fe94e58688..cfde1905d07d 100644
--- a/arch/s390/kernel/compat_wrapper.S
+++ b/arch/s390/kernel/compat_wrapper.S
@@ -1289,7 +1289,7 @@ sys32_timer_create_wrapper:
1289 lgfr %r2,%r2 # timer_t (int) 1289 lgfr %r2,%r2 # timer_t (int)
1290 llgtr %r3,%r3 # struct compat_sigevent * 1290 llgtr %r3,%r3 # struct compat_sigevent *
1291 llgtr %r4,%r4 # timer_t * 1291 llgtr %r4,%r4 # timer_t *
1292 jg sys32_timer_create 1292 jg compat_sys_timer_create
1293 1293
1294 .globl sys32_timer_settime_wrapper 1294 .globl sys32_timer_settime_wrapper
1295sys32_timer_settime_wrapper: 1295sys32_timer_settime_wrapper:
diff --git a/arch/s390/kernel/crash.c b/arch/s390/kernel/crash.c
index 7bd169c58b0c..926cceeae0fa 100644
--- a/arch/s390/kernel/crash.c
+++ b/arch/s390/kernel/crash.c
@@ -10,8 +10,6 @@
10#include <linux/threads.h> 10#include <linux/threads.h>
11#include <linux/kexec.h> 11#include <linux/kexec.h>
12 12
13note_buf_t crash_notes[NR_CPUS];
14
15void machine_crash_shutdown(struct pt_regs *regs) 13void machine_crash_shutdown(struct pt_regs *regs)
16{ 14{
17} 15}
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index a942bf2d58e9..7dd58f8ac6b5 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -352,27 +352,6 @@ int dump_fpu (struct pt_regs * regs, s390_fp_regs *fpregs)
352 return 1; 352 return 1;
353} 353}
354 354
355/*
356 * fill in the user structure for a core dump..
357 */
358void dump_thread(struct pt_regs * regs, struct user * dump)
359{
360
361/* changed the size calculations - should hopefully work better. lbt */
362 dump->magic = CMAGIC;
363 dump->start_code = 0;
364 dump->start_stack = regs->gprs[15] & ~(PAGE_SIZE - 1);
365 dump->u_tsize = current->mm->end_code >> PAGE_SHIFT;
366 dump->u_dsize = (current->mm->brk + PAGE_SIZE - 1) >> PAGE_SHIFT;
367 dump->u_dsize -= dump->u_tsize;
368 dump->u_ssize = 0;
369 if (dump->start_stack < TASK_SIZE)
370 dump->u_ssize = (TASK_SIZE - dump->start_stack) >> PAGE_SHIFT;
371 memcpy(&dump->regs, regs, sizeof(s390_regs));
372 dump_fpu (regs, &dump->regs.fp_regs);
373 dump->regs.per_info = current->thread.per_info;
374}
375
376unsigned long get_wchan(struct task_struct *p) 355unsigned long get_wchan(struct task_struct *p)
377{ 356{
378 struct stack_frame *sf, *low, *high; 357 struct stack_frame *sf, *low, *high;
diff --git a/arch/s390/kernel/s390_ksyms.c b/arch/s390/kernel/s390_ksyms.c
index bee654abb6d3..4176c77670c4 100644
--- a/arch/s390/kernel/s390_ksyms.c
+++ b/arch/s390/kernel/s390_ksyms.c
@@ -10,7 +10,6 @@
10#include <linux/smp.h> 10#include <linux/smp.h>
11#include <linux/syscalls.h> 11#include <linux/syscalls.h>
12#include <linux/interrupt.h> 12#include <linux/interrupt.h>
13#include <linux/ioctl32.h>
14#include <asm/checksum.h> 13#include <asm/checksum.h>
15#include <asm/cpcmd.h> 14#include <asm/cpcmd.h>
16#include <asm/delay.h> 15#include <asm/delay.h>
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c
index fd4f240b833d..8a2bea34ddd2 100644
--- a/arch/sh/kernel/process.c
+++ b/arch/sh/kernel/process.c
@@ -305,26 +305,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
305 return 0; 305 return 0;
306} 306}
307 307
308/*
309 * fill in the user structure for a core dump..
310 */
311void dump_thread(struct pt_regs * regs, struct user * dump)
312{
313 dump->magic = CMAGIC;
314 dump->start_code = current->mm->start_code;
315 dump->start_data = current->mm->start_data;
316 dump->start_stack = regs->regs[15] & ~(PAGE_SIZE - 1);
317 dump->u_tsize = (current->mm->end_code - dump->start_code) >> PAGE_SHIFT;
318 dump->u_dsize = (current->mm->brk + (PAGE_SIZE-1) - dump->start_data) >> PAGE_SHIFT;
319 dump->u_ssize = (current->mm->start_stack - dump->start_stack +
320 PAGE_SIZE - 1) >> PAGE_SHIFT;
321 /* Debug registers will come here. */
322
323 dump->regs = *regs;
324
325 dump->u_fpvalid = dump_fpu(regs, &dump->fpu);
326}
327
328/* Tracing by user break controller. */ 308/* Tracing by user break controller. */
329static void 309static void
330ubc_set_tracing(int asid, unsigned long pc) 310ubc_set_tracing(int asid, unsigned long pc)
diff --git a/arch/sh/kernel/sh_ksyms.c b/arch/sh/kernel/sh_ksyms.c
index 6954fd62470a..1cf94a618be3 100644
--- a/arch/sh/kernel/sh_ksyms.c
+++ b/arch/sh/kernel/sh_ksyms.c
@@ -21,14 +21,12 @@
21#include <asm/cacheflush.h> 21#include <asm/cacheflush.h>
22#include <asm/checksum.h> 22#include <asm/checksum.h>
23 23
24extern void dump_thread(struct pt_regs *, struct user *);
25extern int dump_fpu(struct pt_regs *, elf_fpregset_t *); 24extern int dump_fpu(struct pt_regs *, elf_fpregset_t *);
26extern struct hw_interrupt_type no_irq_type; 25extern struct hw_interrupt_type no_irq_type;
27 26
28EXPORT_SYMBOL(sh_mv); 27EXPORT_SYMBOL(sh_mv);
29 28
30/* platform dependent support */ 29/* platform dependent support */
31EXPORT_SYMBOL(dump_thread);
32EXPORT_SYMBOL(dump_fpu); 30EXPORT_SYMBOL(dump_fpu);
33EXPORT_SYMBOL(iounmap); 31EXPORT_SYMBOL(iounmap);
34EXPORT_SYMBOL(enable_irq); 32EXPORT_SYMBOL(enable_irq);
diff --git a/arch/sh64/Kconfig b/arch/sh64/Kconfig
index fb35b45dc130..07b172deb872 100644
--- a/arch/sh64/Kconfig
+++ b/arch/sh64/Kconfig
@@ -17,10 +17,6 @@ config MMU
17 bool 17 bool
18 default y 18 default y
19 19
20config UID16
21 bool
22 default y
23
24config RWSEM_GENERIC_SPINLOCK 20config RWSEM_GENERIC_SPINLOCK
25 bool 21 bool
26 default y 22 default y
diff --git a/arch/sh64/kernel/process.c b/arch/sh64/kernel/process.c
index b95d04141855..419b5a710441 100644
--- a/arch/sh64/kernel/process.c
+++ b/arch/sh64/kernel/process.c
@@ -775,26 +775,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
775 return 0; 775 return 0;
776} 776}
777 777
778/*
779 * fill in the user structure for a core dump..
780 */
781void dump_thread(struct pt_regs * regs, struct user * dump)
782{
783 dump->magic = CMAGIC;
784 dump->start_code = current->mm->start_code;
785 dump->start_data = current->mm->start_data;
786 dump->start_stack = regs->regs[15] & ~(PAGE_SIZE - 1);
787 dump->u_tsize = (current->mm->end_code - dump->start_code) >> PAGE_SHIFT;
788 dump->u_dsize = (current->mm->brk + (PAGE_SIZE-1) - dump->start_data) >> PAGE_SHIFT;
789 dump->u_ssize = (current->mm->start_stack - dump->start_stack +
790 PAGE_SIZE - 1) >> PAGE_SHIFT;
791 /* Debug registers will come here. */
792
793 dump->regs = *regs;
794
795 dump->u_fpvalid = dump_fpu(regs, &dump->fpu);
796}
797
798asmlinkage int sys_fork(unsigned long r2, unsigned long r3, 778asmlinkage int sys_fork(unsigned long r2, unsigned long r3,
799 unsigned long r4, unsigned long r5, 779 unsigned long r4, unsigned long r5,
800 unsigned long r6, unsigned long r7, 780 unsigned long r6, unsigned long r7,
diff --git a/arch/sh64/kernel/sh_ksyms.c b/arch/sh64/kernel/sh_ksyms.c
index 0b5497d70bd3..472b450e61be 100644
--- a/arch/sh64/kernel/sh_ksyms.c
+++ b/arch/sh64/kernel/sh_ksyms.c
@@ -29,7 +29,6 @@
29#include <asm/delay.h> 29#include <asm/delay.h>
30#include <asm/irq.h> 30#include <asm/irq.h>
31 31
32extern void dump_thread(struct pt_regs *, struct user *);
33extern int dump_fpu(struct pt_regs *, elf_fpregset_t *); 32extern int dump_fpu(struct pt_regs *, elf_fpregset_t *);
34 33
35#if 0 34#if 0
@@ -41,7 +40,6 @@ EXPORT_SYMBOL(drive_info);
41#endif 40#endif
42 41
43/* platform dependent support */ 42/* platform dependent support */
44EXPORT_SYMBOL(dump_thread);
45EXPORT_SYMBOL(dump_fpu); 43EXPORT_SYMBOL(dump_fpu);
46EXPORT_SYMBOL(iounmap); 44EXPORT_SYMBOL(iounmap);
47EXPORT_SYMBOL(enable_irq); 45EXPORT_SYMBOL(enable_irq);
diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c
index 1c8fd0fd9305..0b0d492c953b 100644
--- a/arch/sparc/kernel/sparc_ksyms.c
+++ b/arch/sparc/kernel/sparc_ksyms.c
@@ -82,8 +82,6 @@ extern int __lshrdi3(int, int);
82extern int __muldi3(int, int); 82extern int __muldi3(int, int);
83extern int __divdi3(int, int); 83extern int __divdi3(int, int);
84 84
85extern void dump_thread(struct pt_regs *, struct user *);
86
87/* Private functions with odd calling conventions. */ 85/* Private functions with odd calling conventions. */
88extern void ___atomic24_add(void); 86extern void ___atomic24_add(void);
89extern void ___atomic24_sub(void); 87extern void ___atomic24_sub(void);
diff --git a/arch/sparc64/kernel/Makefile b/arch/sparc64/kernel/Makefile
index 6f00ab8b9d23..83d67eb18895 100644
--- a/arch/sparc64/kernel/Makefile
+++ b/arch/sparc64/kernel/Makefile
@@ -16,7 +16,7 @@ obj-y := process.o setup.o cpu.o idprom.o \
16obj-$(CONFIG_PCI) += ebus.o isa.o pci_common.o pci_iommu.o \ 16obj-$(CONFIG_PCI) += ebus.o isa.o pci_common.o pci_iommu.o \
17 pci_psycho.o pci_sabre.o pci_schizo.o 17 pci_psycho.o pci_sabre.o pci_schizo.o
18obj-$(CONFIG_SMP) += smp.o trampoline.o 18obj-$(CONFIG_SMP) += smp.o trampoline.o
19obj-$(CONFIG_SPARC32_COMPAT) += sys32.o sys_sparc32.o signal32.o ioctl32.o 19obj-$(CONFIG_SPARC32_COMPAT) += sys32.o sys_sparc32.o signal32.o
20obj-$(CONFIG_BINFMT_ELF32) += binfmt_elf32.o 20obj-$(CONFIG_BINFMT_ELF32) += binfmt_elf32.o
21obj-$(CONFIG_BINFMT_AOUT32) += binfmt_aout32.o 21obj-$(CONFIG_BINFMT_AOUT32) += binfmt_aout32.o
22obj-$(CONFIG_MODULES) += module.o 22obj-$(CONFIG_MODULES) += module.o
@@ -40,5 +40,3 @@ endif
40 40
41head.o: head.S ttable.S itlb_base.S dtlb_base.S dtlb_backend.S dtlb_prot.S \ 41head.o: head.S ttable.S itlb_base.S dtlb_base.S dtlb_backend.S dtlb_prot.S \
42 etrap.S rtrap.S winfixup.S entry.S 42 etrap.S rtrap.S winfixup.S entry.S
43
44CFLAGS_ioctl32.o += -Ifs/
diff --git a/arch/sparc64/kernel/binfmt_aout32.c b/arch/sparc64/kernel/binfmt_aout32.c
index edf52d06b280..202a80c24b6f 100644
--- a/arch/sparc64/kernel/binfmt_aout32.c
+++ b/arch/sparc64/kernel/binfmt_aout32.c
@@ -36,8 +36,6 @@ static int load_aout32_binary(struct linux_binprm *, struct pt_regs * regs);
36static int load_aout32_library(struct file*); 36static int load_aout32_library(struct file*);
37static int aout32_core_dump(long signr, struct pt_regs * regs, struct file *file); 37static int aout32_core_dump(long signr, struct pt_regs * regs, struct file *file);
38 38
39extern void dump_thread(struct pt_regs *, struct user *);
40
41static struct linux_binfmt aout32_format = { 39static struct linux_binfmt aout32_format = {
42 NULL, THIS_MODULE, load_aout32_binary, load_aout32_library, aout32_core_dump, 40 NULL, THIS_MODULE, load_aout32_binary, load_aout32_library, aout32_core_dump,
43 PAGE_SIZE 41 PAGE_SIZE
diff --git a/arch/sparc64/kernel/ioctl32.c b/arch/sparc64/kernel/ioctl32.c
deleted file mode 100644
index 196b208665a2..000000000000
--- a/arch/sparc64/kernel/ioctl32.c
+++ /dev/null
@@ -1,39 +0,0 @@
1/* $Id: ioctl32.c,v 1.136 2002/01/14 09:49:52 davem Exp $
2 * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
3 *
4 * Copyright (C) 1997-2000 Jakub Jelinek (jakub@redhat.com)
5 * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be)
6 * Copyright (C) 2003 Pavel Machek (pavel@suse.cz)
7 *
8 * These routines maintain argument size conversion between 32bit and 64bit
9 * ioctls.
10 */
11
12#define INCLUDES
13#include "compat_ioctl.c"
14#include <linux/syscalls.h>
15
16#define CODE
17#include "compat_ioctl.c"
18
19#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl)
20#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl_trans_handler_t)(handler), NULL },
21#define IOCTL_TABLE_START \
22 struct ioctl_trans ioctl_start[] = {
23#define IOCTL_TABLE_END \
24 };
25
26IOCTL_TABLE_START
27#include <linux/compat_ioctl.h>
28#define DECLARES
29#include "compat_ioctl.c"
30#if 0
31HANDLE_IOCTL(RTC32_IRQP_READ, do_rtc_ioctl)
32HANDLE_IOCTL(RTC32_IRQP_SET, do_rtc_ioctl)
33HANDLE_IOCTL(RTC32_EPOCH_READ, do_rtc_ioctl)
34HANDLE_IOCTL(RTC32_EPOCH_SET, do_rtc_ioctl)
35#endif
36/* take care of sizeof(sizeof()) breakage */
37IOCTL_TABLE_END
38
39int ioctl_table_size = ARRAY_SIZE(ioctl_start);
diff --git a/arch/sparc64/kernel/kprobes.c b/arch/sparc64/kernel/kprobes.c
index a97b0f0727ab..ff5e9d5cad50 100644
--- a/arch/sparc64/kernel/kprobes.c
+++ b/arch/sparc64/kernel/kprobes.c
@@ -43,14 +43,10 @@ DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
43 43
44int __kprobes arch_prepare_kprobe(struct kprobe *p) 44int __kprobes arch_prepare_kprobe(struct kprobe *p)
45{ 45{
46 return 0;
47}
48
49void __kprobes arch_copy_kprobe(struct kprobe *p)
50{
51 p->ainsn.insn[0] = *p->addr; 46 p->ainsn.insn[0] = *p->addr;
52 p->ainsn.insn[1] = BREAKPOINT_INSTRUCTION_2; 47 p->ainsn.insn[1] = BREAKPOINT_INSTRUCTION_2;
53 p->opcode = *p->addr; 48 p->opcode = *p->addr;
49 return 0;
54} 50}
55 51
56void __kprobes arch_arm_kprobe(struct kprobe *p) 52void __kprobes arch_arm_kprobe(struct kprobe *p)
@@ -65,10 +61,6 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)
65 flushi(p->addr); 61 flushi(p->addr);
66} 62}
67 63
68void __kprobes arch_remove_kprobe(struct kprobe *p)
69{
70}
71
72static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb) 64static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb)
73{ 65{
74 kcb->prev_kprobe.kp = kprobe_running(); 66 kcb->prev_kprobe.kp = kprobe_running();
diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c
index fb7a5370dbfc..d177d7e5c9d3 100644
--- a/arch/sparc64/kernel/sparc64_ksyms.c
+++ b/arch/sparc64/kernel/sparc64_ksyms.c
@@ -94,7 +94,6 @@ extern void (*prom_palette)(int);
94 94
95extern int __ashrdi3(int, int); 95extern int __ashrdi3(int, int);
96 96
97extern void dump_thread(struct pt_regs *, struct user *);
98extern int dump_fpu (struct pt_regs * regs, elf_fpregset_t * fpregs); 97extern int dump_fpu (struct pt_regs * regs, elf_fpregset_t * fpregs);
99 98
100extern unsigned long phys_base; 99extern unsigned long phys_base;
@@ -241,7 +240,6 @@ EXPORT_SYMBOL(io_remap_pfn_range);
241EXPORT_SYMBOL(_sigpause_common); 240EXPORT_SYMBOL(_sigpause_common);
242EXPORT_SYMBOL(verify_compat_iovec); 241EXPORT_SYMBOL(verify_compat_iovec);
243 242
244EXPORT_SYMBOL(dump_thread);
245EXPORT_SYMBOL(dump_fpu); 243EXPORT_SYMBOL(dump_fpu);
246EXPORT_SYMBOL(pte_alloc_one_kernel); 244EXPORT_SYMBOL(pte_alloc_one_kernel);
247#ifndef CONFIG_SMP 245#ifndef CONFIG_SMP
diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c
index 7f6239ed2521..de342ee3116b 100644
--- a/arch/sparc64/kernel/sys_sparc32.c
+++ b/arch/sparc64/kernel/sys_sparc32.c
@@ -1120,39 +1120,3 @@ long sys32_lookup_dcookie(unsigned long cookie_high,
1120 return sys_lookup_dcookie((cookie_high << 32) | cookie_low, 1120 return sys_lookup_dcookie((cookie_high << 32) | cookie_low,
1121 buf, len); 1121 buf, len);
1122} 1122}
1123
1124extern asmlinkage long
1125sys_timer_create(clockid_t which_clock,
1126 struct sigevent __user *timer_event_spec,
1127 timer_t __user *created_timer_id);
1128
1129long
1130sys32_timer_create(u32 clock, struct compat_sigevent __user *se32,
1131 timer_t __user *timer_id)
1132{
1133 struct sigevent se;
1134 mm_segment_t oldfs;
1135 timer_t t;
1136 long err;
1137
1138 if (se32 == NULL)
1139 return sys_timer_create(clock, NULL, timer_id);
1140
1141 if (get_compat_sigevent(&se, se32))
1142 return -EFAULT;
1143
1144 if (!access_ok(VERIFY_WRITE,timer_id,sizeof(timer_t)))
1145 return -EFAULT;
1146
1147 oldfs = get_fs();
1148 set_fs(KERNEL_DS);
1149 err = sys_timer_create(clock,
1150 (struct sigevent __user *) &se,
1151 (timer_t __user *) &t);
1152 set_fs(oldfs);
1153
1154 if (!err)
1155 err = __put_user (t, timer_id);
1156
1157 return err;
1158}
diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S
index 53eaf2345fe9..98d24bc00044 100644
--- a/arch/sparc64/kernel/systbls.S
+++ b/arch/sparc64/kernel/systbls.S
@@ -73,7 +73,7 @@ sys_call_table32:
73/*250*/ .word sys32_mremap, sys32_sysctl, sys32_getsid, sys_fdatasync, sys32_nfsservctl 73/*250*/ .word sys32_mremap, sys32_sysctl, sys32_getsid, sys_fdatasync, sys32_nfsservctl
74 .word sys_ni_syscall, sys32_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep 74 .word sys_ni_syscall, sys32_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep
75/*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, sys32_timer_settime, compat_sys_timer_gettime, sys_timer_getoverrun 75/*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, sys32_timer_settime, compat_sys_timer_gettime, sys_timer_getoverrun
76 .word sys_timer_delete, sys32_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy 76 .word sys_timer_delete, compat_sys_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy
77/*270*/ .word sys32_io_submit, sys_io_cancel, compat_sys_io_getevents, sys32_mq_open, sys_mq_unlink 77/*270*/ .word sys32_io_submit, sys_io_cancel, compat_sys_io_getevents, sys32_mq_open, sys_mq_unlink
78 .word compat_sys_mq_timedsend, compat_sys_mq_timedreceive, compat_sys_mq_notify, compat_sys_mq_getsetattr, compat_sys_waitid 78 .word compat_sys_mq_timedsend, compat_sys_mq_timedreceive, compat_sys_mq_notify, compat_sys_mq_getsetattr, compat_sys_waitid
79/*280*/ .word sys_ni_syscall, sys_add_key, sys_request_key, sys_keyctl 79/*280*/ .word sys_ni_syscall, sys_add_key, sys_request_key, sys_keyctl
@@ -98,7 +98,7 @@ sys_call_table:
98 .word sys_umount, sys_setgid, sys_getgid, sys_signal, sys_geteuid 98 .word sys_umount, sys_setgid, sys_getgid, sys_signal, sys_geteuid
99/*50*/ .word sys_getegid, sys_acct, sys_memory_ordering, sys_nis_syscall, sys_ioctl 99/*50*/ .word sys_getegid, sys_acct, sys_memory_ordering, sys_nis_syscall, sys_ioctl
100 .word sys_reboot, sys_nis_syscall, sys_symlink, sys_readlink, sys_execve 100 .word sys_reboot, sys_nis_syscall, sys_symlink, sys_readlink, sys_execve
101/*60*/ .word sys_umask, sys_chroot, sys_newfstat, sys_stat64, sys_getpagesize 101/*60*/ .word sys_umask, sys_chroot, sys_newfstat, sys_fstat64, sys_getpagesize
102 .word sys_msync, sys_vfork, sys_pread64, sys_pwrite64, sys_nis_syscall 102 .word sys_msync, sys_vfork, sys_pread64, sys_pwrite64, sys_nis_syscall
103/*70*/ .word sys_nis_syscall, sys_mmap, sys_nis_syscall, sys64_munmap, sys_mprotect 103/*70*/ .word sys_nis_syscall, sys_mmap, sys_nis_syscall, sys64_munmap, sys_mprotect
104 .word sys_madvise, sys_vhangup, sys_nis_syscall, sys_mincore, sys_getgroups 104 .word sys_madvise, sys_vhangup, sys_nis_syscall, sys_mincore, sys_getgroups
diff --git a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c
index cd13b91b9ff6..ab0d0b170816 100644
--- a/arch/um/drivers/chan_kern.c
+++ b/arch/um/drivers/chan_kern.c
@@ -186,9 +186,6 @@ static void tty_receive_char(struct tty_struct *tty, char ch)
186 } 186 }
187 } 187 }
188 188
189 if((tty->flip.flag_buf_ptr == NULL) ||
190 (tty->flip.char_buf_ptr == NULL))
191 return;
192 tty_insert_flip_char(tty, ch, TTY_NORMAL); 189 tty_insert_flip_char(tty, ch, TTY_NORMAL);
193} 190}
194 191
@@ -653,8 +650,7 @@ void chan_interrupt(struct list_head *chans, struct work_struct *task,
653 chan = list_entry(ele, struct chan, list); 650 chan = list_entry(ele, struct chan, list);
654 if(!chan->input || (chan->ops->read == NULL)) continue; 651 if(!chan->input || (chan->ops->read == NULL)) continue;
655 do { 652 do {
656 if((tty != NULL) && 653 if (tty && !tty_buffer_request_room(tty, 1)) {
657 (tty->flip.count >= TTY_FLIPBUF_SIZE)){
658 schedule_delayed_work(task, 1); 654 schedule_delayed_work(task, 1);
659 goto out; 655 goto out;
660 } 656 }
diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c
index 11f518a7e156..8fa2ae7f3026 100644
--- a/arch/um/kernel/time.c
+++ b/arch/um/kernel/time.c
@@ -99,7 +99,8 @@ void uml_idle_timer(void)
99 set_interval(ITIMER_REAL); 99 set_interval(ITIMER_REAL);
100} 100}
101 101
102extern int do_posix_clock_monotonic_gettime(struct timespec *tp); 102extern void ktime_get_ts(struct timespec *ts);
103#define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts)
103 104
104void time_init(void) 105void time_init(void)
105{ 106{
@@ -114,8 +115,8 @@ void time_init(void)
114 wall_to_monotonic.tv_nsec = -now.tv_nsec; 115 wall_to_monotonic.tv_nsec = -now.tv_nsec;
115} 116}
116 117
117/* Declared in linux/time.h, which can't be included here */ 118/* Defined in linux/ktimer.h, which can't be included here */
118extern void clock_was_set(void); 119#define clock_was_set() do { } while (0)
119 120
120void do_gettimeofday(struct timeval *tv) 121void do_gettimeofday(struct timeval *tv)
121{ 122{
diff --git a/arch/v850/kernel/process.c b/arch/v850/kernel/process.c
index 39cf247cdae4..062ffa0a9998 100644
--- a/arch/v850/kernel/process.c
+++ b/arch/v850/kernel/process.c
@@ -164,30 +164,6 @@ int copy_thread (int nr, unsigned long clone_flags,
164} 164}
165 165
166/* 166/*
167 * fill in the user structure for a core dump..
168 */
169void dump_thread (struct pt_regs *regs, struct user *dump)
170{
171#if 0 /* Later. XXX */
172 dump->magic = CMAGIC;
173 dump->start_code = 0;
174 dump->start_stack = regs->gpr[GPR_SP];
175 dump->u_tsize = ((unsigned long) current->mm->end_code) >> PAGE_SHIFT;
176 dump->u_dsize = ((unsigned long) (current->mm->brk +
177 (PAGE_SIZE-1))) >> PAGE_SHIFT;
178 dump->u_dsize -= dump->u_tsize;
179 dump->u_ssize = 0;
180
181 if (dump->start_stack < TASK_SIZE)
182 dump->u_ssize = ((unsigned long) (TASK_SIZE - dump->start_stack)) >> PAGE_SHIFT;
183
184 dump->u_ar0 = (struct user_regs_struct *)((int)&dump->regs - (int)dump);
185 dump->regs = *regs;
186 dump->u_fpvalid = 0;
187#endif
188}
189
190/*
191 * sys_execve() executes a new program. 167 * sys_execve() executes a new program.
192 */ 168 */
193int sys_execve (char *name, char **argv, char **envp, struct pt_regs *regs) 169int sys_execve (char *name, char **argv, char **envp, struct pt_regs *regs)
diff --git a/arch/v850/kernel/v850_ksyms.c b/arch/v850/kernel/v850_ksyms.c
index 0ca64900dd91..8ffc29c1c89d 100644
--- a/arch/v850/kernel/v850_ksyms.c
+++ b/arch/v850/kernel/v850_ksyms.c
@@ -21,8 +21,6 @@ extern void *trap_table;
21EXPORT_SYMBOL (trap_table); 21EXPORT_SYMBOL (trap_table);
22 22
23/* platform dependent support */ 23/* platform dependent support */
24extern void dump_thread (struct pt_regs *, struct user *);
25EXPORT_SYMBOL (dump_thread);
26EXPORT_SYMBOL (kernel_thread); 24EXPORT_SYMBOL (kernel_thread);
27EXPORT_SYMBOL (enable_irq); 25EXPORT_SYMBOL (enable_irq);
28EXPORT_SYMBOL (disable_irq); 26EXPORT_SYMBOL (disable_irq);
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
index 4f3e925962c3..348b4a0d0d6f 100644
--- a/arch/x86_64/Kconfig
+++ b/arch/x86_64/Kconfig
@@ -399,17 +399,6 @@ config X86_MCE_AMD
399 Additional support for AMD specific MCE features such as 399 Additional support for AMD specific MCE features such as
400 the DRAM Error Threshold. 400 the DRAM Error Threshold.
401 401
402config PHYSICAL_START
403 hex "Physical address where the kernel is loaded" if EMBEDDED
404 default "0x100000"
405 help
406 This gives the physical address where the kernel is loaded.
407 Primarily used in the case of kexec on panic where the
408 fail safe kernel needs to run at a different address than
409 the panic-ed kernel.
410
411 Don't change this unless you know what you are doing.
412
413config KEXEC 402config KEXEC
414 bool "kexec system call (EXPERIMENTAL)" 403 bool "kexec system call (EXPERIMENTAL)"
415 depends on EXPERIMENTAL 404 depends on EXPERIMENTAL
@@ -427,6 +416,31 @@ config KEXEC
427 support. As of this writing the exact hardware interface is 416 support. As of this writing the exact hardware interface is
428 strongly in flux, so no good recommendation can be made. 417 strongly in flux, so no good recommendation can be made.
429 418
419config CRASH_DUMP
420 bool "kernel crash dumps (EXPERIMENTAL)"
421 depends on EXPERIMENTAL
422 help
423 Generate crash dump after being started by kexec.
424
425config PHYSICAL_START
426 hex "Physical address where the kernel is loaded" if (EMBEDDED || CRASH_DUMP)
427 default "0x1000000" if CRASH_DUMP
428 default "0x100000"
429 help
430 This gives the physical address where the kernel is loaded. Normally
431 for regular kernels this value is 0x100000 (1MB). But in the case
432 of kexec on panic the fail safe kernel needs to run at a different
433 address than the panic-ed kernel. This option is used to set the load
434 address for kernels used to capture crash dump on being kexec'ed
435 after panic. The default value for crash dump kernels is
436 0x1000000 (16MB). This can also be set based on the "X" value as
437 specified in the "crashkernel=YM@XM" command line boot parameter
438 passed to the panic-ed kernel. Typically this parameter is set as
439 crashkernel=64M@16M. Please take a look at
440 Documentation/kdump/kdump.txt for more details about crash dumps.
441
442 Don't change this unless you know what you are doing.
443
430config SECCOMP 444config SECCOMP
431 bool "Enable seccomp to safely compute untrusted bytecode" 445 bool "Enable seccomp to safely compute untrusted bytecode"
432 depends on PROC_FS 446 depends on PROC_FS
diff --git a/arch/x86_64/Makefile b/arch/x86_64/Makefile
index a9cd42e61828..51d83288d62b 100644
--- a/arch/x86_64/Makefile
+++ b/arch/x86_64/Makefile
@@ -80,9 +80,12 @@ bzlilo: vmlinux
80bzdisk: vmlinux 80bzdisk: vmlinux
81 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) zdisk 81 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) zdisk
82 82
83install fdimage fdimage144 fdimage288: vmlinux 83fdimage fdimage144 fdimage288: vmlinux
84 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@ 84 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@
85 85
86install:
87 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@
88
86archclean: 89archclean:
87 $(Q)$(MAKE) $(clean)=$(boot) 90 $(Q)$(MAKE) $(clean)=$(boot)
88 91
diff --git a/arch/x86_64/boot/Makefile b/arch/x86_64/boot/Makefile
index 18c6e915d69b..29f8396ed151 100644
--- a/arch/x86_64/boot/Makefile
+++ b/arch/x86_64/boot/Makefile
@@ -98,5 +98,5 @@ zlilo: $(BOOTIMAGE)
98 cp System.map $(INSTALL_PATH)/ 98 cp System.map $(INSTALL_PATH)/
99 if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi 99 if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
100 100
101install: $(BOOTIMAGE) 101install:
102 sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)" 102 sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)"
diff --git a/arch/x86_64/boot/install.sh b/arch/x86_64/boot/install.sh
index 198af15a7758..baaa2369bdb8 100644
--- a/arch/x86_64/boot/install.sh
+++ b/arch/x86_64/boot/install.sh
@@ -1,40 +1,2 @@
1#!/bin/sh 1#!/bin/sh
2# 2. $srctree/arch/i386/boot/install.sh
3# arch/x86_64/boot/install.sh
4#
5# This file is subject to the terms and conditions of the GNU General Public
6# License. See the file "COPYING" in the main directory of this archive
7# for more details.
8#
9# Copyright (C) 1995 by Linus Torvalds
10#
11# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin
12#
13# "make install" script for i386 architecture
14#
15# Arguments:
16# $1 - kernel version
17# $2 - kernel image file
18# $3 - kernel map file
19# $4 - default install path (blank if root directory)
20#
21
22# User may have a custom install script
23
24if [ -x ~/bin/${CROSS_COMPILE}installkernel ]; then exec ~/bin/${CROSS_COMPILE}installkernel "$@"; fi
25if [ -x /sbin/${CROSS_COMPILE}installkernel ]; then exec /sbin/${CROSS_COMPILE}installkernel "$@"; fi
26
27# Default install - same as make zlilo
28
29if [ -f $4/vmlinuz ]; then
30 mv $4/vmlinuz $4/vmlinuz.old
31fi
32
33if [ -f $4/System.map ]; then
34 mv $4/System.map $4/System.old
35fi
36
37cat $2 > $4/vmlinuz
38cp $3 $4/System.map
39
40if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
diff --git a/arch/x86_64/ia32/Makefile b/arch/x86_64/ia32/Makefile
index f76217d8f579..051608d55920 100644
--- a/arch/x86_64/ia32/Makefile
+++ b/arch/x86_64/ia32/Makefile
@@ -2,8 +2,7 @@
2# Makefile for the ia32 kernel emulation subsystem. 2# Makefile for the ia32 kernel emulation subsystem.
3# 3#
4 4
5obj-$(CONFIG_IA32_EMULATION) := ia32entry.o sys_ia32.o ia32_ioctl.o \ 5obj-$(CONFIG_IA32_EMULATION) := ia32entry.o sys_ia32.o ia32_signal.o tls32.o \
6 ia32_signal.o tls32.o \
7 ia32_binfmt.o fpu32.o ptrace32.o syscall32.o syscall32_syscall.o 6 ia32_binfmt.o fpu32.o ptrace32.o syscall32.o syscall32_syscall.o
8 7
9sysv-$(CONFIG_SYSVIPC) := ipc32.o 8sysv-$(CONFIG_SYSVIPC) := ipc32.o
@@ -29,4 +28,3 @@ $(obj)/vsyscall-%.so: $(src)/vsyscall.lds $(obj)/vsyscall-%.o FORCE
29 28
30AFLAGS_vsyscall-sysenter.o = -m32 29AFLAGS_vsyscall-sysenter.o = -m32
31AFLAGS_vsyscall-syscall.o = -m32 30AFLAGS_vsyscall-syscall.o = -m32
32CFLAGS_ia32_ioctl.o += -Ifs/
diff --git a/arch/x86_64/ia32/ia32_ioctl.c b/arch/x86_64/ia32/ia32_ioctl.c
deleted file mode 100644
index e335bd0b637d..000000000000
--- a/arch/x86_64/ia32/ia32_ioctl.c
+++ /dev/null
@@ -1,79 +0,0 @@
1/* $Id: ia32_ioctl.c,v 1.25 2002/10/11 07:17:06 ak Exp $
2 * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
3 *
4 * Copyright (C) 1997-2000 Jakub Jelinek (jakub@redhat.com)
5 * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be)
6 * Copyright (C) 2001,2002 Andi Kleen, SuSE Labs
7 *
8 * These routines maintain argument size conversion between 32bit and 64bit
9 * ioctls.
10 */
11
12#define INCLUDES
13#include <linux/syscalls.h>
14#include "compat_ioctl.c"
15#include <asm/ia32.h>
16
17#define CODE
18#include "compat_ioctl.c"
19
20#define RTC_IRQP_READ32 _IOR('p', 0x0b, unsigned int) /* Read IRQ rate */
21#define RTC_IRQP_SET32 _IOW('p', 0x0c, unsigned int) /* Set IRQ rate */
22#define RTC_EPOCH_READ32 _IOR('p', 0x0d, unsigned) /* Read epoch */
23#define RTC_EPOCH_SET32 _IOW('p', 0x0e, unsigned) /* Set epoch */
24
25static int rtc32_ioctl(unsigned fd, unsigned cmd, unsigned long arg)
26{
27 unsigned long val;
28 mm_segment_t oldfs = get_fs();
29 int ret;
30
31 switch (cmd) {
32 case RTC_IRQP_READ32:
33 set_fs(KERNEL_DS);
34 ret = sys_ioctl(fd, RTC_IRQP_READ, (unsigned long)&val);
35 set_fs(oldfs);
36 if (!ret)
37 ret = put_user(val, (unsigned int __user *) arg);
38 return ret;
39
40 case RTC_IRQP_SET32:
41 cmd = RTC_IRQP_SET;
42 break;
43
44 case RTC_EPOCH_READ32:
45 set_fs(KERNEL_DS);
46 ret = sys_ioctl(fd, RTC_EPOCH_READ, (unsigned long) &val);
47 set_fs(oldfs);
48 if (!ret)
49 ret = put_user(val, (unsigned int __user *) arg);
50 return ret;
51
52 case RTC_EPOCH_SET32:
53 cmd = RTC_EPOCH_SET;
54 break;
55 }
56 return sys_ioctl(fd,cmd,arg);
57}
58
59
60#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl_trans_handler_t)(handler) },
61#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL(cmd,sys_ioctl)
62
63struct ioctl_trans ioctl_start[] = {
64#include <linux/compat_ioctl.h>
65#define DECLARES
66#include "compat_ioctl.c"
67
68/* And these ioctls need translation */
69/* realtime device */
70HANDLE_IOCTL(RTC_IRQP_READ, rtc32_ioctl)
71HANDLE_IOCTL(RTC_IRQP_READ32,rtc32_ioctl)
72HANDLE_IOCTL(RTC_IRQP_SET32, rtc32_ioctl)
73HANDLE_IOCTL(RTC_EPOCH_READ32, rtc32_ioctl)
74HANDLE_IOCTL(RTC_EPOCH_SET32, rtc32_ioctl)
75/* take care of sizeof(sizeof()) breakage */
76};
77
78int ioctl_table_size = ARRAY_SIZE(ioctl_start);
79
diff --git a/arch/x86_64/ia32/ia32entry.S b/arch/x86_64/ia32/ia32entry.S
index 1f0ff5adc80e..2ff07b47ea9c 100644
--- a/arch/x86_64/ia32/ia32entry.S
+++ b/arch/x86_64/ia32/ia32entry.S
@@ -608,7 +608,7 @@ ia32_sys_call_table:
608 .quad sys_epoll_wait 608 .quad sys_epoll_wait
609 .quad sys_remap_file_pages 609 .quad sys_remap_file_pages
610 .quad sys_set_tid_address 610 .quad sys_set_tid_address
611 .quad sys32_timer_create 611 .quad compat_sys_timer_create
612 .quad compat_sys_timer_settime /* 260 */ 612 .quad compat_sys_timer_settime /* 260 */
613 .quad compat_sys_timer_gettime 613 .quad compat_sys_timer_gettime
614 .quad sys_timer_getoverrun 614 .quad sys_timer_getoverrun
diff --git a/arch/x86_64/ia32/sys_ia32.c b/arch/x86_64/ia32/sys_ia32.c
index 5389df610e78..54481af5344a 100644
--- a/arch/x86_64/ia32/sys_ia32.c
+++ b/arch/x86_64/ia32/sys_ia32.c
@@ -969,25 +969,6 @@ long sys32_kill(int pid, int sig)
969 return sys_kill(pid, sig); 969 return sys_kill(pid, sig);
970} 970}
971 971
972extern asmlinkage long
973sys_timer_create(clockid_t which_clock,
974 struct sigevent __user *timer_event_spec,
975 timer_t __user * created_timer_id);
976
977long
978sys32_timer_create(u32 clock, struct compat_sigevent __user *se32, timer_t __user *timer_id)
979{
980 struct sigevent __user *p = NULL;
981 if (se32) {
982 struct sigevent se;
983 p = compat_alloc_user_space(sizeof(struct sigevent));
984 if (get_compat_sigevent(&se, se32) ||
985 copy_to_user(p, &se, sizeof(se)))
986 return -EFAULT;
987 }
988 return sys_timer_create(clock, p, timer_id);
989}
990
991long sys32_fadvise64_64(int fd, __u32 offset_low, __u32 offset_high, 972long sys32_fadvise64_64(int fd, __u32 offset_low, __u32 offset_high,
992 __u32 len_low, __u32 len_high, int advice) 973 __u32 len_low, __u32 len_high, int advice)
993{ 974{
diff --git a/arch/x86_64/kernel/Makefile b/arch/x86_64/kernel/Makefile
index fe4cbd1c4b2f..12bc54005e2f 100644
--- a/arch/x86_64/kernel/Makefile
+++ b/arch/x86_64/kernel/Makefile
@@ -22,6 +22,7 @@ obj-$(CONFIG_X86_LOCAL_APIC) += apic.o nmi.o
22obj-$(CONFIG_X86_IO_APIC) += io_apic.o mpparse.o \ 22obj-$(CONFIG_X86_IO_APIC) += io_apic.o mpparse.o \
23 genapic.o genapic_cluster.o genapic_flat.o 23 genapic.o genapic_cluster.o genapic_flat.o
24obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o crash.o 24obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o crash.o
25obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
25obj-$(CONFIG_PM) += suspend.o 26obj-$(CONFIG_PM) += suspend.o
26obj-$(CONFIG_SOFTWARE_SUSPEND) += suspend_asm.o 27obj-$(CONFIG_SOFTWARE_SUSPEND) += suspend_asm.o
27obj-$(CONFIG_CPU_FREQ) += cpufreq/ 28obj-$(CONFIG_CPU_FREQ) += cpufreq/
diff --git a/arch/x86_64/kernel/crash.c b/arch/x86_64/kernel/crash.c
index 535e04466079..4e6c3b729e39 100644
--- a/arch/x86_64/kernel/crash.c
+++ b/arch/x86_64/kernel/crash.c
@@ -11,19 +11,156 @@
11#include <linux/types.h> 11#include <linux/types.h>
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/smp.h> 13#include <linux/smp.h>
14#include <linux/irq.h>
14#include <linux/reboot.h> 15#include <linux/reboot.h>
15#include <linux/kexec.h> 16#include <linux/kexec.h>
17#include <linux/delay.h>
18#include <linux/elf.h>
19#include <linux/elfcore.h>
16 20
17#include <asm/processor.h> 21#include <asm/processor.h>
18#include <asm/hardirq.h> 22#include <asm/hardirq.h>
19#include <asm/nmi.h> 23#include <asm/nmi.h>
20#include <asm/hw_irq.h> 24#include <asm/hw_irq.h>
25#include <asm/mach_apic.h>
21 26
22note_buf_t crash_notes[NR_CPUS]; 27/* This keeps a track of which one is crashing cpu. */
28static int crashing_cpu;
29
30static u32 *append_elf_note(u32 *buf, char *name, unsigned type,
31 void *data, size_t data_len)
32{
33 struct elf_note note;
34
35 note.n_namesz = strlen(name) + 1;
36 note.n_descsz = data_len;
37 note.n_type = type;
38 memcpy(buf, &note, sizeof(note));
39 buf += (sizeof(note) +3)/4;
40 memcpy(buf, name, note.n_namesz);
41 buf += (note.n_namesz + 3)/4;
42 memcpy(buf, data, note.n_descsz);
43 buf += (note.n_descsz + 3)/4;
44
45 return buf;
46}
47
48static void final_note(u32 *buf)
49{
50 struct elf_note note;
51
52 note.n_namesz = 0;
53 note.n_descsz = 0;
54 note.n_type = 0;
55 memcpy(buf, &note, sizeof(note));
56}
57
58static void crash_save_this_cpu(struct pt_regs *regs, int cpu)
59{
60 struct elf_prstatus prstatus;
61 u32 *buf;
62
63 if ((cpu < 0) || (cpu >= NR_CPUS))
64 return;
65
66 /* Using ELF notes here is opportunistic.
67 * I need a well defined structure format
68 * for the data I pass, and I need tags
69 * on the data to indicate what information I have
70 * squirrelled away. ELF notes happen to provide
71 * all of that that no need to invent something new.
72 */
73
74 buf = (u32*)per_cpu_ptr(crash_notes, cpu);
75
76 if (!buf)
77 return;
78
79 memset(&prstatus, 0, sizeof(prstatus));
80 prstatus.pr_pid = current->pid;
81 elf_core_copy_regs(&prstatus.pr_reg, regs);
82 buf = append_elf_note(buf, "CORE", NT_PRSTATUS, &prstatus,
83 sizeof(prstatus));
84 final_note(buf);
85}
86
87static void crash_save_self(struct pt_regs *regs)
88{
89 int cpu;
90
91 cpu = smp_processor_id();
92 crash_save_this_cpu(regs, cpu);
93}
94
95#ifdef CONFIG_SMP
96static atomic_t waiting_for_crash_ipi;
97
98static int crash_nmi_callback(struct pt_regs *regs, int cpu)
99{
100 /*
101 * Don't do anything if this handler is invoked on crashing cpu.
102 * Otherwise, system will completely hang. Crashing cpu can get
103 * an NMI if system was initially booted with nmi_watchdog parameter.
104 */
105 if (cpu == crashing_cpu)
106 return 1;
107 local_irq_disable();
108
109 crash_save_this_cpu(regs, cpu);
110 disable_local_APIC();
111 atomic_dec(&waiting_for_crash_ipi);
112 /* Assume hlt works */
113 for(;;)
114 asm("hlt");
115
116 return 1;
117}
118
119static void smp_send_nmi_allbutself(void)
120{
121 send_IPI_allbutself(APIC_DM_NMI);
122}
123
124/*
125 * This code is a best effort heuristic to get the
126 * other cpus to stop executing. So races with
127 * cpu hotplug shouldn't matter.
128 */
129
130static void nmi_shootdown_cpus(void)
131{
132 unsigned long msecs;
133
134 atomic_set(&waiting_for_crash_ipi, num_online_cpus() - 1);
135 set_nmi_callback(crash_nmi_callback);
136
137 /*
138 * Ensure the new callback function is set before sending
139 * out the NMI
140 */
141 wmb();
142
143 smp_send_nmi_allbutself();
144
145 msecs = 1000; /* Wait at most a second for the other cpus to stop */
146 while ((atomic_read(&waiting_for_crash_ipi) > 0) && msecs) {
147 mdelay(1);
148 msecs--;
149 }
150 /* Leave the nmi callback set */
151 disable_local_APIC();
152}
153#else
154static void nmi_shootdown_cpus(void)
155{
156 /* There are no cpus to shootdown */
157}
158#endif
23 159
24void machine_crash_shutdown(struct pt_regs *regs) 160void machine_crash_shutdown(struct pt_regs *regs)
25{ 161{
26 /* This function is only called after the system 162 /*
163 * This function is only called after the system
27 * has paniced or is otherwise in a critical state. 164 * has paniced or is otherwise in a critical state.
28 * The minimum amount of code to allow a kexec'd kernel 165 * The minimum amount of code to allow a kexec'd kernel
29 * to run successfully needs to happen here. 166 * to run successfully needs to happen here.
@@ -31,4 +168,19 @@ void machine_crash_shutdown(struct pt_regs *regs)
31 * In practice this means shooting down the other cpus in 168 * In practice this means shooting down the other cpus in
32 * an SMP system. 169 * an SMP system.
33 */ 170 */
171 /* The kernel is broken so disable interrupts */
172 local_irq_disable();
173
174 /* Make a note of crashing cpu. Will be used in NMI callback.*/
175 crashing_cpu = smp_processor_id();
176 nmi_shootdown_cpus();
177
178 if(cpu_has_apic)
179 disable_local_APIC();
180
181#if defined(CONFIG_X86_IO_APIC)
182 disable_IO_APIC();
183#endif
184
185 crash_save_self(regs);
34} 186}
diff --git a/arch/x86_64/kernel/crash_dump.c b/arch/x86_64/kernel/crash_dump.c
new file mode 100644
index 000000000000..942deac4d43a
--- /dev/null
+++ b/arch/x86_64/kernel/crash_dump.c
@@ -0,0 +1,47 @@
1/*
2 * kernel/crash_dump.c - Memory preserving reboot related code.
3 *
4 * Created by: Hariprasad Nellitheertha (hari@in.ibm.com)
5 * Copyright (C) IBM Corporation, 2004. All rights reserved
6 */
7
8#include <linux/errno.h>
9#include <linux/crash_dump.h>
10
11#include <asm/uaccess.h>
12#include <asm/io.h>
13
14/**
15 * copy_oldmem_page - copy one page from "oldmem"
16 * @pfn: page frame number to be copied
17 * @buf: target memory address for the copy; this can be in kernel address
18 * space or user address space (see @userbuf)
19 * @csize: number of bytes to copy
20 * @offset: offset in bytes into the page (based on pfn) to begin the copy
21 * @userbuf: if set, @buf is in user address space, use copy_to_user(),
22 * otherwise @buf is in kernel address space, use memcpy().
23 *
24 * Copy a page from "oldmem". For this page, there is no pte mapped
25 * in the current kernel. We stitch up a pte, similar to kmap_atomic.
26 */
27ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
28 size_t csize, unsigned long offset, int userbuf)
29{
30 void *vaddr;
31
32 if (!csize)
33 return 0;
34
35 vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE);
36
37 if (userbuf) {
38 if (copy_to_user(buf, (vaddr + offset), csize)) {
39 iounmap(vaddr);
40 return -EFAULT;
41 }
42 } else
43 memcpy(buf, (vaddr + offset), csize);
44
45 iounmap(vaddr);
46 return csize;
47}
diff --git a/arch/x86_64/kernel/e820.c b/arch/x86_64/kernel/e820.c
index 17579a1a174b..293cd71a266a 100644
--- a/arch/x86_64/kernel/e820.c
+++ b/arch/x86_64/kernel/e820.c
@@ -559,6 +559,27 @@ void __init parse_memopt(char *p, char **from)
559 end_user_pfn >>= PAGE_SHIFT; 559 end_user_pfn >>= PAGE_SHIFT;
560} 560}
561 561
562void __init parse_memmapopt(char *p, char **from)
563{
564 unsigned long long start_at, mem_size;
565
566 mem_size = memparse(p, from);
567 p = *from;
568 if (*p == '@') {
569 start_at = memparse(p+1, from);
570 add_memory_region(start_at, mem_size, E820_RAM);
571 } else if (*p == '#') {
572 start_at = memparse(p+1, from);
573 add_memory_region(start_at, mem_size, E820_ACPI);
574 } else if (*p == '$') {
575 start_at = memparse(p+1, from);
576 add_memory_region(start_at, mem_size, E820_RESERVED);
577 } else {
578 end_user_pfn = (mem_size >> PAGE_SHIFT);
579 }
580 p = *from;
581}
582
562unsigned long pci_mem_start = 0xaeedbabe; 583unsigned long pci_mem_start = 0xaeedbabe;
563 584
564/* 585/*
diff --git a/arch/x86_64/kernel/kprobes.c b/arch/x86_64/kernel/kprobes.c
index afe11f4fbd1d..b7dc1f816d13 100644
--- a/arch/x86_64/kernel/kprobes.c
+++ b/arch/x86_64/kernel/kprobes.c
@@ -42,8 +42,8 @@
42#include <asm/pgtable.h> 42#include <asm/pgtable.h>
43#include <asm/kdebug.h> 43#include <asm/kdebug.h>
44 44
45static DECLARE_MUTEX(kprobe_mutex);
46void jprobe_return_end(void); 45void jprobe_return_end(void);
46static void __kprobes arch_copy_kprobe(struct kprobe *p);
47 47
48DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; 48DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
49DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); 49DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
@@ -69,12 +69,11 @@ static inline int is_IF_modifier(kprobe_opcode_t *insn)
69int __kprobes arch_prepare_kprobe(struct kprobe *p) 69int __kprobes arch_prepare_kprobe(struct kprobe *p)
70{ 70{
71 /* insn: must be on special executable page on x86_64. */ 71 /* insn: must be on special executable page on x86_64. */
72 down(&kprobe_mutex);
73 p->ainsn.insn = get_insn_slot(); 72 p->ainsn.insn = get_insn_slot();
74 up(&kprobe_mutex);
75 if (!p->ainsn.insn) { 73 if (!p->ainsn.insn) {
76 return -ENOMEM; 74 return -ENOMEM;
77 } 75 }
76 arch_copy_kprobe(p);
78 return 0; 77 return 0;
79} 78}
80 79
@@ -181,7 +180,7 @@ static inline s32 *is_riprel(u8 *insn)
181 return NULL; 180 return NULL;
182} 181}
183 182
184void __kprobes arch_copy_kprobe(struct kprobe *p) 183static void __kprobes arch_copy_kprobe(struct kprobe *p)
185{ 184{
186 s32 *ripdisp; 185 s32 *ripdisp;
187 memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE); 186 memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE);
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
index 64c4534b930c..a0e0c9ca8f10 100644
--- a/arch/x86_64/kernel/setup.c
+++ b/arch/x86_64/kernel/setup.c
@@ -35,6 +35,7 @@
35#include <asm/processor.h> 35#include <asm/processor.h>
36#include <linux/console.h> 36#include <linux/console.h>
37#include <linux/seq_file.h> 37#include <linux/seq_file.h>
38#include <linux/crash_dump.h>
38#include <linux/root_dev.h> 39#include <linux/root_dev.h>
39#include <linux/pci.h> 40#include <linux/pci.h>
40#include <linux/acpi.h> 41#include <linux/acpi.h>
@@ -275,6 +276,7 @@ static __init void parse_cmdline_early (char ** cmdline_p)
275{ 276{
276 char c = ' ', *to = command_line, *from = COMMAND_LINE; 277 char c = ' ', *to = command_line, *from = COMMAND_LINE;
277 int len = 0; 278 int len = 0;
279 int userdef = 0;
278 280
279 /* Save unparsed command line copy for /proc/cmdline */ 281 /* Save unparsed command line copy for /proc/cmdline */
280 memcpy(saved_command_line, COMMAND_LINE, COMMAND_LINE_SIZE); 282 memcpy(saved_command_line, COMMAND_LINE, COMMAND_LINE_SIZE);
@@ -357,6 +359,28 @@ static __init void parse_cmdline_early (char ** cmdline_p)
357 if (!memcmp(from, "mem=", 4)) 359 if (!memcmp(from, "mem=", 4))
358 parse_memopt(from+4, &from); 360 parse_memopt(from+4, &from);
359 361
362 if (!memcmp(from, "memmap=", 7)) {
363 /* exactmap option is for used defined memory */
364 if (!memcmp(from+7, "exactmap", 8)) {
365#ifdef CONFIG_CRASH_DUMP
366 /* If we are doing a crash dump, we
367 * still need to know the real mem
368 * size before original memory map is
369 * reset.
370 */
371 saved_max_pfn = e820_end_of_ram();
372#endif
373 from += 8+7;
374 end_pfn_map = 0;
375 e820.nr_map = 0;
376 userdef = 1;
377 }
378 else {
379 parse_memmapopt(from+7, &from);
380 userdef = 1;
381 }
382 }
383
360#ifdef CONFIG_NUMA 384#ifdef CONFIG_NUMA
361 if (!memcmp(from, "numa=", 5)) 385 if (!memcmp(from, "numa=", 5))
362 numa_setup(from+5); 386 numa_setup(from+5);
@@ -395,6 +419,14 @@ static __init void parse_cmdline_early (char ** cmdline_p)
395 } 419 }
396#endif 420#endif
397 421
422#ifdef CONFIG_PROC_VMCORE
423 /* elfcorehdr= specifies the location of elf core header
424 * stored by the crashed kernel. This option will be passed
425 * by kexec loader to the capture kernel.
426 */
427 else if(!memcmp(from, "elfcorehdr=", 11))
428 elfcorehdr_addr = memparse(from+11, &from);
429#endif
398 next_char: 430 next_char:
399 c = *(from++); 431 c = *(from++);
400 if (!c) 432 if (!c)
@@ -403,6 +435,10 @@ static __init void parse_cmdline_early (char ** cmdline_p)
403 break; 435 break;
404 *(to++) = c; 436 *(to++) = c;
405 } 437 }
438 if (userdef) {
439 printk(KERN_INFO "user-defined physical RAM map:\n");
440 e820_print_map("user");
441 }
406 *to = '\0'; 442 *to = '\0';
407 *cmdline_p = command_line; 443 *cmdline_p = command_line;
408} 444}
diff --git a/arch/x86_64/kernel/x8664_ksyms.c b/arch/x86_64/kernel/x8664_ksyms.c
index 4a54221e10bc..b7fd6681c629 100644
--- a/arch/x86_64/kernel/x8664_ksyms.c
+++ b/arch/x86_64/kernel/x8664_ksyms.c
@@ -13,7 +13,6 @@
13#include <linux/string.h> 13#include <linux/string.h>
14#include <linux/syscalls.h> 14#include <linux/syscalls.h>
15#include <linux/tty.h> 15#include <linux/tty.h>
16#include <linux/ioctl32.h>
17 16
18#include <asm/semaphore.h> 17#include <asm/semaphore.h>
19#include <asm/processor.h> 18#include <asm/processor.h>
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
index 7e841aa2a4aa..7ee4a14ec3b1 100644
--- a/arch/xtensa/Kconfig
+++ b/arch/xtensa/Kconfig
@@ -18,10 +18,6 @@ config XTENSA
18 with reasonable minimum requirements. The Xtensa Linux project has 18 with reasonable minimum requirements. The Xtensa Linux project has
19 a home page at <http://xtensa.sourceforge.net/>. 19 a home page at <http://xtensa.sourceforge.net/>.
20 20
21config UID16
22 bool
23 default n
24
25config RWSEM_XCHGADD_ALGORITHM 21config RWSEM_XCHGADD_ALGORITHM
26 bool 22 bool
27 default y 23 default y