aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/kernel/smp.c1
-rw-r--r--arch/arm/lib/bitops.h2
-rw-r--r--arch/arm/mach-integrator/platsmp.c2
-rw-r--r--arch/i386/kernel/cpu/cpufreq/powernow-k8.c38
-rw-r--r--arch/i386/kernel/cpu/cpufreq/powernow-k8.h32
-rw-r--r--arch/i386/kernel/cpu/intel_cacheinfo.c20
-rw-r--r--arch/i386/kernel/machine_kexec.c22
-rw-r--r--arch/i386/kernel/mpparse.c10
-rw-r--r--arch/i386/kernel/numaq.c9
-rw-r--r--arch/i386/mm/discontig.c8
-rw-r--r--arch/i386/pci/irq.c7
-rw-r--r--arch/s390/appldata/appldata_base.c6
-rw-r--r--arch/s390/defconfig253
-rw-r--r--arch/s390/kernel/head.S7
-rw-r--r--arch/s390/kernel/head64.S7
-rw-r--r--arch/um/drivers/Makefile4
-rw-r--r--arch/um/drivers/mconsole_kern.c2
-rw-r--r--arch/um/kernel/exitcode.c2
-rw-r--r--arch/um/kernel/process.c48
-rw-r--r--arch/um/kernel/process_kern.c2
-rw-r--r--arch/um/kernel/skas/process.c2
-rw-r--r--arch/um/kernel/skas/trap_user.c1
-rw-r--r--arch/um/kernel/time_kern.c5
-rw-r--r--arch/um/os-Linux/elf_aux.c6
-rw-r--r--arch/um/os-Linux/user_syms.c3
-rw-r--r--arch/um/sys-i386/stub_segv.c6
-rw-r--r--arch/x86_64/Kconfig5
-rw-r--r--arch/x86_64/Makefile12
-rw-r--r--arch/x86_64/defconfig224
-rw-r--r--arch/x86_64/ia32/Makefile4
-rw-r--r--arch/x86_64/ia32/syscall32.c10
-rw-r--r--arch/x86_64/ia32/syscall32_syscall.S17
-rw-r--r--arch/x86_64/kernel/entry.S22
-rw-r--r--arch/x86_64/kernel/genapic.c33
-rw-r--r--arch/x86_64/kernel/genapic_flat.c142
-rw-r--r--arch/x86_64/kernel/head.S16
-rw-r--r--arch/x86_64/kernel/irq.c19
-rw-r--r--arch/x86_64/kernel/machine_kexec.c101
-rw-r--r--arch/x86_64/kernel/mce.c93
-rw-r--r--arch/x86_64/kernel/mpparse.c17
-rw-r--r--arch/x86_64/kernel/setup.c5
-rw-r--r--arch/x86_64/kernel/setup64.c18
-rw-r--r--arch/x86_64/kernel/smp.c66
-rw-r--r--arch/x86_64/kernel/smpboot.c84
-rw-r--r--arch/x86_64/kernel/traps.c3
-rw-r--r--arch/x86_64/lib/delay.c2
-rw-r--r--arch/x86_64/mm/fault.c1
-rw-r--r--arch/x86_64/mm/numa.c50
-rw-r--r--arch/x86_64/mm/srat.c22
-rw-r--r--arch/x86_64/pci/k8-bus.c2
50 files changed, 878 insertions, 595 deletions
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 295e0a8379cf..b2085735a2ba 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -176,6 +176,7 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
176 cpu_set(cpu, mm->cpu_vm_mask); 176 cpu_set(cpu, mm->cpu_vm_mask);
177 cpu_switch_mm(mm->pgd, mm); 177 cpu_switch_mm(mm->pgd, mm);
178 enter_lazy_tlb(mm, current); 178 enter_lazy_tlb(mm, current);
179 local_flush_tlb_all();
179 180
180 cpu_init(); 181 cpu_init();
181 182
diff --git a/arch/arm/lib/bitops.h b/arch/arm/lib/bitops.h
index 5382a3023602..2036ff15bda9 100644
--- a/arch/arm/lib/bitops.h
+++ b/arch/arm/lib/bitops.h
@@ -7,7 +7,7 @@
71: ldrexb r2, [r1] 71: ldrexb r2, [r1]
8 \instr r2, r2, r3 8 \instr r2, r2, r3
9 strexb r0, r2, [r1] 9 strexb r0, r2, [r1]
10 cmpne r0, #0 10 cmp r0, #0
11 bne 1b 11 bne 1b
12 mov pc, lr 12 mov pc, lr
13 .endm 13 .endm
diff --git a/arch/arm/mach-integrator/platsmp.c b/arch/arm/mach-integrator/platsmp.c
index aecf47ba033a..ea10bd8c972c 100644
--- a/arch/arm/mach-integrator/platsmp.c
+++ b/arch/arm/mach-integrator/platsmp.c
@@ -15,6 +15,7 @@
15#include <linux/mm.h> 15#include <linux/mm.h>
16 16
17#include <asm/atomic.h> 17#include <asm/atomic.h>
18#include <asm/cacheflush.h>
18#include <asm/delay.h> 19#include <asm/delay.h>
19#include <asm/mmu_context.h> 20#include <asm/mmu_context.h>
20#include <asm/procinfo.h> 21#include <asm/procinfo.h>
@@ -80,6 +81,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
80 * "cpu" is Linux's internal ID. 81 * "cpu" is Linux's internal ID.
81 */ 82 */
82 pen_release = cpu; 83 pen_release = cpu;
84 flush_cache_all();
83 85
84 /* 86 /*
85 * XXX 87 * XXX
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
index 31f65c8a4c24..ab6e0611303d 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * (c) 2003, 2004 Advanced Micro Devices, Inc. 2 * (c) 2003, 2004, 2005 Advanced Micro Devices, Inc.
3 * Your use of this code is subject to the terms and conditions of the 3 * Your use of this code is subject to the terms and conditions of the
4 * GNU general public license version 2. See "COPYING" or 4 * GNU general public license version 2. See "COPYING" or
5 * http://www.gnu.org/licenses/gpl.html 5 * http://www.gnu.org/licenses/gpl.html
@@ -44,7 +44,7 @@
44 44
45#define PFX "powernow-k8: " 45#define PFX "powernow-k8: "
46#define BFX PFX "BIOS error: " 46#define BFX PFX "BIOS error: "
47#define VERSION "version 1.40.2" 47#define VERSION "version 1.50.3"
48#include "powernow-k8.h" 48#include "powernow-k8.h"
49 49
50/* serialize freq changes */ 50/* serialize freq changes */
@@ -231,7 +231,7 @@ static int write_new_vid(struct powernow_k8_data *data, u32 vid)
231/* 231/*
232 * Reduce the vid by the max of step or reqvid. 232 * Reduce the vid by the max of step or reqvid.
233 * Decreasing vid codes represent increasing voltages: 233 * Decreasing vid codes represent increasing voltages:
234 * vid of 0 is 1.550V, vid of 0x1e is 0.800V, vid of 0x1f is off. 234 * vid of 0 is 1.550V, vid of 0x1e is 0.800V, vid of VID_OFF is off.
235 */ 235 */
236static int decrease_vid_code_by_step(struct powernow_k8_data *data, u32 reqvid, u32 step) 236static int decrease_vid_code_by_step(struct powernow_k8_data *data, u32 reqvid, u32 step)
237{ 237{
@@ -466,7 +466,7 @@ static int check_supported_cpu(unsigned int cpu)
466 eax = cpuid_eax(CPUID_PROCESSOR_SIGNATURE); 466 eax = cpuid_eax(CPUID_PROCESSOR_SIGNATURE);
467 if (((eax & CPUID_USE_XFAM_XMOD) != CPUID_USE_XFAM_XMOD) || 467 if (((eax & CPUID_USE_XFAM_XMOD) != CPUID_USE_XFAM_XMOD) ||
468 ((eax & CPUID_XFAM) != CPUID_XFAM_K8) || 468 ((eax & CPUID_XFAM) != CPUID_XFAM_K8) ||
469 ((eax & CPUID_XMOD) > CPUID_XMOD_REV_E)) { 469 ((eax & CPUID_XMOD) > CPUID_XMOD_REV_F)) {
470 printk(KERN_INFO PFX "Processor cpuid %x not supported\n", eax); 470 printk(KERN_INFO PFX "Processor cpuid %x not supported\n", eax);
471 goto out; 471 goto out;
472 } 472 }
@@ -695,6 +695,7 @@ static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data, unsigned
695 695
696 data->irt = (data->acpi_data.states[index].control >> IRT_SHIFT) & IRT_MASK; 696 data->irt = (data->acpi_data.states[index].control >> IRT_SHIFT) & IRT_MASK;
697 data->rvo = (data->acpi_data.states[index].control >> RVO_SHIFT) & RVO_MASK; 697 data->rvo = (data->acpi_data.states[index].control >> RVO_SHIFT) & RVO_MASK;
698 data->exttype = (data->acpi_data.states[index].control >> EXT_TYPE_SHIFT) & EXT_TYPE_MASK;
698 data->plllock = (data->acpi_data.states[index].control >> PLL_L_SHIFT) & PLL_L_MASK; 699 data->plllock = (data->acpi_data.states[index].control >> PLL_L_SHIFT) & PLL_L_MASK;
699 data->vidmvs = 1 << ((data->acpi_data.states[index].control >> MVS_SHIFT) & MVS_MASK); 700 data->vidmvs = 1 << ((data->acpi_data.states[index].control >> MVS_SHIFT) & MVS_MASK);
700 data->vstable = (data->acpi_data.states[index].control >> VST_SHIFT) & VST_MASK; 701 data->vstable = (data->acpi_data.states[index].control >> VST_SHIFT) & VST_MASK;
@@ -734,8 +735,16 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
734 } 735 }
735 736
736 for (i = 0; i < data->acpi_data.state_count; i++) { 737 for (i = 0; i < data->acpi_data.state_count; i++) {
737 u32 fid = data->acpi_data.states[i].control & FID_MASK; 738 u32 fid;
738 u32 vid = (data->acpi_data.states[i].control >> VID_SHIFT) & VID_MASK; 739 u32 vid;
740
741 if (data->exttype) {
742 fid = data->acpi_data.states[i].status & FID_MASK;
743 vid = (data->acpi_data.states[i].status >> VID_SHIFT) & VID_MASK;
744 } else {
745 fid = data->acpi_data.states[i].control & FID_MASK;
746 vid = (data->acpi_data.states[i].control >> VID_SHIFT) & VID_MASK;
747 }
739 748
740 dprintk(" %d : fid 0x%x, vid 0x%x\n", i, fid, vid); 749 dprintk(" %d : fid 0x%x, vid 0x%x\n", i, fid, vid);
741 750
@@ -752,7 +761,7 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
752 } 761 }
753 762
754 /* verify voltage is OK - BIOSs are using "off" to indicate invalid */ 763 /* verify voltage is OK - BIOSs are using "off" to indicate invalid */
755 if (vid == 0x1f) { 764 if (vid == VID_OFF) {
756 dprintk("invalid vid %u, ignoring\n", vid); 765 dprintk("invalid vid %u, ignoring\n", vid);
757 powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID; 766 powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID;
758 continue; 767 continue;
@@ -929,15 +938,6 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
929 938
930 down(&fidvid_sem); 939 down(&fidvid_sem);
931 940
932 for_each_cpu_mask(i, cpu_core_map[pol->cpu]) {
933 /* make sure the sibling is initialized */
934 if (!powernow_data[i]) {
935 ret = 0;
936 up(&fidvid_sem);
937 goto err_out;
938 }
939 }
940
941 powernow_k8_acpi_pst_values(data, newstate); 941 powernow_k8_acpi_pst_values(data, newstate);
942 942
943 if (transition_frequency(data, newstate)) { 943 if (transition_frequency(data, newstate)) {
@@ -977,7 +977,7 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
977{ 977{
978 struct powernow_k8_data *data; 978 struct powernow_k8_data *data;
979 cpumask_t oldmask = CPU_MASK_ALL; 979 cpumask_t oldmask = CPU_MASK_ALL;
980 int rc; 980 int rc, i;
981 981
982 if (!check_supported_cpu(pol->cpu)) 982 if (!check_supported_cpu(pol->cpu))
983 return -ENODEV; 983 return -ENODEV;
@@ -1063,7 +1063,9 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
1063 printk("cpu_init done, current fid 0x%x, vid 0x%x\n", 1063 printk("cpu_init done, current fid 0x%x, vid 0x%x\n",
1064 data->currfid, data->currvid); 1064 data->currfid, data->currvid);
1065 1065
1066 powernow_data[pol->cpu] = data; 1066 for_each_cpu_mask(i, cpu_core_map[pol->cpu]) {
1067 powernow_data[i] = data;
1068 }
1067 1069
1068 return 0; 1070 return 0;
1069 1071
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.h b/arch/i386/kernel/cpu/cpufreq/powernow-k8.h
index 9ed5bf221cb7..b1e85bb36396 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.h
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * (c) 2003, 2004 Advanced Micro Devices, Inc. 2 * (c) 2003, 2004, 2005 Advanced Micro Devices, Inc.
3 * Your use of this code is subject to the terms and conditions of the 3 * Your use of this code is subject to the terms and conditions of the
4 * GNU general public license version 2. See "COPYING" or 4 * GNU general public license version 2. See "COPYING" or
5 * http://www.gnu.org/licenses/gpl.html 5 * http://www.gnu.org/licenses/gpl.html
@@ -19,6 +19,7 @@ struct powernow_k8_data {
19 u32 vidmvs; /* usable value calculated from mvs */ 19 u32 vidmvs; /* usable value calculated from mvs */
20 u32 vstable; /* voltage stabilization time, units 20 us */ 20 u32 vstable; /* voltage stabilization time, units 20 us */
21 u32 plllock; /* pll lock time, units 1 us */ 21 u32 plllock; /* pll lock time, units 1 us */
22 u32 exttype; /* extended interface = 1 */
22 23
23 /* keep track of the current fid / vid */ 24 /* keep track of the current fid / vid */
24 u32 currvid, currfid; 25 u32 currvid, currfid;
@@ -41,7 +42,7 @@ struct powernow_k8_data {
41#define CPUID_XFAM 0x0ff00000 /* extended family */ 42#define CPUID_XFAM 0x0ff00000 /* extended family */
42#define CPUID_XFAM_K8 0 43#define CPUID_XFAM_K8 0
43#define CPUID_XMOD 0x000f0000 /* extended model */ 44#define CPUID_XMOD 0x000f0000 /* extended model */
44#define CPUID_XMOD_REV_E 0x00020000 45#define CPUID_XMOD_REV_F 0x00040000
45#define CPUID_USE_XFAM_XMOD 0x00000f00 46#define CPUID_USE_XFAM_XMOD 0x00000f00
46#define CPUID_GET_MAX_CAPABILITIES 0x80000000 47#define CPUID_GET_MAX_CAPABILITIES 0x80000000
47#define CPUID_FREQ_VOLT_CAPABILITIES 0x80000007 48#define CPUID_FREQ_VOLT_CAPABILITIES 0x80000007
@@ -57,25 +58,26 @@ struct powernow_k8_data {
57 58
58/* Field definitions within the FID VID Low Control MSR : */ 59/* Field definitions within the FID VID Low Control MSR : */
59#define MSR_C_LO_INIT_FID_VID 0x00010000 60#define MSR_C_LO_INIT_FID_VID 0x00010000
60#define MSR_C_LO_NEW_VID 0x00001f00 61#define MSR_C_LO_NEW_VID 0x00003f00
61#define MSR_C_LO_NEW_FID 0x0000002f 62#define MSR_C_LO_NEW_FID 0x0000003f
62#define MSR_C_LO_VID_SHIFT 8 63#define MSR_C_LO_VID_SHIFT 8
63 64
64/* Field definitions within the FID VID High Control MSR : */ 65/* Field definitions within the FID VID High Control MSR : */
65#define MSR_C_HI_STP_GNT_TO 0x000fffff 66#define MSR_C_HI_STP_GNT_TO 0x000fffff
66 67
67/* Field definitions within the FID VID Low Status MSR : */ 68/* Field definitions within the FID VID Low Status MSR : */
68#define MSR_S_LO_CHANGE_PENDING 0x80000000 /* cleared when completed */ 69#define MSR_S_LO_CHANGE_PENDING 0x80000000 /* cleared when completed */
69#define MSR_S_LO_MAX_RAMP_VID 0x1f000000 70#define MSR_S_LO_MAX_RAMP_VID 0x3f000000
70#define MSR_S_LO_MAX_FID 0x003f0000 71#define MSR_S_LO_MAX_FID 0x003f0000
71#define MSR_S_LO_START_FID 0x00003f00 72#define MSR_S_LO_START_FID 0x00003f00
72#define MSR_S_LO_CURRENT_FID 0x0000003f 73#define MSR_S_LO_CURRENT_FID 0x0000003f
73 74
74/* Field definitions within the FID VID High Status MSR : */ 75/* Field definitions within the FID VID High Status MSR : */
75#define MSR_S_HI_MAX_WORKING_VID 0x001f0000 76#define MSR_S_HI_MIN_WORKING_VID 0x3f000000
76#define MSR_S_HI_START_VID 0x00001f00 77#define MSR_S_HI_MAX_WORKING_VID 0x003f0000
77#define MSR_S_HI_CURRENT_VID 0x0000001f 78#define MSR_S_HI_START_VID 0x00003f00
78#define MSR_C_HI_STP_GNT_BENIGN 0x00000001 79#define MSR_S_HI_CURRENT_VID 0x0000003f
80#define MSR_C_HI_STP_GNT_BENIGN 0x00000001
79 81
80/* 82/*
81 * There are restrictions frequencies have to follow: 83 * There are restrictions frequencies have to follow:
@@ -99,13 +101,15 @@ struct powernow_k8_data {
99#define MIN_FREQ_RESOLUTION 200 /* fids jump by 2 matching freq jumps by 200 */ 101#define MIN_FREQ_RESOLUTION 200 /* fids jump by 2 matching freq jumps by 200 */
100 102
101#define MAX_FID 0x2a /* Spec only gives FID values as far as 5 GHz */ 103#define MAX_FID 0x2a /* Spec only gives FID values as far as 5 GHz */
102#define LEAST_VID 0x1e /* Lowest (numerically highest) useful vid value */ 104#define LEAST_VID 0x3e /* Lowest (numerically highest) useful vid value */
103 105
104#define MIN_FREQ 800 /* Min and max freqs, per spec */ 106#define MIN_FREQ 800 /* Min and max freqs, per spec */
105#define MAX_FREQ 5000 107#define MAX_FREQ 5000
106 108
107#define INVALID_FID_MASK 0xffffffc1 /* not a valid fid if these bits are set */ 109#define INVALID_FID_MASK 0xffffffc1 /* not a valid fid if these bits are set */
108#define INVALID_VID_MASK 0xffffffe0 /* not a valid vid if these bits are set */ 110#define INVALID_VID_MASK 0xffffffc0 /* not a valid vid if these bits are set */
111
112#define VID_OFF 0x3f
109 113
110#define STOP_GRANT_5NS 1 /* min poss memory access latency for voltage change */ 114#define STOP_GRANT_5NS 1 /* min poss memory access latency for voltage change */
111 115
@@ -121,12 +125,14 @@ struct powernow_k8_data {
121 125
122#define IRT_SHIFT 30 126#define IRT_SHIFT 30
123#define RVO_SHIFT 28 127#define RVO_SHIFT 28
128#define EXT_TYPE_SHIFT 27
124#define PLL_L_SHIFT 20 129#define PLL_L_SHIFT 20
125#define MVS_SHIFT 18 130#define MVS_SHIFT 18
126#define VST_SHIFT 11 131#define VST_SHIFT 11
127#define VID_SHIFT 6 132#define VID_SHIFT 6
128#define IRT_MASK 3 133#define IRT_MASK 3
129#define RVO_MASK 3 134#define RVO_MASK 3
135#define EXT_TYPE_MASK 1
130#define PLL_L_MASK 0x7f 136#define PLL_L_MASK 0x7f
131#define MVS_MASK 3 137#define MVS_MASK 3
132#define VST_MASK 0x7f 138#define VST_MASK 0x7f
diff --git a/arch/i386/kernel/cpu/intel_cacheinfo.c b/arch/i386/kernel/cpu/intel_cacheinfo.c
index 1d768b263269..6c55b50cf048 100644
--- a/arch/i386/kernel/cpu/intel_cacheinfo.c
+++ b/arch/i386/kernel/cpu/intel_cacheinfo.c
@@ -128,7 +128,7 @@ static int __devinit cpuid4_cache_lookup(int index, struct _cpuid4_info *this_le
128 cpuid_count(4, index, &eax, &ebx, &ecx, &edx); 128 cpuid_count(4, index, &eax, &ebx, &ecx, &edx);
129 cache_eax.full = eax; 129 cache_eax.full = eax;
130 if (cache_eax.split.type == CACHE_TYPE_NULL) 130 if (cache_eax.split.type == CACHE_TYPE_NULL)
131 return -1; 131 return -EIO; /* better error ? */
132 132
133 this_leaf->eax.full = eax; 133 this_leaf->eax.full = eax;
134 this_leaf->ebx.full = ebx; 134 this_leaf->ebx.full = ebx;
@@ -334,6 +334,7 @@ static int __devinit detect_cache_attributes(unsigned int cpu)
334 struct _cpuid4_info *this_leaf; 334 struct _cpuid4_info *this_leaf;
335 unsigned long j; 335 unsigned long j;
336 int retval; 336 int retval;
337 cpumask_t oldmask;
337 338
338 if (num_cache_leaves == 0) 339 if (num_cache_leaves == 0)
339 return -ENOENT; 340 return -ENOENT;
@@ -345,19 +346,26 @@ static int __devinit detect_cache_attributes(unsigned int cpu)
345 memset(cpuid4_info[cpu], 0, 346 memset(cpuid4_info[cpu], 0,
346 sizeof(struct _cpuid4_info) * num_cache_leaves); 347 sizeof(struct _cpuid4_info) * num_cache_leaves);
347 348
349 oldmask = current->cpus_allowed;
350 retval = set_cpus_allowed(current, cpumask_of_cpu(cpu));
351 if (retval)
352 goto out;
353
348 /* Do cpuid and store the results */ 354 /* Do cpuid and store the results */
355 retval = 0;
349 for (j = 0; j < num_cache_leaves; j++) { 356 for (j = 0; j < num_cache_leaves; j++) {
350 this_leaf = CPUID4_INFO_IDX(cpu, j); 357 this_leaf = CPUID4_INFO_IDX(cpu, j);
351 retval = cpuid4_cache_lookup(j, this_leaf); 358 retval = cpuid4_cache_lookup(j, this_leaf);
352 if (unlikely(retval < 0)) 359 if (unlikely(retval < 0))
353 goto err_out; 360 break;
354 cache_shared_cpu_map_setup(cpu, j); 361 cache_shared_cpu_map_setup(cpu, j);
355 } 362 }
356 return 0; 363 set_cpus_allowed(current, oldmask);
357 364
358err_out: 365out:
359 free_cache_attributes(cpu); 366 if (retval)
360 return -ENOMEM; 367 free_cache_attributes(cpu);
368 return retval;
361} 369}
362 370
363#ifdef CONFIG_SYSFS 371#ifdef CONFIG_SYSFS
diff --git a/arch/i386/kernel/machine_kexec.c b/arch/i386/kernel/machine_kexec.c
index 52ed18d8b511..cb699a2aa1f8 100644
--- a/arch/i386/kernel/machine_kexec.c
+++ b/arch/i386/kernel/machine_kexec.c
@@ -16,6 +16,7 @@
16#include <asm/io.h> 16#include <asm/io.h>
17#include <asm/apic.h> 17#include <asm/apic.h>
18#include <asm/cpufeature.h> 18#include <asm/cpufeature.h>
19#include <asm/desc.h>
19 20
20static inline unsigned long read_cr3(void) 21static inline unsigned long read_cr3(void)
21{ 22{
@@ -90,33 +91,32 @@ static void identity_map_page(unsigned long address)
90} 91}
91#endif 92#endif
92 93
93
94static void set_idt(void *newidt, __u16 limit) 94static void set_idt(void *newidt, __u16 limit)
95{ 95{
96 unsigned char curidt[6]; 96 struct Xgt_desc_struct curidt;
97 97
98 /* ia32 supports unaliged loads & stores */ 98 /* ia32 supports unaliged loads & stores */
99 (*(__u16 *)(curidt)) = limit; 99 curidt.size = limit;
100 (*(__u32 *)(curidt +2)) = (unsigned long)(newidt); 100 curidt.address = (unsigned long)newidt;
101 101
102 __asm__ __volatile__ ( 102 __asm__ __volatile__ (
103 "lidt %0\n" 103 "lidtl %0\n"
104 : "=m" (curidt) 104 : : "m" (curidt)
105 ); 105 );
106}; 106};
107 107
108 108
109static void set_gdt(void *newgdt, __u16 limit) 109static void set_gdt(void *newgdt, __u16 limit)
110{ 110{
111 unsigned char curgdt[6]; 111 struct Xgt_desc_struct curgdt;
112 112
113 /* ia32 supports unaligned loads & stores */ 113 /* ia32 supports unaligned loads & stores */
114 (*(__u16 *)(curgdt)) = limit; 114 curgdt.size = limit;
115 (*(__u32 *)(curgdt +2)) = (unsigned long)(newgdt); 115 curgdt.address = (unsigned long)newgdt;
116 116
117 __asm__ __volatile__ ( 117 __asm__ __volatile__ (
118 "lgdt %0\n" 118 "lgdtl %0\n"
119 : "=m" (curgdt) 119 : : "m" (curgdt)
120 ); 120 );
121}; 121};
122 122
diff --git a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c
index af917f609c7d..ce838abb27d8 100644
--- a/arch/i386/kernel/mpparse.c
+++ b/arch/i386/kernel/mpparse.c
@@ -1116,7 +1116,15 @@ int mp_register_gsi (u32 gsi, int edge_level, int active_high_low)
1116 */ 1116 */
1117 int irq = gsi; 1117 int irq = gsi;
1118 if (gsi < MAX_GSI_NUM) { 1118 if (gsi < MAX_GSI_NUM) {
1119 gsi = pci_irq++; 1119 if (gsi > 15)
1120 gsi = pci_irq++;
1121#ifdef CONFIG_ACPI_BUS
1122 /*
1123 * Don't assign IRQ used by ACPI SCI
1124 */
1125 if (gsi == acpi_fadt.sci_int)
1126 gsi = pci_irq++;
1127#endif
1120 gsi_to_irq[irq] = gsi; 1128 gsi_to_irq[irq] = gsi;
1121 } else { 1129 } else {
1122 printk(KERN_ERR "GSI %u is too high\n", gsi); 1130 printk(KERN_ERR "GSI %u is too high\n", gsi);
diff --git a/arch/i386/kernel/numaq.c b/arch/i386/kernel/numaq.c
index e51edf0a6564..5f5b075f860a 100644
--- a/arch/i386/kernel/numaq.c
+++ b/arch/i386/kernel/numaq.c
@@ -31,6 +31,7 @@
31#include <linux/nodemask.h> 31#include <linux/nodemask.h>
32#include <asm/numaq.h> 32#include <asm/numaq.h>
33#include <asm/topology.h> 33#include <asm/topology.h>
34#include <asm/processor.h>
34 35
35#define MB_TO_PAGES(addr) ((addr) << (20 - PAGE_SHIFT)) 36#define MB_TO_PAGES(addr) ((addr) << (20 - PAGE_SHIFT))
36 37
@@ -77,3 +78,11 @@ int __init get_memcfg_numaq(void)
77 smp_dump_qct(); 78 smp_dump_qct();
78 return 1; 79 return 1;
79} 80}
81
82static int __init numaq_dsc_disable(void)
83{
84 printk(KERN_DEBUG "NUMAQ: disabling TSC\n");
85 tsc_disable = 1;
86 return 0;
87}
88core_initcall(numaq_dsc_disable);
diff --git a/arch/i386/mm/discontig.c b/arch/i386/mm/discontig.c
index b358f0702a44..c369a8bf7cbe 100644
--- a/arch/i386/mm/discontig.c
+++ b/arch/i386/mm/discontig.c
@@ -243,6 +243,14 @@ static unsigned long calculate_numa_remap_pages(void)
243 /* now the roundup is correct, convert to PAGE_SIZE pages */ 243 /* now the roundup is correct, convert to PAGE_SIZE pages */
244 size = size * PTRS_PER_PTE; 244 size = size * PTRS_PER_PTE;
245 245
246 if (node_end_pfn[nid] & (PTRS_PER_PTE-1)) {
247 /*
248 * Adjust size if node_end_pfn is not on a proper
249 * pmd boundary. remap_numa_kva will barf otherwise.
250 */
251 size += node_end_pfn[nid] & (PTRS_PER_PTE-1);
252 }
253
246 /* 254 /*
247 * Validate the region we are allocating only contains valid 255 * Validate the region we are allocating only contains valid
248 * pages. 256 * pages.
diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c
index 187350ccf864..86348b68fda1 100644
--- a/arch/i386/pci/irq.c
+++ b/arch/i386/pci/irq.c
@@ -551,6 +551,13 @@ static __init int intel_router_probe(struct irq_router *r, struct pci_dev *route
551static __init int via_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) 551static __init int via_router_probe(struct irq_router *r, struct pci_dev *router, u16 device)
552{ 552{
553 /* FIXME: We should move some of the quirk fixup stuff here */ 553 /* FIXME: We should move some of the quirk fixup stuff here */
554
555 if (router->device == PCI_DEVICE_ID_VIA_82C686 &&
556 device == PCI_DEVICE_ID_VIA_82C586_0) {
557 /* Asus k7m bios wrongly reports 82C686A as 586-compatible */
558 device = PCI_DEVICE_ID_VIA_82C686;
559 }
560
554 switch(device) 561 switch(device)
555 { 562 {
556 case PCI_DEVICE_ID_VIA_82C586_0: 563 case PCI_DEVICE_ID_VIA_82C586_0:
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index c067435bae45..c9f2f60cfa58 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -232,7 +232,11 @@ static int appldata_diag(char record_nr, u16 function, unsigned long buffer,
232 ry = -1; 232 ry = -1;
233 asm volatile( 233 asm volatile(
234 "diag %1,%0,0xDC\n\t" 234 "diag %1,%0,0xDC\n\t"
235 : "=d" (ry) : "d" (&(appldata_parameter_list)) : "cc"); 235 : "=d" (ry)
236 : "d" (&appldata_parameter_list),
237 "m" (appldata_parameter_list),
238 "m" (appldata_product_id)
239 : "cc");
236 return (int) ry; 240 return (int) ry;
237} 241}
238/************************ timer, work, DIAG <END> ****************************/ 242/************************ timer, work, DIAG <END> ****************************/
diff --git a/arch/s390/defconfig b/arch/s390/defconfig
index 89850b2c27ea..0865251a3f44 100644
--- a/arch/s390/defconfig
+++ b/arch/s390/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc3 3# Linux kernel version: 2.6.13-rc4
4# Fri Apr 22 15:30:58 2005 4# Fri Jul 29 14:49:30 2005
5# 5#
6CONFIG_MMU=y 6CONFIG_MMU=y
7CONFIG_RWSEM_XCHGADD_ALGORITHM=y 7CONFIG_RWSEM_XCHGADD_ALGORITHM=y
@@ -23,10 +23,11 @@ CONFIG_INIT_ENV_ARG_LIMIT=32
23CONFIG_LOCALVERSION="" 23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y 24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y 25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set 26CONFIG_POSIX_MQUEUE=y
27# CONFIG_BSD_PROCESS_ACCT is not set 27# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y 28CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set 29CONFIG_AUDIT=y
30# CONFIG_AUDITSYSCALL is not set
30CONFIG_HOTPLUG=y 31CONFIG_HOTPLUG=y
31CONFIG_KOBJECT_UEVENT=y 32CONFIG_KOBJECT_UEVENT=y
32CONFIG_IKCONFIG=y 33CONFIG_IKCONFIG=y
@@ -36,6 +37,8 @@ CONFIG_IKCONFIG_PROC=y
36CONFIG_KALLSYMS=y 37CONFIG_KALLSYMS=y
37# CONFIG_KALLSYMS_ALL is not set 38# CONFIG_KALLSYMS_ALL is not set
38# CONFIG_KALLSYMS_EXTRA_PASS is not set 39# CONFIG_KALLSYMS_EXTRA_PASS is not set
40CONFIG_PRINTK=y
41CONFIG_BUG=y
39CONFIG_BASE_FULL=y 42CONFIG_BASE_FULL=y
40CONFIG_FUTEX=y 43CONFIG_FUTEX=y
41CONFIG_EPOLL=y 44CONFIG_EPOLL=y
@@ -51,9 +54,10 @@ CONFIG_BASE_SMALL=0
51# Loadable module support 54# Loadable module support
52# 55#
53CONFIG_MODULES=y 56CONFIG_MODULES=y
54# CONFIG_MODULE_UNLOAD is not set 57CONFIG_MODULE_UNLOAD=y
58# CONFIG_MODULE_FORCE_UNLOAD is not set
55CONFIG_OBSOLETE_MODPARM=y 59CONFIG_OBSOLETE_MODPARM=y
56# CONFIG_MODVERSIONS is not set 60CONFIG_MODVERSIONS=y
57# CONFIG_MODULE_SRCVERSION_ALL is not set 61# CONFIG_MODULE_SRCVERSION_ALL is not set
58CONFIG_KMOD=y 62CONFIG_KMOD=y
59CONFIG_STOP_MACHINE=y 63CONFIG_STOP_MACHINE=y
@@ -81,8 +85,15 @@ CONFIG_MARCH_G5=y
81# CONFIG_MARCH_Z990 is not set 85# CONFIG_MARCH_Z990 is not set
82CONFIG_PACK_STACK=y 86CONFIG_PACK_STACK=y
83# CONFIG_SMALL_STACK is not set 87# CONFIG_SMALL_STACK is not set
84# CONFIG_CHECK_STACK is not set 88CONFIG_CHECK_STACK=y
89CONFIG_STACK_GUARD=256
85# CONFIG_WARN_STACK is not set 90# CONFIG_WARN_STACK is not set
91CONFIG_SELECT_MEMORY_MODEL=y
92CONFIG_FLATMEM_MANUAL=y
93# CONFIG_DISCONTIGMEM_MANUAL is not set
94# CONFIG_SPARSEMEM_MANUAL is not set
95CONFIG_FLATMEM=y
96CONFIG_FLAT_NODE_MEM_MAP=y
86 97
87# 98#
88# I/O subsystem configuration 99# I/O subsystem configuration
@@ -95,7 +106,7 @@ CONFIG_QDIO=y
95# 106#
96# Misc 107# Misc
97# 108#
98# CONFIG_PREEMPT is not set 109CONFIG_PREEMPT=y
99CONFIG_IPL=y 110CONFIG_IPL=y
100# CONFIG_IPL_TAPE is not set 111# CONFIG_IPL_TAPE is not set
101CONFIG_IPL_VM=y 112CONFIG_IPL_VM=y
@@ -105,9 +116,110 @@ CONFIG_BINFMT_MISC=m
105CONFIG_PFAULT=y 116CONFIG_PFAULT=y
106# CONFIG_SHARED_KERNEL is not set 117# CONFIG_SHARED_KERNEL is not set
107# CONFIG_CMM is not set 118# CONFIG_CMM is not set
108# CONFIG_VIRT_TIMER is not set 119CONFIG_VIRT_TIMER=y
120CONFIG_VIRT_CPU_ACCOUNTING=y
121# CONFIG_APPLDATA_BASE is not set
109CONFIG_NO_IDLE_HZ=y 122CONFIG_NO_IDLE_HZ=y
110CONFIG_NO_IDLE_HZ_INIT=y 123CONFIG_NO_IDLE_HZ_INIT=y
124# CONFIG_KEXEC is not set
125
126#
127# Networking
128#
129CONFIG_NET=y
130
131#
132# Networking options
133#
134CONFIG_PACKET=y
135# CONFIG_PACKET_MMAP is not set
136CONFIG_UNIX=y
137CONFIG_XFRM=y
138# CONFIG_XFRM_USER is not set
139CONFIG_NET_KEY=y
140CONFIG_INET=y
141CONFIG_IP_MULTICAST=y
142# CONFIG_IP_ADVANCED_ROUTER is not set
143CONFIG_IP_FIB_HASH=y
144# CONFIG_IP_PNP is not set
145# CONFIG_NET_IPIP is not set
146# CONFIG_NET_IPGRE is not set
147# CONFIG_IP_MROUTE is not set
148# CONFIG_ARPD is not set
149# CONFIG_SYN_COOKIES is not set
150# CONFIG_INET_AH is not set
151# CONFIG_INET_ESP is not set
152# CONFIG_INET_IPCOMP is not set
153# CONFIG_INET_TUNNEL is not set
154CONFIG_IP_TCPDIAG=y
155CONFIG_IP_TCPDIAG_IPV6=y
156# CONFIG_TCP_CONG_ADVANCED is not set
157CONFIG_TCP_CONG_BIC=y
158CONFIG_IPV6=y
159# CONFIG_IPV6_PRIVACY is not set
160# CONFIG_INET6_AH is not set
161# CONFIG_INET6_ESP is not set
162# CONFIG_INET6_IPCOMP is not set
163# CONFIG_INET6_TUNNEL is not set
164# CONFIG_IPV6_TUNNEL is not set
165# CONFIG_NETFILTER is not set
166
167#
168# SCTP Configuration (EXPERIMENTAL)
169#
170# CONFIG_IP_SCTP is not set
171# CONFIG_ATM is not set
172# CONFIG_BRIDGE is not set
173# CONFIG_VLAN_8021Q is not set
174# CONFIG_DECNET is not set
175# CONFIG_LLC2 is not set
176# CONFIG_IPX is not set
177# CONFIG_ATALK is not set
178# CONFIG_X25 is not set
179# CONFIG_LAPB is not set
180# CONFIG_NET_DIVERT is not set
181# CONFIG_ECONET is not set
182# CONFIG_WAN_ROUTER is not set
183CONFIG_NET_SCHED=y
184CONFIG_NET_SCH_CLK_JIFFIES=y
185# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set
186# CONFIG_NET_SCH_CLK_CPU is not set
187CONFIG_NET_SCH_CBQ=m
188# CONFIG_NET_SCH_HTB is not set
189# CONFIG_NET_SCH_HFSC is not set
190CONFIG_NET_SCH_PRIO=m
191CONFIG_NET_SCH_RED=m
192CONFIG_NET_SCH_SFQ=m
193CONFIG_NET_SCH_TEQL=m
194CONFIG_NET_SCH_TBF=m
195CONFIG_NET_SCH_GRED=m
196CONFIG_NET_SCH_DSMARK=m
197# CONFIG_NET_SCH_NETEM is not set
198# CONFIG_NET_SCH_INGRESS is not set
199CONFIG_NET_QOS=y
200CONFIG_NET_ESTIMATOR=y
201CONFIG_NET_CLS=y
202# CONFIG_NET_CLS_BASIC is not set
203CONFIG_NET_CLS_TCINDEX=m
204CONFIG_NET_CLS_ROUTE4=m
205CONFIG_NET_CLS_ROUTE=y
206CONFIG_NET_CLS_FW=m
207CONFIG_NET_CLS_U32=m
208# CONFIG_CLS_U32_PERF is not set
209# CONFIG_NET_CLS_IND is not set
210CONFIG_NET_CLS_RSVP=m
211CONFIG_NET_CLS_RSVP6=m
212# CONFIG_NET_EMATCH is not set
213# CONFIG_NET_CLS_ACT is not set
214CONFIG_NET_CLS_POLICE=y
215
216#
217# Network testing
218#
219# CONFIG_NET_PKTGEN is not set
220# CONFIG_HAMRADIO is not set
221# CONFIG_IRDA is not set
222# CONFIG_BT is not set
111# CONFIG_PCMCIA is not set 223# CONFIG_PCMCIA is not set
112 224
113# 225#
@@ -133,6 +245,7 @@ CONFIG_CHR_DEV_ST=y
133CONFIG_BLK_DEV_SR=y 245CONFIG_BLK_DEV_SR=y
134CONFIG_BLK_DEV_SR_VENDOR=y 246CONFIG_BLK_DEV_SR_VENDOR=y
135CONFIG_CHR_DEV_SG=y 247CONFIG_CHR_DEV_SG=y
248# CONFIG_CHR_DEV_SCH is not set
136 249
137# 250#
138# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 251# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
@@ -205,7 +318,13 @@ CONFIG_MD_RAID5=m
205# CONFIG_MD_RAID6 is not set 318# CONFIG_MD_RAID6 is not set
206CONFIG_MD_MULTIPATH=m 319CONFIG_MD_MULTIPATH=m
207# CONFIG_MD_FAULTY is not set 320# CONFIG_MD_FAULTY is not set
208# CONFIG_BLK_DEV_DM is not set 321CONFIG_BLK_DEV_DM=y
322CONFIG_DM_CRYPT=y
323CONFIG_DM_SNAPSHOT=y
324CONFIG_DM_MIRROR=y
325CONFIG_DM_ZERO=y
326CONFIG_DM_MULTIPATH=y
327# CONFIG_DM_MULTIPATH_EMC is not set
209 328
210# 329#
211# Character device drivers 330# Character device drivers
@@ -231,7 +350,8 @@ CONFIG_CCW_CONSOLE=y
231CONFIG_SCLP=y 350CONFIG_SCLP=y
232CONFIG_SCLP_TTY=y 351CONFIG_SCLP_TTY=y
233CONFIG_SCLP_CONSOLE=y 352CONFIG_SCLP_CONSOLE=y
234# CONFIG_SCLP_VT220_TTY is not set 353CONFIG_SCLP_VT220_TTY=y
354CONFIG_SCLP_VT220_CONSOLE=y
235CONFIG_SCLP_CPI=m 355CONFIG_SCLP_CPI=m
236CONFIG_S390_TAPE=m 356CONFIG_S390_TAPE=m
237 357
@@ -255,105 +375,8 @@ CONFIG_S390_TAPE_34XX=m
255CONFIG_Z90CRYPT=m 375CONFIG_Z90CRYPT=m
256 376
257# 377#
258# Networking support 378# Network device support
259#
260CONFIG_NET=y
261
262#
263# Networking options
264#
265CONFIG_PACKET=y
266# CONFIG_PACKET_MMAP is not set
267CONFIG_UNIX=y
268CONFIG_NET_KEY=y
269CONFIG_INET=y
270CONFIG_IP_MULTICAST=y
271# CONFIG_IP_ADVANCED_ROUTER is not set
272# CONFIG_IP_PNP is not set
273# CONFIG_NET_IPIP is not set
274# CONFIG_NET_IPGRE is not set
275# CONFIG_IP_MROUTE is not set
276# CONFIG_ARPD is not set
277# CONFIG_SYN_COOKIES is not set
278# CONFIG_INET_AH is not set
279# CONFIG_INET_ESP is not set
280# CONFIG_INET_IPCOMP is not set
281# CONFIG_INET_TUNNEL is not set
282CONFIG_IP_TCPDIAG=y
283CONFIG_IP_TCPDIAG_IPV6=y
284CONFIG_IPV6=y
285# CONFIG_IPV6_PRIVACY is not set
286# CONFIG_INET6_AH is not set
287# CONFIG_INET6_ESP is not set
288# CONFIG_INET6_IPCOMP is not set
289# CONFIG_INET6_TUNNEL is not set
290# CONFIG_IPV6_TUNNEL is not set
291# CONFIG_NETFILTER is not set
292CONFIG_XFRM=y
293# CONFIG_XFRM_USER is not set
294
295#
296# SCTP Configuration (EXPERIMENTAL)
297#
298# CONFIG_IP_SCTP is not set
299# CONFIG_ATM is not set
300# CONFIG_BRIDGE is not set
301# CONFIG_VLAN_8021Q is not set
302# CONFIG_DECNET is not set
303# CONFIG_LLC2 is not set
304# CONFIG_IPX is not set
305# CONFIG_ATALK is not set
306# CONFIG_X25 is not set
307# CONFIG_LAPB is not set
308# CONFIG_NET_DIVERT is not set
309# CONFIG_ECONET is not set
310# CONFIG_WAN_ROUTER is not set
311
312#
313# QoS and/or fair queueing
314#
315CONFIG_NET_SCHED=y
316CONFIG_NET_SCH_CLK_JIFFIES=y
317# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set
318# CONFIG_NET_SCH_CLK_CPU is not set
319CONFIG_NET_SCH_CBQ=m
320# CONFIG_NET_SCH_HTB is not set
321# CONFIG_NET_SCH_HFSC is not set
322CONFIG_NET_SCH_PRIO=m
323CONFIG_NET_SCH_RED=m
324CONFIG_NET_SCH_SFQ=m
325CONFIG_NET_SCH_TEQL=m
326CONFIG_NET_SCH_TBF=m
327CONFIG_NET_SCH_GRED=m
328CONFIG_NET_SCH_DSMARK=m
329# CONFIG_NET_SCH_NETEM is not set
330# CONFIG_NET_SCH_INGRESS is not set
331CONFIG_NET_QOS=y
332CONFIG_NET_ESTIMATOR=y
333CONFIG_NET_CLS=y
334# CONFIG_NET_CLS_BASIC is not set
335CONFIG_NET_CLS_TCINDEX=m
336CONFIG_NET_CLS_ROUTE4=m
337CONFIG_NET_CLS_ROUTE=y
338CONFIG_NET_CLS_FW=m
339CONFIG_NET_CLS_U32=m
340# CONFIG_CLS_U32_PERF is not set
341# CONFIG_NET_CLS_IND is not set
342CONFIG_NET_CLS_RSVP=m
343CONFIG_NET_CLS_RSVP6=m
344# CONFIG_NET_EMATCH is not set
345# CONFIG_NET_CLS_ACT is not set
346CONFIG_NET_CLS_POLICE=y
347
348#
349# Network testing
350# 379#
351# CONFIG_NET_PKTGEN is not set
352# CONFIG_NETPOLL is not set
353# CONFIG_NET_POLL_CONTROLLER is not set
354# CONFIG_HAMRADIO is not set
355# CONFIG_IRDA is not set
356# CONFIG_BT is not set
357CONFIG_NETDEVICES=y 380CONFIG_NETDEVICES=y
358CONFIG_DUMMY=m 381CONFIG_DUMMY=m
359CONFIG_BONDING=m 382CONFIG_BONDING=m
@@ -411,12 +434,15 @@ CONFIG_CCWGROUP=y
411# CONFIG_SLIP is not set 434# CONFIG_SLIP is not set
412# CONFIG_SHAPER is not set 435# CONFIG_SHAPER is not set
413# CONFIG_NETCONSOLE is not set 436# CONFIG_NETCONSOLE is not set
437# CONFIG_NETPOLL is not set
438# CONFIG_NET_POLL_CONTROLLER is not set
414 439
415# 440#
416# File systems 441# File systems
417# 442#
418CONFIG_EXT2_FS=y 443CONFIG_EXT2_FS=y
419# CONFIG_EXT2_FS_XATTR is not set 444# CONFIG_EXT2_FS_XATTR is not set
445# CONFIG_EXT2_FS_XIP is not set
420CONFIG_EXT3_FS=y 446CONFIG_EXT3_FS=y
421CONFIG_EXT3_FS_XATTR=y 447CONFIG_EXT3_FS_XATTR=y
422# CONFIG_EXT3_FS_POSIX_ACL is not set 448# CONFIG_EXT3_FS_POSIX_ACL is not set
@@ -426,6 +452,7 @@ CONFIG_JBD=y
426CONFIG_FS_MBCACHE=y 452CONFIG_FS_MBCACHE=y
427# CONFIG_REISERFS_FS is not set 453# CONFIG_REISERFS_FS is not set
428# CONFIG_JFS_FS is not set 454# CONFIG_JFS_FS is not set
455# CONFIG_FS_POSIX_ACL is not set
429 456
430# 457#
431# XFS support 458# XFS support
@@ -433,6 +460,7 @@ CONFIG_FS_MBCACHE=y
433# CONFIG_XFS_FS is not set 460# CONFIG_XFS_FS is not set
434# CONFIG_MINIX_FS is not set 461# CONFIG_MINIX_FS is not set
435# CONFIG_ROMFS_FS is not set 462# CONFIG_ROMFS_FS is not set
463CONFIG_INOTIFY=y
436# CONFIG_QUOTA is not set 464# CONFIG_QUOTA is not set
437CONFIG_DNOTIFY=y 465CONFIG_DNOTIFY=y
438# CONFIG_AUTOFS_FS is not set 466# CONFIG_AUTOFS_FS is not set
@@ -457,7 +485,6 @@ CONFIG_DNOTIFY=y
457CONFIG_PROC_FS=y 485CONFIG_PROC_FS=y
458CONFIG_PROC_KCORE=y 486CONFIG_PROC_KCORE=y
459CONFIG_SYSFS=y 487CONFIG_SYSFS=y
460# CONFIG_DEVFS_FS is not set
461# CONFIG_DEVPTS_FS_XATTR is not set 488# CONFIG_DEVPTS_FS_XATTR is not set
462CONFIG_TMPFS=y 489CONFIG_TMPFS=y
463# CONFIG_TMPFS_XATTR is not set 490# CONFIG_TMPFS_XATTR is not set
@@ -486,15 +513,18 @@ CONFIG_RAMFS=y
486# 513#
487CONFIG_NFS_FS=y 514CONFIG_NFS_FS=y
488CONFIG_NFS_V3=y 515CONFIG_NFS_V3=y
516# CONFIG_NFS_V3_ACL is not set
489# CONFIG_NFS_V4 is not set 517# CONFIG_NFS_V4 is not set
490# CONFIG_NFS_DIRECTIO is not set 518# CONFIG_NFS_DIRECTIO is not set
491CONFIG_NFSD=y 519CONFIG_NFSD=y
492CONFIG_NFSD_V3=y 520CONFIG_NFSD_V3=y
521# CONFIG_NFSD_V3_ACL is not set
493# CONFIG_NFSD_V4 is not set 522# CONFIG_NFSD_V4 is not set
494CONFIG_NFSD_TCP=y 523CONFIG_NFSD_TCP=y
495CONFIG_LOCKD=y 524CONFIG_LOCKD=y
496CONFIG_LOCKD_V4=y 525CONFIG_LOCKD_V4=y
497CONFIG_EXPORTFS=y 526CONFIG_EXPORTFS=y
527CONFIG_NFS_COMMON=y
498CONFIG_SUNRPC=y 528CONFIG_SUNRPC=y
499# CONFIG_RPCSEC_GSS_KRB5 is not set 529# CONFIG_RPCSEC_GSS_KRB5 is not set
500# CONFIG_RPCSEC_GSS_SPKM3 is not set 530# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -544,11 +574,12 @@ CONFIG_MAGIC_SYSRQ=y
544CONFIG_LOG_BUF_SHIFT=17 574CONFIG_LOG_BUF_SHIFT=17
545# CONFIG_SCHEDSTATS is not set 575# CONFIG_SCHEDSTATS is not set
546# CONFIG_DEBUG_SLAB is not set 576# CONFIG_DEBUG_SLAB is not set
577CONFIG_DEBUG_PREEMPT=y
547# CONFIG_DEBUG_SPINLOCK is not set 578# CONFIG_DEBUG_SPINLOCK is not set
548# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 579# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
549# CONFIG_DEBUG_KOBJECT is not set 580# CONFIG_DEBUG_KOBJECT is not set
550# CONFIG_DEBUG_INFO is not set 581# CONFIG_DEBUG_INFO is not set
551# CONFIG_DEBUG_FS is not set 582CONFIG_DEBUG_FS=y
552 583
553# 584#
554# Security options 585# Security options
diff --git a/arch/s390/kernel/head.S b/arch/s390/kernel/head.S
index d12cff11b4bc..2710e66fefba 100644
--- a/arch/s390/kernel/head.S
+++ b/arch/s390/kernel/head.S
@@ -346,6 +346,13 @@ iplstart:
346 la %r2,.Lreset 346 la %r2,.Lreset
347 lhi %r3,26 347 lhi %r3,26
348 diag %r2,%r3,8 348 diag %r2,%r3,8
349 la %r5,.Lirb
350 stsch 0(%r5) # check if irq is pending
351 tm 30(%r5),0x0f # by verifying if any of the
352 bnz .Lwaitforirq # activity or status control
353 tm 31(%r5),0xff # bits is set in the schib
354 bz .Lnoreset
355.Lwaitforirq:
349 mvc 0x78(8),.Lrdrnewpsw # set up IO interrupt psw 356 mvc 0x78(8),.Lrdrnewpsw # set up IO interrupt psw
350.Lwaitrdrirq: 357.Lwaitrdrirq:
351 lpsw .Lrdrwaitpsw 358 lpsw .Lrdrwaitpsw
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S
index 10bc592c3637..9a8263a153cb 100644
--- a/arch/s390/kernel/head64.S
+++ b/arch/s390/kernel/head64.S
@@ -345,6 +345,13 @@ iplstart:
345 la %r2,.Lreset 345 la %r2,.Lreset
346 lhi %r3,26 346 lhi %r3,26
347 diag %r2,%r3,8 347 diag %r2,%r3,8
348 la %r5,.Lirb
349 stsch 0(%r5) # check if irq is pending
350 tm 30(%r5),0x0f # by verifying if any of the
351 bnz .Lwaitforirq # activity or status control
352 tm 31(%r5),0xff # bits is set in the schib
353 bz .Lnoreset
354.Lwaitforirq:
348 mvc 0x78(8),.Lrdrnewpsw # set up IO interrupt psw 355 mvc 0x78(8),.Lrdrnewpsw # set up IO interrupt psw
349.Lwaitrdrirq: 356.Lwaitrdrirq:
350 lpsw .Lrdrwaitpsw 357 lpsw .Lrdrwaitpsw
diff --git a/arch/um/drivers/Makefile b/arch/um/drivers/Makefile
index d6c31a95b887..de17d4c6e02d 100644
--- a/arch/um/drivers/Makefile
+++ b/arch/um/drivers/Makefile
@@ -19,6 +19,8 @@ harddog-objs := harddog_kern.o harddog_user.o
19 19
20LDFLAGS_pcap.o := -r $(shell $(CC) $(CFLAGS) -print-file-name=libpcap.a) 20LDFLAGS_pcap.o := -r $(shell $(CC) $(CFLAGS) -print-file-name=libpcap.a)
21 21
22targets := pcap_kern.o pcap_user.o
23
22$(obj)/pcap.o: $(obj)/pcap_kern.o $(obj)/pcap_user.o 24$(obj)/pcap.o: $(obj)/pcap_kern.o $(obj)/pcap_user.o
23 $(LD) -r -dp -o $@ $^ $(LDFLAGS) $(LDFLAGS_pcap.o) 25 $(LD) -r -dp -o $@ $^ $(LDFLAGS) $(LDFLAGS_pcap.o)
24#XXX: The call below does not work because the flags are added before the 26#XXX: The call below does not work because the flags are added before the
@@ -26,7 +28,7 @@ $(obj)/pcap.o: $(obj)/pcap_kern.o $(obj)/pcap_user.o
26#$(call if_changed,ld) 28#$(call if_changed,ld)
27 29
28# When the above is fixed, don't forget to add this too! 30# When the above is fixed, don't forget to add this too!
29#targets := $(obj)/pcap.o 31#targets += $(obj)/pcap.o
30 32
31obj-y := stdio_console.o fd.o chan_kern.o chan_user.o line.o 33obj-y := stdio_console.o fd.o chan_kern.o chan_user.o line.o
32obj-$(CONFIG_SSL) += ssl.o 34obj-$(CONFIG_SSL) += ssl.o
diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c
index 404de41a4f67..c190c2414197 100644
--- a/arch/um/drivers/mconsole_kern.c
+++ b/arch/um/drivers/mconsole_kern.c
@@ -557,7 +557,7 @@ static int create_proc_mconsole(void)
557 557
558 ent = create_proc_entry("mconsole", S_IFREG | 0200, NULL); 558 ent = create_proc_entry("mconsole", S_IFREG | 0200, NULL);
559 if(ent == NULL){ 559 if(ent == NULL){
560 printk("create_proc_mconsole : create_proc_entry failed\n"); 560 printk(KERN_INFO "create_proc_mconsole : create_proc_entry failed\n");
561 return(0); 561 return(0);
562 } 562 }
563 563
diff --git a/arch/um/kernel/exitcode.c b/arch/um/kernel/exitcode.c
index 0ea87f24b36f..d21ebad666b4 100644
--- a/arch/um/kernel/exitcode.c
+++ b/arch/um/kernel/exitcode.c
@@ -48,7 +48,7 @@ static int make_proc_exitcode(void)
48 48
49 ent = create_proc_entry("exitcode", 0600, &proc_root); 49 ent = create_proc_entry("exitcode", 0600, &proc_root);
50 if(ent == NULL){ 50 if(ent == NULL){
51 printk("make_proc_exitcode : Failed to register " 51 printk(KERN_WARNING "make_proc_exitcode : Failed to register "
52 "/proc/exitcode\n"); 52 "/proc/exitcode\n");
53 return(0); 53 return(0);
54 } 54 }
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
index 8b01a5584e80..67acd92c5322 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
@@ -131,7 +131,7 @@ int start_fork_tramp(void *thread_arg, unsigned long temp_stack,
131 return(arg.pid); 131 return(arg.pid);
132} 132}
133 133
134static int ptrace_child(void) 134static int ptrace_child(void *arg)
135{ 135{
136 int ret; 136 int ret;
137 int pid = os_getpid(), ppid = getppid(); 137 int pid = os_getpid(), ppid = getppid();
@@ -160,16 +160,20 @@ static int ptrace_child(void)
160 _exit(ret); 160 _exit(ret);
161} 161}
162 162
163static int start_ptraced_child(void) 163static int start_ptraced_child(void **stack_out)
164{ 164{
165 void *stack;
166 unsigned long sp;
165 int pid, n, status; 167 int pid, n, status;
166 168
167 pid = fork(); 169 stack = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC,
168 if(pid == 0) 170 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
169 ptrace_child(); 171 if(stack == MAP_FAILED)
170 172 panic("check_ptrace : mmap failed, errno = %d", errno);
173 sp = (unsigned long) stack + PAGE_SIZE - sizeof(void *);
174 pid = clone(ptrace_child, (void *) sp, SIGCHLD, NULL);
171 if(pid < 0) 175 if(pid < 0)
172 panic("check_ptrace : fork failed, errno = %d", errno); 176 panic("check_ptrace : clone failed, errno = %d", errno);
173 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); 177 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED));
174 if(n < 0) 178 if(n < 0)
175 panic("check_ptrace : wait failed, errno = %d", errno); 179 panic("check_ptrace : wait failed, errno = %d", errno);
@@ -177,6 +181,7 @@ static int start_ptraced_child(void)
177 panic("check_ptrace : expected SIGSTOP, got status = %d", 181 panic("check_ptrace : expected SIGSTOP, got status = %d",
178 status); 182 status);
179 183
184 *stack_out = stack;
180 return(pid); 185 return(pid);
181} 186}
182 187
@@ -184,12 +189,12 @@ static int start_ptraced_child(void)
184 * just avoid using sysemu, not panic, but only if SYSEMU features are broken. 189 * just avoid using sysemu, not panic, but only if SYSEMU features are broken.
185 * So only for SYSEMU features we test mustpanic, while normal host features 190 * So only for SYSEMU features we test mustpanic, while normal host features
186 * must work anyway!*/ 191 * must work anyway!*/
187static int stop_ptraced_child(int pid, int exitcode, int mustexit) 192static int stop_ptraced_child(int pid, void *stack, int exitcode, int mustpanic)
188{ 193{
189 int status, n, ret = 0; 194 int status, n, ret = 0;
190 195
191 if(ptrace(PTRACE_CONT, pid, 0, 0) < 0) 196 if(ptrace(PTRACE_CONT, pid, 0, 0) < 0)
192 panic("stop_ptraced_child : ptrace failed, errno = %d", errno); 197 panic("check_ptrace : ptrace failed, errno = %d", errno);
193 CATCH_EINTR(n = waitpid(pid, &status, 0)); 198 CATCH_EINTR(n = waitpid(pid, &status, 0));
194 if(!WIFEXITED(status) || (WEXITSTATUS(status) != exitcode)) { 199 if(!WIFEXITED(status) || (WEXITSTATUS(status) != exitcode)) {
195 int exit_with = WEXITSTATUS(status); 200 int exit_with = WEXITSTATUS(status);
@@ -200,13 +205,15 @@ static int stop_ptraced_child(int pid, int exitcode, int mustexit)
200 printk("check_ptrace : child exited with exitcode %d, while " 205 printk("check_ptrace : child exited with exitcode %d, while "
201 "expecting %d; status 0x%x", exit_with, 206 "expecting %d; status 0x%x", exit_with,
202 exitcode, status); 207 exitcode, status);
203 if (mustexit) 208 if (mustpanic)
204 panic("\n"); 209 panic("\n");
205 else 210 else
206 printk("\n"); 211 printk("\n");
207 ret = -1; 212 ret = -1;
208 } 213 }
209 214
215 if(munmap(stack, PAGE_SIZE) < 0)
216 panic("check_ptrace : munmap failed, errno = %d", errno);
210 return ret; 217 return ret;
211} 218}
212 219
@@ -242,11 +249,12 @@ __uml_setup("nosysemu", nosysemu_cmd_param,
242 249
243static void __init check_sysemu(void) 250static void __init check_sysemu(void)
244{ 251{
252 void *stack;
245 int pid, syscall, n, status, count=0; 253 int pid, syscall, n, status, count=0;
246 254
247 printk("Checking syscall emulation patch for ptrace..."); 255 printk("Checking syscall emulation patch for ptrace...");
248 sysemu_supported = 0; 256 sysemu_supported = 0;
249 pid = start_ptraced_child(); 257 pid = start_ptraced_child(&stack);
250 258
251 if(ptrace(PTRACE_SYSEMU, pid, 0, 0) < 0) 259 if(ptrace(PTRACE_SYSEMU, pid, 0, 0) < 0)
252 goto fail; 260 goto fail;
@@ -264,7 +272,7 @@ static void __init check_sysemu(void)
264 panic("check_sysemu : failed to modify system " 272 panic("check_sysemu : failed to modify system "
265 "call return, errno = %d", errno); 273 "call return, errno = %d", errno);
266 274
267 if (stop_ptraced_child(pid, 0, 0) < 0) 275 if (stop_ptraced_child(pid, stack, 0, 0) < 0)
268 goto fail_stopped; 276 goto fail_stopped;
269 277
270 sysemu_supported = 1; 278 sysemu_supported = 1;
@@ -272,7 +280,7 @@ static void __init check_sysemu(void)
272 set_using_sysemu(!force_sysemu_disabled); 280 set_using_sysemu(!force_sysemu_disabled);
273 281
274 printk("Checking advanced syscall emulation patch for ptrace..."); 282 printk("Checking advanced syscall emulation patch for ptrace...");
275 pid = start_ptraced_child(); 283 pid = start_ptraced_child(&stack);
276 while(1){ 284 while(1){
277 count++; 285 count++;
278 if(ptrace(PTRACE_SYSEMU_SINGLESTEP, pid, 0, 0) < 0) 286 if(ptrace(PTRACE_SYSEMU_SINGLESTEP, pid, 0, 0) < 0)
@@ -297,7 +305,7 @@ static void __init check_sysemu(void)
297 break; 305 break;
298 } 306 }
299 } 307 }
300 if (stop_ptraced_child(pid, 0, 0) < 0) 308 if (stop_ptraced_child(pid, stack, 0, 0) < 0)
301 goto fail_stopped; 309 goto fail_stopped;
302 310
303 sysemu_supported = 2; 311 sysemu_supported = 2;
@@ -308,17 +316,18 @@ static void __init check_sysemu(void)
308 return; 316 return;
309 317
310fail: 318fail:
311 stop_ptraced_child(pid, 1, 0); 319 stop_ptraced_child(pid, stack, 1, 0);
312fail_stopped: 320fail_stopped:
313 printk("missing\n"); 321 printk("missing\n");
314} 322}
315 323
316void __init check_ptrace(void) 324void __init check_ptrace(void)
317{ 325{
326 void *stack;
318 int pid, syscall, n, status; 327 int pid, syscall, n, status;
319 328
320 printk("Checking that ptrace can change system call numbers..."); 329 printk("Checking that ptrace can change system call numbers...");
321 pid = start_ptraced_child(); 330 pid = start_ptraced_child(&stack);
322 331
323 if (ptrace(PTRACE_OLDSETOPTIONS, pid, 0, (void *)PTRACE_O_TRACESYSGOOD) < 0) 332 if (ptrace(PTRACE_OLDSETOPTIONS, pid, 0, (void *)PTRACE_O_TRACESYSGOOD) < 0)
324 panic("check_ptrace: PTRACE_SETOPTIONS failed, errno = %d", errno); 333 panic("check_ptrace: PTRACE_SETOPTIONS failed, errno = %d", errno);
@@ -345,7 +354,7 @@ void __init check_ptrace(void)
345 break; 354 break;
346 } 355 }
347 } 356 }
348 stop_ptraced_child(pid, 0, 1); 357 stop_ptraced_child(pid, stack, 0, 1);
349 printk("OK\n"); 358 printk("OK\n");
350 check_sysemu(); 359 check_sysemu();
351} 360}
@@ -380,10 +389,11 @@ extern void *__syscall_stub_start, __syscall_stub_end;
380static inline void check_skas3_ptrace_support(void) 389static inline void check_skas3_ptrace_support(void)
381{ 390{
382 struct ptrace_faultinfo fi; 391 struct ptrace_faultinfo fi;
392 void *stack;
383 int pid, n; 393 int pid, n;
384 394
385 printf("Checking for the skas3 patch in the host..."); 395 printf("Checking for the skas3 patch in the host...");
386 pid = start_ptraced_child(); 396 pid = start_ptraced_child(&stack);
387 397
388 n = ptrace(PTRACE_FAULTINFO, pid, 0, &fi); 398 n = ptrace(PTRACE_FAULTINFO, pid, 0, &fi);
389 if (n < 0) { 399 if (n < 0) {
@@ -402,7 +412,7 @@ static inline void check_skas3_ptrace_support(void)
402 } 412 }
403 413
404 init_registers(pid); 414 init_registers(pid);
405 stop_ptraced_child(pid, 1, 1); 415 stop_ptraced_child(pid, stack, 1, 1);
406} 416}
407 417
408int can_do_skas(void) 418int can_do_skas(void)
diff --git a/arch/um/kernel/process_kern.c b/arch/um/kernel/process_kern.c
index d4036ed680bc..c23d8a08d0ff 100644
--- a/arch/um/kernel/process_kern.c
+++ b/arch/um/kernel/process_kern.c
@@ -412,7 +412,7 @@ int __init make_proc_sysemu(void)
412 412
413 if (ent == NULL) 413 if (ent == NULL)
414 { 414 {
415 printk("Failed to register /proc/sysemu\n"); 415 printk(KERN_WARNING "Failed to register /proc/sysemu\n");
416 return(0); 416 return(0);
417 } 417 }
418 418
diff --git a/arch/um/kernel/skas/process.c b/arch/um/kernel/skas/process.c
index ba671dab8878..6dd9e5bf18ed 100644
--- a/arch/um/kernel/skas/process.c
+++ b/arch/um/kernel/skas/process.c
@@ -64,7 +64,7 @@ void wait_stub_done(int pid, int sig, char * fname)
64 (WSTOPSIG(status) == SIGVTALRM)); 64 (WSTOPSIG(status) == SIGVTALRM));
65 65
66 if((n < 0) || !WIFSTOPPED(status) || 66 if((n < 0) || !WIFSTOPPED(status) ||
67 (WSTOPSIG(status) != SIGUSR1 && WSTOPSIG(status != SIGTRAP))){ 67 (WSTOPSIG(status) != SIGUSR1 && WSTOPSIG(status) != SIGTRAP)){
68 panic("%s : failed to wait for SIGUSR1/SIGTRAP, " 68 panic("%s : failed to wait for SIGUSR1/SIGTRAP, "
69 "pid = %d, n = %d, errno = %d, status = 0x%x\n", 69 "pid = %d, n = %d, errno = %d, status = 0x%x\n",
70 fname, pid, n, errno, status); 70 fname, pid, n, errno, status);
diff --git a/arch/um/kernel/skas/trap_user.c b/arch/um/kernel/skas/trap_user.c
index 0dee1d95c806..9950a6716fe5 100644
--- a/arch/um/kernel/skas/trap_user.c
+++ b/arch/um/kernel/skas/trap_user.c
@@ -58,7 +58,6 @@ void user_signal(int sig, union uml_pt_regs *regs, int pid)
58 int segv = ((sig == SIGFPE) || (sig == SIGSEGV) || (sig == SIGBUS) || 58 int segv = ((sig == SIGFPE) || (sig == SIGSEGV) || (sig == SIGBUS) ||
59 (sig == SIGILL) || (sig == SIGTRAP)); 59 (sig == SIGILL) || (sig == SIGTRAP));
60 60
61 regs->skas.is_user = 1;
62 if (segv) 61 if (segv)
63 get_skas_faultinfo(pid, &regs->skas.faultinfo); 62 get_skas_faultinfo(pid, &regs->skas.faultinfo);
64 info = &sig_info[sig]; 63 info = &sig_info[sig];
diff --git a/arch/um/kernel/time_kern.c b/arch/um/kernel/time_kern.c
index a8b4ef601f59..4e08f7545d63 100644
--- a/arch/um/kernel/time_kern.c
+++ b/arch/um/kernel/time_kern.c
@@ -137,7 +137,10 @@ long um_stime(int __user *tptr)
137void timer_handler(int sig, union uml_pt_regs *regs) 137void timer_handler(int sig, union uml_pt_regs *regs)
138{ 138{
139 local_irq_disable(); 139 local_irq_disable();
140 update_process_times(CHOOSE_MODE(user_context(UPT_SP(regs)), (regs)->skas.is_user)); 140 irq_enter();
141 update_process_times(CHOOSE_MODE(user_context(UPT_SP(regs)),
142 (regs)->skas.is_user));
143 irq_exit();
141 local_irq_enable(); 144 local_irq_enable();
142 if(current_thread->cpu == 0) 145 if(current_thread->cpu == 0)
143 timer_irq(regs); 146 timer_irq(regs);
diff --git a/arch/um/os-Linux/elf_aux.c b/arch/um/os-Linux/elf_aux.c
index 5423b1ca17c4..9416e1c29926 100644
--- a/arch/um/os-Linux/elf_aux.c
+++ b/arch/um/os-Linux/elf_aux.c
@@ -9,9 +9,10 @@
9 */ 9 */
10#include <elf.h> 10#include <elf.h>
11#include <stddef.h> 11#include <stddef.h>
12#include <asm/elf.h>
12#include "init.h" 13#include "init.h"
13#include "elf_user.h" 14#include "elf_user.h"
14#include <asm/elf.h> 15#include "mem_user.h"
15 16
16#if ELF_CLASS == ELFCLASS32 17#if ELF_CLASS == ELFCLASS32
17typedef Elf32_auxv_t elf_auxv_t; 18typedef Elf32_auxv_t elf_auxv_t;
@@ -41,6 +42,9 @@ __init void scan_elf_aux( char **envp)
41 break; 42 break;
42 case AT_SYSINFO_EHDR: 43 case AT_SYSINFO_EHDR:
43 vsyscall_ehdr = auxv->a_un.a_val; 44 vsyscall_ehdr = auxv->a_un.a_val;
45 /* See if the page is under TASK_SIZE */
46 if (vsyscall_ehdr < (unsigned long) envp)
47 vsyscall_ehdr = 0;
44 break; 48 break;
45 case AT_HWCAP: 49 case AT_HWCAP:
46 elf_aux_hwcap = auxv->a_un.a_val; 50 elf_aux_hwcap = auxv->a_un.a_val;
diff --git a/arch/um/os-Linux/user_syms.c b/arch/um/os-Linux/user_syms.c
index 75d7af9ae1d2..56d3f870926b 100644
--- a/arch/um/os-Linux/user_syms.c
+++ b/arch/um/os-Linux/user_syms.c
@@ -83,6 +83,9 @@ EXPORT_SYMBOL_PROTO(statfs64);
83 83
84EXPORT_SYMBOL_PROTO(getuid); 84EXPORT_SYMBOL_PROTO(getuid);
85 85
86EXPORT_SYMBOL_PROTO(fsync);
87EXPORT_SYMBOL_PROTO(fdatasync);
88
86/* 89/*
87 * Overrides for Emacs so that we follow Linus's tabbing style. 90 * Overrides for Emacs so that we follow Linus's tabbing style.
88 * Emacs will notice this stuff at the end of the file and automatically 91 * Emacs will notice this stuff at the end of the file and automatically
diff --git a/arch/um/sys-i386/stub_segv.c b/arch/um/sys-i386/stub_segv.c
index b251442ad0b1..68aeabe3a654 100644
--- a/arch/um/sys-i386/stub_segv.c
+++ b/arch/um/sys-i386/stub_segv.c
@@ -21,10 +21,10 @@ stub_segv_handler(int sig)
21 __asm__("movl %0, %%eax ; int $0x80": : "g" (__NR_getpid)); 21 __asm__("movl %0, %%eax ; int $0x80": : "g" (__NR_getpid));
22 __asm__("movl %%eax, %%ebx ; movl %0, %%eax ; movl %1, %%ecx ;" 22 __asm__("movl %%eax, %%ebx ; movl %0, %%eax ; movl %1, %%ecx ;"
23 "int $0x80": : "g" (__NR_kill), "g" (SIGUSR1)); 23 "int $0x80": : "g" (__NR_kill), "g" (SIGUSR1));
24 /* Pop the frame pointer and return address since we need to leave 24 /* Load pointer to sigcontext into esp, since we need to leave
25 * the stack in its original form when we do the sigreturn here, by 25 * the stack in its original form when we do the sigreturn here, by
26 * hand. 26 * hand.
27 */ 27 */
28 __asm__("popl %%eax ; popl %%eax ; popl %%eax ; movl %0, %%eax ; " 28 __asm__("mov %0,%%esp ; movl %1, %%eax ; "
29 "int $0x80" : : "g" (__NR_sigreturn)); 29 "int $0x80" : : "a" (sc), "g" (__NR_sigreturn));
30} 30}
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
index 4b8326177c52..660a03a89e66 100644
--- a/arch/x86_64/Kconfig
+++ b/arch/x86_64/Kconfig
@@ -329,12 +329,15 @@ config HPET_EMULATE_RTC
329 329
330config GART_IOMMU 330config GART_IOMMU
331 bool "IOMMU support" 331 bool "IOMMU support"
332 default y
332 depends on PCI 333 depends on PCI
333 help 334 help
334 Support the K8 IOMMU. Needed to run systems with more than 4GB of memory 335 Support the IOMMU. Needed to run systems with more than 3GB of memory
335 properly with 32-bit PCI devices that do not support DAC (Double Address 336 properly with 32-bit PCI devices that do not support DAC (Double Address
336 Cycle). The IOMMU can be turned off at runtime with the iommu=off parameter. 337 Cycle). The IOMMU can be turned off at runtime with the iommu=off parameter.
337 Normally the kernel will take the right choice by itself. 338 Normally the kernel will take the right choice by itself.
339 This option includes a driver for the AMD Opteron/Athlon64 IOMMU
340 and a software emulation used on some other systems.
338 If unsure, say Y. 341 If unsure, say Y.
339 342
340# need this always enabled with GART_IOMMU for the VIA workaround 343# need this always enabled with GART_IOMMU for the VIA workaround
diff --git a/arch/x86_64/Makefile b/arch/x86_64/Makefile
index 428915697675..4c6ed96d5f7c 100644
--- a/arch/x86_64/Makefile
+++ b/arch/x86_64/Makefile
@@ -21,18 +21,6 @@
21# 21#
22# $Id: Makefile,v 1.31 2002/03/22 15:56:07 ak Exp $ 22# $Id: Makefile,v 1.31 2002/03/22 15:56:07 ak Exp $
23 23
24#
25# early bootup linking needs 32bit. You can either use real 32bit tools
26# here or 64bit tools in 32bit mode.
27#
28IA32_CC := $(CC) $(CPPFLAGS) -m32 -O2 -fomit-frame-pointer
29IA32_LD := $(LD) -m elf_i386
30IA32_AS := $(CC) $(AFLAGS) -m32 -Wa,--32 -traditional -c
31IA32_OBJCOPY := $(CROSS_COMPILE)objcopy
32IA32_CPP := $(CROSS_COMPILE)gcc -m32 -E
33export IA32_CC IA32_LD IA32_AS IA32_OBJCOPY IA32_CPP
34
35
36LDFLAGS := -m elf_x86_64 24LDFLAGS := -m elf_x86_64
37OBJCOPYFLAGS := -O binary -R .note -R .comment -S 25OBJCOPYFLAGS := -O binary -R .note -R .comment -S
38LDFLAGS_vmlinux := 26LDFLAGS_vmlinux :=
diff --git a/arch/x86_64/defconfig b/arch/x86_64/defconfig
index 569595b74c7c..776f3c866b70 100644
--- a/arch/x86_64/defconfig
+++ b/arch/x86_64/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc4 3# Linux kernel version: 2.6.13-rc3
4# Fri May 13 06:39:11 2005 4# Fri Jul 22 16:47:31 2005
5# 5#
6CONFIG_X86_64=y 6CONFIG_X86_64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
@@ -84,14 +84,27 @@ CONFIG_X86_IO_APIC=y
84CONFIG_X86_LOCAL_APIC=y 84CONFIG_X86_LOCAL_APIC=y
85CONFIG_MTRR=y 85CONFIG_MTRR=y
86CONFIG_SMP=y 86CONFIG_SMP=y
87# CONFIG_PREEMPT is not set
88CONFIG_SCHED_SMT=y 87CONFIG_SCHED_SMT=y
88CONFIG_PREEMPT_NONE=y
89# CONFIG_PREEMPT_VOLUNTARY is not set
90# CONFIG_PREEMPT is not set
91CONFIG_PREEMPT_BKL=y
89CONFIG_K8_NUMA=y 92CONFIG_K8_NUMA=y
90# CONFIG_NUMA_EMU is not set 93# CONFIG_NUMA_EMU is not set
91CONFIG_DISCONTIGMEM=y 94CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
92CONFIG_NUMA=y 95CONFIG_NUMA=y
96CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y
97CONFIG_ARCH_SPARSEMEM_ENABLE=y
98CONFIG_SELECT_MEMORY_MODEL=y
99# CONFIG_FLATMEM_MANUAL is not set
100CONFIG_DISCONTIGMEM_MANUAL=y
101# CONFIG_SPARSEMEM_MANUAL is not set
102CONFIG_DISCONTIGMEM=y
103CONFIG_FLAT_NODE_MEM_MAP=y
104CONFIG_NEED_MULTIPLE_NODES=y
105CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y
93CONFIG_HAVE_DEC_LOCK=y 106CONFIG_HAVE_DEC_LOCK=y
94CONFIG_NR_CPUS=8 107CONFIG_NR_CPUS=32
95CONFIG_HPET_TIMER=y 108CONFIG_HPET_TIMER=y
96CONFIG_X86_PM_TIMER=y 109CONFIG_X86_PM_TIMER=y
97CONFIG_HPET_EMULATE_RTC=y 110CONFIG_HPET_EMULATE_RTC=y
@@ -99,7 +112,13 @@ CONFIG_GART_IOMMU=y
99CONFIG_SWIOTLB=y 112CONFIG_SWIOTLB=y
100CONFIG_X86_MCE=y 113CONFIG_X86_MCE=y
101CONFIG_X86_MCE_INTEL=y 114CONFIG_X86_MCE_INTEL=y
115CONFIG_PHYSICAL_START=0x100000
116# CONFIG_KEXEC is not set
102CONFIG_SECCOMP=y 117CONFIG_SECCOMP=y
118# CONFIG_HZ_100 is not set
119CONFIG_HZ_250=y
120# CONFIG_HZ_1000 is not set
121CONFIG_HZ=250
103CONFIG_GENERIC_HARDIRQS=y 122CONFIG_GENERIC_HARDIRQS=y
104CONFIG_GENERIC_IRQ_PROBE=y 123CONFIG_GENERIC_IRQ_PROBE=y
105CONFIG_ISA_DMA_API=y 124CONFIG_ISA_DMA_API=y
@@ -118,12 +137,11 @@ CONFIG_PM_STD_PARTITION=""
118CONFIG_ACPI=y 137CONFIG_ACPI=y
119CONFIG_ACPI_BOOT=y 138CONFIG_ACPI_BOOT=y
120CONFIG_ACPI_INTERPRETER=y 139CONFIG_ACPI_INTERPRETER=y
121CONFIG_ACPI_SLEEP=y
122CONFIG_ACPI_SLEEP_PROC_FS=y
123CONFIG_ACPI_AC=y 140CONFIG_ACPI_AC=y
124CONFIG_ACPI_BATTERY=y 141CONFIG_ACPI_BATTERY=y
125CONFIG_ACPI_BUTTON=y 142CONFIG_ACPI_BUTTON=y
126# CONFIG_ACPI_VIDEO is not set 143# CONFIG_ACPI_VIDEO is not set
144CONFIG_ACPI_HOTKEY=m
127CONFIG_ACPI_FAN=y 145CONFIG_ACPI_FAN=y
128CONFIG_ACPI_PROCESSOR=y 146CONFIG_ACPI_PROCESSOR=y
129CONFIG_ACPI_THERMAL=y 147CONFIG_ACPI_THERMAL=y
@@ -154,6 +172,7 @@ CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
154# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set 172# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
155CONFIG_CPU_FREQ_GOV_USERSPACE=y 173CONFIG_CPU_FREQ_GOV_USERSPACE=y
156CONFIG_CPU_FREQ_GOV_ONDEMAND=y 174CONFIG_CPU_FREQ_GOV_ONDEMAND=y
175# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
157 176
158# 177#
159# CPUFreq processor drivers 178# CPUFreq processor drivers
@@ -204,6 +223,76 @@ CONFIG_SYSVIPC_COMPAT=y
204CONFIG_UID16=y 223CONFIG_UID16=y
205 224
206# 225#
226# Networking
227#
228CONFIG_NET=y
229
230#
231# Networking options
232#
233CONFIG_PACKET=y
234# CONFIG_PACKET_MMAP is not set
235CONFIG_UNIX=y
236# CONFIG_NET_KEY is not set
237CONFIG_INET=y
238CONFIG_IP_MULTICAST=y
239# CONFIG_IP_ADVANCED_ROUTER is not set
240CONFIG_IP_FIB_HASH=y
241# CONFIG_IP_PNP is not set
242# CONFIG_NET_IPIP is not set
243# CONFIG_NET_IPGRE is not set
244# CONFIG_IP_MROUTE is not set
245# CONFIG_ARPD is not set
246# CONFIG_SYN_COOKIES is not set
247# CONFIG_INET_AH is not set
248# CONFIG_INET_ESP is not set
249# CONFIG_INET_IPCOMP is not set
250# CONFIG_INET_TUNNEL is not set
251CONFIG_IP_TCPDIAG=y
252CONFIG_IP_TCPDIAG_IPV6=y
253# CONFIG_TCP_CONG_ADVANCED is not set
254CONFIG_TCP_CONG_BIC=y
255CONFIG_IPV6=y
256# CONFIG_IPV6_PRIVACY is not set
257# CONFIG_INET6_AH is not set
258# CONFIG_INET6_ESP is not set
259# CONFIG_INET6_IPCOMP is not set
260# CONFIG_INET6_TUNNEL is not set
261# CONFIG_IPV6_TUNNEL is not set
262# CONFIG_NETFILTER is not set
263
264#
265# SCTP Configuration (EXPERIMENTAL)
266#
267# CONFIG_IP_SCTP is not set
268# CONFIG_ATM is not set
269# CONFIG_BRIDGE is not set
270# CONFIG_VLAN_8021Q is not set
271# CONFIG_DECNET is not set
272# CONFIG_LLC2 is not set
273# CONFIG_IPX is not set
274# CONFIG_ATALK is not set
275# CONFIG_X25 is not set
276# CONFIG_LAPB is not set
277# CONFIG_NET_DIVERT is not set
278# CONFIG_ECONET is not set
279# CONFIG_WAN_ROUTER is not set
280# CONFIG_NET_SCHED is not set
281# CONFIG_NET_CLS_ROUTE is not set
282
283#
284# Network testing
285#
286# CONFIG_NET_PKTGEN is not set
287CONFIG_NETPOLL=y
288# CONFIG_NETPOLL_RX is not set
289# CONFIG_NETPOLL_TRAP is not set
290CONFIG_NET_POLL_CONTROLLER=y
291# CONFIG_HAMRADIO is not set
292# CONFIG_IRDA is not set
293# CONFIG_BT is not set
294
295#
207# Device Drivers 296# Device Drivers
208# 297#
209 298
@@ -308,6 +397,7 @@ CONFIG_BLK_DEV_AMD74XX=y
308# CONFIG_BLK_DEV_HPT366 is not set 397# CONFIG_BLK_DEV_HPT366 is not set
309# CONFIG_BLK_DEV_SC1200 is not set 398# CONFIG_BLK_DEV_SC1200 is not set
310CONFIG_BLK_DEV_PIIX=y 399CONFIG_BLK_DEV_PIIX=y
400# CONFIG_BLK_DEV_IT821X is not set
311# CONFIG_BLK_DEV_NS87415 is not set 401# CONFIG_BLK_DEV_NS87415 is not set
312# CONFIG_BLK_DEV_PDC202XX_OLD is not set 402# CONFIG_BLK_DEV_PDC202XX_OLD is not set
313CONFIG_BLK_DEV_PDC202XX_NEW=y 403CONFIG_BLK_DEV_PDC202XX_NEW=y
@@ -338,6 +428,7 @@ CONFIG_BLK_DEV_SD=y
338# CONFIG_CHR_DEV_OSST is not set 428# CONFIG_CHR_DEV_OSST is not set
339# CONFIG_BLK_DEV_SR is not set 429# CONFIG_BLK_DEV_SR is not set
340# CONFIG_CHR_DEV_SG is not set 430# CONFIG_CHR_DEV_SG is not set
431# CONFIG_CHR_DEV_SCH is not set
341 432
342# 433#
343# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 434# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
@@ -372,7 +463,6 @@ CONFIG_AIC79XX_DEBUG_MASK=0
372# CONFIG_MEGARAID_NEWGEN is not set 463# CONFIG_MEGARAID_NEWGEN is not set
373# CONFIG_MEGARAID_LEGACY is not set 464# CONFIG_MEGARAID_LEGACY is not set
374CONFIG_SCSI_SATA=y 465CONFIG_SCSI_SATA=y
375# CONFIG_SCSI_SATA_AHCI is not set
376# CONFIG_SCSI_SATA_SVW is not set 466# CONFIG_SCSI_SATA_SVW is not set
377CONFIG_SCSI_ATA_PIIX=y 467CONFIG_SCSI_ATA_PIIX=y
378# CONFIG_SCSI_SATA_NV is not set 468# CONFIG_SCSI_SATA_NV is not set
@@ -410,14 +500,21 @@ CONFIG_SCSI_QLA2XXX=y
410# 500#
411# Multi-device support (RAID and LVM) 501# Multi-device support (RAID and LVM)
412# 502#
413# CONFIG_MD is not set 503CONFIG_MD=y
504# CONFIG_BLK_DEV_MD is not set
505CONFIG_BLK_DEV_DM=y
506# CONFIG_DM_CRYPT is not set
507# CONFIG_DM_SNAPSHOT is not set
508# CONFIG_DM_MIRROR is not set
509# CONFIG_DM_ZERO is not set
510# CONFIG_DM_MULTIPATH is not set
414 511
415# 512#
416# Fusion MPT device support 513# Fusion MPT device support
417# 514#
418CONFIG_FUSION=y 515# CONFIG_FUSION is not set
419CONFIG_FUSION_MAX_SGE=40 516# CONFIG_FUSION_SPI is not set
420# CONFIG_FUSION_CTL is not set 517# CONFIG_FUSION_FC is not set
421 518
422# 519#
423# IEEE 1394 (FireWire) support 520# IEEE 1394 (FireWire) support
@@ -430,75 +527,8 @@ CONFIG_FUSION_MAX_SGE=40
430# CONFIG_I2O is not set 527# CONFIG_I2O is not set
431 528
432# 529#
433# Networking support 530# Network device support
434#
435CONFIG_NET=y
436
437#
438# Networking options
439#
440CONFIG_PACKET=y
441# CONFIG_PACKET_MMAP is not set
442CONFIG_UNIX=y
443# CONFIG_NET_KEY is not set
444CONFIG_INET=y
445CONFIG_IP_MULTICAST=y
446# CONFIG_IP_ADVANCED_ROUTER is not set
447# CONFIG_IP_PNP is not set
448# CONFIG_NET_IPIP is not set
449# CONFIG_NET_IPGRE is not set
450# CONFIG_IP_MROUTE is not set
451# CONFIG_ARPD is not set
452# CONFIG_SYN_COOKIES is not set
453# CONFIG_INET_AH is not set
454# CONFIG_INET_ESP is not set
455# CONFIG_INET_IPCOMP is not set
456# CONFIG_INET_TUNNEL is not set
457CONFIG_IP_TCPDIAG=y
458CONFIG_IP_TCPDIAG_IPV6=y
459CONFIG_IPV6=y
460# CONFIG_IPV6_PRIVACY is not set
461# CONFIG_INET6_AH is not set
462# CONFIG_INET6_ESP is not set
463# CONFIG_INET6_IPCOMP is not set
464# CONFIG_INET6_TUNNEL is not set
465# CONFIG_IPV6_TUNNEL is not set
466# CONFIG_NETFILTER is not set
467
468#
469# SCTP Configuration (EXPERIMENTAL)
470# 531#
471# CONFIG_IP_SCTP is not set
472# CONFIG_ATM is not set
473# CONFIG_BRIDGE is not set
474# CONFIG_VLAN_8021Q is not set
475# CONFIG_DECNET is not set
476# CONFIG_LLC2 is not set
477# CONFIG_IPX is not set
478# CONFIG_ATALK is not set
479# CONFIG_X25 is not set
480# CONFIG_LAPB is not set
481# CONFIG_NET_DIVERT is not set
482# CONFIG_ECONET is not set
483# CONFIG_WAN_ROUTER is not set
484
485#
486# QoS and/or fair queueing
487#
488# CONFIG_NET_SCHED is not set
489# CONFIG_NET_CLS_ROUTE is not set
490
491#
492# Network testing
493#
494# CONFIG_NET_PKTGEN is not set
495CONFIG_NETPOLL=y
496# CONFIG_NETPOLL_RX is not set
497# CONFIG_NETPOLL_TRAP is not set
498CONFIG_NET_POLL_CONTROLLER=y
499# CONFIG_HAMRADIO is not set
500# CONFIG_IRDA is not set
501# CONFIG_BT is not set
502CONFIG_NETDEVICES=y 532CONFIG_NETDEVICES=y
503# CONFIG_DUMMY is not set 533# CONFIG_DUMMY is not set
504# CONFIG_BONDING is not set 534# CONFIG_BONDING is not set
@@ -517,7 +547,9 @@ CONFIG_NET_ETHERNET=y
517CONFIG_MII=y 547CONFIG_MII=y
518# CONFIG_HAPPYMEAL is not set 548# CONFIG_HAPPYMEAL is not set
519# CONFIG_SUNGEM is not set 549# CONFIG_SUNGEM is not set
520# CONFIG_NET_VENDOR_3COM is not set 550CONFIG_NET_VENDOR_3COM=y
551CONFIG_VORTEX=y
552# CONFIG_TYPHOON is not set
521 553
522# 554#
523# Tulip family network device support 555# Tulip family network device support
@@ -532,7 +564,7 @@ CONFIG_NET_PCI=y
532CONFIG_FORCEDETH=y 564CONFIG_FORCEDETH=y
533# CONFIG_DGRS is not set 565# CONFIG_DGRS is not set
534# CONFIG_EEPRO100 is not set 566# CONFIG_EEPRO100 is not set
535# CONFIG_E100 is not set 567CONFIG_E100=y
536# CONFIG_FEALNX is not set 568# CONFIG_FEALNX is not set
537# CONFIG_NATSEMI is not set 569# CONFIG_NATSEMI is not set
538# CONFIG_NE2K_PCI is not set 570# CONFIG_NE2K_PCI is not set
@@ -553,14 +585,15 @@ CONFIG_8139TOO=y
553# CONFIG_ACENIC is not set 585# CONFIG_ACENIC is not set
554# CONFIG_DL2K is not set 586# CONFIG_DL2K is not set
555CONFIG_E1000=y 587CONFIG_E1000=y
556# CONFIG_E1000_NAPI is not set
557# CONFIG_NS83820 is not set 588# CONFIG_NS83820 is not set
558# CONFIG_HAMACHI is not set 589# CONFIG_HAMACHI is not set
559# CONFIG_YELLOWFIN is not set 590# CONFIG_YELLOWFIN is not set
560# CONFIG_R8169 is not set 591# CONFIG_R8169 is not set
592# CONFIG_SKGE is not set
561# CONFIG_SK98LIN is not set 593# CONFIG_SK98LIN is not set
562# CONFIG_VIA_VELOCITY is not set 594# CONFIG_VIA_VELOCITY is not set
563CONFIG_TIGON3=y 595CONFIG_TIGON3=y
596# CONFIG_BNX2 is not set
564 597
565# 598#
566# Ethernet (10000 Mbit) 599# Ethernet (10000 Mbit)
@@ -647,7 +680,6 @@ CONFIG_SERIO_I8042=y
647CONFIG_SERIO_LIBPS2=y 680CONFIG_SERIO_LIBPS2=y
648# CONFIG_SERIO_RAW is not set 681# CONFIG_SERIO_RAW is not set
649# CONFIG_GAMEPORT is not set 682# CONFIG_GAMEPORT is not set
650CONFIG_SOUND_GAMEPORT=y
651 683
652# 684#
653# Character devices 685# Character devices
@@ -716,6 +748,7 @@ CONFIG_MAX_RAW_DEVS=256
716# I2C support 748# I2C support
717# 749#
718# CONFIG_I2C is not set 750# CONFIG_I2C is not set
751# CONFIG_I2C_SENSOR is not set
719 752
720# 753#
721# Dallas's 1-wire bus 754# Dallas's 1-wire bus
@@ -723,6 +756,12 @@ CONFIG_MAX_RAW_DEVS=256
723# CONFIG_W1 is not set 756# CONFIG_W1 is not set
724 757
725# 758#
759# Hardware Monitoring support
760#
761CONFIG_HWMON=y
762# CONFIG_HWMON_DEBUG_CHIP is not set
763
764#
726# Misc devices 765# Misc devices
727# 766#
728# CONFIG_IBM_ASM is not set 767# CONFIG_IBM_ASM is not set
@@ -808,6 +847,7 @@ CONFIG_USB_DEVICEFS=y
808CONFIG_USB_EHCI_HCD=y 847CONFIG_USB_EHCI_HCD=y
809# CONFIG_USB_EHCI_SPLIT_ISO is not set 848# CONFIG_USB_EHCI_SPLIT_ISO is not set
810# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 849# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
850# CONFIG_USB_ISP116X_HCD is not set
811CONFIG_USB_OHCI_HCD=y 851CONFIG_USB_OHCI_HCD=y
812# CONFIG_USB_OHCI_BIG_ENDIAN is not set 852# CONFIG_USB_OHCI_BIG_ENDIAN is not set
813CONFIG_USB_OHCI_LITTLE_ENDIAN=y 853CONFIG_USB_OHCI_LITTLE_ENDIAN=y
@@ -846,12 +886,15 @@ CONFIG_USB_HIDINPUT=y
846# CONFIG_USB_HIDDEV is not set 886# CONFIG_USB_HIDDEV is not set
847# CONFIG_USB_AIPTEK is not set 887# CONFIG_USB_AIPTEK is not set
848# CONFIG_USB_WACOM is not set 888# CONFIG_USB_WACOM is not set
889# CONFIG_USB_ACECAD is not set
849# CONFIG_USB_KBTAB is not set 890# CONFIG_USB_KBTAB is not set
850# CONFIG_USB_POWERMATE is not set 891# CONFIG_USB_POWERMATE is not set
851# CONFIG_USB_MTOUCH is not set 892# CONFIG_USB_MTOUCH is not set
893# CONFIG_USB_ITMTOUCH is not set
852# CONFIG_USB_EGALAX is not set 894# CONFIG_USB_EGALAX is not set
853# CONFIG_USB_XPAD is not set 895# CONFIG_USB_XPAD is not set
854# CONFIG_USB_ATI_REMOTE is not set 896# CONFIG_USB_ATI_REMOTE is not set
897# CONFIG_USB_KEYSPAN_REMOTE is not set
855 898
856# 899#
857# USB Imaging devices 900# USB Imaging devices
@@ -902,10 +945,11 @@ CONFIG_USB_MON=y
902# CONFIG_USB_PHIDGETSERVO is not set 945# CONFIG_USB_PHIDGETSERVO is not set
903# CONFIG_USB_IDMOUSE is not set 946# CONFIG_USB_IDMOUSE is not set
904# CONFIG_USB_SISUSBVGA is not set 947# CONFIG_USB_SISUSBVGA is not set
948# CONFIG_USB_LD is not set
905# CONFIG_USB_TEST is not set 949# CONFIG_USB_TEST is not set
906 950
907# 951#
908# USB ATM/DSL drivers 952# USB DSL modem support
909# 953#
910 954
911# 955#
@@ -924,6 +968,10 @@ CONFIG_USB_MON=y
924# CONFIG_INFINIBAND is not set 968# CONFIG_INFINIBAND is not set
925 969
926# 970#
971# SN Devices
972#
973
974#
927# Firmware Drivers 975# Firmware Drivers
928# 976#
929# CONFIG_EDD is not set 977# CONFIG_EDD is not set
@@ -935,6 +983,7 @@ CONFIG_EXT2_FS=y
935CONFIG_EXT2_FS_XATTR=y 983CONFIG_EXT2_FS_XATTR=y
936CONFIG_EXT2_FS_POSIX_ACL=y 984CONFIG_EXT2_FS_POSIX_ACL=y
937# CONFIG_EXT2_FS_SECURITY is not set 985# CONFIG_EXT2_FS_SECURITY is not set
986# CONFIG_EXT2_FS_XIP is not set
938CONFIG_EXT3_FS=y 987CONFIG_EXT3_FS=y
939CONFIG_EXT3_FS_XATTR=y 988CONFIG_EXT3_FS_XATTR=y
940CONFIG_EXT3_FS_POSIX_ACL=y 989CONFIG_EXT3_FS_POSIX_ACL=y
@@ -957,6 +1006,7 @@ CONFIG_FS_POSIX_ACL=y
957# CONFIG_XFS_FS is not set 1006# CONFIG_XFS_FS is not set
958# CONFIG_MINIX_FS is not set 1007# CONFIG_MINIX_FS is not set
959# CONFIG_ROMFS_FS is not set 1008# CONFIG_ROMFS_FS is not set
1009CONFIG_INOTIFY=y
960# CONFIG_QUOTA is not set 1010# CONFIG_QUOTA is not set
961CONFIG_DNOTIFY=y 1011CONFIG_DNOTIFY=y
962CONFIG_AUTOFS_FS=y 1012CONFIG_AUTOFS_FS=y
@@ -986,7 +1036,6 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
986CONFIG_PROC_FS=y 1036CONFIG_PROC_FS=y
987CONFIG_PROC_KCORE=y 1037CONFIG_PROC_KCORE=y
988CONFIG_SYSFS=y 1038CONFIG_SYSFS=y
989# CONFIG_DEVFS_FS is not set
990# CONFIG_DEVPTS_FS_XATTR is not set 1039# CONFIG_DEVPTS_FS_XATTR is not set
991CONFIG_TMPFS=y 1040CONFIG_TMPFS=y
992# CONFIG_TMPFS_XATTR is not set 1041# CONFIG_TMPFS_XATTR is not set
@@ -1016,15 +1065,18 @@ CONFIG_RAMFS=y
1016# 1065#
1017CONFIG_NFS_FS=y 1066CONFIG_NFS_FS=y
1018CONFIG_NFS_V3=y 1067CONFIG_NFS_V3=y
1068# CONFIG_NFS_V3_ACL is not set
1019# CONFIG_NFS_V4 is not set 1069# CONFIG_NFS_V4 is not set
1020# CONFIG_NFS_DIRECTIO is not set 1070# CONFIG_NFS_DIRECTIO is not set
1021CONFIG_NFSD=y 1071CONFIG_NFSD=y
1022CONFIG_NFSD_V3=y 1072CONFIG_NFSD_V3=y
1073# CONFIG_NFSD_V3_ACL is not set
1023# CONFIG_NFSD_V4 is not set 1074# CONFIG_NFSD_V4 is not set
1024CONFIG_NFSD_TCP=y 1075CONFIG_NFSD_TCP=y
1025CONFIG_LOCKD=y 1076CONFIG_LOCKD=y
1026CONFIG_LOCKD_V4=y 1077CONFIG_LOCKD_V4=y
1027CONFIG_EXPORTFS=y 1078CONFIG_EXPORTFS=y
1079CONFIG_NFS_COMMON=y
1028CONFIG_SUNRPC=y 1080CONFIG_SUNRPC=y
1029# CONFIG_RPCSEC_GSS_KRB5 is not set 1081# CONFIG_RPCSEC_GSS_KRB5 is not set
1030# CONFIG_RPCSEC_GSS_SPKM3 is not set 1082# CONFIG_RPCSEC_GSS_SPKM3 is not set
diff --git a/arch/x86_64/ia32/Makefile b/arch/x86_64/ia32/Makefile
index a12b19da4b59..f76217d8f579 100644
--- a/arch/x86_64/ia32/Makefile
+++ b/arch/x86_64/ia32/Makefile
@@ -4,14 +4,14 @@
4 4
5obj-$(CONFIG_IA32_EMULATION) := ia32entry.o sys_ia32.o ia32_ioctl.o \ 5obj-$(CONFIG_IA32_EMULATION) := ia32entry.o sys_ia32.o ia32_ioctl.o \
6 ia32_signal.o tls32.o \ 6 ia32_signal.o tls32.o \
7 ia32_binfmt.o fpu32.o ptrace32.o syscall32.o 7 ia32_binfmt.o fpu32.o ptrace32.o syscall32.o syscall32_syscall.o
8 8
9sysv-$(CONFIG_SYSVIPC) := ipc32.o 9sysv-$(CONFIG_SYSVIPC) := ipc32.o
10obj-$(CONFIG_IA32_EMULATION) += $(sysv-y) 10obj-$(CONFIG_IA32_EMULATION) += $(sysv-y)
11 11
12obj-$(CONFIG_IA32_AOUT) += ia32_aout.o 12obj-$(CONFIG_IA32_AOUT) += ia32_aout.o
13 13
14$(obj)/syscall32.o: $(src)/syscall32.c \ 14$(obj)/syscall32_syscall.o: \
15 $(foreach F,sysenter syscall,$(obj)/vsyscall-$F.so) 15 $(foreach F,sysenter syscall,$(obj)/vsyscall-$F.so)
16 16
17# Teach kbuild about targets 17# Teach kbuild about targets
diff --git a/arch/x86_64/ia32/syscall32.c b/arch/x86_64/ia32/syscall32.c
index 816a3b89f13d..adbc5f8089e9 100644
--- a/arch/x86_64/ia32/syscall32.c
+++ b/arch/x86_64/ia32/syscall32.c
@@ -14,16 +14,6 @@
14#include <asm/tlbflush.h> 14#include <asm/tlbflush.h>
15#include <asm/ia32_unistd.h> 15#include <asm/ia32_unistd.h>
16 16
17/* 32bit VDSOs mapped into user space. */
18asm(".section \".init.data\",\"aw\"\n"
19 "syscall32_syscall:\n"
20 ".incbin \"arch/x86_64/ia32/vsyscall-syscall.so\"\n"
21 "syscall32_syscall_end:\n"
22 "syscall32_sysenter:\n"
23 ".incbin \"arch/x86_64/ia32/vsyscall-sysenter.so\"\n"
24 "syscall32_sysenter_end:\n"
25 ".previous");
26
27extern unsigned char syscall32_syscall[], syscall32_syscall_end[]; 17extern unsigned char syscall32_syscall[], syscall32_syscall_end[];
28extern unsigned char syscall32_sysenter[], syscall32_sysenter_end[]; 18extern unsigned char syscall32_sysenter[], syscall32_sysenter_end[];
29extern int sysctl_vsyscall32; 19extern int sysctl_vsyscall32;
diff --git a/arch/x86_64/ia32/syscall32_syscall.S b/arch/x86_64/ia32/syscall32_syscall.S
new file mode 100644
index 000000000000..8f8271bdf135
--- /dev/null
+++ b/arch/x86_64/ia32/syscall32_syscall.S
@@ -0,0 +1,17 @@
1/* 32bit VDSOs mapped into user space. */
2
3 .section ".init.data","aw"
4
5 .globl syscall32_syscall
6 .globl syscall32_syscall_end
7
8syscall32_syscall:
9 .incbin "arch/x86_64/ia32/vsyscall-syscall.so"
10syscall32_syscall_end:
11
12 .globl syscall32_sysenter
13 .globl syscall32_sysenter_end
14
15syscall32_sysenter:
16 .incbin "arch/x86_64/ia32/vsyscall-sysenter.so"
17syscall32_sysenter_end:
diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S
index 28817490fdc6..096d470e280f 100644
--- a/arch/x86_64/kernel/entry.S
+++ b/arch/x86_64/kernel/entry.S
@@ -76,7 +76,7 @@
76 76
77 .macro FAKE_STACK_FRAME child_rip 77 .macro FAKE_STACK_FRAME child_rip
78 /* push in order ss, rsp, eflags, cs, rip */ 78 /* push in order ss, rsp, eflags, cs, rip */
79 xorq %rax, %rax 79 xorl %eax, %eax
80 pushq %rax /* ss */ 80 pushq %rax /* ss */
81 CFI_ADJUST_CFA_OFFSET 8 81 CFI_ADJUST_CFA_OFFSET 8
82 pushq %rax /* rsp */ 82 pushq %rax /* rsp */
@@ -423,7 +423,7 @@ ENTRY(stub_rt_sigreturn)
423 testl $3,CS(%rdi) 423 testl $3,CS(%rdi)
424 je 1f 424 je 1f
425 swapgs 425 swapgs
4261: addl $1,%gs:pda_irqcount # RED-PEN should check preempt count 4261: incl %gs:pda_irqcount # RED-PEN should check preempt count
427 movq %gs:pda_irqstackptr,%rax 427 movq %gs:pda_irqstackptr,%rax
428 cmoveq %rax,%rsp 428 cmoveq %rax,%rsp
429 pushq %rdi # save old stack 429 pushq %rdi # save old stack
@@ -436,7 +436,7 @@ ENTRY(common_interrupt)
436ret_from_intr: 436ret_from_intr:
437 popq %rdi 437 popq %rdi
438 cli 438 cli
439 subl $1,%gs:pda_irqcount 439 decl %gs:pda_irqcount
440#ifdef CONFIG_DEBUG_INFO 440#ifdef CONFIG_DEBUG_INFO
441 movq RBP(%rdi),%rbp 441 movq RBP(%rdi),%rbp
442#endif 442#endif
@@ -494,7 +494,7 @@ retint_signal:
494 sti 494 sti
495 SAVE_REST 495 SAVE_REST
496 movq $-1,ORIG_RAX(%rsp) 496 movq $-1,ORIG_RAX(%rsp)
497 xorq %rsi,%rsi # oldset 497 xorl %esi,%esi # oldset
498 movq %rsp,%rdi # &pt_regs 498 movq %rsp,%rdi # &pt_regs
499 call do_notify_resume 499 call do_notify_resume
500 RESTORE_REST 500 RESTORE_REST
@@ -752,7 +752,7 @@ child_rip:
752 movq %rsi, %rdi 752 movq %rsi, %rdi
753 call *%rax 753 call *%rax
754 # exit 754 # exit
755 xorq %rdi, %rdi 755 xorl %edi, %edi
756 call do_exit 756 call do_exit
757 757
758/* 758/*
@@ -918,3 +918,15 @@ ENTRY(machine_check)
918ENTRY(call_debug) 918ENTRY(call_debug)
919 zeroentry do_call_debug 919 zeroentry do_call_debug
920 920
921ENTRY(call_softirq)
922 movq %gs:pda_irqstackptr,%rax
923 pushq %r15
924 movq %rsp,%r15
925 incl %gs:pda_irqcount
926 cmove %rax,%rsp
927 call __do_softirq
928 movq %r15,%rsp
929 decl %gs:pda_irqcount
930 popq %r15
931 ret
932
diff --git a/arch/x86_64/kernel/genapic.c b/arch/x86_64/kernel/genapic.c
index 69b9c25a8fc4..30c843a5efdd 100644
--- a/arch/x86_64/kernel/genapic.c
+++ b/arch/x86_64/kernel/genapic.c
@@ -31,6 +31,7 @@ u8 x86_cpu_to_log_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID };
31 31
32extern struct genapic apic_cluster; 32extern struct genapic apic_cluster;
33extern struct genapic apic_flat; 33extern struct genapic apic_flat;
34extern struct genapic apic_physflat;
34 35
35struct genapic *genapic = &apic_flat; 36struct genapic *genapic = &apic_flat;
36 37
@@ -44,12 +45,7 @@ void __init clustered_apic_check(void)
44 u8 clusters, max_cluster; 45 u8 clusters, max_cluster;
45 u8 id; 46 u8 id;
46 u8 cluster_cnt[NUM_APIC_CLUSTERS]; 47 u8 cluster_cnt[NUM_APIC_CLUSTERS];
47 48 int num_cpus = 0;
48 if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) {
49 /* AMD always uses flat mode right now */
50 genapic = &apic_flat;
51 goto print;
52 }
53 49
54#if defined(CONFIG_ACPI_BUS) 50#if defined(CONFIG_ACPI_BUS)
55 /* 51 /*
@@ -64,15 +60,34 @@ void __init clustered_apic_check(void)
64#endif 60#endif
65 61
66 memset(cluster_cnt, 0, sizeof(cluster_cnt)); 62 memset(cluster_cnt, 0, sizeof(cluster_cnt));
67
68 for (i = 0; i < NR_CPUS; i++) { 63 for (i = 0; i < NR_CPUS; i++) {
69 id = bios_cpu_apicid[i]; 64 id = bios_cpu_apicid[i];
70 if (id != BAD_APICID) 65 if (id == BAD_APICID)
71 cluster_cnt[APIC_CLUSTERID(id)]++; 66 continue;
67 num_cpus++;
68 cluster_cnt[APIC_CLUSTERID(id)]++;
72 } 69 }
73 70
71 /* Don't use clustered mode on AMD platforms. */
72 if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) {
73 genapic = &apic_physflat;
74#ifndef CONFIG_CPU_HOTPLUG
75 /* In the CPU hotplug case we cannot use broadcast mode
76 because that opens a race when a CPU is removed.
77 Stay at physflat mode in this case.
78 It is bad to do this unconditionally though. Once
79 we have ACPI platform support for CPU hotplug
80 we should detect hotplug capablity from ACPI tables and
81 only do this when really needed. -AK */
82 if (num_cpus <= 8)
83 genapic = &apic_flat;
84#endif
85 goto print;
86 }
87
74 clusters = 0; 88 clusters = 0;
75 max_cluster = 0; 89 max_cluster = 0;
90
76 for (i = 0; i < NUM_APIC_CLUSTERS; i++) { 91 for (i = 0; i < NUM_APIC_CLUSTERS; i++) {
77 if (cluster_cnt[i] > 0) { 92 if (cluster_cnt[i] > 0) {
78 ++clusters; 93 ++clusters;
diff --git a/arch/x86_64/kernel/genapic_flat.c b/arch/x86_64/kernel/genapic_flat.c
index 282846965080..adc96282a9e2 100644
--- a/arch/x86_64/kernel/genapic_flat.c
+++ b/arch/x86_64/kernel/genapic_flat.c
@@ -2,13 +2,11 @@
2 * Copyright 2004 James Cleverdon, IBM. 2 * Copyright 2004 James Cleverdon, IBM.
3 * Subject to the GNU Public License, v.2 3 * Subject to the GNU Public License, v.2
4 * 4 *
5 * Flat APIC subarch code. Maximum 8 CPUs, logical delivery. 5 * Flat APIC subarch code.
6 * 6 *
7 * Hacked for x86-64 by James Cleverdon from i386 architecture code by 7 * Hacked for x86-64 by James Cleverdon from i386 architecture code by
8 * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and 8 * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
9 * James Cleverdon. 9 * James Cleverdon.
10 * Ashok Raj <ashok.raj@intel.com>
11 * Removed IPI broadcast shortcut to support CPU hotplug
12 */ 10 */
13#include <linux/config.h> 11#include <linux/config.h>
14#include <linux/threads.h> 12#include <linux/threads.h>
@@ -20,47 +18,6 @@
20#include <asm/smp.h> 18#include <asm/smp.h>
21#include <asm/ipi.h> 19#include <asm/ipi.h>
22 20
23/*
24 * The following permit choosing broadcast IPI shortcut v.s sending IPI only
25 * to online cpus via the send_IPI_mask varient.
26 * The mask version is my preferred option, since it eliminates a lot of
27 * other extra code that would need to be written to cleanup intrs sent
28 * to a CPU while offline.
29 *
30 * Sending broadcast introduces lots of trouble in CPU hotplug situations.
31 * These IPI's are delivered to cpu's irrespective of their offline status
32 * and could pickup stale intr data when these CPUS are turned online.
33 *
34 * Not using broadcast is a cleaner approach IMO, but Andi Kleen disagrees with
35 * the idea of not using broadcast IPI's anymore. Hence the run time check
36 * is introduced, on his request so we can choose an alternate mechanism.
37 *
38 * Initial wacky performance tests that collect cycle counts show
39 * no increase in using mask v.s broadcast version. In fact they seem
40 * identical in terms of cycle counts.
41 *
42 * if we need to use broadcast, we need to do the following.
43 *
44 * cli;
45 * hold call_lock;
46 * clear any pending IPI, just ack and clear all pending intr
47 * set cpu_online_map;
48 * release call_lock;
49 * sti;
50 *
51 * The complicated dummy irq processing shown above is not required if
52 * we didnt sent IPI's to wrong CPU's in the first place.
53 *
54 * - Ashok Raj <ashok.raj@intel.com>
55 */
56#ifdef CONFIG_HOTPLUG_CPU
57#define DEFAULT_SEND_IPI (1)
58#else
59#define DEFAULT_SEND_IPI (0)
60#endif
61
62static int no_broadcast=DEFAULT_SEND_IPI;
63
64static cpumask_t flat_target_cpus(void) 21static cpumask_t flat_target_cpus(void)
65{ 22{
66 return cpu_online_map; 23 return cpu_online_map;
@@ -119,37 +76,15 @@ static void flat_send_IPI_mask(cpumask_t cpumask, int vector)
119 local_irq_restore(flags); 76 local_irq_restore(flags);
120} 77}
121 78
122static inline void __local_flat_send_IPI_allbutself(int vector)
123{
124 if (no_broadcast) {
125 cpumask_t mask = cpu_online_map;
126 int this_cpu = get_cpu();
127
128 cpu_clear(this_cpu, mask);
129 flat_send_IPI_mask(mask, vector);
130 put_cpu();
131 }
132 else
133 __send_IPI_shortcut(APIC_DEST_ALLBUT, vector, APIC_DEST_LOGICAL);
134}
135
136static inline void __local_flat_send_IPI_all(int vector)
137{
138 if (no_broadcast)
139 flat_send_IPI_mask(cpu_online_map, vector);
140 else
141 __send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL);
142}
143
144static void flat_send_IPI_allbutself(int vector) 79static void flat_send_IPI_allbutself(int vector)
145{ 80{
146 if (((num_online_cpus()) - 1) >= 1) 81 if (((num_online_cpus()) - 1) >= 1)
147 __local_flat_send_IPI_allbutself(vector); 82 __send_IPI_shortcut(APIC_DEST_ALLBUT, vector,APIC_DEST_LOGICAL);
148} 83}
149 84
150static void flat_send_IPI_all(int vector) 85static void flat_send_IPI_all(int vector)
151{ 86{
152 __local_flat_send_IPI_all(vector); 87 __send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL);
153} 88}
154 89
155static int flat_apic_id_registered(void) 90static int flat_apic_id_registered(void)
@@ -170,16 +105,6 @@ static unsigned int phys_pkg_id(int index_msb)
170 return ((ebx >> 24) & 0xFF) >> index_msb; 105 return ((ebx >> 24) & 0xFF) >> index_msb;
171} 106}
172 107
173static __init int no_ipi_broadcast(char *str)
174{
175 get_option(&str, &no_broadcast);
176 printk ("Using %s mode\n", no_broadcast ? "No IPI Broadcast" :
177 "IPI Broadcast");
178 return 1;
179}
180
181__setup("no_ipi_broadcast", no_ipi_broadcast);
182
183struct genapic apic_flat = { 108struct genapic apic_flat = {
184 .name = "flat", 109 .name = "flat",
185 .int_delivery_mode = dest_LowestPrio, 110 .int_delivery_mode = dest_LowestPrio,
@@ -195,11 +120,62 @@ struct genapic apic_flat = {
195 .phys_pkg_id = phys_pkg_id, 120 .phys_pkg_id = phys_pkg_id,
196}; 121};
197 122
198static int __init print_ipi_mode(void) 123/*
124 * Physflat mode is used when there are more than 8 CPUs on a AMD system.
125 * We cannot use logical delivery in this case because the mask
126 * overflows, so use physical mode.
127 */
128
129static cpumask_t physflat_target_cpus(void)
130{
131 return cpumask_of_cpu(0);
132}
133
134static void physflat_send_IPI_mask(cpumask_t cpumask, int vector)
135{
136 send_IPI_mask_sequence(cpumask, vector);
137}
138
139static void physflat_send_IPI_allbutself(int vector)
140{
141 cpumask_t allbutme = cpu_online_map;
142 int me = get_cpu();
143 cpu_clear(me, allbutme);
144 physflat_send_IPI_mask(allbutme, vector);
145 put_cpu();
146}
147
148static void physflat_send_IPI_all(int vector)
199{ 149{
200 printk ("Using IPI %s mode\n", no_broadcast ? "No-Shortcut" : 150 physflat_send_IPI_mask(cpu_online_map, vector);
201 "Shortcut");
202 return 0;
203} 151}
204 152
205late_initcall(print_ipi_mode); 153static unsigned int physflat_cpu_mask_to_apicid(cpumask_t cpumask)
154{
155 int cpu;
156
157 /*
158 * We're using fixed IRQ delivery, can only return one phys APIC ID.
159 * May as well be the first.
160 */
161 cpu = first_cpu(cpumask);
162 if ((unsigned)cpu < NR_CPUS)
163 return x86_cpu_to_apicid[cpu];
164 else
165 return BAD_APICID;
166}
167
168struct genapic apic_physflat = {
169 .name = "physical flat",
170 .int_delivery_mode = dest_LowestPrio,
171 .int_dest_mode = (APIC_DEST_PHYSICAL != 0),
172 .int_delivery_dest = APIC_DEST_PHYSICAL | APIC_DM_LOWEST,
173 .target_cpus = physflat_target_cpus,
174 .apic_id_registered = flat_apic_id_registered,
175 .init_apic_ldr = flat_init_apic_ldr,/*not needed, but shouldn't hurt*/
176 .send_IPI_all = physflat_send_IPI_all,
177 .send_IPI_allbutself = physflat_send_IPI_allbutself,
178 .send_IPI_mask = physflat_send_IPI_mask,
179 .cpu_mask_to_apicid = physflat_cpu_mask_to_apicid,
180 .phys_pkg_id = phys_pkg_id,
181};
diff --git a/arch/x86_64/kernel/head.S b/arch/x86_64/kernel/head.S
index 8d765aa77a26..98ff5eb32b9a 100644
--- a/arch/x86_64/kernel/head.S
+++ b/arch/x86_64/kernel/head.S
@@ -137,14 +137,14 @@ startup_64:
137 wrmsr 137 wrmsr
138 138
139 /* Setup cr0 */ 139 /* Setup cr0 */
140 xorq %rax, %rax 140#define CR0_PM 1 /* protected mode */
141 btsq $31, %rax /* Enable paging */ 141#define CR0_MP (1<<1)
142 btsq $0, %rax /* Enable protected mode */ 142#define CR0_ET (1<<4)
143 btsq $1, %rax /* Enable MP */ 143#define CR0_NE (1<<5)
144 btsq $4, %rax /* Enable ET */ 144#define CR0_WP (1<<16)
145 btsq $5, %rax /* Enable NE */ 145#define CR0_AM (1<<18)
146 btsq $16, %rax /* Enable WP */ 146#define CR0_PAGING (1<<31)
147 btsq $18, %rax /* Enable AM */ 147 movl $CR0_PM|CR0_MP|CR0_ET|CR0_NE|CR0_WP|CR0_AM|CR0_PAGING,%eax
148 /* Make changes effective */ 148 /* Make changes effective */
149 movq %rax, %cr0 149 movq %rax, %cr0
150 150
diff --git a/arch/x86_64/kernel/irq.c b/arch/x86_64/kernel/irq.c
index cc3fb85f5145..849a20aec7ca 100644
--- a/arch/x86_64/kernel/irq.c
+++ b/arch/x86_64/kernel/irq.c
@@ -135,3 +135,22 @@ void fixup_irqs(cpumask_t map)
135 local_irq_disable(); 135 local_irq_disable();
136} 136}
137#endif 137#endif
138
139extern void call_softirq(void);
140
141asmlinkage void do_softirq(void)
142{
143 __u32 pending;
144 unsigned long flags;
145
146 if (in_interrupt())
147 return;
148
149 local_irq_save(flags);
150 pending = local_softirq_pending();
151 /* Switch to interrupt stack */
152 if (pending)
153 call_softirq();
154 local_irq_restore(flags);
155}
156EXPORT_SYMBOL(do_softirq);
diff --git a/arch/x86_64/kernel/machine_kexec.c b/arch/x86_64/kernel/machine_kexec.c
index 60d1eff41567..89fab51e20f4 100644
--- a/arch/x86_64/kernel/machine_kexec.c
+++ b/arch/x86_64/kernel/machine_kexec.c
@@ -8,43 +8,26 @@
8 8
9#include <linux/mm.h> 9#include <linux/mm.h>
10#include <linux/kexec.h> 10#include <linux/kexec.h>
11#include <linux/delay.h>
12#include <linux/string.h> 11#include <linux/string.h>
13#include <linux/reboot.h> 12#include <linux/reboot.h>
14#include <asm/pda.h>
15#include <asm/pgtable.h> 13#include <asm/pgtable.h>
16#include <asm/pgalloc.h>
17#include <asm/tlbflush.h> 14#include <asm/tlbflush.h>
18#include <asm/mmu_context.h> 15#include <asm/mmu_context.h>
19#include <asm/io.h> 16#include <asm/io.h>
20#include <asm/apic.h> 17
21#include <asm/cpufeature.h> 18static void init_level2_page(pmd_t *level2p, unsigned long addr)
22#include <asm/hw_irq.h>
23
24#define LEVEL0_SIZE (1UL << 12UL)
25#define LEVEL1_SIZE (1UL << 21UL)
26#define LEVEL2_SIZE (1UL << 30UL)
27#define LEVEL3_SIZE (1UL << 39UL)
28#define LEVEL4_SIZE (1UL << 48UL)
29
30#define L0_ATTR (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY)
31#define L1_ATTR (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_PSE)
32#define L2_ATTR (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY)
33#define L3_ATTR (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY)
34
35static void init_level2_page(u64 *level2p, unsigned long addr)
36{ 19{
37 unsigned long end_addr; 20 unsigned long end_addr;
38 21
39 addr &= PAGE_MASK; 22 addr &= PAGE_MASK;
40 end_addr = addr + LEVEL2_SIZE; 23 end_addr = addr + PUD_SIZE;
41 while (addr < end_addr) { 24 while (addr < end_addr) {
42 *(level2p++) = addr | L1_ATTR; 25 set_pmd(level2p++, __pmd(addr | __PAGE_KERNEL_LARGE_EXEC));
43 addr += LEVEL1_SIZE; 26 addr += PMD_SIZE;
44 } 27 }
45} 28}
46 29
47static int init_level3_page(struct kimage *image, u64 *level3p, 30static int init_level3_page(struct kimage *image, pud_t *level3p,
48 unsigned long addr, unsigned long last_addr) 31 unsigned long addr, unsigned long last_addr)
49{ 32{
50 unsigned long end_addr; 33 unsigned long end_addr;
@@ -52,32 +35,32 @@ static int init_level3_page(struct kimage *image, u64 *level3p,
52 35
53 result = 0; 36 result = 0;
54 addr &= PAGE_MASK; 37 addr &= PAGE_MASK;
55 end_addr = addr + LEVEL3_SIZE; 38 end_addr = addr + PGDIR_SIZE;
56 while ((addr < last_addr) && (addr < end_addr)) { 39 while ((addr < last_addr) && (addr < end_addr)) {
57 struct page *page; 40 struct page *page;
58 u64 *level2p; 41 pmd_t *level2p;
59 42
60 page = kimage_alloc_control_pages(image, 0); 43 page = kimage_alloc_control_pages(image, 0);
61 if (!page) { 44 if (!page) {
62 result = -ENOMEM; 45 result = -ENOMEM;
63 goto out; 46 goto out;
64 } 47 }
65 level2p = (u64 *)page_address(page); 48 level2p = (pmd_t *)page_address(page);
66 init_level2_page(level2p, addr); 49 init_level2_page(level2p, addr);
67 *(level3p++) = __pa(level2p) | L2_ATTR; 50 set_pud(level3p++, __pud(__pa(level2p) | _KERNPG_TABLE));
68 addr += LEVEL2_SIZE; 51 addr += PUD_SIZE;
69 } 52 }
70 /* clear the unused entries */ 53 /* clear the unused entries */
71 while (addr < end_addr) { 54 while (addr < end_addr) {
72 *(level3p++) = 0; 55 pud_clear(level3p++);
73 addr += LEVEL2_SIZE; 56 addr += PUD_SIZE;
74 } 57 }
75out: 58out:
76 return result; 59 return result;
77} 60}
78 61
79 62
80static int init_level4_page(struct kimage *image, u64 *level4p, 63static int init_level4_page(struct kimage *image, pgd_t *level4p,
81 unsigned long addr, unsigned long last_addr) 64 unsigned long addr, unsigned long last_addr)
82{ 65{
83 unsigned long end_addr; 66 unsigned long end_addr;
@@ -85,28 +68,28 @@ static int init_level4_page(struct kimage *image, u64 *level4p,
85 68
86 result = 0; 69 result = 0;
87 addr &= PAGE_MASK; 70 addr &= PAGE_MASK;
88 end_addr = addr + LEVEL4_SIZE; 71 end_addr = addr + (PTRS_PER_PGD * PGDIR_SIZE);
89 while ((addr < last_addr) && (addr < end_addr)) { 72 while ((addr < last_addr) && (addr < end_addr)) {
90 struct page *page; 73 struct page *page;
91 u64 *level3p; 74 pud_t *level3p;
92 75
93 page = kimage_alloc_control_pages(image, 0); 76 page = kimage_alloc_control_pages(image, 0);
94 if (!page) { 77 if (!page) {
95 result = -ENOMEM; 78 result = -ENOMEM;
96 goto out; 79 goto out;
97 } 80 }
98 level3p = (u64 *)page_address(page); 81 level3p = (pud_t *)page_address(page);
99 result = init_level3_page(image, level3p, addr, last_addr); 82 result = init_level3_page(image, level3p, addr, last_addr);
100 if (result) { 83 if (result) {
101 goto out; 84 goto out;
102 } 85 }
103 *(level4p++) = __pa(level3p) | L3_ATTR; 86 set_pgd(level4p++, __pgd(__pa(level3p) | _KERNPG_TABLE));
104 addr += LEVEL3_SIZE; 87 addr += PGDIR_SIZE;
105 } 88 }
106 /* clear the unused entries */ 89 /* clear the unused entries */
107 while (addr < end_addr) { 90 while (addr < end_addr) {
108 *(level4p++) = 0; 91 pgd_clear(level4p++);
109 addr += LEVEL3_SIZE; 92 addr += PGDIR_SIZE;
110 } 93 }
111out: 94out:
112 return result; 95 return result;
@@ -115,52 +98,50 @@ out:
115 98
116static int init_pgtable(struct kimage *image, unsigned long start_pgtable) 99static int init_pgtable(struct kimage *image, unsigned long start_pgtable)
117{ 100{
118 u64 *level4p; 101 pgd_t *level4p;
119 level4p = (u64 *)__va(start_pgtable); 102 level4p = (pgd_t *)__va(start_pgtable);
120 return init_level4_page(image, level4p, 0, end_pfn << PAGE_SHIFT); 103 return init_level4_page(image, level4p, 0, end_pfn << PAGE_SHIFT);
121} 104}
122 105
123static void set_idt(void *newidt, u16 limit) 106static void set_idt(void *newidt, u16 limit)
124{ 107{
125 unsigned char curidt[10]; 108 struct desc_ptr curidt;
126 109
127 /* x86-64 supports unaliged loads & stores */ 110 /* x86-64 supports unaliged loads & stores */
128 (*(u16 *)(curidt)) = limit; 111 curidt.size = limit;
129 (*(u64 *)(curidt +2)) = (unsigned long)(newidt); 112 curidt.address = (unsigned long)newidt;
130 113
131 __asm__ __volatile__ ( 114 __asm__ __volatile__ (
132 "lidt %0\n" 115 "lidtq %0\n"
133 : "=m" (curidt) 116 : : "m" (curidt)
134 ); 117 );
135}; 118};
136 119
137 120
138static void set_gdt(void *newgdt, u16 limit) 121static void set_gdt(void *newgdt, u16 limit)
139{ 122{
140 unsigned char curgdt[10]; 123 struct desc_ptr curgdt;
141 124
142 /* x86-64 supports unaligned loads & stores */ 125 /* x86-64 supports unaligned loads & stores */
143 (*(u16 *)(curgdt)) = limit; 126 curgdt.size = limit;
144 (*(u64 *)(curgdt +2)) = (unsigned long)(newgdt); 127 curgdt.address = (unsigned long)newgdt;
145 128
146 __asm__ __volatile__ ( 129 __asm__ __volatile__ (
147 "lgdt %0\n" 130 "lgdtq %0\n"
148 : "=m" (curgdt) 131 : : "m" (curgdt)
149 ); 132 );
150}; 133};
151 134
152static void load_segments(void) 135static void load_segments(void)
153{ 136{
154 __asm__ __volatile__ ( 137 __asm__ __volatile__ (
155 "\tmovl $"STR(__KERNEL_DS)",%eax\n" 138 "\tmovl %0,%%ds\n"
156 "\tmovl %eax,%ds\n" 139 "\tmovl %0,%%es\n"
157 "\tmovl %eax,%es\n" 140 "\tmovl %0,%%ss\n"
158 "\tmovl %eax,%ss\n" 141 "\tmovl %0,%%fs\n"
159 "\tmovl %eax,%fs\n" 142 "\tmovl %0,%%gs\n"
160 "\tmovl %eax,%gs\n" 143 : : "a" (__KERNEL_DS)
161 ); 144 );
162#undef STR
163#undef __STR
164} 145}
165 146
166typedef NORET_TYPE void (*relocate_new_kernel_t)(unsigned long indirection_page, 147typedef NORET_TYPE void (*relocate_new_kernel_t)(unsigned long indirection_page,
@@ -178,7 +159,7 @@ int machine_kexec_prepare(struct kimage *image)
178 159
179 /* Calculate the offsets */ 160 /* Calculate the offsets */
180 start_pgtable = page_to_pfn(image->control_code_page) << PAGE_SHIFT; 161 start_pgtable = page_to_pfn(image->control_code_page) << PAGE_SHIFT;
181 control_code_buffer = start_pgtable + 4096UL; 162 control_code_buffer = start_pgtable + PAGE_SIZE;
182 163
183 /* Setup the identity mapped 64bit page table */ 164 /* Setup the identity mapped 64bit page table */
184 result = init_pgtable(image, start_pgtable); 165 result = init_pgtable(image, start_pgtable);
@@ -214,7 +195,7 @@ NORET_TYPE void machine_kexec(struct kimage *image)
214 /* Calculate the offsets */ 195 /* Calculate the offsets */
215 page_list = image->head; 196 page_list = image->head;
216 start_pgtable = page_to_pfn(image->control_code_page) << PAGE_SHIFT; 197 start_pgtable = page_to_pfn(image->control_code_page) << PAGE_SHIFT;
217 control_code_buffer = start_pgtable + 4096UL; 198 control_code_buffer = start_pgtable + PAGE_SIZE;
218 199
219 /* Set the low half of the page table to my identity mapped 200 /* Set the low half of the page table to my identity mapped
220 * page table for kexec. Leave the high half pointing at the 201 * page table for kexec. Leave the high half pointing at the
diff --git a/arch/x86_64/kernel/mce.c b/arch/x86_64/kernel/mce.c
index 21e70625a495..3b267c91bb0c 100644
--- a/arch/x86_64/kernel/mce.c
+++ b/arch/x86_64/kernel/mce.c
@@ -15,6 +15,8 @@
15#include <linux/sysdev.h> 15#include <linux/sysdev.h>
16#include <linux/miscdevice.h> 16#include <linux/miscdevice.h>
17#include <linux/fs.h> 17#include <linux/fs.h>
18#include <linux/cpu.h>
19#include <linux/percpu.h>
18#include <asm/processor.h> 20#include <asm/processor.h>
19#include <asm/msr.h> 21#include <asm/msr.h>
20#include <asm/mce.h> 22#include <asm/mce.h>
@@ -514,10 +516,7 @@ static struct sysdev_class mce_sysclass = {
514 set_kset_name("machinecheck"), 516 set_kset_name("machinecheck"),
515}; 517};
516 518
517static struct sys_device device_mce = { 519static DEFINE_PER_CPU(struct sys_device, device_mce);
518 .id = 0,
519 .cls = &mce_sysclass,
520};
521 520
522/* Why are there no generic functions for this? */ 521/* Why are there no generic functions for this? */
523#define ACCESSOR(name, var, start) \ 522#define ACCESSOR(name, var, start) \
@@ -542,27 +541,83 @@ ACCESSOR(bank4ctl,bank[4],mce_restart())
542ACCESSOR(tolerant,tolerant,) 541ACCESSOR(tolerant,tolerant,)
543ACCESSOR(check_interval,check_interval,mce_restart()) 542ACCESSOR(check_interval,check_interval,mce_restart())
544 543
545static __cpuinit int mce_init_device(void) 544/* Per cpu sysdev init. All of the cpus still share the same ctl bank */
545static __cpuinit int mce_create_device(unsigned int cpu)
546{ 546{
547 int err; 547 int err;
548 if (!mce_available(&cpu_data[cpu]))
549 return -EIO;
550
551 per_cpu(device_mce,cpu).id = cpu;
552 per_cpu(device_mce,cpu).cls = &mce_sysclass;
553
554 err = sysdev_register(&per_cpu(device_mce,cpu));
555
556 if (!err) {
557 sysdev_create_file(&per_cpu(device_mce,cpu), &attr_bank0ctl);
558 sysdev_create_file(&per_cpu(device_mce,cpu), &attr_bank1ctl);
559 sysdev_create_file(&per_cpu(device_mce,cpu), &attr_bank2ctl);
560 sysdev_create_file(&per_cpu(device_mce,cpu), &attr_bank3ctl);
561 sysdev_create_file(&per_cpu(device_mce,cpu), &attr_bank4ctl);
562 sysdev_create_file(&per_cpu(device_mce,cpu), &attr_tolerant);
563 sysdev_create_file(&per_cpu(device_mce,cpu), &attr_check_interval);
564 }
565 return err;
566}
567
568#ifdef CONFIG_HOTPLUG_CPU
569static __cpuinit void mce_remove_device(unsigned int cpu)
570{
571 sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_bank0ctl);
572 sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_bank1ctl);
573 sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_bank2ctl);
574 sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_bank3ctl);
575 sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_bank4ctl);
576 sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_tolerant);
577 sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_check_interval);
578 sysdev_unregister(&per_cpu(device_mce,cpu));
579}
580#endif
581
582/* Get notified when a cpu comes on/off. Be hotplug friendly. */
583static __cpuinit int
584mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
585{
586 unsigned int cpu = (unsigned long)hcpu;
587
588 switch (action) {
589 case CPU_ONLINE:
590 mce_create_device(cpu);
591 break;
592#ifdef CONFIG_HOTPLUG_CPU
593 case CPU_DEAD:
594 mce_remove_device(cpu);
595 break;
596#endif
597 }
598 return NOTIFY_OK;
599}
600
601static struct notifier_block mce_cpu_notifier = {
602 .notifier_call = mce_cpu_callback,
603};
604
605static __init int mce_init_device(void)
606{
607 int err;
608 int i = 0;
609
548 if (!mce_available(&boot_cpu_data)) 610 if (!mce_available(&boot_cpu_data))
549 return -EIO; 611 return -EIO;
550 err = sysdev_class_register(&mce_sysclass); 612 err = sysdev_class_register(&mce_sysclass);
551 if (!err) 613
552 err = sysdev_register(&device_mce); 614 for_each_online_cpu(i) {
553 if (!err) { 615 mce_create_device(i);
554 /* could create per CPU objects, but it is not worth it. */ 616 }
555 sysdev_create_file(&device_mce, &attr_bank0ctl); 617
556 sysdev_create_file(&device_mce, &attr_bank1ctl); 618 register_cpu_notifier(&mce_cpu_notifier);
557 sysdev_create_file(&device_mce, &attr_bank2ctl);
558 sysdev_create_file(&device_mce, &attr_bank3ctl);
559 sysdev_create_file(&device_mce, &attr_bank4ctl);
560 sysdev_create_file(&device_mce, &attr_tolerant);
561 sysdev_create_file(&device_mce, &attr_check_interval);
562 }
563
564 misc_register(&mce_log_device); 619 misc_register(&mce_log_device);
565 return err; 620 return err;
566
567} 621}
622
568device_initcall(mce_init_device); 623device_initcall(mce_init_device);
diff --git a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c
index 9c5aa2a790c7..08abf9f5b159 100644
--- a/arch/x86_64/kernel/mpparse.c
+++ b/arch/x86_64/kernel/mpparse.c
@@ -109,7 +109,7 @@ static int __init mpf_checksum(unsigned char *mp, int len)
109 109
110static void __init MP_processor_info (struct mpc_config_processor *m) 110static void __init MP_processor_info (struct mpc_config_processor *m)
111{ 111{
112 int ver; 112 int ver, cpu;
113 static int found_bsp=0; 113 static int found_bsp=0;
114 114
115 if (!(m->mpc_cpuflag & CPU_ENABLED)) 115 if (!(m->mpc_cpuflag & CPU_ENABLED))
@@ -131,7 +131,7 @@ static void __init MP_processor_info (struct mpc_config_processor *m)
131 return; 131 return;
132 } 132 }
133 133
134 num_processors++; 134 cpu = num_processors++;
135 135
136 if (m->mpc_apicid > MAX_APICS) { 136 if (m->mpc_apicid > MAX_APICS) {
137 printk(KERN_ERR "Processor #%d INVALID. (Max ID: %d).\n", 137 printk(KERN_ERR "Processor #%d INVALID. (Max ID: %d).\n",
@@ -155,13 +155,18 @@ static void __init MP_processor_info (struct mpc_config_processor *m)
155 * in same order as logical cpu numbers. Hence the first 155 * in same order as logical cpu numbers. Hence the first
156 * entry is BSP, and so on. 156 * entry is BSP, and so on.
157 */ 157 */
158 cpu = 0;
159
158 bios_cpu_apicid[0] = m->mpc_apicid; 160 bios_cpu_apicid[0] = m->mpc_apicid;
159 x86_cpu_to_apicid[0] = m->mpc_apicid; 161 x86_cpu_to_apicid[0] = m->mpc_apicid;
160 found_bsp = 1; 162 found_bsp = 1;
161 } else { 163 } else
162 bios_cpu_apicid[num_processors - found_bsp] = m->mpc_apicid; 164 cpu = num_processors - found_bsp;
163 x86_cpu_to_apicid[num_processors - found_bsp] = m->mpc_apicid; 165 bios_cpu_apicid[cpu] = m->mpc_apicid;
164 } 166 x86_cpu_to_apicid[cpu] = m->mpc_apicid;
167
168 cpu_set(cpu, cpu_possible_map);
169 cpu_set(cpu, cpu_present_map);
165} 170}
166 171
167static void __init MP_bus_info (struct mpc_config_bus *m) 172static void __init MP_bus_info (struct mpc_config_bus *m)
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
index 5fd03225058a..0aa526298e92 100644
--- a/arch/x86_64/kernel/setup.c
+++ b/arch/x86_64/kernel/setup.c
@@ -765,8 +765,6 @@ static void __init amd_detect_cmp(struct cpuinfo_x86 *c)
765 int cpu = smp_processor_id(); 765 int cpu = smp_processor_id();
766 int node = 0; 766 int node = 0;
767 unsigned bits; 767 unsigned bits;
768 if (c->x86_num_cores == 1)
769 return;
770 768
771 bits = 0; 769 bits = 0;
772 while ((1 << bits) < c->x86_num_cores) 770 while ((1 << bits) < c->x86_num_cores)
@@ -1081,8 +1079,7 @@ void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
1081 else 1079 else
1082 mtrr_ap_init(); 1080 mtrr_ap_init();
1083#ifdef CONFIG_NUMA 1081#ifdef CONFIG_NUMA
1084 if (c != &boot_cpu_data) 1082 numa_add_cpu(smp_processor_id());
1085 numa_add_cpu(c - cpu_data);
1086#endif 1083#endif
1087} 1084}
1088 1085
diff --git a/arch/x86_64/kernel/setup64.c b/arch/x86_64/kernel/setup64.c
index f2b9c6bc999a..34082c1cc41e 100644
--- a/arch/x86_64/kernel/setup64.c
+++ b/arch/x86_64/kernel/setup64.c
@@ -12,6 +12,7 @@
12#include <linux/string.h> 12#include <linux/string.h>
13#include <linux/bootmem.h> 13#include <linux/bootmem.h>
14#include <linux/bitops.h> 14#include <linux/bitops.h>
15#include <linux/module.h>
15#include <asm/bootsetup.h> 16#include <asm/bootsetup.h>
16#include <asm/pda.h> 17#include <asm/pda.h>
17#include <asm/pgtable.h> 18#include <asm/pgtable.h>
@@ -22,10 +23,8 @@
22#include <asm/smp.h> 23#include <asm/smp.h>
23#include <asm/i387.h> 24#include <asm/i387.h>
24#include <asm/percpu.h> 25#include <asm/percpu.h>
25#include <asm/mtrr.h>
26#include <asm/proto.h> 26#include <asm/proto.h>
27#include <asm/mman.h> 27#include <asm/sections.h>
28#include <asm/numa.h>
29 28
30char x86_boot_params[BOOT_PARAM_SIZE] __initdata = {0,}; 29char x86_boot_params[BOOT_PARAM_SIZE] __initdata = {0,};
31 30
@@ -33,11 +32,6 @@ cpumask_t cpu_initialized __cpuinitdata = CPU_MASK_NONE;
33 32
34struct x8664_pda cpu_pda[NR_CPUS] __cacheline_aligned; 33struct x8664_pda cpu_pda[NR_CPUS] __cacheline_aligned;
35 34
36extern struct task_struct init_task;
37
38extern unsigned char __per_cpu_start[], __per_cpu_end[];
39
40extern struct desc_ptr cpu_gdt_descr[];
41struct desc_ptr idt_descr = { 256 * 16, (unsigned long) idt_table }; 35struct desc_ptr idt_descr = { 256 * 16, (unsigned long) idt_table };
42 36
43char boot_cpu_stack[IRQSTACKSIZE] __attribute__((section(".bss.page_aligned"))); 37char boot_cpu_stack[IRQSTACKSIZE] __attribute__((section(".bss.page_aligned")));
@@ -101,7 +95,7 @@ void __init setup_per_cpu_areas(void)
101#endif 95#endif
102 96
103 for (i = 0; i < NR_CPUS; i++) { 97 for (i = 0; i < NR_CPUS; i++) {
104 unsigned char *ptr; 98 char *ptr;
105 99
106 if (!NODE_DATA(cpu_to_node(i))) { 100 if (!NODE_DATA(cpu_to_node(i))) {
107 printk("cpu with no node %d, num_online_nodes %d\n", 101 printk("cpu with no node %d, num_online_nodes %d\n",
@@ -190,11 +184,7 @@ void __cpuinit check_efer(void)
190 */ 184 */
191void __cpuinit cpu_init (void) 185void __cpuinit cpu_init (void)
192{ 186{
193#ifdef CONFIG_SMP
194 int cpu = stack_smp_processor_id(); 187 int cpu = stack_smp_processor_id();
195#else
196 int cpu = smp_processor_id();
197#endif
198 struct tss_struct *t = &per_cpu(init_tss, cpu); 188 struct tss_struct *t = &per_cpu(init_tss, cpu);
199 unsigned long v; 189 unsigned long v;
200 char *estacks = NULL; 190 char *estacks = NULL;
@@ -214,7 +204,7 @@ void __cpuinit cpu_init (void)
214 204
215 printk("Initializing CPU#%d\n", cpu); 205 printk("Initializing CPU#%d\n", cpu);
216 206
217 clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE); 207 clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE);
218 208
219 /* 209 /*
220 * Initialize the per-CPU GDT with the boot GDT, 210 * Initialize the per-CPU GDT with the boot GDT,
diff --git a/arch/x86_64/kernel/smp.c b/arch/x86_64/kernel/smp.c
index ccae392886af..e5958220d6b8 100644
--- a/arch/x86_64/kernel/smp.c
+++ b/arch/x86_64/kernel/smp.c
@@ -129,10 +129,9 @@ asmlinkage void smp_invalidate_interrupt (void)
129 } else 129 } else
130 leave_mm(cpu); 130 leave_mm(cpu);
131 } 131 }
132out:
132 ack_APIC_irq(); 133 ack_APIC_irq();
133 cpu_clear(cpu, flush_cpumask); 134 cpu_clear(cpu, flush_cpumask);
134
135out:
136 put_cpu_no_resched(); 135 put_cpu_no_resched();
137} 136}
138 137
@@ -294,6 +293,69 @@ void unlock_ipi_call_lock(void)
294} 293}
295 294
296/* 295/*
296 * this function sends a 'generic call function' IPI to one other CPU
297 * in the system.
298 */
299static void __smp_call_function_single (int cpu, void (*func) (void *info), void *info,
300 int nonatomic, int wait)
301{
302 struct call_data_struct data;
303 int cpus = 1;
304
305 data.func = func;
306 data.info = info;
307 atomic_set(&data.started, 0);
308 data.wait = wait;
309 if (wait)
310 atomic_set(&data.finished, 0);
311
312 call_data = &data;
313 wmb();
314 /* Send a message to all other CPUs and wait for them to respond */
315 send_IPI_mask(cpumask_of_cpu(cpu), CALL_FUNCTION_VECTOR);
316
317 /* Wait for response */
318 while (atomic_read(&data.started) != cpus)
319 cpu_relax();
320
321 if (!wait)
322 return;
323
324 while (atomic_read(&data.finished) != cpus)
325 cpu_relax();
326}
327
328/*
329 * smp_call_function_single - Run a function on another CPU
330 * @func: The function to run. This must be fast and non-blocking.
331 * @info: An arbitrary pointer to pass to the function.
332 * @nonatomic: Currently unused.
333 * @wait: If true, wait until function has completed on other CPUs.
334 *
335 * Retrurns 0 on success, else a negative status code.
336 *
337 * Does not return until the remote CPU is nearly ready to execute <func>
338 * or is or has executed.
339 */
340
341int smp_call_function_single (int cpu, void (*func) (void *info), void *info,
342 int nonatomic, int wait)
343{
344 /* prevent preemption and reschedule on another processor */
345 int me = get_cpu();
346 if (cpu == me) {
347 WARN_ON(1);
348 put_cpu();
349 return -EBUSY;
350 }
351 spin_lock_bh(&call_lock);
352 __smp_call_function_single(cpu, func, info, nonatomic, wait);
353 spin_unlock_bh(&call_lock);
354 put_cpu();
355 return 0;
356}
357
358/*
297 * this function sends a 'generic call function' IPI to all other CPUs 359 * this function sends a 'generic call function' IPI to all other CPUs
298 * in the system. 360 * in the system.
299 */ 361 */
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c
index e773a794ec45..6e4807d64d46 100644
--- a/arch/x86_64/kernel/smpboot.c
+++ b/arch/x86_64/kernel/smpboot.c
@@ -113,24 +113,6 @@ struct task_struct *idle_thread_array[NR_CPUS] __cpuinitdata ;
113#define set_idle_for_cpu(x,p) (idle_thread_array[(x)] = (p)) 113#define set_idle_for_cpu(x,p) (idle_thread_array[(x)] = (p))
114 114
115/* 115/*
116 * cpu_possible_map should be static, it cannot change as cpu's
117 * are onlined, or offlined. The reason is per-cpu data-structures
118 * are allocated by some modules at init time, and dont expect to
119 * do this dynamically on cpu arrival/departure.
120 * cpu_present_map on the other hand can change dynamically.
121 * In case when cpu_hotplug is not compiled, then we resort to current
122 * behaviour, which is cpu_possible == cpu_present.
123 * If cpu-hotplug is supported, then we need to preallocate for all
124 * those NR_CPUS, hence cpu_possible_map represents entire NR_CPUS range.
125 * - Ashok Raj
126 */
127#ifdef CONFIG_HOTPLUG_CPU
128#define fixup_cpu_possible_map(x) cpu_set((x), cpu_possible_map)
129#else
130#define fixup_cpu_possible_map(x)
131#endif
132
133/*
134 * Currently trivial. Write the real->protected mode 116 * Currently trivial. Write the real->protected mode
135 * bootstrap into the page concerned. The caller 117 * bootstrap into the page concerned. The caller
136 * has made sure it's suitably aligned. 118 * has made sure it's suitably aligned.
@@ -229,9 +211,6 @@ static __cpuinit void sync_master(void *arg)
229{ 211{
230 unsigned long flags, i; 212 unsigned long flags, i;
231 213
232 if (smp_processor_id() != 0)
233 return;
234
235 go[MASTER] = 0; 214 go[MASTER] = 0;
236 215
237 local_irq_save(flags); 216 local_irq_save(flags);
@@ -280,7 +259,7 @@ get_delta(long *rt, long *master)
280 return tcenter - best_tm; 259 return tcenter - best_tm;
281} 260}
282 261
283static __cpuinit void sync_tsc(void) 262static __cpuinit void sync_tsc(unsigned int master)
284{ 263{
285 int i, done = 0; 264 int i, done = 0;
286 long delta, adj, adjust_latency = 0; 265 long delta, adj, adjust_latency = 0;
@@ -294,9 +273,17 @@ static __cpuinit void sync_tsc(void)
294 } t[NUM_ROUNDS] __cpuinitdata; 273 } t[NUM_ROUNDS] __cpuinitdata;
295#endif 274#endif
296 275
276 printk(KERN_INFO "CPU %d: Syncing TSC to CPU %u.\n",
277 smp_processor_id(), master);
278
297 go[MASTER] = 1; 279 go[MASTER] = 1;
298 280
299 smp_call_function(sync_master, NULL, 1, 0); 281 /* It is dangerous to broadcast IPI as cpus are coming up,
282 * as they may not be ready to accept them. So since
283 * we only need to send the ipi to the boot cpu direct
284 * the message, and avoid the race.
285 */
286 smp_call_function_single(master, sync_master, NULL, 1, 0);
300 287
301 while (go[MASTER]) /* wait for master to be ready */ 288 while (go[MASTER]) /* wait for master to be ready */
302 no_cpu_relax(); 289 no_cpu_relax();
@@ -340,16 +327,14 @@ static __cpuinit void sync_tsc(void)
340 printk(KERN_INFO 327 printk(KERN_INFO
341 "CPU %d: synchronized TSC with CPU %u (last diff %ld cycles, " 328 "CPU %d: synchronized TSC with CPU %u (last diff %ld cycles, "
342 "maxerr %lu cycles)\n", 329 "maxerr %lu cycles)\n",
343 smp_processor_id(), boot_cpu_id, delta, rt); 330 smp_processor_id(), master, delta, rt);
344} 331}
345 332
346static void __cpuinit tsc_sync_wait(void) 333static void __cpuinit tsc_sync_wait(void)
347{ 334{
348 if (notscsync || !cpu_has_tsc) 335 if (notscsync || !cpu_has_tsc)
349 return; 336 return;
350 printk(KERN_INFO "CPU %d: Syncing TSC to CPU %u.\n", smp_processor_id(), 337 sync_tsc(boot_cpu_id);
351 boot_cpu_id);
352 sync_tsc();
353} 338}
354 339
355static __init int notscsync_setup(char *s) 340static __init int notscsync_setup(char *s)
@@ -773,8 +758,9 @@ do_rest:
773 initial_code = start_secondary; 758 initial_code = start_secondary;
774 clear_ti_thread_flag(c_idle.idle->thread_info, TIF_FORK); 759 clear_ti_thread_flag(c_idle.idle->thread_info, TIF_FORK);
775 760
776 printk(KERN_INFO "Booting processor %d/%d rip %lx rsp %lx\n", cpu, apicid, 761 printk(KERN_INFO "Booting processor %d/%d APIC 0x%x\n", cpu,
777 start_rip, init_rsp); 762 cpus_weight(cpu_present_map),
763 apicid);
778 764
779 /* 765 /*
780 * This grunge runs the startup process for 766 * This grunge runs the startup process for
@@ -924,6 +910,27 @@ static __init void enforce_max_cpus(unsigned max_cpus)
924 } 910 }
925} 911}
926 912
913#ifdef CONFIG_HOTPLUG_CPU
914/*
915 * cpu_possible_map should be static, it cannot change as cpu's
916 * are onlined, or offlined. The reason is per-cpu data-structures
917 * are allocated by some modules at init time, and dont expect to
918 * do this dynamically on cpu arrival/departure.
919 * cpu_present_map on the other hand can change dynamically.
920 * In case when cpu_hotplug is not compiled, then we resort to current
921 * behaviour, which is cpu_possible == cpu_present.
922 * If cpu-hotplug is supported, then we need to preallocate for all
923 * those NR_CPUS, hence cpu_possible_map represents entire NR_CPUS range.
924 * - Ashok Raj
925 */
926static void prefill_possible_map(void)
927{
928 int i;
929 for (i = 0; i < NR_CPUS; i++)
930 cpu_set(i, cpu_possible_map);
931}
932#endif
933
927/* 934/*
928 * Various sanity checks. 935 * Various sanity checks.
929 */ 936 */
@@ -987,25 +994,15 @@ static int __init smp_sanity_check(unsigned max_cpus)
987 */ 994 */
988void __init smp_prepare_cpus(unsigned int max_cpus) 995void __init smp_prepare_cpus(unsigned int max_cpus)
989{ 996{
990 int i;
991
992 nmi_watchdog_default(); 997 nmi_watchdog_default();
993 current_cpu_data = boot_cpu_data; 998 current_cpu_data = boot_cpu_data;
994 current_thread_info()->cpu = 0; /* needed? */ 999 current_thread_info()->cpu = 0; /* needed? */
995 1000
996 enforce_max_cpus(max_cpus); 1001 enforce_max_cpus(max_cpus);
997 1002
998 /* 1003#ifdef CONFIG_HOTPLUG_CPU
999 * Fill in cpu_present_mask 1004 prefill_possible_map();
1000 */ 1005#endif
1001 for (i = 0; i < NR_CPUS; i++) {
1002 int apicid = cpu_present_to_apicid(i);
1003 if (physid_isset(apicid, phys_cpu_present_map)) {
1004 cpu_set(i, cpu_present_map);
1005 cpu_set(i, cpu_possible_map);
1006 }
1007 fixup_cpu_possible_map(i);
1008 }
1009 1006
1010 if (smp_sanity_check(max_cpus) < 0) { 1007 if (smp_sanity_check(max_cpus) < 0) {
1011 printk(KERN_INFO "SMP disabled\n"); 1008 printk(KERN_INFO "SMP disabled\n");
@@ -1189,8 +1186,7 @@ void __cpu_die(unsigned int cpu)
1189 printk ("CPU %d is now offline\n", cpu); 1186 printk ("CPU %d is now offline\n", cpu);
1190 return; 1187 return;
1191 } 1188 }
1192 current->state = TASK_UNINTERRUPTIBLE; 1189 msleep(100);
1193 schedule_timeout(HZ/10);
1194 } 1190 }
1195 printk(KERN_ERR "CPU %u didn't die...\n", cpu); 1191 printk(KERN_ERR "CPU %u didn't die...\n", cpu);
1196} 1192}
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c
index 102736630002..6ead433a3885 100644
--- a/arch/x86_64/kernel/traps.c
+++ b/arch/x86_64/kernel/traps.c
@@ -594,9 +594,6 @@ asmlinkage void default_do_nmi(struct pt_regs *regs)
594 if (!cpu) 594 if (!cpu)
595 reason = get_nmi_reason(); 595 reason = get_nmi_reason();
596 596
597 if (!cpu_online(cpu))
598 return;
599
600 if (!(reason & 0xc0)) { 597 if (!(reason & 0xc0)) {
601 if (notify_die(DIE_NMI_IPI, "nmi_ipi", regs, reason, 0, SIGINT) 598 if (notify_die(DIE_NMI_IPI, "nmi_ipi", regs, reason, 0, SIGINT)
602 == NOTIFY_STOP) 599 == NOTIFY_STOP)
diff --git a/arch/x86_64/lib/delay.c b/arch/x86_64/lib/delay.c
index 33a873a3c223..841bd738a189 100644
--- a/arch/x86_64/lib/delay.c
+++ b/arch/x86_64/lib/delay.c
@@ -18,8 +18,6 @@
18#include <asm/smp.h> 18#include <asm/smp.h>
19#endif 19#endif
20 20
21int x86_udelay_tsc = 0; /* Delay via TSC */
22
23int read_current_timer(unsigned long *timer_value) 21int read_current_timer(unsigned long *timer_value)
24{ 22{
25 rdtscll(*timer_value); 23 rdtscll(*timer_value);
diff --git a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c
index 2f187986f940..13792721037e 100644
--- a/arch/x86_64/mm/fault.c
+++ b/arch/x86_64/mm/fault.c
@@ -23,7 +23,6 @@
23#include <linux/vt_kern.h> /* For unblank_screen() */ 23#include <linux/vt_kern.h> /* For unblank_screen() */
24#include <linux/compiler.h> 24#include <linux/compiler.h>
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/kprobes.h>
27 26
28#include <asm/system.h> 27#include <asm/system.h>
29#include <asm/uaccess.h> 28#include <asm/uaccess.h>
diff --git a/arch/x86_64/mm/numa.c b/arch/x86_64/mm/numa.c
index ac61c186eb02..70cb2904a90f 100644
--- a/arch/x86_64/mm/numa.c
+++ b/arch/x86_64/mm/numa.c
@@ -36,34 +36,36 @@ int numa_off __initdata;
36int __init compute_hash_shift(struct node *nodes, int numnodes) 36int __init compute_hash_shift(struct node *nodes, int numnodes)
37{ 37{
38 int i; 38 int i;
39 int shift = 24; 39 int shift = 20;
40 u64 addr; 40 unsigned long addr,maxend=0;
41 41
42 /* When in doubt use brute force. */ 42 for (i = 0; i < numnodes; i++)
43 while (shift < 48) { 43 if ((nodes[i].start != nodes[i].end) && (nodes[i].end > maxend))
44 memset(memnodemap,0xff,sizeof(*memnodemap) * NODEMAPSIZE); 44 maxend = nodes[i].end;
45 for (i = 0; i < numnodes; i++) { 45
46 if (nodes[i].start == nodes[i].end) 46 while ((1UL << shift) < (maxend / NODEMAPSIZE))
47 continue; 47 shift++;
48 for (addr = nodes[i].start; 48
49 addr < nodes[i].end; 49 printk (KERN_DEBUG"Using %d for the hash shift. Max adder is %lx \n",
50 addr += (1UL << shift)) { 50 shift,maxend);
51 if (memnodemap[addr >> shift] != 0xff && 51 memset(memnodemap,0xff,sizeof(*memnodemap) * NODEMAPSIZE);
52 memnodemap[addr >> shift] != i) { 52 for (i = 0; i < numnodes; i++) {
53 printk(KERN_INFO 53 if (nodes[i].start == nodes[i].end)
54 "node %d shift %d addr %Lx conflict %d\n", 54 continue;
55 i, shift, addr, memnodemap[addr>>shift]); 55 for (addr = nodes[i].start;
56 goto next; 56 addr < nodes[i].end;
57 } 57 addr += (1UL << shift)) {
58 memnodemap[addr >> shift] = i; 58 if (memnodemap[addr >> shift] != 0xff) {
59 printk(KERN_INFO
60 "Your memory is not aligned you need to rebuild your kernel "
61 "with a bigger NODEMAPSIZE shift=%d adder=%lu\n",
62 shift,addr);
63 return -1;
59 } 64 }
65 memnodemap[addr >> shift] = i;
60 } 66 }
61 return shift;
62 next:
63 shift++;
64 } 67 }
65 memset(memnodemap,0,sizeof(*memnodemap) * NODEMAPSIZE); 68 return shift;
66 return -1;
67} 69}
68 70
69#ifdef CONFIG_SPARSEMEM 71#ifdef CONFIG_SPARSEMEM
diff --git a/arch/x86_64/mm/srat.c b/arch/x86_64/mm/srat.c
index 5d01b31472e1..8e3d097a9ddd 100644
--- a/arch/x86_64/mm/srat.c
+++ b/arch/x86_64/mm/srat.c
@@ -20,6 +20,9 @@
20 20
21static struct acpi_table_slit *acpi_slit; 21static struct acpi_table_slit *acpi_slit;
22 22
23/* Internal processor count */
24static unsigned int __initdata num_processors = 0;
25
23static nodemask_t nodes_parsed __initdata; 26static nodemask_t nodes_parsed __initdata;
24static nodemask_t nodes_found __initdata; 27static nodemask_t nodes_found __initdata;
25static struct node nodes[MAX_NUMNODES] __initdata; 28static struct node nodes[MAX_NUMNODES] __initdata;
@@ -101,16 +104,18 @@ acpi_numa_processor_affinity_init(struct acpi_table_processor_affinity *pa)
101 bad_srat(); 104 bad_srat();
102 return; 105 return;
103 } 106 }
104 if (pa->apic_id >= NR_CPUS) { 107 if (num_processors >= NR_CPUS) {
105 printk(KERN_ERR "SRAT: lapic %u too large.\n", 108 printk(KERN_ERR "SRAT: Processor #%d (lapic %u) INVALID. (Max ID: %d).\n",
106 pa->apic_id); 109 num_processors, pa->apic_id, NR_CPUS);
107 bad_srat(); 110 bad_srat();
108 return; 111 return;
109 } 112 }
110 cpu_to_node[pa->apic_id] = node; 113 cpu_to_node[num_processors] = node;
111 acpi_numa = 1; 114 acpi_numa = 1;
112 printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n", 115 printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> CPU %u -> Node %u\n",
113 pxm, pa->apic_id, node); 116 pxm, pa->apic_id, num_processors, node);
117
118 num_processors++;
114} 119}
115 120
116/* Callback for parsing of the Proximity Domain <-> Memory Area mappings */ 121/* Callback for parsing of the Proximity Domain <-> Memory Area mappings */
@@ -124,7 +129,6 @@ acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma)
124 129
125 if (srat_disabled() || ma->flags.enabled == 0) 130 if (srat_disabled() || ma->flags.enabled == 0)
126 return; 131 return;
127 /* hotplug bit is ignored for now */
128 pxm = ma->proximity_domain; 132 pxm = ma->proximity_domain;
129 node = setup_node(pxm); 133 node = setup_node(pxm);
130 if (node < 0) { 134 if (node < 0) {
@@ -134,6 +138,10 @@ acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma)
134 } 138 }
135 start = ma->base_addr_lo | ((u64)ma->base_addr_hi << 32); 139 start = ma->base_addr_lo | ((u64)ma->base_addr_hi << 32);
136 end = start + (ma->length_lo | ((u64)ma->length_hi << 32)); 140 end = start + (ma->length_lo | ((u64)ma->length_hi << 32));
141 /* It is fine to add this area to the nodes data it will be used later*/
142 if (ma->flags.hot_pluggable == 1)
143 printk(KERN_INFO "SRAT: hot plug zone found %lx - %lx \n",
144 start, end);
137 i = conflicting_nodes(start, end); 145 i = conflicting_nodes(start, end);
138 if (i >= 0) { 146 if (i >= 0) {
139 printk(KERN_ERR 147 printk(KERN_ERR
diff --git a/arch/x86_64/pci/k8-bus.c b/arch/x86_64/pci/k8-bus.c
index 7e7d0c2a0025..c2c38b579939 100644
--- a/arch/x86_64/pci/k8-bus.c
+++ b/arch/x86_64/pci/k8-bus.c
@@ -29,7 +29,7 @@ __init static int
29fill_mp_bus_to_cpumask(void) 29fill_mp_bus_to_cpumask(void)
30{ 30{
31 struct pci_dev *nb_dev = NULL; 31 struct pci_dev *nb_dev = NULL;
32 int i, j, printed; 32 int i, j;
33 u32 ldtbus, nid; 33 u32 ldtbus, nid;
34 static int lbnr[3] = { 34 static int lbnr[3] = {
35 LDT_BUS_NUMBER_REGISTER_0, 35 LDT_BUS_NUMBER_REGISTER_0,