aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/Kconfig5
-rw-r--r--arch/alpha/kernel/alpha_ksyms.c1
-rw-r--r--arch/alpha/kernel/setup.c17
-rw-r--r--arch/alpha/kernel/smp.c8
-rw-r--r--arch/arm/Kconfig6
-rw-r--r--arch/arm/kernel/armksyms.c1
-rw-r--r--arch/arm/mach-at91rm9200/devices.c12
-rw-r--r--arch/arm26/kernel/armksyms.c1
-rw-r--r--arch/cris/kernel/crisksyms.c1
-rw-r--r--arch/frv/kernel/entry.S26
-rw-r--r--arch/frv/kernel/frv_ksyms.c1
-rw-r--r--arch/h8300/kernel/h8300_ksyms.c1
-rw-r--r--arch/i386/Kconfig73
-rw-r--r--arch/i386/Kconfig.cpu2
-rw-r--r--arch/i386/boot/video.S5
-rw-r--r--arch/i386/kernel/Makefile2
-rw-r--r--arch/i386/kernel/acpi/boot.c5
-rw-r--r--arch/i386/kernel/cpu/amd.c2
-rw-r--r--arch/i386/kernel/dmi_scan.c358
-rw-r--r--arch/i386/kernel/i386_ksyms.c1
-rw-r--r--arch/i386/kernel/mpparse.c22
-rw-r--r--arch/i386/kernel/syscall_table.S1
-rw-r--r--arch/i386/kernel/traps.c16
-rw-r--r--arch/i386/mach-voyager/voyager_cat.c10
-rw-r--r--arch/i386/pci/direct.c6
-rw-r--r--arch/i386/pci/irq.c3
-rw-r--r--arch/i386/pci/mmconfig.c2
-rw-r--r--arch/ia64/Kconfig19
-rw-r--r--arch/ia64/kernel/Makefile3
-rw-r--r--arch/ia64/kernel/acpi-ext.c143
-rw-r--r--arch/ia64/kernel/entry.S4
-rw-r--r--arch/ia64/kernel/mca.c43
-rw-r--r--arch/ia64/kernel/mca_asm.S10
-rw-r--r--arch/ia64/kernel/module.c2
-rw-r--r--arch/ia64/mm/discontig.c66
-rw-r--r--arch/ia64/mm/fault.c3
-rw-r--r--arch/ia64/sn/kernel/xpc_channel.c2
-rw-r--r--arch/m32r/Kconfig5
-rw-r--r--arch/m32r/kernel/m32r_ksyms.c29
-rw-r--r--arch/m32r/kernel/setup.c12
-rw-r--r--arch/m32r/kernel/smpboot.c19
-rw-r--r--arch/m32r/lib/Makefile4
-rw-r--r--arch/m32r/lib/getuser.S88
-rw-r--r--arch/m32r/lib/putuser.S84
-rw-r--r--arch/m68k/kernel/m68k_ksyms.c1
-rw-r--r--arch/m68knommu/kernel/m68k_ksyms.c1
-rw-r--r--arch/mips/Kconfig5
-rw-r--r--arch/mips/kernel/mips_ksyms.c1
-rw-r--r--arch/parisc/Kconfig5
-rw-r--r--arch/parisc/kernel/parisc_ksyms.c1
-rw-r--r--arch/powerpc/Kconfig5
-rw-r--r--arch/powerpc/kernel/systbl.S1
-rw-r--r--arch/ppc/boot/lib/Makefile2
-rw-r--r--arch/s390/Makefile1
-rw-r--r--arch/s390/defconfig48
-rw-r--r--arch/sh/Kconfig5
-rw-r--r--arch/sh/kernel/sh_ksyms.c1
-rw-r--r--arch/sh64/kernel/sh_ksyms.c1
-rw-r--r--arch/sparc/kernel/smp.c2
-rw-r--r--arch/sparc/kernel/sparc_ksyms.c1
-rw-r--r--arch/sparc/kernel/systbls.S2
-rw-r--r--arch/sparc/math-emu/Makefile2
-rw-r--r--arch/sparc64/kernel/pci_sun4v.c2
-rw-r--r--arch/sparc64/kernel/setup.c2
-rw-r--r--arch/sparc64/kernel/smp.c6
-rw-r--r--arch/sparc64/kernel/sparc64_ksyms.c1
-rw-r--r--arch/sparc64/kernel/sys32.S1
-rw-r--r--arch/sparc64/kernel/systbls.S4
-rw-r--r--arch/um/Makefile3
-rw-r--r--arch/um/drivers/cow.h2
-rw-r--r--arch/um/drivers/cow_sys.h2
-rw-r--r--arch/um/drivers/cow_user.c94
-rw-r--r--arch/um/drivers/mconsole_kern.c8
-rw-r--r--arch/um/drivers/net_user.c4
-rw-r--r--arch/um/drivers/slirp_user.c2
-rw-r--r--arch/um/include/kern_util.h4
-rw-r--r--arch/um/include/tt/tt.h3
-rw-r--r--arch/um/include/user.h6
-rw-r--r--arch/um/include/user_util.h3
-rw-r--r--arch/um/kernel/ksyms.c5
-rw-r--r--arch/um/os-Linux/drivers/ethertap_user.c2
-rw-r--r--arch/um/os-Linux/helper.c10
-rw-r--r--arch/um/os-Linux/mem.c23
-rw-r--r--arch/um/os-Linux/sigio.c2
-rw-r--r--arch/um/os-Linux/skas/mem.c4
-rw-r--r--arch/um/os-Linux/skas/process.c4
-rw-r--r--arch/um/os-Linux/sys-i386/tls.c1
-rw-r--r--arch/um/os-Linux/umid.c15
-rw-r--r--arch/um/os-Linux/user_syms.c9
-rw-r--r--arch/um/scripts/Makefile.rules6
-rw-r--r--arch/um/sys-i386/ksyms.c4
-rw-r--r--arch/um/sys-i386/ptrace_user.c2
-rw-r--r--arch/um/sys-i386/signal.c2
-rw-r--r--arch/um/sys-i386/tls.c2
-rw-r--r--arch/um/sys-x86_64/signal.c2
-rw-r--r--arch/v850/kernel/v850_ksyms.c1
-rw-r--r--arch/x86_64/Kconfig5
-rw-r--r--arch/x86_64/boot/video.S5
-rw-r--r--arch/x86_64/kernel/Makefile4
-rw-r--r--arch/x86_64/kernel/ptrace.c5
-rw-r--r--arch/x86_64/kernel/x8664_ksyms.c1
-rw-r--r--arch/x86_64/pci/mmconfig.c4
-rw-r--r--arch/xtensa/kernel/xtensa_ksyms.c1
103 files changed, 574 insertions, 901 deletions
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index 9bef61b30367..8290b69da202 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -549,6 +549,11 @@ config NUMA
549 Access). This option is for configuring high-end multiprocessor 549 Access). This option is for configuring high-end multiprocessor
550 server machines. If in doubt, say N. 550 server machines. If in doubt, say N.
551 551
552config NODES_SHIFT
553 int
554 default "7"
555 depends on NEED_MULTIPLE_NODES
556
552# LARGE_VMALLOC is racy, if you *really* need it then fix it first 557# LARGE_VMALLOC is racy, if you *really* need it then fix it first
553config ALPHA_LARGE_VMALLOC 558config ALPHA_LARGE_VMALLOC
554 bool 559 bool
diff --git a/arch/alpha/kernel/alpha_ksyms.c b/arch/alpha/kernel/alpha_ksyms.c
index 9d6186d50245..c645c5e14786 100644
--- a/arch/alpha/kernel/alpha_ksyms.c
+++ b/arch/alpha/kernel/alpha_ksyms.c
@@ -76,7 +76,6 @@ EXPORT_SYMBOL(strncpy);
76EXPORT_SYMBOL(strnlen); 76EXPORT_SYMBOL(strnlen);
77EXPORT_SYMBOL(strncat); 77EXPORT_SYMBOL(strncat);
78EXPORT_SYMBOL(strstr); 78EXPORT_SYMBOL(strstr);
79EXPORT_SYMBOL(strpbrk);
80EXPORT_SYMBOL(strchr); 79EXPORT_SYMBOL(strchr);
81EXPORT_SYMBOL(strrchr); 80EXPORT_SYMBOL(strrchr);
82EXPORT_SYMBOL(memcmp); 81EXPORT_SYMBOL(memcmp);
diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c
index a15e18a00258..558b83368559 100644
--- a/arch/alpha/kernel/setup.c
+++ b/arch/alpha/kernel/setup.c
@@ -24,6 +24,7 @@
24#include <linux/config.h> /* CONFIG_ALPHA_LCA etc */ 24#include <linux/config.h> /* CONFIG_ALPHA_LCA etc */
25#include <linux/mc146818rtc.h> 25#include <linux/mc146818rtc.h>
26#include <linux/console.h> 26#include <linux/console.h>
27#include <linux/cpu.h>
27#include <linux/errno.h> 28#include <linux/errno.h>
28#include <linux/init.h> 29#include <linux/init.h>
29#include <linux/string.h> 30#include <linux/string.h>
@@ -471,6 +472,22 @@ page_is_ram(unsigned long pfn)
471 return 0; 472 return 0;
472} 473}
473 474
475static int __init
476register_cpus(void)
477{
478 int i;
479
480 for_each_possible_cpu(i) {
481 struct cpu *p = kzalloc(sizeof(*p), GFP_KERNEL);
482 if (!p)
483 return -ENOMEM;
484 register_cpu(p, i, NULL);
485 }
486 return 0;
487}
488
489arch_initcall(register_cpus);
490
474void __init 491void __init
475setup_arch(char **cmdline_p) 492setup_arch(char **cmdline_p)
476{ 493{
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c
index 02c2db08114a..185255416e85 100644
--- a/arch/alpha/kernel/smp.c
+++ b/arch/alpha/kernel/smp.c
@@ -439,7 +439,7 @@ setup_smp(void)
439 if ((cpu->flags & 0x1cc) == 0x1cc) { 439 if ((cpu->flags & 0x1cc) == 0x1cc) {
440 smp_num_probed++; 440 smp_num_probed++;
441 /* Assume here that "whami" == index */ 441 /* Assume here that "whami" == index */
442 cpu_set(i, cpu_possible_map); 442 cpu_set(i, cpu_present_mask);
443 cpu->pal_revision = boot_cpu_palrev; 443 cpu->pal_revision = boot_cpu_palrev;
444 } 444 }
445 445
@@ -450,9 +450,8 @@ setup_smp(void)
450 } 450 }
451 } else { 451 } else {
452 smp_num_probed = 1; 452 smp_num_probed = 1;
453 cpu_set(boot_cpuid, cpu_possible_map); 453 cpu_set(boot_cpuid, cpu_present_mask);
454 } 454 }
455 cpu_present_mask = cpumask_of_cpu(boot_cpuid);
456 455
457 printk(KERN_INFO "SMP: %d CPUs probed -- cpu_present_mask = %lx\n", 456 printk(KERN_INFO "SMP: %d CPUs probed -- cpu_present_mask = %lx\n",
458 smp_num_probed, cpu_possible_map.bits[0]); 457 smp_num_probed, cpu_possible_map.bits[0]);
@@ -488,9 +487,8 @@ void __devinit
488smp_prepare_boot_cpu(void) 487smp_prepare_boot_cpu(void)
489{ 488{
490 /* 489 /*
491 * Mark the boot cpu (current cpu) as both present and online 490 * Mark the boot cpu (current cpu) as online
492 */ 491 */
493 cpu_set(smp_processor_id(), cpu_present_mask);
494 cpu_set(smp_processor_id(), cpu_online_map); 492 cpu_set(smp_processor_id(), cpu_online_map);
495} 493}
496 494
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index dc5a9332c915..1dbf6ddb300d 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -512,6 +512,12 @@ config ARCH_DISCONTIGMEM_ENABLE
512 or have huge holes in the physical address space for other reasons. 512 or have huge holes in the physical address space for other reasons.
513 See <file:Documentation/vm/numa> for more. 513 See <file:Documentation/vm/numa> for more.
514 514
515config NODES_SHIFT
516 int
517 default "4" if ARCH_LH7A40X
518 default "2"
519 depends on NEED_MULTIPLE_NODES
520
515source "mm/Kconfig" 521source "mm/Kconfig"
516 522
517config LEDS 523config LEDS
diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
index ee083b3f0522..c49b5d4d7fca 100644
--- a/arch/arm/kernel/armksyms.c
+++ b/arch/arm/kernel/armksyms.c
@@ -101,7 +101,6 @@ EXPORT_SYMBOL(__raw_writesl);
101 101
102 /* string / mem functions */ 102 /* string / mem functions */
103EXPORT_SYMBOL(strchr); 103EXPORT_SYMBOL(strchr);
104EXPORT_SYMBOL(strpbrk);
105EXPORT_SYMBOL(strrchr); 104EXPORT_SYMBOL(strrchr);
106EXPORT_SYMBOL(memset); 105EXPORT_SYMBOL(memset);
107EXPORT_SYMBOL(memcpy); 106EXPORT_SYMBOL(memcpy);
diff --git a/arch/arm/mach-at91rm9200/devices.c b/arch/arm/mach-at91rm9200/devices.c
index 1781b8f342c4..bfe47bd6e50c 100644
--- a/arch/arm/mach-at91rm9200/devices.c
+++ b/arch/arm/mach-at91rm9200/devices.c
@@ -194,13 +194,23 @@ void __init at91_add_device_eth(struct at91_eth_data *data) {}
194#if defined(CONFIG_AT91_CF) || defined(CONFIG_AT91_CF_MODULE) 194#if defined(CONFIG_AT91_CF) || defined(CONFIG_AT91_CF_MODULE)
195static struct at91_cf_data cf_data; 195static struct at91_cf_data cf_data;
196 196
197static struct resource at91_cf_resources[] = {
198 [0] = {
199 .start = AT91_CF_BASE,
200 /* ties up CS4, CS5, and CS6 */
201 .end = AT91_CF_BASE + (0x30000000 - 1),
202 .flags = IORESOURCE_MEM | IORESOURCE_MEM_8AND16BIT,
203 },
204};
205
197static struct platform_device at91rm9200_cf_device = { 206static struct platform_device at91rm9200_cf_device = {
198 .name = "at91_cf", 207 .name = "at91_cf",
199 .id = -1, 208 .id = -1,
200 .dev = { 209 .dev = {
201 .platform_data = &cf_data, 210 .platform_data = &cf_data,
202 }, 211 },
203 .num_resources = 0, 212 .resource = at91_cf_resources,
213 .num_resources = ARRAY_SIZE(at91_cf_resources),
204}; 214};
205 215
206void __init at91_add_device_cf(struct at91_cf_data *data) 216void __init at91_add_device_cf(struct at91_cf_data *data)
diff --git a/arch/arm26/kernel/armksyms.c b/arch/arm26/kernel/armksyms.c
index a6a1b3373444..9d66c27f2724 100644
--- a/arch/arm26/kernel/armksyms.c
+++ b/arch/arm26/kernel/armksyms.c
@@ -152,7 +152,6 @@ EXPORT_SYMBOL(strncmp);
152EXPORT_SYMBOL(strchr); 152EXPORT_SYMBOL(strchr);
153EXPORT_SYMBOL(strlen); 153EXPORT_SYMBOL(strlen);
154EXPORT_SYMBOL(strnlen); 154EXPORT_SYMBOL(strnlen);
155EXPORT_SYMBOL(strpbrk);
156EXPORT_SYMBOL(strrchr); 155EXPORT_SYMBOL(strrchr);
157EXPORT_SYMBOL(strstr); 156EXPORT_SYMBOL(strstr);
158EXPORT_SYMBOL(memset); 157EXPORT_SYMBOL(memset);
diff --git a/arch/cris/kernel/crisksyms.c b/arch/cris/kernel/crisksyms.c
index de39725da920..d57859053ce7 100644
--- a/arch/cris/kernel/crisksyms.c
+++ b/arch/cris/kernel/crisksyms.c
@@ -39,7 +39,6 @@ EXPORT_SYMBOL(loops_per_usec);
39/* String functions */ 39/* String functions */
40EXPORT_SYMBOL(memcmp); 40EXPORT_SYMBOL(memcmp);
41EXPORT_SYMBOL(memmove); 41EXPORT_SYMBOL(memmove);
42EXPORT_SYMBOL(strpbrk);
43EXPORT_SYMBOL(strstr); 42EXPORT_SYMBOL(strstr);
44EXPORT_SYMBOL(strcpy); 43EXPORT_SYMBOL(strcpy);
45EXPORT_SYMBOL(strchr); 44EXPORT_SYMBOL(strchr);
diff --git a/arch/frv/kernel/entry.S b/arch/frv/kernel/entry.S
index 1d21c8d34d8a..a9b59527a741 100644
--- a/arch/frv/kernel/entry.S
+++ b/arch/frv/kernel/entry.S
@@ -1170,12 +1170,6 @@ __syscall_badsys:
1170# syscall vector table 1170# syscall vector table
1171# 1171#
1172############################################################################### 1172###############################################################################
1173#ifdef CONFIG_MMU
1174#define __MMU(X) X
1175#else
1176#define __MMU(X) sys_ni_syscall
1177#endif
1178
1179 .section .rodata 1173 .section .rodata
1180ALIGN 1174ALIGN
1181 .globl sys_call_table 1175 .globl sys_call_table
@@ -1305,7 +1299,7 @@ sys_call_table:
1305 .long sys_newuname 1299 .long sys_newuname
1306 .long sys_ni_syscall /* old "cacheflush" */ 1300 .long sys_ni_syscall /* old "cacheflush" */
1307 .long sys_adjtimex 1301 .long sys_adjtimex
1308 .long __MMU(sys_mprotect) /* 125 */ 1302 .long sys_mprotect /* 125 */
1309 .long sys_sigprocmask 1303 .long sys_sigprocmask
1310 .long sys_ni_syscall /* old "create_module" */ 1304 .long sys_ni_syscall /* old "create_module" */
1311 .long sys_init_module 1305 .long sys_init_module
@@ -1324,16 +1318,16 @@ sys_call_table:
1324 .long sys_getdents 1318 .long sys_getdents
1325 .long sys_select 1319 .long sys_select
1326 .long sys_flock 1320 .long sys_flock
1327 .long __MMU(sys_msync) 1321 .long sys_msync
1328 .long sys_readv /* 145 */ 1322 .long sys_readv /* 145 */
1329 .long sys_writev 1323 .long sys_writev
1330 .long sys_getsid 1324 .long sys_getsid
1331 .long sys_fdatasync 1325 .long sys_fdatasync
1332 .long sys_sysctl 1326 .long sys_sysctl
1333 .long __MMU(sys_mlock) /* 150 */ 1327 .long sys_mlock /* 150 */
1334 .long __MMU(sys_munlock) 1328 .long sys_munlock
1335 .long __MMU(sys_mlockall) 1329 .long sys_mlockall
1336 .long __MMU(sys_munlockall) 1330 .long sys_munlockall
1337 .long sys_sched_setparam 1331 .long sys_sched_setparam
1338 .long sys_sched_getparam /* 155 */ 1332 .long sys_sched_getparam /* 155 */
1339 .long sys_sched_setscheduler 1333 .long sys_sched_setscheduler
@@ -1343,7 +1337,7 @@ sys_call_table:
1343 .long sys_sched_get_priority_min /* 160 */ 1337 .long sys_sched_get_priority_min /* 160 */
1344 .long sys_sched_rr_get_interval 1338 .long sys_sched_rr_get_interval
1345 .long sys_nanosleep 1339 .long sys_nanosleep
1346 .long __MMU(sys_mremap) 1340 .long sys_mremap
1347 .long sys_setresuid16 1341 .long sys_setresuid16
1348 .long sys_getresuid16 /* 165 */ 1342 .long sys_getresuid16 /* 165 */
1349 .long sys_ni_syscall /* for vm86 */ 1343 .long sys_ni_syscall /* for vm86 */
@@ -1398,8 +1392,8 @@ sys_call_table:
1398 .long sys_setfsuid /* 215 */ 1392 .long sys_setfsuid /* 215 */
1399 .long sys_setfsgid 1393 .long sys_setfsgid
1400 .long sys_pivot_root 1394 .long sys_pivot_root
1401 .long __MMU(sys_mincore) 1395 .long sys_mincore
1402 .long __MMU(sys_madvise) 1396 .long sys_madvise
1403 .long sys_getdents64 /* 220 */ 1397 .long sys_getdents64 /* 220 */
1404 .long sys_fcntl64 1398 .long sys_fcntl64
1405 .long sys_ni_syscall /* reserved for TUX */ 1399 .long sys_ni_syscall /* reserved for TUX */
@@ -1437,7 +1431,7 @@ sys_call_table:
1437 .long sys_epoll_create 1431 .long sys_epoll_create
1438 .long sys_epoll_ctl /* 255 */ 1432 .long sys_epoll_ctl /* 255 */
1439 .long sys_epoll_wait 1433 .long sys_epoll_wait
1440 .long __MMU(sys_remap_file_pages) 1434 .long sys_remap_file_pages
1441 .long sys_set_tid_address 1435 .long sys_set_tid_address
1442 .long sys_timer_create 1436 .long sys_timer_create
1443 .long sys_timer_settime /* 260 */ 1437 .long sys_timer_settime /* 260 */
diff --git a/arch/frv/kernel/frv_ksyms.c b/arch/frv/kernel/frv_ksyms.c
index 07c8ffa0dd39..0f273a7aca5a 100644
--- a/arch/frv/kernel/frv_ksyms.c
+++ b/arch/frv/kernel/frv_ksyms.c
@@ -27,7 +27,6 @@ EXPORT_SYMBOL(__ioremap);
27EXPORT_SYMBOL(iounmap); 27EXPORT_SYMBOL(iounmap);
28 28
29EXPORT_SYMBOL(strnlen); 29EXPORT_SYMBOL(strnlen);
30EXPORT_SYMBOL(strpbrk);
31EXPORT_SYMBOL(strrchr); 30EXPORT_SYMBOL(strrchr);
32EXPORT_SYMBOL(strstr); 31EXPORT_SYMBOL(strstr);
33EXPORT_SYMBOL(strchr); 32EXPORT_SYMBOL(strchr);
diff --git a/arch/h8300/kernel/h8300_ksyms.c b/arch/h8300/kernel/h8300_ksyms.c
index b6cd78c972bb..f8d6dee84781 100644
--- a/arch/h8300/kernel/h8300_ksyms.c
+++ b/arch/h8300/kernel/h8300_ksyms.c
@@ -25,7 +25,6 @@ extern char h8300_debug_device[];
25/* platform dependent support */ 25/* platform dependent support */
26 26
27EXPORT_SYMBOL(strnlen); 27EXPORT_SYMBOL(strnlen);
28EXPORT_SYMBOL(strpbrk);
29EXPORT_SYMBOL(strrchr); 28EXPORT_SYMBOL(strrchr);
30EXPORT_SYMBOL(strstr); 29EXPORT_SYMBOL(strstr);
31EXPORT_SYMBOL(strchr); 30EXPORT_SYMBOL(strchr);
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index f17bd1d2707e..18ec9fe6deb6 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -53,6 +53,35 @@ source "init/Kconfig"
53 53
54menu "Processor type and features" 54menu "Processor type and features"
55 55
56config SMP
57 bool "Symmetric multi-processing support"
58 ---help---
59 This enables support for systems with more than one CPU. If you have
60 a system with only one CPU, like most personal computers, say N. If
61 you have a system with more than one CPU, say Y.
62
63 If you say N here, the kernel will run on single and multiprocessor
64 machines, but will use only one CPU of a multiprocessor machine. If
65 you say Y here, the kernel will run on many, but not all,
66 singleprocessor machines. On a singleprocessor machine, the kernel
67 will run faster if you say N here.
68
69 Note that if you say Y here and choose architecture "586" or
70 "Pentium" under "Processor family", the kernel will not work on 486
71 architectures. Similarly, multiprocessor kernels for the "PPro"
72 architecture may not work on all Pentium based boards.
73
74 People using multiprocessor machines who say Y here should also say
75 Y to "Enhanced Real Time Clock Support", below. The "Advanced Power
76 Management" code will be disabled if you say Y here.
77
78 See also the <file:Documentation/smp.txt>,
79 <file:Documentation/i386/IO-APIC.txt>,
80 <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO available at
81 <http://www.tldp.org/docs.html#howto>.
82
83 If you don't know what to do here, say N.
84
56choice 85choice
57 prompt "Subarchitecture Type" 86 prompt "Subarchitecture Type"
58 default X86_PC 87 default X86_PC
@@ -178,35 +207,6 @@ config HPET_EMULATE_RTC
178 depends on HPET_TIMER && RTC=y 207 depends on HPET_TIMER && RTC=y
179 default y 208 default y
180 209
181config SMP
182 bool "Symmetric multi-processing support"
183 ---help---
184 This enables support for systems with more than one CPU. If you have
185 a system with only one CPU, like most personal computers, say N. If
186 you have a system with more than one CPU, say Y.
187
188 If you say N here, the kernel will run on single and multiprocessor
189 machines, but will use only one CPU of a multiprocessor machine. If
190 you say Y here, the kernel will run on many, but not all,
191 singleprocessor machines. On a singleprocessor machine, the kernel
192 will run faster if you say N here.
193
194 Note that if you say Y here and choose architecture "586" or
195 "Pentium" under "Processor family", the kernel will not work on 486
196 architectures. Similarly, multiprocessor kernels for the "PPro"
197 architecture may not work on all Pentium based boards.
198
199 People using multiprocessor machines who say Y here should also say
200 Y to "Enhanced Real Time Clock Support", below. The "Advanced Power
201 Management" code will be disabled if you say Y here.
202
203 See also the <file:Documentation/smp.txt>,
204 <file:Documentation/i386/IO-APIC.txt>,
205 <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO available at
206 <http://www.tldp.org/docs.html#howto>.
207
208 If you don't know what to do here, say N.
209
210config NR_CPUS 210config NR_CPUS
211 int "Maximum number of CPUs (2-255)" 211 int "Maximum number of CPUs (2-255)"
212 range 2 255 212 range 2 255
@@ -522,6 +522,12 @@ config NUMA
522comment "NUMA (Summit) requires SMP, 64GB highmem support, ACPI" 522comment "NUMA (Summit) requires SMP, 64GB highmem support, ACPI"
523 depends on X86_SUMMIT && (!HIGHMEM64G || !ACPI) 523 depends on X86_SUMMIT && (!HIGHMEM64G || !ACPI)
524 524
525config NODES_SHIFT
526 int
527 default "4" if X86_NUMAQ
528 default "3"
529 depends on NEED_MULTIPLE_NODES
530
525config HAVE_ARCH_BOOTMEM_NODE 531config HAVE_ARCH_BOOTMEM_NODE
526 bool 532 bool
527 depends on NUMA 533 depends on NUMA
@@ -757,15 +763,6 @@ config HOTPLUG_CPU
757 763
758 Say N. 764 Say N.
759 765
760config DOUBLEFAULT
761 default y
762 bool "Enable doublefault exception handler" if EMBEDDED
763 help
764 This option allows trapping of rare doublefault exceptions that
765 would otherwise cause a system to silently reboot. Disabling this
766 option saves about 4k and might cause you much additional grey
767 hair.
768
769endmenu 766endmenu
770 767
771 768
diff --git a/arch/i386/Kconfig.cpu b/arch/i386/Kconfig.cpu
index 79603b3471f9..eb130482ba18 100644
--- a/arch/i386/Kconfig.cpu
+++ b/arch/i386/Kconfig.cpu
@@ -311,5 +311,5 @@ config X86_OOSTORE
311 311
312config X86_TSC 312config X86_TSC
313 bool 313 bool
314 depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MGEODEGX1) && !X86_NUMAQ 314 depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MGEODEGX1 || MGEODE_LX) && !X86_NUMAQ
315 default y 315 default y
diff --git a/arch/i386/boot/video.S b/arch/i386/boot/video.S
index 0000a2674537..c9343c3a8082 100644
--- a/arch/i386/boot/video.S
+++ b/arch/i386/boot/video.S
@@ -97,6 +97,7 @@
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
100 101
101/* Define DO_STORE according to CONFIG_VIDEO_RETAIN */ 102/* Define DO_STORE according to CONFIG_VIDEO_RETAIN */
102#ifdef CONFIG_VIDEO_RETAIN 103#ifdef CONFIG_VIDEO_RETAIN
@@ -233,6 +234,10 @@ mopar_gr:
233 movw 18(%di), %ax 234 movw 18(%di), %ax
234 movl %eax, %fs:(PARAM_LFB_SIZE) 235 movl %eax, %fs:(PARAM_LFB_SIZE)
235 236
237# store mode capabilities
238 movl 10(%di), %eax
239 movl %eax, %fs:(PARAM_CAPABILITIES)
240
236# switching the DAC to 8-bit is for <= 8 bpp only 241# switching the DAC to 8-bit is for <= 8 bpp only
237 movw %fs:(PARAM_LFB_DEPTH), %ax 242 movw %fs:(PARAM_LFB_DEPTH), %ax
238 cmpw $8, %ax 243 cmpw $8, %ax
diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile
index 5b9ed21216cf..96fb8a020af2 100644
--- a/arch/i386/kernel/Makefile
+++ b/arch/i386/kernel/Makefile
@@ -6,7 +6,7 @@ extra-y := head.o init_task.o vmlinux.lds
6 6
7obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \ 7obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \
8 ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \ 8 ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \
9 pci-dma.o i386_ksyms.o i387.o dmi_scan.o bootflag.o \ 9 pci-dma.o i386_ksyms.o i387.o bootflag.o \
10 quirks.o i8237.o topology.o alternative.o 10 quirks.o i8237.o topology.o alternative.o
11 11
12obj-y += cpu/ 12obj-y += cpu/
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
index 8dab3527bc97..030a0007a4e0 100644
--- a/arch/i386/kernel/acpi/boot.c
+++ b/arch/i386/kernel/acpi/boot.c
@@ -168,7 +168,7 @@ int __init acpi_parse_mcfg(unsigned long phys_addr, unsigned long size)
168 unsigned long i; 168 unsigned long i;
169 int config_size; 169 int config_size;
170 170
171 if (!phys_addr || !size) 171 if (!phys_addr || !size || !cpu_has_apic)
172 return -EINVAL; 172 return -EINVAL;
173 173
174 mcfg = (struct acpi_table_mcfg *)__acpi_map_table(phys_addr, size); 174 mcfg = (struct acpi_table_mcfg *)__acpi_map_table(phys_addr, size);
@@ -693,6 +693,9 @@ static int __init acpi_parse_madt_lapic_entries(void)
693{ 693{
694 int count; 694 int count;
695 695
696 if (!cpu_has_apic)
697 return -ENODEV;
698
696 /* 699 /*
697 * Note that the LAPIC address is obtained from the MADT (32-bit value) 700 * Note that the LAPIC address is obtained from the MADT (32-bit value)
698 * and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value). 701 * and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value).
diff --git a/arch/i386/kernel/cpu/amd.c b/arch/i386/kernel/cpu/amd.c
index 0810f81f2a05..ff2b2154ac1b 100644
--- a/arch/i386/kernel/cpu/amd.c
+++ b/arch/i386/kernel/cpu/amd.c
@@ -212,8 +212,6 @@ static void __init init_amd(struct cpuinfo_x86 *c)
212 212
213 if (cpuid_eax(0x80000000) >= 0x80000008) { 213 if (cpuid_eax(0x80000000) >= 0x80000008) {
214 c->x86_max_cores = (cpuid_ecx(0x80000008) & 0xff) + 1; 214 c->x86_max_cores = (cpuid_ecx(0x80000008) & 0xff) + 1;
215 if (c->x86_max_cores & (c->x86_max_cores - 1))
216 c->x86_max_cores = 1;
217 } 215 }
218 216
219 if (cpuid_eax(0x80000000) >= 0x80000007) { 217 if (cpuid_eax(0x80000000) >= 0x80000007) {
diff --git a/arch/i386/kernel/dmi_scan.c b/arch/i386/kernel/dmi_scan.c
deleted file mode 100644
index 5efceebc48dc..000000000000
--- a/arch/i386/kernel/dmi_scan.c
+++ /dev/null
@@ -1,358 +0,0 @@
1#include <linux/types.h>
2#include <linux/string.h>
3#include <linux/init.h>
4#include <linux/module.h>
5#include <linux/dmi.h>
6#include <linux/efi.h>
7#include <linux/bootmem.h>
8#include <linux/slab.h>
9#include <asm/dmi.h>
10
11static char * __init dmi_string(struct dmi_header *dm, u8 s)
12{
13 u8 *bp = ((u8 *) dm) + dm->length;
14 char *str = "";
15
16 if (s) {
17 s--;
18 while (s > 0 && *bp) {
19 bp += strlen(bp) + 1;
20 s--;
21 }
22
23 if (*bp != 0) {
24 str = dmi_alloc(strlen(bp) + 1);
25 if (str != NULL)
26 strcpy(str, bp);
27 else
28 printk(KERN_ERR "dmi_string: out of memory.\n");
29 }
30 }
31
32 return str;
33}
34
35/*
36 * We have to be cautious here. We have seen BIOSes with DMI pointers
37 * pointing to completely the wrong place for example
38 */
39static int __init dmi_table(u32 base, int len, int num,
40 void (*decode)(struct dmi_header *))
41{
42 u8 *buf, *data;
43 int i = 0;
44
45 buf = dmi_ioremap(base, len);
46 if (buf == NULL)
47 return -1;
48
49 data = buf;
50
51 /*
52 * Stop when we see all the items the table claimed to have
53 * OR we run off the end of the table (also happens)
54 */
55 while ((i < num) && (data - buf + sizeof(struct dmi_header)) <= len) {
56 struct dmi_header *dm = (struct dmi_header *)data;
57 /*
58 * We want to know the total length (formated area and strings)
59 * before decoding to make sure we won't run off the table in
60 * dmi_decode or dmi_string
61 */
62 data += dm->length;
63 while ((data - buf < len - 1) && (data[0] || data[1]))
64 data++;
65 if (data - buf < len - 1)
66 decode(dm);
67 data += 2;
68 i++;
69 }
70 dmi_iounmap(buf, len);
71 return 0;
72}
73
74static int __init dmi_checksum(u8 *buf)
75{
76 u8 sum = 0;
77 int a;
78
79 for (a = 0; a < 15; a++)
80 sum += buf[a];
81
82 return sum == 0;
83}
84
85static char *dmi_ident[DMI_STRING_MAX];
86static LIST_HEAD(dmi_devices);
87
88/*
89 * Save a DMI string
90 */
91static void __init dmi_save_ident(struct dmi_header *dm, int slot, int string)
92{
93 char *p, *d = (char*) dm;
94
95 if (dmi_ident[slot])
96 return;
97
98 p = dmi_string(dm, d[string]);
99 if (p == NULL)
100 return;
101
102 dmi_ident[slot] = p;
103}
104
105static void __init dmi_save_devices(struct dmi_header *dm)
106{
107 int i, count = (dm->length - sizeof(struct dmi_header)) / 2;
108 struct dmi_device *dev;
109
110 for (i = 0; i < count; i++) {
111 char *d = (char *)(dm + 1) + (i * 2);
112
113 /* Skip disabled device */
114 if ((*d & 0x80) == 0)
115 continue;
116
117 dev = dmi_alloc(sizeof(*dev));
118 if (!dev) {
119 printk(KERN_ERR "dmi_save_devices: out of memory.\n");
120 break;
121 }
122
123 dev->type = *d++ & 0x7f;
124 dev->name = dmi_string(dm, *d);
125 dev->device_data = NULL;
126
127 list_add(&dev->list, &dmi_devices);
128 }
129}
130
131static void __init dmi_save_ipmi_device(struct dmi_header *dm)
132{
133 struct dmi_device *dev;
134 void * data;
135
136 data = dmi_alloc(dm->length);
137 if (data == NULL) {
138 printk(KERN_ERR "dmi_save_ipmi_device: out of memory.\n");
139 return;
140 }
141
142 memcpy(data, dm, dm->length);
143
144 dev = dmi_alloc(sizeof(*dev));
145 if (!dev) {
146 printk(KERN_ERR "dmi_save_ipmi_device: out of memory.\n");
147 return;
148 }
149
150 dev->type = DMI_DEV_TYPE_IPMI;
151 dev->name = "IPMI controller";
152 dev->device_data = data;
153
154 list_add(&dev->list, &dmi_devices);
155}
156
157/*
158 * Process a DMI table entry. Right now all we care about are the BIOS
159 * and machine entries. For 2.5 we should pull the smbus controller info
160 * out of here.
161 */
162static void __init dmi_decode(struct dmi_header *dm)
163{
164 switch(dm->type) {
165 case 0: /* BIOS Information */
166 dmi_save_ident(dm, DMI_BIOS_VENDOR, 4);
167 dmi_save_ident(dm, DMI_BIOS_VERSION, 5);
168 dmi_save_ident(dm, DMI_BIOS_DATE, 8);
169 break;
170 case 1: /* System Information */
171 dmi_save_ident(dm, DMI_SYS_VENDOR, 4);
172 dmi_save_ident(dm, DMI_PRODUCT_NAME, 5);
173 dmi_save_ident(dm, DMI_PRODUCT_VERSION, 6);
174 dmi_save_ident(dm, DMI_PRODUCT_SERIAL, 7);
175 break;
176 case 2: /* Base Board Information */
177 dmi_save_ident(dm, DMI_BOARD_VENDOR, 4);
178 dmi_save_ident(dm, DMI_BOARD_NAME, 5);
179 dmi_save_ident(dm, DMI_BOARD_VERSION, 6);
180 break;
181 case 10: /* Onboard Devices Information */
182 dmi_save_devices(dm);
183 break;
184 case 38: /* IPMI Device Information */
185 dmi_save_ipmi_device(dm);
186 }
187}
188
189static int __init dmi_present(char __iomem *p)
190{
191 u8 buf[15];
192 memcpy_fromio(buf, p, 15);
193 if ((memcmp(buf, "_DMI_", 5) == 0) && dmi_checksum(buf)) {
194 u16 num = (buf[13] << 8) | buf[12];
195 u16 len = (buf[7] << 8) | buf[6];
196 u32 base = (buf[11] << 24) | (buf[10] << 16) |
197 (buf[9] << 8) | buf[8];
198
199 /*
200 * DMI version 0.0 means that the real version is taken from
201 * the SMBIOS version, which we don't know at this point.
202 */
203 if (buf[14] != 0)
204 printk(KERN_INFO "DMI %d.%d present.\n",
205 buf[14] >> 4, buf[14] & 0xF);
206 else
207 printk(KERN_INFO "DMI present.\n");
208 if (dmi_table(base,len, num, dmi_decode) == 0)
209 return 0;
210 }
211 return 1;
212}
213
214void __init dmi_scan_machine(void)
215{
216 char __iomem *p, *q;
217 int rc;
218
219 if (efi_enabled) {
220 if (efi.smbios == EFI_INVALID_TABLE_ADDR)
221 goto out;
222
223 /* This is called as a core_initcall() because it isn't
224 * needed during early boot. This also means we can
225 * iounmap the space when we're done with it.
226 */
227 p = dmi_ioremap(efi.smbios, 32);
228 if (p == NULL)
229 goto out;
230
231 rc = dmi_present(p + 0x10); /* offset of _DMI_ string */
232 dmi_iounmap(p, 32);
233 if (!rc)
234 return;
235 }
236 else {
237 /*
238 * no iounmap() for that ioremap(); it would be a no-op, but
239 * it's so early in setup that sucker gets confused into doing
240 * what it shouldn't if we actually call it.
241 */
242 p = dmi_ioremap(0xF0000, 0x10000);
243 if (p == NULL)
244 goto out;
245
246 for (q = p; q < p + 0x10000; q += 16) {
247 rc = dmi_present(q);
248 if (!rc)
249 return;
250 }
251 }
252 out: printk(KERN_INFO "DMI not present or invalid.\n");
253}
254
255/**
256 * dmi_check_system - check system DMI data
257 * @list: array of dmi_system_id structures to match against
258 *
259 * Walk the blacklist table running matching functions until someone
260 * returns non zero or we hit the end. Callback function is called for
261 * each successfull match. Returns the number of matches.
262 */
263int dmi_check_system(struct dmi_system_id *list)
264{
265 int i, count = 0;
266 struct dmi_system_id *d = list;
267
268 while (d->ident) {
269 for (i = 0; i < ARRAY_SIZE(d->matches); i++) {
270 int s = d->matches[i].slot;
271 if (s == DMI_NONE)
272 continue;
273 if (dmi_ident[s] && strstr(dmi_ident[s], d->matches[i].substr))
274 continue;
275 /* No match */
276 goto fail;
277 }
278 count++;
279 if (d->callback && d->callback(d))
280 break;
281fail: d++;
282 }
283
284 return count;
285}
286EXPORT_SYMBOL(dmi_check_system);
287
288/**
289 * dmi_get_system_info - return DMI data value
290 * @field: data index (see enum dmi_filed)
291 *
292 * Returns one DMI data value, can be used to perform
293 * complex DMI data checks.
294 */
295char *dmi_get_system_info(int field)
296{
297 return dmi_ident[field];
298}
299EXPORT_SYMBOL(dmi_get_system_info);
300
301/**
302 * dmi_find_device - find onboard device by type/name
303 * @type: device type or %DMI_DEV_TYPE_ANY to match all device types
304 * @desc: device name string or %NULL to match all
305 * @from: previous device found in search, or %NULL for new search.
306 *
307 * Iterates through the list of known onboard devices. If a device is
308 * found with a matching @vendor and @device, a pointer to its device
309 * structure is returned. Otherwise, %NULL is returned.
310 * A new search is initiated by passing %NULL to the @from argument.
311 * If @from is not %NULL, searches continue from next device.
312 */
313struct dmi_device * dmi_find_device(int type, const char *name,
314 struct dmi_device *from)
315{
316 struct list_head *d, *head = from ? &from->list : &dmi_devices;
317
318 for(d = head->next; d != &dmi_devices; d = d->next) {
319 struct dmi_device *dev = list_entry(d, struct dmi_device, list);
320
321 if (((type == DMI_DEV_TYPE_ANY) || (dev->type == type)) &&
322 ((name == NULL) || (strcmp(dev->name, name) == 0)))
323 return dev;
324 }
325
326 return NULL;
327}
328EXPORT_SYMBOL(dmi_find_device);
329
330/**
331 * dmi_get_year - Return year of a DMI date
332 * @field: data index (like dmi_get_system_info)
333 *
334 * Returns -1 when the field doesn't exist. 0 when it is broken.
335 */
336int dmi_get_year(int field)
337{
338 int year;
339 char *s = dmi_get_system_info(field);
340
341 if (!s)
342 return -1;
343 if (*s == '\0')
344 return 0;
345 s = strrchr(s, '/');
346 if (!s)
347 return 0;
348
349 s += 1;
350 year = simple_strtoul(s, NULL, 0);
351 if (year && year < 100) { /* 2-digit year */
352 year += 1900;
353 if (year < 1996) /* no dates < spec 1.0 */
354 year += 100;
355 }
356
357 return year;
358}
diff --git a/arch/i386/kernel/i386_ksyms.c b/arch/i386/kernel/i386_ksyms.c
index 055325056a74..036a9857936f 100644
--- a/arch/i386/kernel/i386_ksyms.c
+++ b/arch/i386/kernel/i386_ksyms.c
@@ -19,7 +19,6 @@ EXPORT_SYMBOL(__put_user_2);
19EXPORT_SYMBOL(__put_user_4); 19EXPORT_SYMBOL(__put_user_4);
20EXPORT_SYMBOL(__put_user_8); 20EXPORT_SYMBOL(__put_user_8);
21 21
22EXPORT_SYMBOL(strpbrk);
23EXPORT_SYMBOL(strstr); 22EXPORT_SYMBOL(strstr);
24 23
25#ifdef CONFIG_SMP 24#ifdef CONFIG_SMP
diff --git a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c
index db120174aa7e..34d21e21e012 100644
--- a/arch/i386/kernel/mpparse.c
+++ b/arch/i386/kernel/mpparse.c
@@ -38,12 +38,6 @@
38int smp_found_config; 38int smp_found_config;
39unsigned int __initdata maxcpus = NR_CPUS; 39unsigned int __initdata maxcpus = NR_CPUS;
40 40
41#ifdef CONFIG_HOTPLUG_CPU
42#define CPU_HOTPLUG_ENABLED (1)
43#else
44#define CPU_HOTPLUG_ENABLED (0)
45#endif
46
47/* 41/*
48 * Various Linux-internal data structures created from the 42 * Various Linux-internal data structures created from the
49 * MP-table. 43 * MP-table.
@@ -204,7 +198,14 @@ static void __devinit MP_processor_info (struct mpc_config_processor *m)
204 cpu_set(num_processors, cpu_possible_map); 198 cpu_set(num_processors, cpu_possible_map);
205 num_processors++; 199 num_processors++;
206 200
207 if (CPU_HOTPLUG_ENABLED || (num_processors > 8)) { 201 /*
202 * Would be preferable to switch to bigsmp when CONFIG_HOTPLUG_CPU=y
203 * but we need to work other dependencies like SMP_SUSPEND etc
204 * before this can be done without some confusion.
205 * if (CPU_HOTPLUG_ENABLED || num_processors > 8)
206 * - Ashok Raj <ashok.raj@intel.com>
207 */
208 if (num_processors > 8) {
208 switch (boot_cpu_data.x86_vendor) { 209 switch (boot_cpu_data.x86_vendor) {
209 case X86_VENDOR_INTEL: 210 case X86_VENDOR_INTEL:
210 if (!APIC_XAPIC(ver)) { 211 if (!APIC_XAPIC(ver)) {
@@ -228,6 +229,13 @@ static void __init MP_bus_info (struct mpc_config_bus *m)
228 229
229 mpc_oem_bus_info(m, str, translation_table[mpc_record]); 230 mpc_oem_bus_info(m, str, translation_table[mpc_record]);
230 231
232 if (m->mpc_busid >= MAX_MP_BUSSES) {
233 printk(KERN_WARNING "MP table busid value (%d) for bustype %s "
234 " is too large, max. supported is %d\n",
235 m->mpc_busid, str, MAX_MP_BUSSES - 1);
236 return;
237 }
238
231 if (strncmp(str, BUSTYPE_ISA, sizeof(BUSTYPE_ISA)-1) == 0) { 239 if (strncmp(str, BUSTYPE_ISA, sizeof(BUSTYPE_ISA)-1) == 0) {
232 mp_bus_id_to_type[m->mpc_busid] = MP_BUS_ISA; 240 mp_bus_id_to_type[m->mpc_busid] = MP_BUS_ISA;
233 } else if (strncmp(str, BUSTYPE_EISA, sizeof(BUSTYPE_EISA)-1) == 0) { 241 } else if (strncmp(str, BUSTYPE_EISA, sizeof(BUSTYPE_EISA)-1) == 0) {
diff --git a/arch/i386/kernel/syscall_table.S b/arch/i386/kernel/syscall_table.S
index 4f58b9c0efe3..f48bef15b4f0 100644
--- a/arch/i386/kernel/syscall_table.S
+++ b/arch/i386/kernel/syscall_table.S
@@ -314,3 +314,4 @@ ENTRY(sys_call_table)
314 .long sys_get_robust_list 314 .long sys_get_robust_list
315 .long sys_splice 315 .long sys_splice
316 .long sys_sync_file_range 316 .long sys_sync_file_range
317 .long sys_tee /* 315 */
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index e38527994590..2d22f5761b1d 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -365,6 +365,9 @@ void die(const char * str, struct pt_regs * regs, long err)
365 365
366 if (++die.lock_owner_depth < 3) { 366 if (++die.lock_owner_depth < 3) {
367 int nl = 0; 367 int nl = 0;
368 unsigned long esp;
369 unsigned short ss;
370
368 handle_BUG(regs); 371 handle_BUG(regs);
369 printk(KERN_EMERG "%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); 372 printk(KERN_EMERG "%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter);
370#ifdef CONFIG_PREEMPT 373#ifdef CONFIG_PREEMPT
@@ -387,8 +390,19 @@ void die(const char * str, struct pt_regs * regs, long err)
387 printk("\n"); 390 printk("\n");
388 if (notify_die(DIE_OOPS, str, regs, err, 391 if (notify_die(DIE_OOPS, str, regs, err,
389 current->thread.trap_no, SIGSEGV) != 392 current->thread.trap_no, SIGSEGV) !=
390 NOTIFY_STOP) 393 NOTIFY_STOP) {
391 show_registers(regs); 394 show_registers(regs);
395 /* Executive summary in case the oops scrolled away */
396 esp = (unsigned long) (&regs->esp);
397 savesegment(ss, ss);
398 if (user_mode(regs)) {
399 esp = regs->esp;
400 ss = regs->xss & 0xffff;
401 }
402 printk(KERN_EMERG "EIP: [<%08lx>] ", regs->eip);
403 print_symbol("%s", regs->eip);
404 printk(" SS:ESP %04x:%08lx\n", ss, esp);
405 }
392 else 406 else
393 regs = NULL; 407 regs = NULL;
394 } else 408 } else
diff --git a/arch/i386/mach-voyager/voyager_cat.c b/arch/i386/mach-voyager/voyager_cat.c
index 23967fe658d3..3039539de51e 100644
--- a/arch/i386/mach-voyager/voyager_cat.c
+++ b/arch/i386/mach-voyager/voyager_cat.c
@@ -106,9 +106,15 @@ voyager_module_t *voyager_cat_list;
106 106
107/* the I/O port assignments for the VIC and QIC */ 107/* the I/O port assignments for the VIC and QIC */
108static struct resource vic_res = { 108static struct resource vic_res = {
109 "Voyager Interrupt Controller", 0xFC00, 0xFC6F }; 109 .name = "Voyager Interrupt Controller",
110 .start = 0xFC00,
111 .end = 0xFC6F
112};
110static struct resource qic_res = { 113static struct resource qic_res = {
111 "Quad Interrupt Controller", 0xFC70, 0xFCFF }; 114 .name = "Quad Interrupt Controller",
115 .start = 0xFC70,
116 .end = 0xFCFF
117};
112 118
113/* This function is used to pack a data bit stream inside a message. 119/* This function is used to pack a data bit stream inside a message.
114 * It writes num_bits of the data buffer in msg starting at start_bit. 120 * It writes num_bits of the data buffer in msg starting at start_bit.
diff --git a/arch/i386/pci/direct.c b/arch/i386/pci/direct.c
index 0659ced01185..5d81fb510375 100644
--- a/arch/i386/pci/direct.c
+++ b/arch/i386/pci/direct.c
@@ -19,7 +19,7 @@ int pci_conf1_read(unsigned int seg, unsigned int bus,
19{ 19{
20 unsigned long flags; 20 unsigned long flags;
21 21
22 if (!value || (bus > 255) || (devfn > 255) || (reg > 255)) { 22 if ((bus > 255) || (devfn > 255) || (reg > 255)) {
23 *value = -1; 23 *value = -1;
24 return -EINVAL; 24 return -EINVAL;
25 } 25 }
@@ -94,8 +94,10 @@ static int pci_conf2_read(unsigned int seg, unsigned int bus,
94 unsigned long flags; 94 unsigned long flags;
95 int dev, fn; 95 int dev, fn;
96 96
97 if (!value || (bus > 255) || (devfn > 255) || (reg > 255)) 97 if ((bus > 255) || (devfn > 255) || (reg > 255)) {
98 *value = -1;
98 return -EINVAL; 99 return -EINVAL;
100 }
99 101
100 dev = PCI_SLOT(devfn); 102 dev = PCI_SLOT(devfn);
101 fn = PCI_FUNC(devfn); 103 fn = PCI_FUNC(devfn);
diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c
index 3ca59cad05f3..73235443fda7 100644
--- a/arch/i386/pci/irq.c
+++ b/arch/i386/pci/irq.c
@@ -588,7 +588,10 @@ static __init int via_router_probe(struct irq_router *r,
588 case PCI_DEVICE_ID_VIA_82C596: 588 case PCI_DEVICE_ID_VIA_82C596:
589 case PCI_DEVICE_ID_VIA_82C686: 589 case PCI_DEVICE_ID_VIA_82C686:
590 case PCI_DEVICE_ID_VIA_8231: 590 case PCI_DEVICE_ID_VIA_8231:
591 case PCI_DEVICE_ID_VIA_8233A:
591 case PCI_DEVICE_ID_VIA_8235: 592 case PCI_DEVICE_ID_VIA_8235:
593 case PCI_DEVICE_ID_VIA_8237:
594 case PCI_DEVICE_ID_VIA_8237_SATA:
592 /* FIXME: add new ones for 8233/5 */ 595 /* FIXME: add new ones for 8233/5 */
593 r->name = "VIA"; 596 r->name = "VIA";
594 r->get = pirq_via_get; 597 r->get = pirq_via_get;
diff --git a/arch/i386/pci/mmconfig.c b/arch/i386/pci/mmconfig.c
index f77d7f8b9bf6..6b1ea0c9a570 100644
--- a/arch/i386/pci/mmconfig.c
+++ b/arch/i386/pci/mmconfig.c
@@ -80,7 +80,7 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int bus,
80 unsigned long flags; 80 unsigned long flags;
81 u32 base; 81 u32 base;
82 82
83 if (!value || (bus > 255) || (devfn > 255) || (reg > 4095)) { 83 if ((bus > 255) || (devfn > 255) || (reg > 4095)) {
84 *value = -1; 84 *value = -1;
85 return -EINVAL; 85 return -EINVAL;
86 } 86 }
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index edffe25a477a..9f40eeff0b5c 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -260,15 +260,6 @@ config NR_CPUS
260 than 64 will cause the use of a CPU mask array, causing a small 260 than 64 will cause the use of a CPU mask array, causing a small
261 performance hit. 261 performance hit.
262 262
263config IA64_NR_NODES
264 int "Maximum number of NODEs (256-1024)" if (IA64_SGI_SN2 || IA64_GENERIC)
265 range 256 1024
266 depends on IA64_SGI_SN2 || IA64_GENERIC
267 default "256"
268 help
269 This option specifies the maximum number of nodes in your SSI system.
270 If in doubt, use the default.
271
272config HOTPLUG_CPU 263config HOTPLUG_CPU
273 bool "Support for hot-pluggable CPUs (EXPERIMENTAL)" 264 bool "Support for hot-pluggable CPUs (EXPERIMENTAL)"
274 depends on SMP && EXPERIMENTAL 265 depends on SMP && EXPERIMENTAL
@@ -352,6 +343,16 @@ config NUMA
352 Access). This option is for configuring high-end multiprocessor 343 Access). This option is for configuring high-end multiprocessor
353 server systems. If in doubt, say N. 344 server systems. If in doubt, say N.
354 345
346config NODES_SHIFT
347 int "Max num nodes shift(3-10)"
348 range 3 10
349 default "8"
350 depends on NEED_MULTIPLE_NODES
351 help
352 This option specifies the maximum number of nodes in your SSI system.
353 MAX_NUMNODES will be 2^(This value).
354 If in doubt, use the default.
355
355# VIRTUAL_MEM_MAP and FLAT_NODE_MEM_MAP are functionally equivalent. 356# VIRTUAL_MEM_MAP and FLAT_NODE_MEM_MAP are functionally equivalent.
356# VIRTUAL_MEM_MAP has been retained for historical reasons. 357# VIRTUAL_MEM_MAP has been retained for historical reasons.
357config VIRTUAL_MEM_MAP 358config VIRTUAL_MEM_MAP
diff --git a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile
index 59e871dae742..09a0dbc17fb6 100644
--- a/arch/ia64/kernel/Makefile
+++ b/arch/ia64/kernel/Makefile
@@ -7,7 +7,7 @@ extra-y := head.o init_task.o vmlinux.lds
7obj-y := acpi.o entry.o efi.o efi_stub.o gate-data.o fsys.o ia64_ksyms.o irq.o irq_ia64.o \ 7obj-y := acpi.o entry.o efi.o efi_stub.o gate-data.o fsys.o ia64_ksyms.o irq.o irq_ia64.o \
8 irq_lsapic.o ivt.o machvec.o pal.o patch.o process.o perfmon.o ptrace.o sal.o \ 8 irq_lsapic.o ivt.o machvec.o pal.o patch.o process.o perfmon.o ptrace.o sal.o \
9 salinfo.o semaphore.o setup.o signal.o sys_ia64.o time.o traps.o unaligned.o \ 9 salinfo.o semaphore.o setup.o signal.o sys_ia64.o time.o traps.o unaligned.o \
10 unwind.o mca.o mca_asm.o topology.o dmi_scan.o 10 unwind.o mca.o mca_asm.o topology.o
11 11
12obj-$(CONFIG_IA64_BRL_EMU) += brl_emu.o 12obj-$(CONFIG_IA64_BRL_EMU) += brl_emu.o
13obj-$(CONFIG_IA64_GENERIC) += acpi-ext.o 13obj-$(CONFIG_IA64_GENERIC) += acpi-ext.o
@@ -30,7 +30,6 @@ obj-$(CONFIG_IA64_MCA_RECOVERY) += mca_recovery.o
30obj-$(CONFIG_KPROBES) += kprobes.o jprobes.o 30obj-$(CONFIG_KPROBES) += kprobes.o jprobes.o
31obj-$(CONFIG_IA64_UNCACHED_ALLOCATOR) += uncached.o 31obj-$(CONFIG_IA64_UNCACHED_ALLOCATOR) += uncached.o
32mca_recovery-y += mca_drv.o mca_drv_asm.o 32mca_recovery-y += mca_drv.o mca_drv_asm.o
33dmi_scan-y += ../../i386/kernel/dmi_scan.o
34 33
35# The gate DSO image is built using a special linker script. 34# The gate DSO image is built using a special linker script.
36targets += gate.so gate-syms.o 35targets += gate.so gate-syms.o
diff --git a/arch/ia64/kernel/acpi-ext.c b/arch/ia64/kernel/acpi-ext.c
index 4a5574ff007b..fff82929d225 100644
--- a/arch/ia64/kernel/acpi-ext.c
+++ b/arch/ia64/kernel/acpi-ext.c
@@ -1,105 +1,104 @@
1/* 1/*
2 * arch/ia64/kernel/acpi-ext.c 2 * (c) Copyright 2003, 2006 Hewlett-Packard Development Company, L.P.
3 * Alex Williamson <alex.williamson@hp.com>
4 * Bjorn Helgaas <bjorn.helgaas@hp.com>
3 * 5 *
4 * Copyright (C) 2003 Hewlett-Packard 6 * This program is free software; you can redistribute it and/or modify
5 * Copyright (C) Alex Williamson 7 * it under the terms of the GNU General Public License version 2 as
6 * Copyright (C) Bjorn Helgaas 8 * published by the Free Software Foundation.
7 *
8 * Vendor specific extensions to ACPI.
9 */ 9 */
10 10
11#include <linux/config.h> 11#include <linux/config.h>
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/types.h> 13#include <linux/types.h>
14#include <linux/acpi.h> 14#include <linux/acpi.h>
15#include <linux/efi.h>
16 15
17#include <asm/acpi-ext.h> 16#include <asm/acpi-ext.h>
18 17
19struct acpi_vendor_descriptor { 18/*
20 u8 guid_id; 19 * Device CSRs that do not appear in PCI config space should be described
21 efi_guid_t guid; 20 * via ACPI. This would normally be done with Address Space Descriptors
22}; 21 * marked as "consumer-only," but old versions of Windows and Linux ignore
22 * the producer/consumer flag, so HP invented a vendor-defined resource to
23 * describe the location and size of CSR space.
24 */
23 25
24struct acpi_vendor_info { 26struct acpi_vendor_uuid hp_ccsr_uuid = {
25 struct acpi_vendor_descriptor *descriptor; 27 .subtype = 2,
26 u8 *data; 28 .data = { 0xf9, 0xad, 0xe9, 0x69, 0x4f, 0x92, 0x5f, 0xab, 0xf6, 0x4a,
27 u32 length; 29 0x24, 0xd2, 0x01, 0x37, 0x0e, 0xad },
28}; 30};
29 31
30acpi_status 32static acpi_status hp_ccsr_locate(acpi_handle obj, u64 *base, u64 *length)
31acpi_vendor_resource_match(struct acpi_resource *resource, void *context)
32{ 33{
33 struct acpi_vendor_info *info = (struct acpi_vendor_info *)context; 34 acpi_status status;
34 struct acpi_resource_vendor *vendor; 35 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
35 struct acpi_vendor_descriptor *descriptor; 36 struct acpi_resource *resource;
36 u32 byte_length; 37 struct acpi_resource_vendor_typed *vendor;
37
38 if (resource->type != ACPI_RESOURCE_TYPE_VENDOR)
39 return AE_OK;
40
41 vendor = (struct acpi_resource_vendor *)&resource->data;
42 descriptor = (struct acpi_vendor_descriptor *)vendor->byte_data;
43 if (vendor->byte_length <= sizeof(*info->descriptor) ||
44 descriptor->guid_id != info->descriptor->guid_id ||
45 efi_guidcmp(descriptor->guid, info->descriptor->guid))
46 return AE_OK;
47
48 byte_length = vendor->byte_length - sizeof(struct acpi_vendor_descriptor);
49 info->data = acpi_os_allocate(byte_length);
50 if (!info->data)
51 return AE_NO_MEMORY;
52
53 memcpy(info->data,
54 vendor->byte_data + sizeof(struct acpi_vendor_descriptor),
55 byte_length);
56 info->length = byte_length;
57 return AE_CTRL_TERMINATE;
58}
59 38
60acpi_status 39 status = acpi_get_vendor_resource(obj, METHOD_NAME__CRS, &hp_ccsr_uuid,
61acpi_find_vendor_resource(acpi_handle obj, struct acpi_vendor_descriptor * id, 40 &buffer);
62 u8 ** data, u32 * byte_length)
63{
64 struct acpi_vendor_info info;
65 41
66 info.descriptor = id; 42 resource = buffer.pointer;
67 info.data = NULL; 43 vendor = &resource->data.vendor_typed;
68 44
69 acpi_walk_resources(obj, METHOD_NAME__CRS, acpi_vendor_resource_match, 45 if (ACPI_FAILURE(status) || vendor->byte_length < 16) {
70 &info); 46 status = AE_NOT_FOUND;
71 if (!info.data) 47 goto exit;
72 return AE_NOT_FOUND; 48 }
73 49
74 *data = info.data; 50 memcpy(base, vendor->byte_data, sizeof(*base));
75 *byte_length = info.length; 51 memcpy(length, vendor->byte_data + 8, sizeof(*length));
76 return AE_OK; 52
53 exit:
54 acpi_os_free(buffer.pointer);
55 return status;
77} 56}
78 57
79struct acpi_vendor_descriptor hp_ccsr_descriptor = { 58struct csr_space {
80 .guid_id = 2, 59 u64 base;
81 .guid = 60 u64 length;
82 EFI_GUID(0x69e9adf9, 0x924f, 0xab5f, 0xf6, 0x4a, 0x24, 0xd2, 0x01,
83 0x37, 0x0e, 0xad)
84}; 61};
85 62
86acpi_status hp_acpi_csr_space(acpi_handle obj, u64 * csr_base, u64 * csr_length) 63static acpi_status find_csr_space(struct acpi_resource *resource, void *data)
87{ 64{
65 struct csr_space *space = data;
66 struct acpi_resource_address64 addr;
88 acpi_status status; 67 acpi_status status;
89 u8 *data;
90 u32 length;
91 68
92 status = 69 status = acpi_resource_to_address64(resource, &addr);
93 acpi_find_vendor_resource(obj, &hp_ccsr_descriptor, &data, &length); 70 if (ACPI_SUCCESS(status) &&
71 addr.resource_type == ACPI_MEMORY_RANGE &&
72 addr.address_length &&
73 addr.producer_consumer == ACPI_CONSUMER) {
74 space->base = addr.minimum;
75 space->length = addr.address_length;
76 return AE_CTRL_TERMINATE;
77 }
78 return AE_OK; /* keep looking */
79}
94 80
95 if (ACPI_FAILURE(status) || length != 16) 81static acpi_status hp_crs_locate(acpi_handle obj, u64 *base, u64 *length)
96 return AE_NOT_FOUND; 82{
83 struct csr_space space = { 0, 0 };
97 84
98 memcpy(csr_base, data, sizeof(*csr_base)); 85 acpi_walk_resources(obj, METHOD_NAME__CRS, find_csr_space, &space);
99 memcpy(csr_length, data + 8, sizeof(*csr_length)); 86 if (!space.length)
100 acpi_os_free(data); 87 return AE_NOT_FOUND;
101 88
89 *base = space.base;
90 *length = space.length;
102 return AE_OK; 91 return AE_OK;
103} 92}
104 93
94acpi_status hp_acpi_csr_space(acpi_handle obj, u64 *csr_base, u64 *csr_length)
95{
96 acpi_status status;
97
98 status = hp_ccsr_locate(obj, csr_base, csr_length);
99 if (ACPI_SUCCESS(status))
100 return status;
101
102 return hp_crs_locate(obj, csr_base, csr_length);
103}
105EXPORT_SYMBOL(hp_acpi_csr_space); 104EXPORT_SYMBOL(hp_acpi_csr_space);
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index 750e8e7fbdc3..e30798811216 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -1606,5 +1606,9 @@ sys_call_table:
1606 data8 sys_ni_syscall // 1295 reserved for ppoll 1606 data8 sys_ni_syscall // 1295 reserved for ppoll
1607 data8 sys_unshare 1607 data8 sys_unshare
1608 data8 sys_splice 1608 data8 sys_splice
1609 data8 sys_set_robust_list
1610 data8 sys_get_robust_list
1611 data8 sys_sync_file_range // 1300
1612 data8 sys_tee
1609 1613
1610 .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls 1614 .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
index 8963171788d5..6a0880639bc9 100644
--- a/arch/ia64/kernel/mca.c
+++ b/arch/ia64/kernel/mca.c
@@ -581,10 +581,12 @@ ia64_mca_rendez_int_handler(int rendez_irq, void *arg, struct pt_regs *regs)
581{ 581{
582 unsigned long flags; 582 unsigned long flags;
583 int cpu = smp_processor_id(); 583 int cpu = smp_processor_id();
584 struct ia64_mca_notify_die nd =
585 { .sos = NULL, .monarch_cpu = &monarch_cpu };
584 586
585 /* Mask all interrupts */ 587 /* Mask all interrupts */
586 local_irq_save(flags); 588 local_irq_save(flags);
587 if (notify_die(DIE_MCA_RENDZVOUS_ENTER, "MCA", regs, 0, 0, 0) 589 if (notify_die(DIE_MCA_RENDZVOUS_ENTER, "MCA", regs, (long)&nd, 0, 0)
588 == NOTIFY_STOP) 590 == NOTIFY_STOP)
589 ia64_mca_spin(__FUNCTION__); 591 ia64_mca_spin(__FUNCTION__);
590 592
@@ -594,7 +596,7 @@ ia64_mca_rendez_int_handler(int rendez_irq, void *arg, struct pt_regs *regs)
594 */ 596 */
595 ia64_sal_mc_rendez(); 597 ia64_sal_mc_rendez();
596 598
597 if (notify_die(DIE_MCA_RENDZVOUS_PROCESS, "MCA", regs, 0, 0, 0) 599 if (notify_die(DIE_MCA_RENDZVOUS_PROCESS, "MCA", regs, (long)&nd, 0, 0)
598 == NOTIFY_STOP) 600 == NOTIFY_STOP)
599 ia64_mca_spin(__FUNCTION__); 601 ia64_mca_spin(__FUNCTION__);
600 602
@@ -602,7 +604,7 @@ ia64_mca_rendez_int_handler(int rendez_irq, void *arg, struct pt_regs *regs)
602 while (monarch_cpu != -1) 604 while (monarch_cpu != -1)
603 cpu_relax(); /* spin until monarch leaves */ 605 cpu_relax(); /* spin until monarch leaves */
604 606
605 if (notify_die(DIE_MCA_RENDZVOUS_LEAVE, "MCA", regs, 0, 0, 0) 607 if (notify_die(DIE_MCA_RENDZVOUS_LEAVE, "MCA", regs, (long)&nd, 0, 0)
606 == NOTIFY_STOP) 608 == NOTIFY_STOP)
607 ia64_mca_spin(__FUNCTION__); 609 ia64_mca_spin(__FUNCTION__);
608 610
@@ -961,7 +963,7 @@ no_mod:
961 */ 963 */
962 964
963static void 965static void
964ia64_wait_for_slaves(int monarch) 966ia64_wait_for_slaves(int monarch, const char *type)
965{ 967{
966 int c, wait = 0, missing = 0; 968 int c, wait = 0, missing = 0;
967 for_each_online_cpu(c) { 969 for_each_online_cpu(c) {
@@ -987,7 +989,7 @@ ia64_wait_for_slaves(int monarch)
987 } 989 }
988 if (!missing) 990 if (!missing)
989 goto all_in; 991 goto all_in;
990 printk(KERN_INFO "OS MCA slave did not rendezvous on cpu"); 992 printk(KERN_INFO "OS %s slave did not rendezvous on cpu", type);
991 for_each_online_cpu(c) { 993 for_each_online_cpu(c) {
992 if (c == monarch) 994 if (c == monarch)
993 continue; 995 continue;
@@ -998,7 +1000,7 @@ ia64_wait_for_slaves(int monarch)
998 return; 1000 return;
999 1001
1000all_in: 1002all_in:
1001 printk(KERN_INFO "All OS MCA slaves have reached rendezvous\n"); 1003 printk(KERN_INFO "All OS %s slaves have reached rendezvous\n", type);
1002 return; 1004 return;
1003} 1005}
1004 1006
@@ -1023,6 +1025,8 @@ ia64_mca_handler(struct pt_regs *regs, struct switch_stack *sw,
1023 &sos->proc_state_param; 1025 &sos->proc_state_param;
1024 int recover, cpu = smp_processor_id(); 1026 int recover, cpu = smp_processor_id();
1025 task_t *previous_current; 1027 task_t *previous_current;
1028 struct ia64_mca_notify_die nd =
1029 { .sos = sos, .monarch_cpu = &monarch_cpu };
1026 1030
1027 oops_in_progress = 1; /* FIXME: make printk NMI/MCA/INIT safe */ 1031 oops_in_progress = 1; /* FIXME: make printk NMI/MCA/INIT safe */
1028 console_loglevel = 15; /* make sure printks make it to console */ 1032 console_loglevel = 15; /* make sure printks make it to console */
@@ -1031,10 +1035,10 @@ ia64_mca_handler(struct pt_regs *regs, struct switch_stack *sw,
1031 1035
1032 previous_current = ia64_mca_modify_original_stack(regs, sw, sos, "MCA"); 1036 previous_current = ia64_mca_modify_original_stack(regs, sw, sos, "MCA");
1033 monarch_cpu = cpu; 1037 monarch_cpu = cpu;
1034 if (notify_die(DIE_MCA_MONARCH_ENTER, "MCA", regs, 0, 0, 0) 1038 if (notify_die(DIE_MCA_MONARCH_ENTER, "MCA", regs, (long)&nd, 0, 0)
1035 == NOTIFY_STOP) 1039 == NOTIFY_STOP)
1036 ia64_mca_spin(__FUNCTION__); 1040 ia64_mca_spin(__FUNCTION__);
1037 ia64_wait_for_slaves(cpu); 1041 ia64_wait_for_slaves(cpu, "MCA");
1038 1042
1039 /* Wakeup all the processors which are spinning in the rendezvous loop. 1043 /* Wakeup all the processors which are spinning in the rendezvous loop.
1040 * They will leave SAL, then spin in the OS with interrupts disabled 1044 * They will leave SAL, then spin in the OS with interrupts disabled
@@ -1043,7 +1047,7 @@ ia64_mca_handler(struct pt_regs *regs, struct switch_stack *sw,
1043 * spinning in SAL does not work. 1047 * spinning in SAL does not work.
1044 */ 1048 */
1045 ia64_mca_wakeup_all(); 1049 ia64_mca_wakeup_all();
1046 if (notify_die(DIE_MCA_MONARCH_PROCESS, "MCA", regs, 0, 0, 0) 1050 if (notify_die(DIE_MCA_MONARCH_PROCESS, "MCA", regs, (long)&nd, 0, 0)
1047 == NOTIFY_STOP) 1051 == NOTIFY_STOP)
1048 ia64_mca_spin(__FUNCTION__); 1052 ia64_mca_spin(__FUNCTION__);
1049 1053
@@ -1064,7 +1068,7 @@ ia64_mca_handler(struct pt_regs *regs, struct switch_stack *sw,
1064 ia64_sal_clear_state_info(SAL_INFO_TYPE_MCA); 1068 ia64_sal_clear_state_info(SAL_INFO_TYPE_MCA);
1065 sos->os_status = IA64_MCA_CORRECTED; 1069 sos->os_status = IA64_MCA_CORRECTED;
1066 } 1070 }
1067 if (notify_die(DIE_MCA_MONARCH_LEAVE, "MCA", regs, 0, 0, recover) 1071 if (notify_die(DIE_MCA_MONARCH_LEAVE, "MCA", regs, (long)&nd, 0, recover)
1068 == NOTIFY_STOP) 1072 == NOTIFY_STOP)
1069 ia64_mca_spin(__FUNCTION__); 1073 ia64_mca_spin(__FUNCTION__);
1070 1074
@@ -1351,10 +1355,14 @@ ia64_init_handler(struct pt_regs *regs, struct switch_stack *sw,
1351 static atomic_t monarchs; 1355 static atomic_t monarchs;
1352 task_t *previous_current; 1356 task_t *previous_current;
1353 int cpu = smp_processor_id(); 1357 int cpu = smp_processor_id();
1358 struct ia64_mca_notify_die nd =
1359 { .sos = sos, .monarch_cpu = &monarch_cpu };
1354 1360
1355 oops_in_progress = 1; /* FIXME: make printk NMI/MCA/INIT safe */ 1361 oops_in_progress = 1; /* FIXME: make printk NMI/MCA/INIT safe */
1356 console_loglevel = 15; /* make sure printks make it to console */ 1362 console_loglevel = 15; /* make sure printks make it to console */
1357 1363
1364 (void) notify_die(DIE_INIT_ENTER, "INIT", regs, (long)&nd, 0, 0);
1365
1358 printk(KERN_INFO "Entered OS INIT handler. PSP=%lx cpu=%d monarch=%ld\n", 1366 printk(KERN_INFO "Entered OS INIT handler. PSP=%lx cpu=%d monarch=%ld\n",
1359 sos->proc_state_param, cpu, sos->monarch); 1367 sos->proc_state_param, cpu, sos->monarch);
1360 salinfo_log_wakeup(SAL_INFO_TYPE_INIT, NULL, 0, 0); 1368 salinfo_log_wakeup(SAL_INFO_TYPE_INIT, NULL, 0, 0);
@@ -1390,15 +1398,15 @@ ia64_init_handler(struct pt_regs *regs, struct switch_stack *sw,
1390 ia64_mc_info.imi_rendez_checkin[cpu] = IA64_MCA_RENDEZ_CHECKIN_INIT; 1398 ia64_mc_info.imi_rendez_checkin[cpu] = IA64_MCA_RENDEZ_CHECKIN_INIT;
1391 while (monarch_cpu == -1) 1399 while (monarch_cpu == -1)
1392 cpu_relax(); /* spin until monarch enters */ 1400 cpu_relax(); /* spin until monarch enters */
1393 if (notify_die(DIE_INIT_SLAVE_ENTER, "INIT", regs, 0, 0, 0) 1401 if (notify_die(DIE_INIT_SLAVE_ENTER, "INIT", regs, (long)&nd, 0, 0)
1394 == NOTIFY_STOP) 1402 == NOTIFY_STOP)
1395 ia64_mca_spin(__FUNCTION__); 1403 ia64_mca_spin(__FUNCTION__);
1396 if (notify_die(DIE_INIT_SLAVE_PROCESS, "INIT", regs, 0, 0, 0) 1404 if (notify_die(DIE_INIT_SLAVE_PROCESS, "INIT", regs, (long)&nd, 0, 0)
1397 == NOTIFY_STOP) 1405 == NOTIFY_STOP)
1398 ia64_mca_spin(__FUNCTION__); 1406 ia64_mca_spin(__FUNCTION__);
1399 while (monarch_cpu != -1) 1407 while (monarch_cpu != -1)
1400 cpu_relax(); /* spin until monarch leaves */ 1408 cpu_relax(); /* spin until monarch leaves */
1401 if (notify_die(DIE_INIT_SLAVE_LEAVE, "INIT", regs, 0, 0, 0) 1409 if (notify_die(DIE_INIT_SLAVE_LEAVE, "INIT", regs, (long)&nd, 0, 0)
1402 == NOTIFY_STOP) 1410 == NOTIFY_STOP)
1403 ia64_mca_spin(__FUNCTION__); 1411 ia64_mca_spin(__FUNCTION__);
1404 printk("Slave on cpu %d returning to normal service.\n", cpu); 1412 printk("Slave on cpu %d returning to normal service.\n", cpu);
@@ -1409,7 +1417,7 @@ ia64_init_handler(struct pt_regs *regs, struct switch_stack *sw,
1409 } 1417 }
1410 1418
1411 monarch_cpu = cpu; 1419 monarch_cpu = cpu;
1412 if (notify_die(DIE_INIT_MONARCH_ENTER, "INIT", regs, 0, 0, 0) 1420 if (notify_die(DIE_INIT_MONARCH_ENTER, "INIT", regs, (long)&nd, 0, 0)
1413 == NOTIFY_STOP) 1421 == NOTIFY_STOP)
1414 ia64_mca_spin(__FUNCTION__); 1422 ia64_mca_spin(__FUNCTION__);
1415 1423
@@ -1421,15 +1429,15 @@ ia64_init_handler(struct pt_regs *regs, struct switch_stack *sw,
1421 */ 1429 */
1422 printk("Delaying for 5 seconds...\n"); 1430 printk("Delaying for 5 seconds...\n");
1423 udelay(5*1000000); 1431 udelay(5*1000000);
1424 ia64_wait_for_slaves(cpu); 1432 ia64_wait_for_slaves(cpu, "INIT");
1425 /* If nobody intercepts DIE_INIT_MONARCH_PROCESS then we drop through 1433 /* If nobody intercepts DIE_INIT_MONARCH_PROCESS then we drop through
1426 * to default_monarch_init_process() above and just print all the 1434 * to default_monarch_init_process() above and just print all the
1427 * tasks. 1435 * tasks.
1428 */ 1436 */
1429 if (notify_die(DIE_INIT_MONARCH_PROCESS, "INIT", regs, 0, 0, 0) 1437 if (notify_die(DIE_INIT_MONARCH_PROCESS, "INIT", regs, (long)&nd, 0, 0)
1430 == NOTIFY_STOP) 1438 == NOTIFY_STOP)
1431 ia64_mca_spin(__FUNCTION__); 1439 ia64_mca_spin(__FUNCTION__);
1432 if (notify_die(DIE_INIT_MONARCH_LEAVE, "INIT", regs, 0, 0, 0) 1440 if (notify_die(DIE_INIT_MONARCH_LEAVE, "INIT", regs, (long)&nd, 0, 0)
1433 == NOTIFY_STOP) 1441 == NOTIFY_STOP)
1434 ia64_mca_spin(__FUNCTION__); 1442 ia64_mca_spin(__FUNCTION__);
1435 printk("\nINIT dump complete. Monarch on cpu %d returning to normal service.\n", cpu); 1443 printk("\nINIT dump complete. Monarch on cpu %d returning to normal service.\n", cpu);
@@ -1631,6 +1639,7 @@ ia64_mca_init(void)
1631 printk(KERN_INFO "Increasing MCA rendezvous timeout from " 1639 printk(KERN_INFO "Increasing MCA rendezvous timeout from "
1632 "%ld to %ld milliseconds\n", timeout, isrv.v0); 1640 "%ld to %ld milliseconds\n", timeout, isrv.v0);
1633 timeout = isrv.v0; 1641 timeout = isrv.v0;
1642 (void) notify_die(DIE_MCA_NEW_TIMEOUT, "MCA", NULL, timeout, 0, 0);
1634 continue; 1643 continue;
1635 } 1644 }
1636 printk(KERN_ERR "Failed to register rendezvous interrupt " 1645 printk(KERN_ERR "Failed to register rendezvous interrupt "
diff --git a/arch/ia64/kernel/mca_asm.S b/arch/ia64/kernel/mca_asm.S
index 60a464bfd9e2..6dff024cd62b 100644
--- a/arch/ia64/kernel/mca_asm.S
+++ b/arch/ia64/kernel/mca_asm.S
@@ -827,7 +827,7 @@ ia64_state_restore:
827 ld8 r9=[temp2],16 // sal_gp 827 ld8 r9=[temp2],16 // sal_gp
828 ;; 828 ;;
829 ld8 r22=[temp1],16 // pal_min_state, virtual 829 ld8 r22=[temp1],16 // pal_min_state, virtual
830 ld8 r21=[temp2],16 // prev_IA64_KR_CURRENT 830 ld8 r13=[temp2],16 // prev_IA64_KR_CURRENT
831 ;; 831 ;;
832 ld8 r16=[temp1],16 // prev_IA64_KR_CURRENT_STACK 832 ld8 r16=[temp1],16 // prev_IA64_KR_CURRENT_STACK
833 ld8 r20=[temp2],16 // prev_task 833 ld8 r20=[temp2],16 // prev_task
@@ -848,7 +848,7 @@ ia64_state_restore:
848 mov cr.iim=temp3 848 mov cr.iim=temp3
849 mov cr.iha=temp4 849 mov cr.iha=temp4
850 dep r22=0,r22,62,1 // pal_min_state, physical, uncached 850 dep r22=0,r22,62,1 // pal_min_state, physical, uncached
851 mov IA64_KR(CURRENT)=r21 851 mov IA64_KR(CURRENT)=r13
852 ld8 r8=[temp1] // os_status 852 ld8 r8=[temp1] // os_status
853 ld8 r10=[temp2] // context 853 ld8 r10=[temp2] // context
854 854
@@ -856,7 +856,7 @@ ia64_state_restore:
856 * avoid any dependencies on the algorithm in ia64_switch_to(), just 856 * avoid any dependencies on the algorithm in ia64_switch_to(), just
857 * purge any existing CURRENT_STACK mapping and insert the new one. 857 * purge any existing CURRENT_STACK mapping and insert the new one.
858 * 858 *
859 * r16 contains prev_IA64_KR_CURRENT_STACK, r21 contains 859 * r16 contains prev_IA64_KR_CURRENT_STACK, r13 contains
860 * prev_IA64_KR_CURRENT, these values may have been changed by the C 860 * prev_IA64_KR_CURRENT, these values may have been changed by the C
861 * code. Do not use r8, r9, r10, r22, they contain values ready for 861 * code. Do not use r8, r9, r10, r22, they contain values ready for
862 * the return to SAL. 862 * the return to SAL.
@@ -873,7 +873,7 @@ ia64_state_restore:
873 ;; 873 ;;
874 srlz.d 874 srlz.d
875 875
876 extr.u r19=r21,61,3 // r21 = prev_IA64_KR_CURRENT 876 extr.u r19=r13,61,3 // r13 = prev_IA64_KR_CURRENT
877 shl r20=r16,IA64_GRANULE_SHIFT // r16 = prev_IA64_KR_CURRENT_STACK 877 shl r20=r16,IA64_GRANULE_SHIFT // r16 = prev_IA64_KR_CURRENT_STACK
878 movl r21=PAGE_KERNEL // page properties 878 movl r21=PAGE_KERNEL // page properties
879 ;; 879 ;;
@@ -883,7 +883,7 @@ ia64_state_restore:
883(p6) br.spnt 1f // the dreaded cpu 0 idle task in region 5:( 883(p6) br.spnt 1f // the dreaded cpu 0 idle task in region 5:(
884 ;; 884 ;;
885 mov cr.itir=r18 885 mov cr.itir=r18
886 mov cr.ifa=r21 886 mov cr.ifa=r13
887 mov r20=IA64_TR_CURRENT_STACK 887 mov r20=IA64_TR_CURRENT_STACK
888 ;; 888 ;;
889 itr.d dtr[r20]=r21 889 itr.d dtr[r20]=r21
diff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c
index 7a2f0a798d12..3a30cfc9574f 100644
--- a/arch/ia64/kernel/module.c
+++ b/arch/ia64/kernel/module.c
@@ -947,7 +947,7 @@ void
947percpu_modcopy (void *pcpudst, const void *src, unsigned long size) 947percpu_modcopy (void *pcpudst, const void *src, unsigned long size)
948{ 948{
949 unsigned int i; 949 unsigned int i;
950 for_each_cpu(i) { 950 for_each_possible_cpu(i) {
951 memcpy(pcpudst + __per_cpu_offset[i], src, size); 951 memcpy(pcpudst + __per_cpu_offset[i], src, size);
952 } 952 }
953} 953}
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
index ec9eeb89975d..b6bcc9fa3603 100644
--- a/arch/ia64/mm/discontig.c
+++ b/arch/ia64/mm/discontig.c
@@ -519,6 +519,68 @@ void __cpuinit *per_cpu_init(void)
519} 519}
520#endif /* CONFIG_SMP */ 520#endif /* CONFIG_SMP */
521 521
522#ifdef CONFIG_VIRTUAL_MEM_MAP
523static inline int find_next_valid_pfn_for_pgdat(pg_data_t *pgdat, int i)
524{
525 unsigned long end_address, hole_next_pfn;
526 unsigned long stop_address;
527
528 end_address = (unsigned long) &vmem_map[pgdat->node_start_pfn + i];
529 end_address = PAGE_ALIGN(end_address);
530
531 stop_address = (unsigned long) &vmem_map[
532 pgdat->node_start_pfn + pgdat->node_spanned_pages];
533
534 do {
535 pgd_t *pgd;
536 pud_t *pud;
537 pmd_t *pmd;
538 pte_t *pte;
539
540 pgd = pgd_offset_k(end_address);
541 if (pgd_none(*pgd)) {
542 end_address += PGDIR_SIZE;
543 continue;
544 }
545
546 pud = pud_offset(pgd, end_address);
547 if (pud_none(*pud)) {
548 end_address += PUD_SIZE;
549 continue;
550 }
551
552 pmd = pmd_offset(pud, end_address);
553 if (pmd_none(*pmd)) {
554 end_address += PMD_SIZE;
555 continue;
556 }
557
558 pte = pte_offset_kernel(pmd, end_address);
559retry_pte:
560 if (pte_none(*pte)) {
561 end_address += PAGE_SIZE;
562 pte++;
563 if ((end_address < stop_address) &&
564 (end_address != ALIGN(end_address, 1UL << PMD_SHIFT)))
565 goto retry_pte;
566 continue;
567 }
568 /* Found next valid vmem_map page */
569 break;
570 } while (end_address < stop_address);
571
572 end_address = min(end_address, stop_address);
573 end_address = end_address - (unsigned long) vmem_map + sizeof(struct page) - 1;
574 hole_next_pfn = end_address / sizeof(struct page);
575 return hole_next_pfn - pgdat->node_start_pfn;
576}
577#else
578static inline int find_next_valid_pfn_for_pgdat(pg_data_t *pgdat, int i)
579{
580 return i + 1;
581}
582#endif
583
522/** 584/**
523 * show_mem - give short summary of memory stats 585 * show_mem - give short summary of memory stats
524 * 586 *
@@ -547,8 +609,10 @@ void show_mem(void)
547 struct page *page; 609 struct page *page;
548 if (pfn_valid(pgdat->node_start_pfn + i)) 610 if (pfn_valid(pgdat->node_start_pfn + i))
549 page = pfn_to_page(pgdat->node_start_pfn + i); 611 page = pfn_to_page(pgdat->node_start_pfn + i);
550 else 612 else {
613 i = find_next_valid_pfn_for_pgdat(pgdat, i) - 1;
551 continue; 614 continue;
615 }
552 if (PageReserved(page)) 616 if (PageReserved(page))
553 reserved++; 617 reserved++;
554 else if (PageSwapCache(page)) 618 else if (PageSwapCache(page))
diff --git a/arch/ia64/mm/fault.c b/arch/ia64/mm/fault.c
index af7eb087dca7..d98ec49570b8 100644
--- a/arch/ia64/mm/fault.c
+++ b/arch/ia64/mm/fault.c
@@ -60,6 +60,9 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re
60 struct siginfo si; 60 struct siginfo si;
61 unsigned long mask; 61 unsigned long mask;
62 62
63 /* mmap_sem is performance critical.... */
64 prefetchw(&mm->mmap_sem);
65
63 /* 66 /*
64 * If we're in an interrupt or have no user context, we must not take the fault.. 67 * If we're in an interrupt or have no user context, we must not take the fault..
65 */ 68 */
diff --git a/arch/ia64/sn/kernel/xpc_channel.c b/arch/ia64/sn/kernel/xpc_channel.c
index d0abddd9ffe6..8255a9be4632 100644
--- a/arch/ia64/sn/kernel/xpc_channel.c
+++ b/arch/ia64/sn/kernel/xpc_channel.c
@@ -1831,7 +1831,7 @@ xpc_initiate_allocate(partid_t partid, int ch_number, u32 flags, void **payload)
1831{ 1831{
1832 struct xpc_partition *part = &xpc_partitions[partid]; 1832 struct xpc_partition *part = &xpc_partitions[partid];
1833 enum xpc_retval ret = xpcUnknownReason; 1833 enum xpc_retval ret = xpcUnknownReason;
1834 struct xpc_msg *msg; 1834 struct xpc_msg *msg = NULL;
1835 1835
1836 1836
1837 DBUG_ON(partid <= 0 || partid >= XP_MAX_PARTITIONS); 1837 DBUG_ON(partid <= 0 || partid >= XP_MAX_PARTITIONS);
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig
index 05c864c6c2d9..41fd490af3b4 100644
--- a/arch/m32r/Kconfig
+++ b/arch/m32r/Kconfig
@@ -285,6 +285,11 @@ config NUMA
285 depends on SMP && BROKEN 285 depends on SMP && BROKEN
286 default n 286 default n
287 287
288config NODES_SHIFT
289 int
290 default "1"
291 depends on NEED_MULTIPLE_NODES
292
288# turning this on wastes a bunch of space. 293# turning this on wastes a bunch of space.
289# Summit needs it only when NUMA is on 294# Summit needs it only when NUMA is on
290config BOOT_IOREMAP 295config BOOT_IOREMAP
diff --git a/arch/m32r/kernel/m32r_ksyms.c b/arch/m32r/kernel/m32r_ksyms.c
index be8b711367ec..c50330fa83b9 100644
--- a/arch/m32r/kernel/m32r_ksyms.c
+++ b/arch/m32r/kernel/m32r_ksyms.c
@@ -23,9 +23,6 @@ EXPORT_SYMBOL(boot_cpu_data);
23EXPORT_SYMBOL(dump_fpu); 23EXPORT_SYMBOL(dump_fpu);
24EXPORT_SYMBOL(__ioremap); 24EXPORT_SYMBOL(__ioremap);
25EXPORT_SYMBOL(iounmap); 25EXPORT_SYMBOL(iounmap);
26EXPORT_SYMBOL(enable_irq);
27EXPORT_SYMBOL(disable_irq);
28EXPORT_SYMBOL(disable_irq_nosync);
29EXPORT_SYMBOL(kernel_thread); 26EXPORT_SYMBOL(kernel_thread);
30EXPORT_SYMBOL(__down); 27EXPORT_SYMBOL(__down);
31EXPORT_SYMBOL(__down_interruptible); 28EXPORT_SYMBOL(__down_interruptible);
@@ -38,13 +35,6 @@ EXPORT_SYMBOL(__udelay);
38EXPORT_SYMBOL(__delay); 35EXPORT_SYMBOL(__delay);
39EXPORT_SYMBOL(__const_udelay); 36EXPORT_SYMBOL(__const_udelay);
40 37
41EXPORT_SYMBOL(__get_user_1);
42EXPORT_SYMBOL(__get_user_2);
43EXPORT_SYMBOL(__get_user_4);
44
45EXPORT_SYMBOL(strpbrk);
46EXPORT_SYMBOL(strstr);
47
48EXPORT_SYMBOL(strncpy_from_user); 38EXPORT_SYMBOL(strncpy_from_user);
49EXPORT_SYMBOL(__strncpy_from_user); 39EXPORT_SYMBOL(__strncpy_from_user);
50EXPORT_SYMBOL(clear_user); 40EXPORT_SYMBOL(clear_user);
@@ -59,11 +49,8 @@ extern void *dcache_dummy;
59EXPORT_SYMBOL(dcache_dummy); 49EXPORT_SYMBOL(dcache_dummy);
60#endif 50#endif
61EXPORT_SYMBOL(cpu_data); 51EXPORT_SYMBOL(cpu_data);
62EXPORT_SYMBOL(cpu_online_map);
63EXPORT_SYMBOL(cpu_callout_map);
64 52
65/* Global SMP stuff */ 53/* Global SMP stuff */
66EXPORT_SYMBOL(synchronize_irq);
67EXPORT_SYMBOL(smp_call_function); 54EXPORT_SYMBOL(smp_call_function);
68 55
69/* TLB flushing */ 56/* TLB flushing */
@@ -83,27 +70,11 @@ EXPORT_SYMBOL(__lshrdi3);
83EXPORT_SYMBOL(__muldi3); 70EXPORT_SYMBOL(__muldi3);
84 71
85/* memory and string operations */ 72/* memory and string operations */
86EXPORT_SYMBOL(memchr);
87EXPORT_SYMBOL(memcpy); 73EXPORT_SYMBOL(memcpy);
88/* EXPORT_SYMBOL(memcpy_fromio); // not implement yet */
89/* EXPORT_SYMBOL(memcpy_toio); // not implement yet */
90EXPORT_SYMBOL(memset); 74EXPORT_SYMBOL(memset);
91/* EXPORT_SYMBOL(memset_io); // not implement yet */
92EXPORT_SYMBOL(memmove);
93EXPORT_SYMBOL(memcmp);
94EXPORT_SYMBOL(memscan);
95EXPORT_SYMBOL(copy_page); 75EXPORT_SYMBOL(copy_page);
96EXPORT_SYMBOL(clear_page); 76EXPORT_SYMBOL(clear_page);
97
98EXPORT_SYMBOL(strcat);
99EXPORT_SYMBOL(strchr);
100EXPORT_SYMBOL(strcmp);
101EXPORT_SYMBOL(strcpy);
102EXPORT_SYMBOL(strlen); 77EXPORT_SYMBOL(strlen);
103EXPORT_SYMBOL(strncat);
104EXPORT_SYMBOL(strncmp);
105EXPORT_SYMBOL(strnlen);
106EXPORT_SYMBOL(strncpy);
107 78
108EXPORT_SYMBOL(_inb); 79EXPORT_SYMBOL(_inb);
109EXPORT_SYMBOL(_inw); 80EXPORT_SYMBOL(_inw);
diff --git a/arch/m32r/kernel/setup.c b/arch/m32r/kernel/setup.c
index 0d78942b4c76..3cd3c2988a48 100644
--- a/arch/m32r/kernel/setup.c
+++ b/arch/m32r/kernel/setup.c
@@ -9,6 +9,7 @@
9 9
10#include <linux/config.h> 10#include <linux/config.h>
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/kernel.h>
12#include <linux/stddef.h> 13#include <linux/stddef.h>
13#include <linux/fs.h> 14#include <linux/fs.h>
14#include <linux/sched.h> 15#include <linux/sched.h>
@@ -219,8 +220,6 @@ static unsigned long __init setup_memory(void)
219extern unsigned long setup_memory(void); 220extern unsigned long setup_memory(void);
220#endif /* CONFIG_DISCONTIGMEM */ 221#endif /* CONFIG_DISCONTIGMEM */
221 222
222#define M32R_PCC_PCATCR 0x00ef7014 /* will move to m32r.h */
223
224void __init setup_arch(char **cmdline_p) 223void __init setup_arch(char **cmdline_p)
225{ 224{
226 ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV); 225 ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV);
@@ -269,15 +268,14 @@ void __init setup_arch(char **cmdline_p)
269 paging_init(); 268 paging_init();
270} 269}
271 270
272static struct cpu cpu[NR_CPUS]; 271static struct cpu cpu_devices[NR_CPUS];
273 272
274static int __init topology_init(void) 273static int __init topology_init(void)
275{ 274{
276 int cpu_id; 275 int i;
277 276
278 for (cpu_id = 0; cpu_id < NR_CPUS; cpu_id++) 277 for_each_present_cpu(i)
279 if (cpu_possible(cpu_id)) 278 register_cpu(&cpu_devices[i], i, NULL);
280 register_cpu(&cpu[cpu_id], cpu_id, NULL);
281 279
282 return 0; 280 return 0;
283} 281}
diff --git a/arch/m32r/kernel/smpboot.c b/arch/m32r/kernel/smpboot.c
index d7ec16e7fb25..840b4348bf0c 100644
--- a/arch/m32r/kernel/smpboot.c
+++ b/arch/m32r/kernel/smpboot.c
@@ -39,8 +39,10 @@
39 * Martin J. Bligh : Added support for multi-quad systems 39 * Martin J. Bligh : Added support for multi-quad systems
40 */ 40 */
41 41
42#include <linux/module.h>
42#include <linux/config.h> 43#include <linux/config.h>
43#include <linux/init.h> 44#include <linux/init.h>
45#include <linux/kernel.h>
44#include <linux/mm.h> 46#include <linux/mm.h>
45#include <linux/smp_lock.h> 47#include <linux/smp_lock.h>
46#include <linux/irq.h> 48#include <linux/irq.h>
@@ -72,11 +74,15 @@ physid_mask_t phys_cpu_present_map;
72 74
73/* Bitmask of currently online CPUs */ 75/* Bitmask of currently online CPUs */
74cpumask_t cpu_online_map; 76cpumask_t cpu_online_map;
77EXPORT_SYMBOL(cpu_online_map);
75 78
76cpumask_t cpu_bootout_map; 79cpumask_t cpu_bootout_map;
77cpumask_t cpu_bootin_map; 80cpumask_t cpu_bootin_map;
78cpumask_t cpu_callout_map;
79static cpumask_t cpu_callin_map; 81static cpumask_t cpu_callin_map;
82cpumask_t cpu_callout_map;
83EXPORT_SYMBOL(cpu_callout_map);
84cpumask_t cpu_possible_map = CPU_MASK_ALL;
85EXPORT_SYMBOL(cpu_possible_map);
80 86
81/* Per CPU bogomips and other parameters */ 87/* Per CPU bogomips and other parameters */
82struct cpuinfo_m32r cpu_data[NR_CPUS] __cacheline_aligned; 88struct cpuinfo_m32r cpu_data[NR_CPUS] __cacheline_aligned;
@@ -110,7 +116,6 @@ static unsigned int calibration_result;
110 116
111void smp_prepare_boot_cpu(void); 117void smp_prepare_boot_cpu(void);
112void smp_prepare_cpus(unsigned int); 118void smp_prepare_cpus(unsigned int);
113static void smp_tune_scheduling(void);
114static void init_ipi_lock(void); 119static void init_ipi_lock(void);
115static void do_boot_cpu(int); 120static void do_boot_cpu(int);
116int __cpu_up(unsigned int); 121int __cpu_up(unsigned int);
@@ -177,6 +182,9 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
177 } 182 }
178 for (phys_id = 0 ; phys_id < nr_cpu ; phys_id++) 183 for (phys_id = 0 ; phys_id < nr_cpu ; phys_id++)
179 physid_set(phys_id, phys_cpu_present_map); 184 physid_set(phys_id, phys_cpu_present_map);
185#ifndef CONFIG_HOTPLUG_CPU
186 cpu_present_map = cpu_possible_map;
187#endif
180 188
181 show_mp_info(nr_cpu); 189 show_mp_info(nr_cpu);
182 190
@@ -186,7 +194,6 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
186 * Setup boot CPU information 194 * Setup boot CPU information
187 */ 195 */
188 smp_store_cpu_info(0); /* Final full version of the data */ 196 smp_store_cpu_info(0); /* Final full version of the data */
189 smp_tune_scheduling();
190 197
191 /* 198 /*
192 * If SMP should be disabled, then really disable it! 199 * If SMP should be disabled, then really disable it!
@@ -230,11 +237,6 @@ smp_done:
230 Dprintk("Boot done.\n"); 237 Dprintk("Boot done.\n");
231} 238}
232 239
233static void __init smp_tune_scheduling(void)
234{
235 /* Nothing to do. */
236}
237
238/* 240/*
239 * init_ipi_lock : Initialize IPI locks. 241 * init_ipi_lock : Initialize IPI locks.
240 */ 242 */
@@ -629,4 +631,3 @@ static void __init unmap_cpu_to_physid(int cpu_id, int phys_id)
629 physid_2_cpu[phys_id] = -1; 631 physid_2_cpu[phys_id] = -1;
630 cpu_2_physid[cpu_id] = -1; 632 cpu_2_physid[cpu_id] = -1;
631} 633}
632
diff --git a/arch/m32r/lib/Makefile b/arch/m32r/lib/Makefile
index e632d10c7d78..d16b4e40d1ae 100644
--- a/arch/m32r/lib/Makefile
+++ b/arch/m32r/lib/Makefile
@@ -2,6 +2,6 @@
2# Makefile for M32R-specific library files.. 2# Makefile for M32R-specific library files..
3# 3#
4 4
5lib-y := checksum.o ashxdi3.o memset.o memcpy.o getuser.o \ 5lib-y := checksum.o ashxdi3.o memset.o memcpy.o \
6 putuser.o delay.o strlen.o usercopy.o csum_partial_copy.o 6 delay.o strlen.o usercopy.o csum_partial_copy.o
7 7
diff --git a/arch/m32r/lib/getuser.S b/arch/m32r/lib/getuser.S
deleted file mode 100644
index 58a0db055c5c..000000000000
--- a/arch/m32r/lib/getuser.S
+++ /dev/null
@@ -1,88 +0,0 @@
1/*
2 * __get_user functions.
3 *
4 * (C) Copyright 2001 Hirokazu Takata
5 *
6 * These functions have a non-standard call interface
7 * to make them more efficient, especially as they
8 * return an error value in addition to the "real"
9 * return value.
10 */
11
12#include <linux/config.h>
13
14/*
15 * __get_user_X
16 *
17 * Inputs: r0 contains the address
18 *
19 * Outputs: r0 is error code (0 or -EFAULT)
20 * r1 contains zero-extended value
21 *
22 * These functions should not modify any other registers,
23 * as they get called from within inline assembly.
24 */
25
26#ifdef CONFIG_ISA_DUAL_ISSUE
27
28 .text
29 .balign 4
30 .globl __get_user_1
31__get_user_1:
321: ldub r1, @r0 || ldi r0, #0
33 jmp r14
34
35 .balign 4
36 .globl __get_user_2
37__get_user_2:
382: lduh r1, @r0 || ldi r0, #0
39 jmp r14
40
41 .balign 4
42 .globl __get_user_4
43__get_user_4:
443: ld r1, @r0 || ldi r0, #0
45 jmp r14
46
47bad_get_user:
48 ldi r1, #0 || ldi r0, #-14
49 jmp r14
50
51#else /* not CONFIG_ISA_DUAL_ISSUE */
52
53 .text
54 .balign 4
55 .globl __get_user_1
56__get_user_1:
571: ldub r1, @r0
58 ldi r0, #0
59 jmp r14
60
61 .balign 4
62 .globl __get_user_2
63__get_user_2:
642: lduh r1, @r0
65 ldi r0, #0
66 jmp r14
67
68 .balign 4
69 .globl __get_user_4
70__get_user_4:
713: ld r1, @r0
72 ldi r0, #0
73 jmp r14
74
75bad_get_user:
76 ldi r1, #0
77 ldi r0, #-14
78 jmp r14
79
80#endif /* not CONFIG_ISA_DUAL_ISSUE */
81
82.section __ex_table,"a"
83 .long 1b,bad_get_user
84 .long 2b,bad_get_user
85 .long 3b,bad_get_user
86.previous
87
88 .end
diff --git a/arch/m32r/lib/putuser.S b/arch/m32r/lib/putuser.S
deleted file mode 100644
index 218154cc3890..000000000000
--- a/arch/m32r/lib/putuser.S
+++ /dev/null
@@ -1,84 +0,0 @@
1/*
2 * __put_user functions.
3 *
4 * (C) Copyright 1998 Linus Torvalds
5 * (C) Copyright 2001 Hirokazu Takata
6 *
7 * These functions have a non-standard call interface
8 * to make them more efficient.
9 */
10
11#include <linux/config.h>
12
13/*
14 * __put_user_X
15 *
16 * Inputs: r0 contains the address
17 * r1 contains the value
18 *
19 * Outputs: r0 is error code (0 or -EFAULT)
20 * r1 is corrupted (will contain "current_task").
21 *
22 * These functions should not modify any other registers,
23 * as they get called from within inline assembly.
24 */
25
26#ifdef CONFIG_ISA_DUAL_ISSUE
27
28 .text
29 .balign 4
30 .globl __put_user_1
31__put_user_1:
321: stb r1, @r0 || ldi r0, #0
33 jmp r14
34
35 .balign 4
36 .globl __put_user_2
37__put_user_2:
382: sth r1, @r0 || ldi r0, #0
39 jmp r14
40
41 .balign 4
42 .globl __put_user_4
43__put_user_4:
443: st r1, @r0 || ldi r0, #0
45 jmp r14
46
47bad_put_user:
48 ldi r0, #-14 || jmp r14
49
50#else /* not CONFIG_ISA_DUAL_ISSUE */
51
52 .text
53 .balign 4
54 .globl __put_user_1
55__put_user_1:
561: stb r1, @r0
57 ldi r0, #0
58 jmp r14
59
60 .balign 4
61 .globl __put_user_2
62__put_user_2:
632: sth r1, @r0
64 ldi r0, #0
65 jmp r14
66
67 .balign 4
68 .globl __put_user_4
69__put_user_4:
703: st r1, @r0
71 ldi r0, #0
72 jmp r14
73
74bad_put_user:
75 ldi r0, #-14
76 jmp r14
77
78#endif /* not CONFIG_ISA_DUAL_ISSUE */
79
80.section __ex_table,"a"
81 .long 1b,bad_put_user
82 .long 2b,bad_put_user
83 .long 3b,bad_put_user
84.previous
diff --git a/arch/m68k/kernel/m68k_ksyms.c b/arch/m68k/kernel/m68k_ksyms.c
index c3319514a85e..5b7952ea2bae 100644
--- a/arch/m68k/kernel/m68k_ksyms.c
+++ b/arch/m68k/kernel/m68k_ksyms.c
@@ -57,7 +57,6 @@ EXPORT_SYMBOL(dump_thread);
57EXPORT_SYMBOL(strnlen); 57EXPORT_SYMBOL(strnlen);
58EXPORT_SYMBOL(strrchr); 58EXPORT_SYMBOL(strrchr);
59EXPORT_SYMBOL(strstr); 59EXPORT_SYMBOL(strstr);
60EXPORT_SYMBOL(strpbrk);
61EXPORT_SYMBOL(enable_irq); 60EXPORT_SYMBOL(enable_irq);
62EXPORT_SYMBOL(disable_irq); 61EXPORT_SYMBOL(disable_irq);
63EXPORT_SYMBOL(kernel_thread); 62EXPORT_SYMBOL(kernel_thread);
diff --git a/arch/m68knommu/kernel/m68k_ksyms.c b/arch/m68knommu/kernel/m68k_ksyms.c
index f9b4ea16c099..4320d5dcc9cb 100644
--- a/arch/m68knommu/kernel/m68k_ksyms.c
+++ b/arch/m68knommu/kernel/m68k_ksyms.c
@@ -26,7 +26,6 @@ EXPORT_SYMBOL(__ioremap);
26EXPORT_SYMBOL(iounmap); 26EXPORT_SYMBOL(iounmap);
27EXPORT_SYMBOL(dump_fpu); 27EXPORT_SYMBOL(dump_fpu);
28EXPORT_SYMBOL(strnlen); 28EXPORT_SYMBOL(strnlen);
29EXPORT_SYMBOL(strpbrk);
30EXPORT_SYMBOL(strrchr); 29EXPORT_SYMBOL(strrchr);
31EXPORT_SYMBOL(strstr); 30EXPORT_SYMBOL(strstr);
32EXPORT_SYMBOL(strchr); 31EXPORT_SYMBOL(strchr);
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index e15709ce8866..7aec60d40420 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1590,6 +1590,11 @@ config ARCH_FLATMEM_ENABLE
1590 def_bool y 1590 def_bool y
1591 depends on !NUMA 1591 depends on !NUMA
1592 1592
1593config NODES_SHIFT
1594 int
1595 default "6"
1596 depends on NEED_MULTIPLE_NODES
1597
1593source "mm/Kconfig" 1598source "mm/Kconfig"
1594 1599
1595config SMP 1600config SMP
diff --git a/arch/mips/kernel/mips_ksyms.c b/arch/mips/kernel/mips_ksyms.c
index 86e42c633f73..e042f9d2ba31 100644
--- a/arch/mips/kernel/mips_ksyms.c
+++ b/arch/mips/kernel/mips_ksyms.c
@@ -39,7 +39,6 @@ EXPORT_SYMBOL(strchr);
39EXPORT_SYMBOL(strncmp); 39EXPORT_SYMBOL(strncmp);
40#endif 40#endif
41EXPORT_SYMBOL(strlen); 41EXPORT_SYMBOL(strlen);
42EXPORT_SYMBOL(strpbrk);
43EXPORT_SYMBOL(strncat); 42EXPORT_SYMBOL(strncat);
44EXPORT_SYMBOL(strnlen); 43EXPORT_SYMBOL(strnlen);
45EXPORT_SYMBOL(strrchr); 44EXPORT_SYMBOL(strrchr);
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 2fdf21989dc2..19f911c5dd58 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -177,6 +177,11 @@ config ARCH_DISCONTIGMEM_DEFAULT
177 def_bool y 177 def_bool y
178 depends on ARCH_DISCONTIGMEM_ENABLE 178 depends on ARCH_DISCONTIGMEM_ENABLE
179 179
180config NODES_SHIFT
181 int
182 default "3"
183 depends on NEED_MULTIPLE_NODES
184
180source "kernel/Kconfig.preempt" 185source "kernel/Kconfig.preempt"
181source "kernel/Kconfig.hz" 186source "kernel/Kconfig.hz"
182source "mm/Kconfig" 187source "mm/Kconfig"
diff --git a/arch/parisc/kernel/parisc_ksyms.c b/arch/parisc/kernel/parisc_ksyms.c
index 47ca5c0a323b..fc107add627c 100644
--- a/arch/parisc/kernel/parisc_ksyms.c
+++ b/arch/parisc/kernel/parisc_ksyms.c
@@ -31,7 +31,6 @@
31 31
32#include <linux/string.h> 32#include <linux/string.h>
33EXPORT_SYMBOL(memset); 33EXPORT_SYMBOL(memset);
34EXPORT_SYMBOL(strpbrk);
35 34
36#include <asm/atomic.h> 35#include <asm/atomic.h>
37EXPORT_SYMBOL(__xchg8); 36EXPORT_SYMBOL(__xchg8);
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 2cdc35ce8045..167e70e95556 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -649,6 +649,11 @@ config NUMA
649 depends on PPC64 649 depends on PPC64
650 default y if SMP && PPC_PSERIES 650 default y if SMP && PPC_PSERIES
651 651
652config NODES_SHIFT
653 int
654 default "4"
655 depends on NEED_MULTIPLE_NODES
656
652config ARCH_SELECT_MEMORY_MODEL 657config ARCH_SELECT_MEMORY_MODEL
653 def_bool y 658 def_bool y
654 depends on PPC64 659 depends on PPC64
diff --git a/arch/powerpc/kernel/systbl.S b/arch/powerpc/kernel/systbl.S
index 1424eab450ee..a14c96403840 100644
--- a/arch/powerpc/kernel/systbl.S
+++ b/arch/powerpc/kernel/systbl.S
@@ -323,3 +323,4 @@ COMPAT_SYS(pselect6)
323COMPAT_SYS(ppoll) 323COMPAT_SYS(ppoll)
324SYSCALL(unshare) 324SYSCALL(unshare)
325SYSCALL(splice) 325SYSCALL(splice)
326SYSCALL(tee)
diff --git a/arch/ppc/boot/lib/Makefile b/arch/ppc/boot/lib/Makefile
index d4077e69086f..80c84d562fa4 100644
--- a/arch/ppc/boot/lib/Makefile
+++ b/arch/ppc/boot/lib/Makefile
@@ -3,7 +3,7 @@
3# 3#
4 4
5CFLAGS_kbd.o := -Idrivers/char 5CFLAGS_kbd.o := -Idrivers/char
6CFLAGS_vreset.o := -I$(srctree)/arch/ppc/boot/include 6CFLAGS_vreset.o := -Iarch/ppc/boot/include
7 7
8zlib := infblock.c infcodes.c inffast.c inflate.c inftrees.c infutil.c 8zlib := infblock.c infcodes.c inffast.c inflate.c inftrees.c infutil.c
9 9
diff --git a/arch/s390/Makefile b/arch/s390/Makefile
index 6c6b197898d0..7bb16fb97d4f 100644
--- a/arch/s390/Makefile
+++ b/arch/s390/Makefile
@@ -67,7 +67,6 @@ cflags-$(CONFIG_WARN_STACK) += -mwarn-framesize=$(CONFIG_WARN_STACK_SIZE)
67endif 67endif
68 68
69CFLAGS += -mbackchain -msoft-float $(cflags-y) 69CFLAGS += -mbackchain -msoft-float $(cflags-y)
70CFLAGS += $(call cc-option,-finline-limit=10000)
71CFLAGS += -pipe -fno-strength-reduce -Wno-sign-compare 70CFLAGS += -pipe -fno-strength-reduce -Wno-sign-compare
72AFLAGS += $(aflags-y) 71AFLAGS += $(aflags-y)
73 72
diff --git a/arch/s390/defconfig b/arch/s390/defconfig
index f8d0cd540a06..f4dfc10026d2 100644
--- a/arch/s390/defconfig
+++ b/arch/s390/defconfig
@@ -1,10 +1,11 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc2 3# Linux kernel version: 2.6.17-rc1
4# Wed Feb 8 10:44:39 2006 4# Mon Apr 3 14:34:15 2006
5# 5#
6CONFIG_MMU=y 6CONFIG_MMU=y
7CONFIG_RWSEM_XCHGADD_ALGORITHM=y 7CONFIG_RWSEM_XCHGADD_ALGORITHM=y
8CONFIG_GENERIC_HWEIGHT=y
8CONFIG_GENERIC_CALIBRATE_DELAY=y 9CONFIG_GENERIC_CALIBRATE_DELAY=y
9CONFIG_S390=y 10CONFIG_S390=y
10 11
@@ -30,8 +31,8 @@ CONFIG_AUDIT=y
30CONFIG_IKCONFIG=y 31CONFIG_IKCONFIG=y
31CONFIG_IKCONFIG_PROC=y 32CONFIG_IKCONFIG_PROC=y
32# CONFIG_CPUSETS is not set 33# CONFIG_CPUSETS is not set
34# CONFIG_RELAY is not set
33CONFIG_INITRAMFS_SOURCE="" 35CONFIG_INITRAMFS_SOURCE=""
34CONFIG_UID16=y
35# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 36# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
36# CONFIG_EMBEDDED is not set 37# CONFIG_EMBEDDED is not set
37CONFIG_KALLSYMS=y 38CONFIG_KALLSYMS=y
@@ -45,10 +46,6 @@ CONFIG_BASE_FULL=y
45CONFIG_FUTEX=y 46CONFIG_FUTEX=y
46CONFIG_EPOLL=y 47CONFIG_EPOLL=y
47CONFIG_SHMEM=y 48CONFIG_SHMEM=y
48CONFIG_CC_ALIGN_FUNCTIONS=0
49CONFIG_CC_ALIGN_LABELS=0
50CONFIG_CC_ALIGN_LOOPS=0
51CONFIG_CC_ALIGN_JUMPS=0
52CONFIG_SLAB=y 49CONFIG_SLAB=y
53# CONFIG_TINY_SHMEM is not set 50# CONFIG_TINY_SHMEM is not set
54CONFIG_BASE_SMALL=0 51CONFIG_BASE_SMALL=0
@@ -60,7 +57,6 @@ CONFIG_BASE_SMALL=0
60CONFIG_MODULES=y 57CONFIG_MODULES=y
61CONFIG_MODULE_UNLOAD=y 58CONFIG_MODULE_UNLOAD=y
62# CONFIG_MODULE_FORCE_UNLOAD is not set 59# CONFIG_MODULE_FORCE_UNLOAD is not set
63CONFIG_OBSOLETE_MODPARM=y
64CONFIG_MODVERSIONS=y 60CONFIG_MODVERSIONS=y
65# CONFIG_MODULE_SRCVERSION_ALL is not set 61# CONFIG_MODULE_SRCVERSION_ALL is not set
66CONFIG_KMOD=y 62CONFIG_KMOD=y
@@ -69,7 +65,7 @@ CONFIG_STOP_MACHINE=y
69# 65#
70# Block layer 66# Block layer
71# 67#
72# CONFIG_LBD is not set 68# CONFIG_BLK_DEV_IO_TRACE is not set
73 69
74# 70#
75# IO Schedulers 71# IO Schedulers
@@ -91,17 +87,20 @@ CONFIG_DEFAULT_IOSCHED="deadline"
91# 87#
92# Processor type and features 88# Processor type and features
93# 89#
94# CONFIG_64BIT is not set 90CONFIG_64BIT=y
95CONFIG_SMP=y 91CONFIG_SMP=y
96CONFIG_NR_CPUS=32 92CONFIG_NR_CPUS=32
97CONFIG_HOTPLUG_CPU=y 93CONFIG_HOTPLUG_CPU=y
98CONFIG_MATHEMU=y 94CONFIG_DEFAULT_MIGRATION_COST=1000000
95CONFIG_COMPAT=y
96CONFIG_SYSVIPC_COMPAT=y
97CONFIG_BINFMT_ELF32=y
99 98
100# 99#
101# Code generation options 100# Code generation options
102# 101#
103CONFIG_MARCH_G5=y 102# CONFIG_MARCH_G5 is not set
104# CONFIG_MARCH_Z900 is not set 103CONFIG_MARCH_Z900=y
105# CONFIG_MARCH_Z990 is not set 104# CONFIG_MARCH_Z990 is not set
106CONFIG_PACK_STACK=y 105CONFIG_PACK_STACK=y
107# CONFIG_SMALL_STACK is not set 106# CONFIG_SMALL_STACK is not set
@@ -143,7 +142,7 @@ CONFIG_VIRT_CPU_ACCOUNTING=y
143# CONFIG_APPLDATA_BASE is not set 142# CONFIG_APPLDATA_BASE is not set
144CONFIG_NO_IDLE_HZ=y 143CONFIG_NO_IDLE_HZ=y
145CONFIG_NO_IDLE_HZ_INIT=y 144CONFIG_NO_IDLE_HZ_INIT=y
146# CONFIG_KEXEC is not set 145CONFIG_KEXEC=y
147 146
148# 147#
149# Networking 148# Networking
@@ -173,6 +172,7 @@ CONFIG_IP_FIB_HASH=y
173# CONFIG_INET_AH is not set 172# CONFIG_INET_AH is not set
174# CONFIG_INET_ESP is not set 173# CONFIG_INET_ESP is not set
175# CONFIG_INET_IPCOMP is not set 174# CONFIG_INET_IPCOMP is not set
175# CONFIG_INET_XFRM_TUNNEL is not set
176# CONFIG_INET_TUNNEL is not set 176# CONFIG_INET_TUNNEL is not set
177CONFIG_INET_DIAG=y 177CONFIG_INET_DIAG=y
178CONFIG_INET_TCP_DIAG=y 178CONFIG_INET_TCP_DIAG=y
@@ -180,9 +180,11 @@ CONFIG_INET_TCP_DIAG=y
180CONFIG_TCP_CONG_BIC=y 180CONFIG_TCP_CONG_BIC=y
181CONFIG_IPV6=y 181CONFIG_IPV6=y
182# CONFIG_IPV6_PRIVACY is not set 182# CONFIG_IPV6_PRIVACY is not set
183# CONFIG_IPV6_ROUTER_PREF is not set
183# CONFIG_INET6_AH is not set 184# CONFIG_INET6_AH is not set
184# CONFIG_INET6_ESP is not set 185# CONFIG_INET6_ESP is not set
185# CONFIG_INET6_IPCOMP is not set 186# CONFIG_INET6_IPCOMP is not set
187# CONFIG_INET6_XFRM_TUNNEL is not set
186# CONFIG_INET6_TUNNEL is not set 188# CONFIG_INET6_TUNNEL is not set
187# CONFIG_IPV6_TUNNEL is not set 189# CONFIG_IPV6_TUNNEL is not set
188# CONFIG_NETFILTER is not set 190# CONFIG_NETFILTER is not set
@@ -276,6 +278,11 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
276# CONFIG_DEBUG_DRIVER is not set 278# CONFIG_DEBUG_DRIVER is not set
277 279
278# 280#
281# Connector - unified userspace <-> kernelspace linker
282#
283# CONFIG_CONNECTOR is not set
284
285#
279# SCSI device support 286# SCSI device support
280# 287#
281# CONFIG_RAID_ATTRS is not set 288# CONFIG_RAID_ATTRS is not set
@@ -340,8 +347,7 @@ CONFIG_DASD_PROFILE=y
340CONFIG_DASD_ECKD=y 347CONFIG_DASD_ECKD=y
341CONFIG_DASD_FBA=y 348CONFIG_DASD_FBA=y
342CONFIG_DASD_DIAG=y 349CONFIG_DASD_DIAG=y
343CONFIG_DASD_EER=m 350CONFIG_DASD_EER=y
344# CONFIG_DASD_CMB is not set
345# CONFIG_ATA_OVER_ETH is not set 351# CONFIG_ATA_OVER_ETH is not set
346 352
347# 353#
@@ -354,6 +360,7 @@ CONFIG_MD_RAID0=m
354CONFIG_MD_RAID1=m 360CONFIG_MD_RAID1=m
355# CONFIG_MD_RAID10 is not set 361# CONFIG_MD_RAID10 is not set
356CONFIG_MD_RAID5=m 362CONFIG_MD_RAID5=m
363# CONFIG_MD_RAID5_RESHAPE is not set
357# CONFIG_MD_RAID6 is not set 364# CONFIG_MD_RAID6 is not set
358CONFIG_MD_MULTIPATH=m 365CONFIG_MD_MULTIPATH=m
359# CONFIG_MD_FAULTY is not set 366# CONFIG_MD_FAULTY is not set
@@ -404,6 +411,7 @@ CONFIG_S390_TAPE_BLOCK=y
404# S/390 tape hardware support 411# S/390 tape hardware support
405# 412#
406CONFIG_S390_TAPE_34XX=m 413CONFIG_S390_TAPE_34XX=m
414# CONFIG_S390_TAPE_3590 is not set
407# CONFIG_VMLOGRDR is not set 415# CONFIG_VMLOGRDR is not set
408# CONFIG_VMCP is not set 416# CONFIG_VMCP is not set
409# CONFIG_MONREADER is not set 417# CONFIG_MONREADER is not set
@@ -529,7 +537,6 @@ CONFIG_SYSFS=y
529CONFIG_TMPFS=y 537CONFIG_TMPFS=y
530# CONFIG_HUGETLB_PAGE is not set 538# CONFIG_HUGETLB_PAGE is not set
531CONFIG_RAMFS=y 539CONFIG_RAMFS=y
532# CONFIG_RELAYFS_FS is not set
533# CONFIG_CONFIGFS_FS is not set 540# CONFIG_CONFIGFS_FS is not set
534 541
535# 542#
@@ -619,14 +626,15 @@ CONFIG_LOG_BUF_SHIFT=17
619# CONFIG_DETECT_SOFTLOCKUP is not set 626# CONFIG_DETECT_SOFTLOCKUP is not set
620# CONFIG_SCHEDSTATS is not set 627# CONFIG_SCHEDSTATS is not set
621# CONFIG_DEBUG_SLAB is not set 628# CONFIG_DEBUG_SLAB is not set
622# CONFIG_DEBUG_PREEMPT is not set 629CONFIG_DEBUG_PREEMPT=y
623CONFIG_DEBUG_MUTEXES=y 630CONFIG_DEBUG_MUTEXES=y
624# CONFIG_DEBUG_SPINLOCK is not set 631CONFIG_DEBUG_SPINLOCK=y
625# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 632CONFIG_DEBUG_SPINLOCK_SLEEP=y
626# CONFIG_DEBUG_KOBJECT is not set 633# CONFIG_DEBUG_KOBJECT is not set
627# CONFIG_DEBUG_INFO is not set 634# CONFIG_DEBUG_INFO is not set
628CONFIG_DEBUG_FS=y 635CONFIG_DEBUG_FS=y
629# CONFIG_DEBUG_VM is not set 636# CONFIG_DEBUG_VM is not set
637# CONFIG_UNWIND_INFO is not set
630CONFIG_FORCED_INLINING=y 638CONFIG_FORCED_INLINING=y
631# CONFIG_RCU_TORTURE_TEST is not set 639# CONFIG_RCU_TORTURE_TEST is not set
632 640
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 58583f459471..2bcecf422573 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -527,6 +527,11 @@ config CPU_HAS_SR_RB
527 See <file:Documentation/sh/register-banks.txt> for further 527 See <file:Documentation/sh/register-banks.txt> for further
528 information on SR.RB and register banking in the kernel in general. 528 information on SR.RB and register banking in the kernel in general.
529 529
530config NODES_SHIFT
531 int
532 default "1"
533 depends on NEED_MULTIPLE_NODES
534
530endmenu 535endmenu
531 536
532menu "Boot options" 537menu "Boot options"
diff --git a/arch/sh/kernel/sh_ksyms.c b/arch/sh/kernel/sh_ksyms.c
index 1cf94a618be3..d5d032533a8b 100644
--- a/arch/sh/kernel/sh_ksyms.c
+++ b/arch/sh/kernel/sh_ksyms.c
@@ -37,7 +37,6 @@ EXPORT_SYMBOL(disable_irq_nosync);
37EXPORT_SYMBOL(irq_desc); 37EXPORT_SYMBOL(irq_desc);
38EXPORT_SYMBOL(no_irq_type); 38EXPORT_SYMBOL(no_irq_type);
39 39
40EXPORT_SYMBOL(strpbrk);
41EXPORT_SYMBOL(strstr); 40EXPORT_SYMBOL(strstr);
42EXPORT_SYMBOL(strlen); 41EXPORT_SYMBOL(strlen);
43EXPORT_SYMBOL(strnlen); 42EXPORT_SYMBOL(strnlen);
diff --git a/arch/sh64/kernel/sh_ksyms.c b/arch/sh64/kernel/sh_ksyms.c
index de29c45f23a7..6f3a1c946339 100644
--- a/arch/sh64/kernel/sh_ksyms.c
+++ b/arch/sh64/kernel/sh_ksyms.c
@@ -41,7 +41,6 @@ EXPORT_SYMBOL(kernel_thread);
41/* Networking helper routines. */ 41/* Networking helper routines. */
42EXPORT_SYMBOL(csum_partial_copy); 42EXPORT_SYMBOL(csum_partial_copy);
43 43
44EXPORT_SYMBOL(strpbrk);
45EXPORT_SYMBOL(strstr); 44EXPORT_SYMBOL(strstr);
46 45
47#ifdef CONFIG_VT 46#ifdef CONFIG_VT
diff --git a/arch/sparc/kernel/smp.c b/arch/sparc/kernel/smp.c
index 2be812115197..a93f5da6855d 100644
--- a/arch/sparc/kernel/smp.c
+++ b/arch/sparc/kernel/smp.c
@@ -244,7 +244,7 @@ int setup_profiling_timer(unsigned int multiplier)
244 return -EINVAL; 244 return -EINVAL;
245 245
246 spin_lock_irqsave(&prof_setup_lock, flags); 246 spin_lock_irqsave(&prof_setup_lock, flags);
247 for_each_cpu(i) { 247 for_each_possible_cpu(i) {
248 load_profile_irq(i, lvl14_resolution / multiplier); 248 load_profile_irq(i, lvl14_resolution / multiplier);
249 prof_multiplier(i) = multiplier; 249 prof_multiplier(i) = multiplier;
250 } 250 }
diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c
index 2c21d7907635..ec1c9687d679 100644
--- a/arch/sparc/kernel/sparc_ksyms.c
+++ b/arch/sparc/kernel/sparc_ksyms.c
@@ -263,7 +263,6 @@ EXPORT_SYMBOL(strcmp);
263EXPORT_SYMBOL(strncmp); 263EXPORT_SYMBOL(strncmp);
264EXPORT_SYMBOL(strchr); 264EXPORT_SYMBOL(strchr);
265EXPORT_SYMBOL(strrchr); 265EXPORT_SYMBOL(strrchr);
266EXPORT_SYMBOL(strpbrk);
267EXPORT_SYMBOL(strstr); 266EXPORT_SYMBOL(strstr);
268EXPORT_SYMBOL(page_kernel); 267EXPORT_SYMBOL(page_kernel);
269 268
diff --git a/arch/sparc/kernel/systbls.S b/arch/sparc/kernel/systbls.S
index fbbec5e761c6..db8faa75f94d 100644
--- a/arch/sparc/kernel/systbls.S
+++ b/arch/sparc/kernel/systbls.S
@@ -75,7 +75,7 @@ sys_call_table:
75/*265*/ .long sys_timer_delete, sys_timer_create, sys_nis_syscall, sys_io_setup, sys_io_destroy 75/*265*/ .long sys_timer_delete, sys_timer_create, sys_nis_syscall, sys_io_setup, sys_io_destroy
76/*270*/ .long sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink 76/*270*/ .long sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink
77/*275*/ .long sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid 77/*275*/ .long sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid
78/*280*/ .long sys_ni_syscall, sys_add_key, sys_request_key, sys_keyctl, sys_openat 78/*280*/ .long sys_tee, sys_add_key, sys_request_key, sys_keyctl, sys_openat
79/*285*/ .long sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64 79/*285*/ .long sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64
80/*290*/ .long sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat 80/*290*/ .long sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat
81/*295*/ .long sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare 81/*295*/ .long sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare
diff --git a/arch/sparc/math-emu/Makefile b/arch/sparc/math-emu/Makefile
index f84a9a6162be..8136987977f4 100644
--- a/arch/sparc/math-emu/Makefile
+++ b/arch/sparc/math-emu/Makefile
@@ -5,4 +5,4 @@
5obj-y := math.o 5obj-y := math.o
6 6
7EXTRA_AFLAGS := -ansi 7EXTRA_AFLAGS := -ansi
8EXTRA_CFLAGS = -I. -I$(TOPDIR)/include/math-emu -w 8EXTRA_CFLAGS = -I. -Iinclude/math-emu -w
diff --git a/arch/sparc64/kernel/pci_sun4v.c b/arch/sparc64/kernel/pci_sun4v.c
index 9372d4f376d5..9e94db2573a2 100644
--- a/arch/sparc64/kernel/pci_sun4v.c
+++ b/arch/sparc64/kernel/pci_sun4v.c
@@ -1092,7 +1092,7 @@ void sun4v_pci_init(int node, char *model_name)
1092 } 1092 }
1093 } 1093 }
1094 1094
1095 for_each_cpu(i) { 1095 for_each_possible_cpu(i) {
1096 unsigned long page = get_zeroed_page(GFP_ATOMIC); 1096 unsigned long page = get_zeroed_page(GFP_ATOMIC);
1097 1097
1098 if (!page) 1098 if (!page)
diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c
index 7d0e67c1ce50..005167f82419 100644
--- a/arch/sparc64/kernel/setup.c
+++ b/arch/sparc64/kernel/setup.c
@@ -535,7 +535,7 @@ static int __init topology_init(void)
535 while (!cpu_find_by_instance(ncpus_probed, NULL, NULL)) 535 while (!cpu_find_by_instance(ncpus_probed, NULL, NULL))
536 ncpus_probed++; 536 ncpus_probed++;
537 537
538 for_each_cpu(i) { 538 for_each_possible_cpu(i) {
539 struct cpu *p = kzalloc(sizeof(*p), GFP_KERNEL); 539 struct cpu *p = kzalloc(sizeof(*p), GFP_KERNEL);
540 if (p) { 540 if (p) {
541 register_cpu(p, i, NULL); 541 register_cpu(p, i, NULL);
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index eb36f7988ff7..90eaca3ec9a6 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -1280,7 +1280,7 @@ int setup_profiling_timer(unsigned int multiplier)
1280 return -EINVAL; 1280 return -EINVAL;
1281 1281
1282 spin_lock_irqsave(&prof_setup_lock, flags); 1282 spin_lock_irqsave(&prof_setup_lock, flags);
1283 for_each_cpu(i) 1283 for_each_possible_cpu(i)
1284 prof_multiplier(i) = multiplier; 1284 prof_multiplier(i) = multiplier;
1285 current_tick_offset = (timer_tick_offset / multiplier); 1285 current_tick_offset = (timer_tick_offset / multiplier);
1286 spin_unlock_irqrestore(&prof_setup_lock, flags); 1286 spin_unlock_irqrestore(&prof_setup_lock, flags);
@@ -1308,12 +1308,12 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
1308 } 1308 }
1309 } 1309 }
1310 1310
1311 for_each_cpu(i) { 1311 for_each_possible_cpu(i) {
1312 if (tlb_type == hypervisor) { 1312 if (tlb_type == hypervisor) {
1313 int j; 1313 int j;
1314 1314
1315 /* XXX get this mapping from machine description */ 1315 /* XXX get this mapping from machine description */
1316 for_each_cpu(j) { 1316 for_each_possible_cpu(j) {
1317 if ((j >> 2) == (i >> 2)) 1317 if ((j >> 2) == (i >> 2))
1318 cpu_set(j, cpu_sibling_map[i]); 1318 cpu_set(j, cpu_sibling_map[i]);
1319 } 1319 }
diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c
index f5e8db1de76b..62d8a99271ea 100644
--- a/arch/sparc64/kernel/sparc64_ksyms.c
+++ b/arch/sparc64/kernel/sparc64_ksyms.c
@@ -276,7 +276,6 @@ EXPORT_SYMBOL(__prom_getsibling);
276EXPORT_SYMBOL(strlen); 276EXPORT_SYMBOL(strlen);
277EXPORT_SYMBOL(__strlen_user); 277EXPORT_SYMBOL(__strlen_user);
278EXPORT_SYMBOL(__strnlen_user); 278EXPORT_SYMBOL(__strnlen_user);
279EXPORT_SYMBOL(strpbrk);
280 279
281#ifdef CONFIG_SOLARIS_EMUL_MODULE 280#ifdef CONFIG_SOLARIS_EMUL_MODULE
282EXPORT_SYMBOL(linux_sparc_syscall); 281EXPORT_SYMBOL(linux_sparc_syscall);
diff --git a/arch/sparc64/kernel/sys32.S b/arch/sparc64/kernel/sys32.S
index 86dd5cb81e09..f9b75760163c 100644
--- a/arch/sparc64/kernel/sys32.S
+++ b/arch/sparc64/kernel/sys32.S
@@ -138,6 +138,7 @@ SIGN2(sys32_ioprio_get, sys_ioprio_get, %o0, %o1)
138SIGN3(sys32_ioprio_set, sys_ioprio_set, %o0, %o1, %o2) 138SIGN3(sys32_ioprio_set, sys_ioprio_set, %o0, %o1, %o2)
139SIGN2(sys32_splice, sys_splice, %o0, %o1) 139SIGN2(sys32_splice, sys_splice, %o0, %o1)
140SIGN2(sys32_sync_file_range, compat_sync_file_range, %o0, %o5) 140SIGN2(sys32_sync_file_range, compat_sync_file_range, %o0, %o5)
141SIGN2(sys32_tee, sys_tee, %o0, %o1)
141 142
142 .globl sys32_mmap2 143 .globl sys32_mmap2
143sys32_mmap2: 144sys32_mmap2:
diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S
index 857b82c82875..62672cd92eca 100644
--- a/arch/sparc64/kernel/systbls.S
+++ b/arch/sparc64/kernel/systbls.S
@@ -76,7 +76,7 @@ sys_call_table32:
76 .word sys_timer_delete, compat_sys_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, compat_sys_openat 79/*280*/ .word sys32_tee, sys_add_key, sys_request_key, sys_keyctl, compat_sys_openat
80 .word sys_mkdirat, sys_mknodat, sys_fchownat, compat_sys_futimesat, compat_sys_fstatat64 80 .word sys_mkdirat, sys_mknodat, sys_fchownat, compat_sys_futimesat, compat_sys_fstatat64
81/*285*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat 81/*285*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat
82 .word sys_fchmodat, sys_faccessat, compat_sys_pselect6, compat_sys_ppoll, sys_unshare 82 .word sys_fchmodat, sys_faccessat, compat_sys_pselect6, compat_sys_ppoll, sys_unshare
@@ -145,7 +145,7 @@ sys_call_table:
145 .word sys_timer_delete, sys_timer_create, sys_ni_syscall, sys_io_setup, sys_io_destroy 145 .word sys_timer_delete, sys_timer_create, sys_ni_syscall, sys_io_setup, sys_io_destroy
146/*270*/ .word sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink 146/*270*/ .word sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink
147 .word sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid 147 .word sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid
148/*280*/ .word sys_nis_syscall, sys_add_key, sys_request_key, sys_keyctl, sys_openat 148/*280*/ .word sys_tee, sys_add_key, sys_request_key, sys_keyctl, sys_openat
149 .word sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64 149 .word sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64
150/*285*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat 150/*285*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat
151 .word sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare 151 .word sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare
diff --git a/arch/um/Makefile b/arch/um/Makefile
index 24790bed2054..a508e7a02891 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -159,6 +159,7 @@ archclean:
159$(SYMLINK_HEADERS): 159$(SYMLINK_HEADERS):
160 @echo ' SYMLINK $@' 160 @echo ' SYMLINK $@'
161ifneq ($(KBUILD_SRC),) 161ifneq ($(KBUILD_SRC),)
162 $(Q)mkdir -p $(objtree)/include/asm-um
162 $(Q)ln -fsn $(srctree)/include/asm-um/$(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $@ 163 $(Q)ln -fsn $(srctree)/include/asm-um/$(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $@
163else 164else
164 $(Q)cd $(TOPDIR)/$(dir $@) ; \ 165 $(Q)cd $(TOPDIR)/$(dir $@) ; \
@@ -168,7 +169,7 @@ endif
168include/asm-um/arch: 169include/asm-um/arch:
169 @echo ' SYMLINK $@' 170 @echo ' SYMLINK $@'
170ifneq ($(KBUILD_SRC),) 171ifneq ($(KBUILD_SRC),)
171 $(Q)mkdir -p include/asm-um 172 $(Q)mkdir -p $(objtree)/include/asm-um
172 $(Q)ln -fsn $(srctree)/include/asm-$(SUBARCH) include/asm-um/arch 173 $(Q)ln -fsn $(srctree)/include/asm-$(SUBARCH) include/asm-um/arch
173else 174else
174 $(Q)cd $(TOPDIR)/include/asm-um && ln -sf ../asm-$(SUBARCH) arch 175 $(Q)cd $(TOPDIR)/include/asm-um && ln -sf ../asm-$(SUBARCH) arch
diff --git a/arch/um/drivers/cow.h b/arch/um/drivers/cow.h
index 04e3958266e0..dc36b222100b 100644
--- a/arch/um/drivers/cow.h
+++ b/arch/um/drivers/cow.h
@@ -46,7 +46,7 @@ extern int file_reader(__u64 offset, char *buf, int len, void *arg);
46extern int read_cow_header(int (*reader)(__u64, char *, int, void *), 46extern int read_cow_header(int (*reader)(__u64, char *, int, void *),
47 void *arg, __u32 *version_out, 47 void *arg, __u32 *version_out,
48 char **backing_file_out, time_t *mtime_out, 48 char **backing_file_out, time_t *mtime_out,
49 __u64 *size_out, int *sectorsize_out, 49 unsigned long long *size_out, int *sectorsize_out,
50 __u32 *align_out, int *bitmap_offset_out); 50 __u32 *align_out, int *bitmap_offset_out);
51 51
52extern int write_cow_header(char *cow_file, int fd, char *backing_file, 52extern int write_cow_header(char *cow_file, int fd, char *backing_file,
diff --git a/arch/um/drivers/cow_sys.h b/arch/um/drivers/cow_sys.h
index 94de4ead4f7a..7a5b4afde692 100644
--- a/arch/um/drivers/cow_sys.h
+++ b/arch/um/drivers/cow_sys.h
@@ -28,7 +28,7 @@ static inline int cow_seek_file(int fd, __u64 offset)
28 return(os_seek_file(fd, offset)); 28 return(os_seek_file(fd, offset));
29} 29}
30 30
31static inline int cow_file_size(char *file, __u64 *size_out) 31static inline int cow_file_size(char *file, unsigned long long *size_out)
32{ 32{
33 return(os_file_size(file, size_out)); 33 return(os_file_size(file, size_out));
34} 34}
diff --git a/arch/um/drivers/cow_user.c b/arch/um/drivers/cow_user.c
index 61951b721268..0ec4052db9c5 100644
--- a/arch/um/drivers/cow_user.c
+++ b/arch/um/drivers/cow_user.c
@@ -17,30 +17,34 @@
17 17
18#define PATH_LEN_V1 256 18#define PATH_LEN_V1 256
19 19
20typedef __u32 time32_t;
21
20struct cow_header_v1 { 22struct cow_header_v1 {
21 int magic; 23 __s32 magic;
22 int version; 24 __s32 version;
23 char backing_file[PATH_LEN_V1]; 25 char backing_file[PATH_LEN_V1];
24 time_t mtime; 26 time32_t mtime;
25 __u64 size; 27 __u64 size;
26 int sectorsize; 28 __s32 sectorsize;
27}; 29} __attribute__((packed));
28 30
29#define PATH_LEN_V2 MAXPATHLEN 31/* Define PATH_LEN_V3 as the usual value of MAXPATHLEN, just hard-code it in
32 * case other systems have different values for MAXPATHLEN.
33 *
34 * The same must hold for V2 - we want file format compatibility, not anything
35 * else.
36 */
37#define PATH_LEN_V3 4096
38#define PATH_LEN_V2 PATH_LEN_V3
30 39
31struct cow_header_v2 { 40struct cow_header_v2 {
32 __u32 magic; 41 __u32 magic;
33 __u32 version; 42 __u32 version;
34 char backing_file[PATH_LEN_V2]; 43 char backing_file[PATH_LEN_V2];
35 time_t mtime; 44 time32_t mtime;
36 __u64 size; 45 __u64 size;
37 int sectorsize; 46 __s32 sectorsize;
38}; 47} __attribute__((packed));
39
40/* Define PATH_LEN_V3 as the usual value of MAXPATHLEN, just hard-code it in
41 * case other systems have different values for MAXPATHLEN
42 */
43#define PATH_LEN_V3 4096
44 48
45/* Changes from V2 - 49/* Changes from V2 -
46 * PATH_LEN_V3 as described above 50 * PATH_LEN_V3 as described above
@@ -66,6 +70,15 @@ struct cow_header_v2 {
66 * Fixed (finally!) the rounding bug 70 * Fixed (finally!) the rounding bug
67 */ 71 */
68 72
73/* Until Dec2005, __attribute__((packed)) was left out from the below
74 * definition, leading on 64-bit systems to 4 bytes of padding after mtime, to
75 * align size to 8-byte alignment. This shifted all fields above (no padding
76 * was present on 32-bit, no other padding was added).
77 *
78 * However, this _can be detected_: it means that cow_format (always 0 until
79 * now) is shifted onto the first 4 bytes of backing_file, where it is otherwise
80 * impossible to find 4 zeros. -bb */
81
69struct cow_header_v3 { 82struct cow_header_v3 {
70 __u32 magic; 83 __u32 magic;
71 __u32 version; 84 __u32 version;
@@ -75,6 +88,18 @@ struct cow_header_v3 {
75 __u32 alignment; 88 __u32 alignment;
76 __u32 cow_format; 89 __u32 cow_format;
77 char backing_file[PATH_LEN_V3]; 90 char backing_file[PATH_LEN_V3];
91} __attribute__((packed));
92
93/* This is the broken layout used by some 64-bit binaries. */
94struct cow_header_v3_broken {
95 __u32 magic;
96 __u32 version;
97 __s64 mtime;
98 __u64 size;
99 __u32 sectorsize;
100 __u32 alignment;
101 __u32 cow_format;
102 char backing_file[PATH_LEN_V3];
78}; 103};
79 104
80/* COW format definitions - for now, we have only the usual COW bitmap */ 105/* COW format definitions - for now, we have only the usual COW bitmap */
@@ -84,6 +109,7 @@ union cow_header {
84 struct cow_header_v1 v1; 109 struct cow_header_v1 v1;
85 struct cow_header_v2 v2; 110 struct cow_header_v2 v2;
86 struct cow_header_v3 v3; 111 struct cow_header_v3 v3;
112 struct cow_header_v3_broken v3_b;
87}; 113};
88 114
89#define COW_MAGIC 0x4f4f4f4d /* MOOO */ 115#define COW_MAGIC 0x4f4f4f4d /* MOOO */
@@ -184,8 +210,9 @@ int write_cow_header(char *cow_file, int fd, char *backing_file,
184 210
185 err = -EINVAL; 211 err = -EINVAL;
186 if(strlen(backing_file) > sizeof(header->backing_file) - 1){ 212 if(strlen(backing_file) > sizeof(header->backing_file) - 1){
213 /* Below, %zd is for a size_t value */
187 cow_printf("Backing file name \"%s\" is too long - names are " 214 cow_printf("Backing file name \"%s\" is too long - names are "
188 "limited to %d characters\n", backing_file, 215 "limited to %zd characters\n", backing_file,
189 sizeof(header->backing_file) - 1); 216 sizeof(header->backing_file) - 1);
190 goto out_free; 217 goto out_free;
191 } 218 }
@@ -300,7 +327,8 @@ int read_cow_header(int (*reader)(__u64, char *, int, void *), void *arg,
300 *align_out = *sectorsize_out; 327 *align_out = *sectorsize_out;
301 file = header->v2.backing_file; 328 file = header->v2.backing_file;
302 } 329 }
303 else if(version == 3){ 330 /* This is very subtle - see above at union cow_header definition */
331 else if(version == 3 && (*((int*)header->v3.backing_file) != 0)){
304 if(n < sizeof(header->v3)){ 332 if(n < sizeof(header->v3)){
305 cow_printf("read_cow_header - failed to read V3 " 333 cow_printf("read_cow_header - failed to read V3 "
306 "header\n"); 334 "header\n");
@@ -310,9 +338,43 @@ int read_cow_header(int (*reader)(__u64, char *, int, void *), void *arg,
310 *size_out = ntohll(header->v3.size); 338 *size_out = ntohll(header->v3.size);
311 *sectorsize_out = ntohl(header->v3.sectorsize); 339 *sectorsize_out = ntohl(header->v3.sectorsize);
312 *align_out = ntohl(header->v3.alignment); 340 *align_out = ntohl(header->v3.alignment);
341 if (*align_out == 0) {
342 cow_printf("read_cow_header - invalid COW header, "
343 "align == 0\n");
344 }
313 *bitmap_offset_out = ROUND_UP(sizeof(header->v3), *align_out); 345 *bitmap_offset_out = ROUND_UP(sizeof(header->v3), *align_out);
314 file = header->v3.backing_file; 346 file = header->v3.backing_file;
315 } 347 }
348 else if(version == 3){
349 cow_printf("read_cow_header - broken V3 file with"
350 " 64-bit layout - recovering content.\n");
351
352 if(n < sizeof(header->v3_b)){
353 cow_printf("read_cow_header - failed to read V3 "
354 "header\n");
355 goto out;
356 }
357
358 /* this was used until Dec2005 - 64bits are needed to represent
359 * 2038+. I.e. we can safely do this truncating cast.
360 *
361 * Additionally, we must use ntohl() instead of ntohll(), since
362 * the program used to use the former (tested - I got mtime
363 * mismatch "0 vs whatever").
364 *
365 * Ever heard about bug-to-bug-compatibility ? ;-) */
366 *mtime_out = (time32_t) ntohl(header->v3_b.mtime);
367
368 *size_out = ntohll(header->v3_b.size);
369 *sectorsize_out = ntohl(header->v3_b.sectorsize);
370 *align_out = ntohl(header->v3_b.alignment);
371 if (*align_out == 0) {
372 cow_printf("read_cow_header - invalid COW header, "
373 "align == 0\n");
374 }
375 *bitmap_offset_out = ROUND_UP(sizeof(header->v3_b), *align_out);
376 file = header->v3_b.backing_file;
377 }
316 else { 378 else {
317 cow_printf("read_cow_header - invalid COW version\n"); 379 cow_printf("read_cow_header - invalid COW version\n");
318 goto out; 380 goto out;
diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c
index 28e3760e8b98..6d7173fc55a3 100644
--- a/arch/um/drivers/mconsole_kern.c
+++ b/arch/um/drivers/mconsole_kern.c
@@ -62,7 +62,7 @@ static void mc_work_proc(void *unused)
62 unsigned long flags; 62 unsigned long flags;
63 63
64 while(!list_empty(&mc_requests)){ 64 while(!list_empty(&mc_requests)){
65 local_save_flags(flags); 65 local_irq_save(flags);
66 req = list_entry(mc_requests.next, struct mconsole_entry, 66 req = list_entry(mc_requests.next, struct mconsole_entry,
67 list); 67 list);
68 list_del(&req->list); 68 list_del(&req->list);
@@ -87,7 +87,7 @@ static irqreturn_t mconsole_interrupt(int irq, void *dev_id,
87 if(req.cmd->context == MCONSOLE_INTR) 87 if(req.cmd->context == MCONSOLE_INTR)
88 (*req.cmd->handler)(&req); 88 (*req.cmd->handler)(&req);
89 else { 89 else {
90 new = kmalloc(sizeof(*new), GFP_ATOMIC); 90 new = kmalloc(sizeof(*new), GFP_NOWAIT);
91 if(new == NULL) 91 if(new == NULL)
92 mconsole_reply(&req, "Out of memory", 1, 0); 92 mconsole_reply(&req, "Out of memory", 1, 0);
93 else { 93 else {
@@ -415,7 +415,6 @@ static int mem_config(char *str)
415 415
416 unplugged = page_address(page); 416 unplugged = page_address(page);
417 if(unplug_index == UNPLUGGED_PER_PAGE){ 417 if(unplug_index == UNPLUGGED_PER_PAGE){
418 INIT_LIST_HEAD(&unplugged->list);
419 list_add(&unplugged->list, &unplugged_pages); 418 list_add(&unplugged->list, &unplugged_pages);
420 unplug_index = 0; 419 unplug_index = 0;
421 } 420 }
@@ -616,7 +615,7 @@ static void console_write(struct console *console, const char *string,
616 return; 615 return;
617 616
618 while(1){ 617 while(1){
619 n = min((size_t)len, ARRAY_SIZE(console_buf) - console_index); 618 n = min((size_t) len, ARRAY_SIZE(console_buf) - console_index);
620 strncpy(&console_buf[console_index], string, n); 619 strncpy(&console_buf[console_index], string, n);
621 console_index += n; 620 console_index += n;
622 string += n; 621 string += n;
@@ -655,7 +654,6 @@ static void with_console(struct mc_request *req, void (*proc)(void *),
655 struct mconsole_entry entry; 654 struct mconsole_entry entry;
656 unsigned long flags; 655 unsigned long flags;
657 656
658 INIT_LIST_HEAD(&entry.list);
659 entry.request = *req; 657 entry.request = *req;
660 list_add(&entry.list, &clients); 658 list_add(&entry.list, &clients);
661 spin_lock_irqsave(&console_lock, flags); 659 spin_lock_irqsave(&console_lock, flags);
diff --git a/arch/um/drivers/net_user.c b/arch/um/drivers/net_user.c
index 0e2f06187ea7..0a7786e00cfb 100644
--- a/arch/um/drivers/net_user.c
+++ b/arch/um/drivers/net_user.c
@@ -182,7 +182,9 @@ static int change_tramp(char **argv, char *output, int output_len)
182 pe_data.stdout = fds[1]; 182 pe_data.stdout = fds[1];
183 pid = run_helper(change_pre_exec, &pe_data, argv, NULL); 183 pid = run_helper(change_pre_exec, &pe_data, argv, NULL);
184 184
185 read_output(fds[0], output, output_len); 185 if (pid > 0) /* Avoid hang as we won't get data in failure case. */
186 read_output(fds[0], output, output_len);
187
186 os_close_file(fds[0]); 188 os_close_file(fds[0]);
187 os_close_file(fds[1]); 189 os_close_file(fds[1]);
188 190
diff --git a/arch/um/drivers/slirp_user.c b/arch/um/drivers/slirp_user.c
index b94c66114bc8..33c5f6e625e8 100644
--- a/arch/um/drivers/slirp_user.c
+++ b/arch/um/drivers/slirp_user.c
@@ -104,7 +104,7 @@ static void slirp_close(int fd, void *data)
104 } 104 }
105 105
106 if(err == 0) { 106 if(err == 0) {
107 printk("slirp_close: process %d has not exited\n"); 107 printk("slirp_close: process %d has not exited\n", pri->pid);
108 return; 108 return;
109 } 109 }
110 110
diff --git a/arch/um/include/kern_util.h b/arch/um/include/kern_util.h
index 42557130a408..efa3d33c0be6 100644
--- a/arch/um/include/kern_util.h
+++ b/arch/um/include/kern_util.h
@@ -117,10 +117,6 @@ extern struct task_struct *get_task(int pid, int require);
117extern void machine_halt(void); 117extern void machine_halt(void);
118extern int is_syscall(unsigned long addr); 118extern int is_syscall(unsigned long addr);
119 119
120extern void arch_switch_to_tt(struct task_struct *from, struct task_struct *to);
121
122extern void arch_switch_to_skas(struct task_struct *from, struct task_struct *to);
123
124extern void free_irq(unsigned int, void *); 120extern void free_irq(unsigned int, void *);
125extern int cpu(void); 121extern int cpu(void);
126 122
diff --git a/arch/um/include/tt/tt.h b/arch/um/include/tt/tt.h
index 808521980186..acb8356e1f98 100644
--- a/arch/um/include/tt/tt.h
+++ b/arch/um/include/tt/tt.h
@@ -19,7 +19,8 @@ extern int fork_tramp(void *sig_stack);
19extern int do_proc_op(void *t, int proc_id); 19extern int do_proc_op(void *t, int proc_id);
20extern int tracer(int (*init_proc)(void *), void *sp); 20extern int tracer(int (*init_proc)(void *), void *sp);
21extern void attach_process(int pid); 21extern void attach_process(int pid);
22extern void tracer_panic(char *format, ...); 22extern void tracer_panic(char *format, ...)
23 __attribute__ ((format (printf, 1, 2)));
23extern void set_init_pid(int pid); 24extern void set_init_pid(int pid);
24extern int set_user_mode(void *task); 25extern int set_user_mode(void *task);
25extern void set_tracing(void *t, int tracing); 26extern void set_tracing(void *t, int tracing);
diff --git a/arch/um/include/user.h b/arch/um/include/user.h
index 91b0ac4ad88c..39f8c8801076 100644
--- a/arch/um/include/user.h
+++ b/arch/um/include/user.h
@@ -6,8 +6,10 @@
6#ifndef __USER_H__ 6#ifndef __USER_H__
7#define __USER_H__ 7#define __USER_H__
8 8
9extern void panic(const char *fmt, ...); 9extern void panic(const char *fmt, ...)
10extern int printk(const char *fmt, ...); 10 __attribute__ ((format (printf, 1, 2)));
11extern int printk(const char *fmt, ...)
12 __attribute__ ((format (printf, 1, 2)));
11extern void schedule(void); 13extern void schedule(void);
12extern void *um_kmalloc(int size); 14extern void *um_kmalloc(int size);
13extern void *um_kmalloc_atomic(int size); 15extern void *um_kmalloc_atomic(int size);
diff --git a/arch/um/include/user_util.h b/arch/um/include/user_util.h
index fe0c29b5144d..802d7842514d 100644
--- a/arch/um/include/user_util.h
+++ b/arch/um/include/user_util.h
@@ -55,7 +55,8 @@ extern int get_pty(void);
55extern void *um_kmalloc(int size); 55extern void *um_kmalloc(int size);
56extern int switcheroo(int fd, int prot, void *from, void *to, int size); 56extern int switcheroo(int fd, int prot, void *from, void *to, int size);
57extern void do_exec(int old_pid, int new_pid); 57extern void do_exec(int old_pid, int new_pid);
58extern void tracer_panic(char *msg, ...); 58extern void tracer_panic(char *msg, ...)
59 __attribute__ ((format (printf, 1, 2)));
59extern int detach(int pid, int sig); 60extern int detach(int pid, int sig);
60extern int attach(int pid); 61extern int attach(int pid);
61extern void kill_child_dead(int pid); 62extern void kill_child_dead(int pid);
diff --git a/arch/um/kernel/ksyms.c b/arch/um/kernel/ksyms.c
index 7713e7a6f476..432cf0b97a13 100644
--- a/arch/um/kernel/ksyms.c
+++ b/arch/um/kernel/ksyms.c
@@ -39,7 +39,6 @@ EXPORT_SYMBOL(um_virt_to_phys);
39EXPORT_SYMBOL(mode_tt); 39EXPORT_SYMBOL(mode_tt);
40EXPORT_SYMBOL(handle_page_fault); 40EXPORT_SYMBOL(handle_page_fault);
41EXPORT_SYMBOL(find_iomem); 41EXPORT_SYMBOL(find_iomem);
42EXPORT_SYMBOL(end_iomem);
43 42
44#ifdef CONFIG_MODE_TT 43#ifdef CONFIG_MODE_TT
45EXPORT_SYMBOL(strncpy_from_user_tt); 44EXPORT_SYMBOL(strncpy_from_user_tt);
@@ -89,12 +88,10 @@ EXPORT_SYMBOL(dump_thread);
89EXPORT_SYMBOL(do_gettimeofday); 88EXPORT_SYMBOL(do_gettimeofday);
90EXPORT_SYMBOL(do_settimeofday); 89EXPORT_SYMBOL(do_settimeofday);
91 90
92/* This is here because UML expands open to sys_open, not to a system 91/* This is here because UML expands lseek to sys_lseek, not to a system
93 * call instruction. 92 * call instruction.
94 */ 93 */
95EXPORT_SYMBOL(sys_open);
96EXPORT_SYMBOL(sys_lseek); 94EXPORT_SYMBOL(sys_lseek);
97EXPORT_SYMBOL(sys_read);
98EXPORT_SYMBOL(sys_wait4); 95EXPORT_SYMBOL(sys_wait4);
99 96
100#ifdef CONFIG_SMP 97#ifdef CONFIG_SMP
diff --git a/arch/um/os-Linux/drivers/ethertap_user.c b/arch/um/os-Linux/drivers/ethertap_user.c
index 901b85e8a1c6..8f49507e64ef 100644
--- a/arch/um/os-Linux/drivers/ethertap_user.c
+++ b/arch/um/os-Linux/drivers/ethertap_user.c
@@ -40,7 +40,7 @@ static void etap_change(int op, unsigned char *addr, unsigned char *netmask,
40 int fd) 40 int fd)
41{ 41{
42 struct addr_change change; 42 struct addr_change change;
43 void *output; 43 char *output;
44 int n; 44 int n;
45 45
46 change.what = op; 46 change.what = op;
diff --git a/arch/um/os-Linux/helper.c b/arch/um/os-Linux/helper.c
index 6490a4ff40ac..6987d1d247a2 100644
--- a/arch/um/os-Linux/helper.c
+++ b/arch/um/os-Linux/helper.c
@@ -43,7 +43,7 @@ static int helper_child(void *arg)
43 (*data->pre_exec)(data->pre_data); 43 (*data->pre_exec)(data->pre_data);
44 execvp(argv[0], argv); 44 execvp(argv[0], argv);
45 errval = errno; 45 errval = errno;
46 printk("execvp of '%s' failed - errno = %d\n", argv[0], errno); 46 printk("helper_child - execve of '%s' failed - errno = %d\n", argv[0], errno);
47 os_write_file(data->fd, &errval, sizeof(errval)); 47 os_write_file(data->fd, &errval, sizeof(errval));
48 kill(os_getpid(), SIGKILL); 48 kill(os_getpid(), SIGKILL);
49 return(0); 49 return(0);
@@ -92,15 +92,15 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv,
92 close(fds[1]); 92 close(fds[1]);
93 fds[1] = -1; 93 fds[1] = -1;
94 94
95 /*Read the errno value from the child.*/ 95 /* Read the errno value from the child, if the exec failed, or get 0 if
96 * the exec succeeded because the pipe fd was set as close-on-exec. */
96 n = os_read_file(fds[0], &ret, sizeof(ret)); 97 n = os_read_file(fds[0], &ret, sizeof(ret));
97 if(n < 0){ 98 if (n < 0) {
98 printk("run_helper : read on pipe failed, ret = %d\n", -n); 99 printk("run_helper : read on pipe failed, ret = %d\n", -n);
99 ret = n; 100 ret = n;
100 kill(pid, SIGKILL); 101 kill(pid, SIGKILL);
101 CATCH_EINTR(waitpid(pid, NULL, 0)); 102 CATCH_EINTR(waitpid(pid, NULL, 0));
102 } 103 } else if(n != 0){
103 else if(n != 0){
104 CATCH_EINTR(n = waitpid(pid, NULL, 0)); 104 CATCH_EINTR(n = waitpid(pid, NULL, 0));
105 ret = -errno; 105 ret = -errno;
106 } else { 106 } else {
diff --git a/arch/um/os-Linux/mem.c b/arch/um/os-Linux/mem.c
index 6ab372da9657..71bb90a7606d 100644
--- a/arch/um/os-Linux/mem.c
+++ b/arch/um/os-Linux/mem.c
@@ -53,33 +53,36 @@ static void __init find_tempdir(void)
53 */ 53 */
54int make_tempfile(const char *template, char **out_tempname, int do_unlink) 54int make_tempfile(const char *template, char **out_tempname, int do_unlink)
55{ 55{
56 char tempname[MAXPATHLEN]; 56 char *tempname;
57 int fd; 57 int fd;
58 58
59 tempname = malloc(MAXPATHLEN);
60
59 find_tempdir(); 61 find_tempdir();
60 if (*template != '/') 62 if (template[0] != '/')
61 strcpy(tempname, tempdir); 63 strcpy(tempname, tempdir);
62 else 64 else
63 *tempname = 0; 65 tempname[0] = '\0';
64 strcat(tempname, template); 66 strcat(tempname, template);
65 fd = mkstemp(tempname); 67 fd = mkstemp(tempname);
66 if(fd < 0){ 68 if(fd < 0){
67 fprintf(stderr, "open - cannot create %s: %s\n", tempname, 69 fprintf(stderr, "open - cannot create %s: %s\n", tempname,
68 strerror(errno)); 70 strerror(errno));
69 return -1; 71 goto out;
70 } 72 }
71 if(do_unlink && (unlink(tempname) < 0)){ 73 if(do_unlink && (unlink(tempname) < 0)){
72 perror("unlink"); 74 perror("unlink");
73 return -1; 75 goto out;
74 } 76 }
75 if(out_tempname){ 77 if(out_tempname){
76 *out_tempname = strdup(tempname); 78 *out_tempname = tempname;
77 if(*out_tempname == NULL){ 79 } else {
78 perror("strdup"); 80 free(tempname);
79 return -1;
80 }
81 } 81 }
82 return(fd); 82 return(fd);
83out:
84 free(tempname);
85 return -1;
83} 86}
84 87
85#define TEMPNAME_TEMPLATE "vm_file-XXXXXX" 88#define TEMPNAME_TEMPLATE "vm_file-XXXXXX"
diff --git a/arch/um/os-Linux/sigio.c b/arch/um/os-Linux/sigio.c
index 9ba942947146..00e9388e947a 100644
--- a/arch/um/os-Linux/sigio.c
+++ b/arch/um/os-Linux/sigio.c
@@ -304,8 +304,8 @@ out_clear_poll:
304 .size = 0, 304 .size = 0,
305 .used = 0 }); 305 .used = 0 });
306out_free: 306out_free:
307 kfree(p);
308 sigio_unlock(); 307 sigio_unlock();
308 kfree(p);
309out_close2: 309out_close2:
310 close(l_sigio_private[0]); 310 close(l_sigio_private[0]);
311 close(l_sigio_private[1]); 311 close(l_sigio_private[1]);
diff --git a/arch/um/os-Linux/skas/mem.c b/arch/um/os-Linux/skas/mem.c
index fbb080c2fc26..b3c11cfa995a 100644
--- a/arch/um/os-Linux/skas/mem.c
+++ b/arch/um/os-Linux/skas/mem.c
@@ -82,8 +82,8 @@ static inline long do_syscall_stub(struct mm_id * mm_idp, void **addr)
82 if (offset) { 82 if (offset) {
83 data = (unsigned long *)(mm_idp->stack + 83 data = (unsigned long *)(mm_idp->stack +
84 offset - UML_CONFIG_STUB_DATA); 84 offset - UML_CONFIG_STUB_DATA);
85 printk("do_syscall_stub : ret = %d, offset = %d, " 85 printk("do_syscall_stub : ret = %ld, offset = %ld, "
86 "data = 0x%x\n", ret, offset, data); 86 "data = %p\n", ret, offset, data);
87 syscall = (unsigned long *)((unsigned long)data + data[0]); 87 syscall = (unsigned long *)((unsigned long)data + data[0]);
88 printk("do_syscall_stub: syscall %ld failed, return value = " 88 printk("do_syscall_stub: syscall %ld failed, return value = "
89 "0x%lx, expected return value = 0x%lx\n", 89 "0x%lx, expected return value = 0x%lx\n",
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c
index bbf34cb91ce1..045ae0037456 100644
--- a/arch/um/os-Linux/skas/process.c
+++ b/arch/um/os-Linux/skas/process.c
@@ -265,7 +265,7 @@ void userspace(union uml_pt_regs *regs)
265 if(err) 265 if(err)
266 panic("userspace - could not resume userspace process, " 266 panic("userspace - could not resume userspace process, "
267 "pid=%d, ptrace operation = %d, errno = %d\n", 267 "pid=%d, ptrace operation = %d, errno = %d\n",
268 op, errno); 268 pid, op, errno);
269 269
270 CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED)); 270 CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED));
271 if(err < 0) 271 if(err < 0)
@@ -369,7 +369,7 @@ int copy_context_skas0(unsigned long new_stack, int pid)
369 */ 369 */
370 wait_stub_done(pid, -1, "copy_context_skas0"); 370 wait_stub_done(pid, -1, "copy_context_skas0");
371 if (child_data->err != UML_CONFIG_STUB_DATA) 371 if (child_data->err != UML_CONFIG_STUB_DATA)
372 panic("copy_context_skas0 - stub-child reports error %d\n", 372 panic("copy_context_skas0 - stub-child reports error %ld\n",
373 child_data->err); 373 child_data->err);
374 374
375 if (ptrace(PTRACE_OLDSETOPTIONS, pid, NULL, 375 if (ptrace(PTRACE_OLDSETOPTIONS, pid, NULL,
diff --git a/arch/um/os-Linux/sys-i386/tls.c b/arch/um/os-Linux/sys-i386/tls.c
index ba21f0e04a2f..120abbe4e3ce 100644
--- a/arch/um/os-Linux/sys-i386/tls.c
+++ b/arch/um/os-Linux/sys-i386/tls.c
@@ -1,3 +1,4 @@
1#include <errno.h>
1#include <linux/unistd.h> 2#include <linux/unistd.h>
2#include "sysdep/tls.h" 3#include "sysdep/tls.h"
3#include "user_util.h" 4#include "user_util.h"
diff --git a/arch/um/os-Linux/umid.c b/arch/um/os-Linux/umid.c
index 198e59163288..34bfc1bb9e38 100644
--- a/arch/um/os-Linux/umid.c
+++ b/arch/um/os-Linux/umid.c
@@ -120,7 +120,8 @@ static int not_dead_yet(char *dir)
120 120
121 dead = 0; 121 dead = 0;
122 fd = open(file, O_RDONLY); 122 fd = open(file, O_RDONLY);
123 if(fd < 0){ 123 if(fd < 0) {
124 fd = -errno;
124 if(fd != -ENOENT){ 125 if(fd != -ENOENT){
125 printk("not_dead_yet : couldn't open pid file '%s', " 126 printk("not_dead_yet : couldn't open pid file '%s', "
126 "err = %d\n", file, -fd); 127 "err = %d\n", file, -fd);
@@ -130,9 +131,13 @@ static int not_dead_yet(char *dir)
130 131
131 err = 0; 132 err = 0;
132 n = read(fd, pid, sizeof(pid)); 133 n = read(fd, pid, sizeof(pid));
133 if(n <= 0){ 134 if(n < 0){
135 printk("not_dead_yet : couldn't read pid file '%s', "
136 "err = %d\n", file, errno);
137 goto out_close;
138 } else if(n == 0){
134 printk("not_dead_yet : couldn't read pid file '%s', " 139 printk("not_dead_yet : couldn't read pid file '%s', "
135 "err = %d\n", file, -n); 140 "0-byte read\n", file);
136 goto out_close; 141 goto out_close;
137 } 142 }
138 143
@@ -155,9 +160,9 @@ static int not_dead_yet(char *dir)
155 160
156 return err; 161 return err;
157 162
158 out_close: 163out_close:
159 close(fd); 164 close(fd);
160 out: 165out:
161 return 0; 166 return 0;
162} 167}
163 168
diff --git a/arch/um/os-Linux/user_syms.c b/arch/um/os-Linux/user_syms.c
index 8da6ab31152a..2598158e1f53 100644
--- a/arch/um/os-Linux/user_syms.c
+++ b/arch/um/os-Linux/user_syms.c
@@ -18,14 +18,19 @@ extern void *memmove(void *, const void *, size_t);
18extern void *memset(void *, int, size_t); 18extern void *memset(void *, int, size_t);
19extern int printf(const char *, ...); 19extern int printf(const char *, ...);
20 20
21/* If they're not defined, the export is included in lib/string.c.*/
22#ifdef __HAVE_ARCH_STRLEN
21EXPORT_SYMBOL(strlen); 23EXPORT_SYMBOL(strlen);
24#endif
25#ifdef __HAVE_ARCH_STRSTR
26EXPORT_SYMBOL(strstr);
27#endif
28
22EXPORT_SYMBOL(memcpy); 29EXPORT_SYMBOL(memcpy);
23EXPORT_SYMBOL(memmove); 30EXPORT_SYMBOL(memmove);
24EXPORT_SYMBOL(memset); 31EXPORT_SYMBOL(memset);
25EXPORT_SYMBOL(printf); 32EXPORT_SYMBOL(printf);
26 33
27EXPORT_SYMBOL(strstr);
28
29/* Here, instead, I can provide a fake prototype. Yes, someone cares: genksyms. 34/* Here, instead, I can provide a fake prototype. Yes, someone cares: genksyms.
30 * However, the modules will use the CRC defined *here*, no matter if it is 35 * However, the modules will use the CRC defined *here*, no matter if it is
31 * good; so the versions of these symbols will always match 36 * good; so the versions of these symbols will always match
diff --git a/arch/um/scripts/Makefile.rules b/arch/um/scripts/Makefile.rules
index b696b451774c..5e7a9c310aa5 100644
--- a/arch/um/scripts/Makefile.rules
+++ b/arch/um/scripts/Makefile.rules
@@ -9,10 +9,8 @@ USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
9 9
10$(USER_OBJS) $(USER_OBJS:.o=.i) $(USER_OBJS:.o=.s) $(USER_OBJS:.o=.lst): \ 10$(USER_OBJS) $(USER_OBJS:.o=.i) $(USER_OBJS:.o=.s) $(USER_OBJS:.o=.lst): \
11 c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) $(CFLAGS_$(notdir $@)) 11 c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) $(CFLAGS_$(notdir $@))
12$(USER_OBJS): cmd_checksrc = 12$(USER_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \
13$(USER_OBJS): quiet_cmd_checksrc = 13 -Dunix -D__unix__ -D__$(SUBARCH)__
14$(USER_OBJS): cmd_force_checksrc =
15$(USER_OBJS): quiet_cmd_force_checksrc =
16 14
17 15
18# The stubs and unmap.o can't try to call mcount or update basic block data 16# The stubs and unmap.o can't try to call mcount or update basic block data
diff --git a/arch/um/sys-i386/ksyms.c b/arch/um/sys-i386/ksyms.c
index db524ab3f743..2a1eac1859ce 100644
--- a/arch/um/sys-i386/ksyms.c
+++ b/arch/um/sys-i386/ksyms.c
@@ -15,7 +15,3 @@ EXPORT_SYMBOL(__up_wakeup);
15 15
16/* Networking helper routines. */ 16/* Networking helper routines. */
17EXPORT_SYMBOL(csum_partial); 17EXPORT_SYMBOL(csum_partial);
18
19/* delay core functions */
20EXPORT_SYMBOL(__const_udelay);
21EXPORT_SYMBOL(__udelay);
diff --git a/arch/um/sys-i386/ptrace_user.c b/arch/um/sys-i386/ptrace_user.c
index 9f3bd8ed78f5..40aa88531446 100644
--- a/arch/um/sys-i386/ptrace_user.c
+++ b/arch/um/sys-i386/ptrace_user.c
@@ -57,7 +57,7 @@ static void write_debugregs(int pid, unsigned long *regs)
57 if(ptrace(PTRACE_POKEUSR, pid, &dummy->u_debugreg[i], 57 if(ptrace(PTRACE_POKEUSR, pid, &dummy->u_debugreg[i],
58 regs[i]) < 0) 58 regs[i]) < 0)
59 printk("write_debugregs - ptrace failed on " 59 printk("write_debugregs - ptrace failed on "
60 "register %d, value = 0x%x, errno = %d\n", i, 60 "register %d, value = 0x%lx, errno = %d\n", i,
61 regs[i], errno); 61 regs[i], errno);
62 } 62 }
63} 63}
diff --git a/arch/um/sys-i386/signal.c b/arch/um/sys-i386/signal.c
index f5d0e1c37ea2..618fd8594643 100644
--- a/arch/um/sys-i386/signal.c
+++ b/arch/um/sys-i386/signal.c
@@ -147,7 +147,7 @@ int copy_sc_to_user_tt(struct sigcontext *to, struct _fpstate __user *fp,
147 * delivery. The sp passed in is the original, and this needs 147 * delivery. The sp passed in is the original, and this needs
148 * to be restored, so we stick it in separately. 148 * to be restored, so we stick it in separately.
149 */ 149 */
150 err |= copy_to_user(&SC_SP(to), sp, sizeof(sp)); 150 err |= copy_to_user(&SC_SP(to), &sp, sizeof(sp));
151 151
152 if(from_fp != NULL){ 152 if(from_fp != NULL){
153 err |= copy_to_user(&to->fpstate, &to_fp, sizeof(to->fpstate)); 153 err |= copy_to_user(&to->fpstate, &to_fp, sizeof(to->fpstate));
diff --git a/arch/um/sys-i386/tls.c b/arch/um/sys-i386/tls.c
index a3188e861cc7..71b9796258ef 100644
--- a/arch/um/sys-i386/tls.c
+++ b/arch/um/sys-i386/tls.c
@@ -378,7 +378,7 @@ static int __init __setup_host_supports_tls(void) {
378 } else 378 } else
379 printk(KERN_ERR " Host TLS support NOT detected! " 379 printk(KERN_ERR " Host TLS support NOT detected! "
380 "TLS support inside UML will not work\n"); 380 "TLS support inside UML will not work\n");
381 return 1; 381 return 0;
382} 382}
383 383
384__initcall(__setup_host_supports_tls); 384__initcall(__setup_host_supports_tls);
diff --git a/arch/um/sys-x86_64/signal.c b/arch/um/sys-x86_64/signal.c
index e75c4e1838b0..a4c46a8af008 100644
--- a/arch/um/sys-x86_64/signal.c
+++ b/arch/um/sys-x86_64/signal.c
@@ -137,7 +137,7 @@ int copy_sc_to_user_tt(struct sigcontext *to, struct _fpstate *fp,
137 * delivery. The sp passed in is the original, and this needs 137 * delivery. The sp passed in is the original, and this needs
138 * to be restored, so we stick it in separately. 138 * to be restored, so we stick it in separately.
139 */ 139 */
140 err |= copy_to_user(&SC_SP(to), sp, sizeof(sp)); 140 err |= copy_to_user(&SC_SP(to), &sp, sizeof(sp));
141 141
142 if(from_fp != NULL){ 142 if(from_fp != NULL){
143 err |= copy_to_user(&to->fpstate, &to_fp, sizeof(to->fpstate)); 143 err |= copy_to_user(&to->fpstate, &to_fp, sizeof(to->fpstate));
diff --git a/arch/v850/kernel/v850_ksyms.c b/arch/v850/kernel/v850_ksyms.c
index 8ffc29c1c89d..6bcfcfe88384 100644
--- a/arch/v850/kernel/v850_ksyms.c
+++ b/arch/v850/kernel/v850_ksyms.c
@@ -43,7 +43,6 @@ EXPORT_SYMBOL (strncmp);
43EXPORT_SYMBOL (strchr); 43EXPORT_SYMBOL (strchr);
44EXPORT_SYMBOL (strlen); 44EXPORT_SYMBOL (strlen);
45EXPORT_SYMBOL (strnlen); 45EXPORT_SYMBOL (strnlen);
46EXPORT_SYMBOL (strpbrk);
47EXPORT_SYMBOL (strrchr); 46EXPORT_SYMBOL (strrchr);
48EXPORT_SYMBOL (strstr); 47EXPORT_SYMBOL (strstr);
49EXPORT_SYMBOL (memset); 48EXPORT_SYMBOL (memset);
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
index 7df2fe1844be..408d44a59756 100644
--- a/arch/x86_64/Kconfig
+++ b/arch/x86_64/Kconfig
@@ -288,6 +288,11 @@ config K8_NUMA
288 Northbridge of Opteron. It is recommended to use X86_64_ACPI_NUMA 288 Northbridge of Opteron. It is recommended to use X86_64_ACPI_NUMA
289 instead, which also takes priority if both are compiled in. 289 instead, which also takes priority if both are compiled in.
290 290
291config NODES_SHIFT
292 int
293 default "6"
294 depends on NEED_MULTIPLE_NODES
295
291# Dummy CONFIG option to select ACPI_NUMA from drivers/acpi/Kconfig. 296# Dummy CONFIG option to select ACPI_NUMA from drivers/acpi/Kconfig.
292 297
293config X86_64_ACPI_NUMA 298config X86_64_ACPI_NUMA
diff --git a/arch/x86_64/boot/video.S b/arch/x86_64/boot/video.S
index 0587477c99f2..32327bb37aff 100644
--- a/arch/x86_64/boot/video.S
+++ b/arch/x86_64/boot/video.S
@@ -97,6 +97,7 @@
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
100 101
101/* Define DO_STORE according to CONFIG_VIDEO_RETAIN */ 102/* Define DO_STORE according to CONFIG_VIDEO_RETAIN */
102#ifdef CONFIG_VIDEO_RETAIN 103#ifdef CONFIG_VIDEO_RETAIN
@@ -233,6 +234,10 @@ mopar_gr:
233 movw 18(%di), %ax 234 movw 18(%di), %ax
234 movl %eax, %fs:(PARAM_LFB_SIZE) 235 movl %eax, %fs:(PARAM_LFB_SIZE)
235 236
237# store mode capabilities
238 movl 10(%di), %eax
239 movl %eax, %fs:(PARAM_CAPABILITIES)
240
236# switching the DAC to 8-bit is for <= 8 bpp only 241# switching the DAC to 8-bit is for <= 8 bpp only
237 movw %fs:(PARAM_LFB_DEPTH), %ax 242 movw %fs:(PARAM_LFB_DEPTH), %ax
238 cmpw $8, %ax 243 cmpw $8, %ax
diff --git a/arch/x86_64/kernel/Makefile b/arch/x86_64/kernel/Makefile
index a098a11e7755..059c88313f4e 100644
--- a/arch/x86_64/kernel/Makefile
+++ b/arch/x86_64/kernel/Makefile
@@ -8,7 +8,7 @@ obj-y := process.o signal.o entry.o traps.o irq.o \
8 ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_x86_64.o \ 8 ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_x86_64.o \
9 x8664_ksyms.o i387.o syscall.o vsyscall.o \ 9 x8664_ksyms.o i387.o syscall.o vsyscall.o \
10 setup64.o bootflag.o e820.o reboot.o quirks.o i8237.o \ 10 setup64.o bootflag.o e820.o reboot.o quirks.o i8237.o \
11 dmi_scan.o pci-dma.o pci-nommu.o 11 pci-dma.o pci-nommu.o
12 12
13obj-$(CONFIG_X86_MCE) += mce.o 13obj-$(CONFIG_X86_MCE) += mce.o
14obj-$(CONFIG_X86_MCE_INTEL) += mce_intel.o 14obj-$(CONFIG_X86_MCE_INTEL) += mce_intel.o
@@ -49,5 +49,3 @@ intel_cacheinfo-y += ../../i386/kernel/cpu/intel_cacheinfo.o
49quirks-y += ../../i386/kernel/quirks.o 49quirks-y += ../../i386/kernel/quirks.o
50i8237-y += ../../i386/kernel/i8237.o 50i8237-y += ../../i386/kernel/i8237.o
51msr-$(subst m,y,$(CONFIG_X86_MSR)) += ../../i386/kernel/msr.o 51msr-$(subst m,y,$(CONFIG_X86_MSR)) += ../../i386/kernel/msr.o
52dmi_scan-y += ../../i386/kernel/dmi_scan.o
53
diff --git a/arch/x86_64/kernel/ptrace.c b/arch/x86_64/kernel/ptrace.c
index d44b2c1e63a6..da8e7903d817 100644
--- a/arch/x86_64/kernel/ptrace.c
+++ b/arch/x86_64/kernel/ptrace.c
@@ -274,11 +274,6 @@ static int putreg(struct task_struct *child,
274 return -EIO; 274 return -EIO;
275 value &= 0xffff; 275 value &= 0xffff;
276 break; 276 break;
277 case offsetof(struct user_regs_struct, rip):
278 /* Check if the new RIP address is canonical */
279 if (value >= TASK_SIZE_OF(child))
280 return -EIO;
281 break;
282 } 277 }
283 put_stack_long(child, regno - sizeof(struct pt_regs), value); 278 put_stack_long(child, regno - sizeof(struct pt_regs), value);
284 return 0; 279 return 0;
diff --git a/arch/x86_64/kernel/x8664_ksyms.c b/arch/x86_64/kernel/x8664_ksyms.c
index fec4e521c01c..1def21c9f7cd 100644
--- a/arch/x86_64/kernel/x8664_ksyms.c
+++ b/arch/x86_64/kernel/x8664_ksyms.c
@@ -120,7 +120,6 @@ extern void * memcpy(void *,const void *,__kernel_size_t);
120extern void * __memcpy(void *,const void *,__kernel_size_t); 120extern void * __memcpy(void *,const void *,__kernel_size_t);
121 121
122EXPORT_SYMBOL(memset); 122EXPORT_SYMBOL(memset);
123EXPORT_SYMBOL(strpbrk);
124EXPORT_SYMBOL(memmove); 123EXPORT_SYMBOL(memmove);
125EXPORT_SYMBOL(memcpy); 124EXPORT_SYMBOL(memcpy);
126EXPORT_SYMBOL(__memcpy); 125EXPORT_SYMBOL(__memcpy);
diff --git a/arch/x86_64/pci/mmconfig.c b/arch/x86_64/pci/mmconfig.c
index b493ed977e7c..a2060e4d5de6 100644
--- a/arch/x86_64/pci/mmconfig.c
+++ b/arch/x86_64/pci/mmconfig.c
@@ -75,7 +75,7 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int bus,
75 char __iomem *addr; 75 char __iomem *addr;
76 76
77 /* Why do we have this when nobody checks it. How about a BUG()!? -AK */ 77 /* Why do we have this when nobody checks it. How about a BUG()!? -AK */
78 if (unlikely(!value || (bus > 255) || (devfn > 255) || (reg > 4095))) { 78 if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) {
79 *value = -1; 79 *value = -1;
80 return -EINVAL; 80 return -EINVAL;
81 } 81 }
@@ -142,7 +142,7 @@ static __init void unreachable_devices(void)
142{ 142{
143 int i, k; 143 int i, k;
144 /* Use the max bus number from ACPI here? */ 144 /* Use the max bus number from ACPI here? */
145 for (k = 0; i < MAX_CHECK_BUS; k++) { 145 for (k = 0; k < MAX_CHECK_BUS; k++) {
146 for (i = 0; i < 32; i++) { 146 for (i = 0; i < 32; i++) {
147 u32 val1; 147 u32 val1;
148 char __iomem *addr; 148 char __iomem *addr;
diff --git a/arch/xtensa/kernel/xtensa_ksyms.c b/arch/xtensa/kernel/xtensa_ksyms.c
index 152b9370789b..a15b6e3e72c8 100644
--- a/arch/xtensa/kernel/xtensa_ksyms.c
+++ b/arch/xtensa/kernel/xtensa_ksyms.c
@@ -48,7 +48,6 @@ EXPORT_SYMBOL(memchr);
48EXPORT_SYMBOL(strcat); 48EXPORT_SYMBOL(strcat);
49EXPORT_SYMBOL(strchr); 49EXPORT_SYMBOL(strchr);
50EXPORT_SYMBOL(strlen); 50EXPORT_SYMBOL(strlen);
51EXPORT_SYMBOL(strpbrk);
52EXPORT_SYMBOL(strncat); 51EXPORT_SYMBOL(strncat);
53EXPORT_SYMBOL(strnlen); 52EXPORT_SYMBOL(strnlen);
54EXPORT_SYMBOL(strrchr); 53EXPORT_SYMBOL(strrchr);