aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386')
-rw-r--r--arch/i386/Kconfig73
-rw-r--r--arch/i386/Kconfig.cpu2
-rw-r--r--arch/i386/boot/video.S5
-rw-r--r--arch/i386/kernel/acpi/boot.c10
-rw-r--r--arch/i386/kernel/apic.c23
-rw-r--r--arch/i386/kernel/cpu/amd.c2
-rw-r--r--arch/i386/kernel/cpu/cpufreq/powernow-k8.c18
-rw-r--r--arch/i386/kernel/i386_ksyms.c1
-rw-r--r--arch/i386/kernel/mpparse.c43
-rw-r--r--arch/i386/kernel/reboot_fixups.c2
-rw-r--r--arch/i386/kernel/setup.c36
-rw-r--r--arch/i386/kernel/traps.c16
-rw-r--r--arch/i386/mach-voyager/voyager_cat.c10
-rw-r--r--arch/i386/mm/init.c2
-rw-r--r--arch/i386/pci/direct.c13
-rw-r--r--arch/i386/pci/mmconfig.c67
16 files changed, 206 insertions, 117 deletions
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index f17bd1d2707e..18ec9fe6deb6 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -53,6 +53,35 @@ source "init/Kconfig"
53 53
54menu "Processor type and features" 54menu "Processor type and features"
55 55
56config SMP
57 bool "Symmetric multi-processing support"
58 ---help---
59 This enables support for systems with more than one CPU. If you have
60 a system with only one CPU, like most personal computers, say N. If
61 you have a system with more than one CPU, say Y.
62
63 If you say N here, the kernel will run on single and multiprocessor
64 machines, but will use only one CPU of a multiprocessor machine. If
65 you say Y here, the kernel will run on many, but not all,
66 singleprocessor machines. On a singleprocessor machine, the kernel
67 will run faster if you say N here.
68
69 Note that if you say Y here and choose architecture "586" or
70 "Pentium" under "Processor family", the kernel will not work on 486
71 architectures. Similarly, multiprocessor kernels for the "PPro"
72 architecture may not work on all Pentium based boards.
73
74 People using multiprocessor machines who say Y here should also say
75 Y to "Enhanced Real Time Clock Support", below. The "Advanced Power
76 Management" code will be disabled if you say Y here.
77
78 See also the <file:Documentation/smp.txt>,
79 <file:Documentation/i386/IO-APIC.txt>,
80 <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO available at
81 <http://www.tldp.org/docs.html#howto>.
82
83 If you don't know what to do here, say N.
84
56choice 85choice
57 prompt "Subarchitecture Type" 86 prompt "Subarchitecture Type"
58 default X86_PC 87 default X86_PC
@@ -178,35 +207,6 @@ config HPET_EMULATE_RTC
178 depends on HPET_TIMER && RTC=y 207 depends on HPET_TIMER && RTC=y
179 default y 208 default y
180 209
181config SMP
182 bool "Symmetric multi-processing support"
183 ---help---
184 This enables support for systems with more than one CPU. If you have
185 a system with only one CPU, like most personal computers, say N. If
186 you have a system with more than one CPU, say Y.
187
188 If you say N here, the kernel will run on single and multiprocessor
189 machines, but will use only one CPU of a multiprocessor machine. If
190 you say Y here, the kernel will run on many, but not all,
191 singleprocessor machines. On a singleprocessor machine, the kernel
192 will run faster if you say N here.
193
194 Note that if you say Y here and choose architecture "586" or
195 "Pentium" under "Processor family", the kernel will not work on 486
196 architectures. Similarly, multiprocessor kernels for the "PPro"
197 architecture may not work on all Pentium based boards.
198
199 People using multiprocessor machines who say Y here should also say
200 Y to "Enhanced Real Time Clock Support", below. The "Advanced Power
201 Management" code will be disabled if you say Y here.
202
203 See also the <file:Documentation/smp.txt>,
204 <file:Documentation/i386/IO-APIC.txt>,
205 <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO available at
206 <http://www.tldp.org/docs.html#howto>.
207
208 If you don't know what to do here, say N.
209
210config NR_CPUS 210config NR_CPUS
211 int "Maximum number of CPUs (2-255)" 211 int "Maximum number of CPUs (2-255)"
212 range 2 255 212 range 2 255
@@ -522,6 +522,12 @@ config NUMA
522comment "NUMA (Summit) requires SMP, 64GB highmem support, ACPI" 522comment "NUMA (Summit) requires SMP, 64GB highmem support, ACPI"
523 depends on X86_SUMMIT && (!HIGHMEM64G || !ACPI) 523 depends on X86_SUMMIT && (!HIGHMEM64G || !ACPI)
524 524
525config NODES_SHIFT
526 int
527 default "4" if X86_NUMAQ
528 default "3"
529 depends on NEED_MULTIPLE_NODES
530
525config HAVE_ARCH_BOOTMEM_NODE 531config HAVE_ARCH_BOOTMEM_NODE
526 bool 532 bool
527 depends on NUMA 533 depends on NUMA
@@ -757,15 +763,6 @@ config HOTPLUG_CPU
757 763
758 Say N. 764 Say N.
759 765
760config DOUBLEFAULT
761 default y
762 bool "Enable doublefault exception handler" if EMBEDDED
763 help
764 This option allows trapping of rare doublefault exceptions that
765 would otherwise cause a system to silently reboot. Disabling this
766 option saves about 4k and might cause you much additional grey
767 hair.
768
769endmenu 766endmenu
770 767
771 768
diff --git a/arch/i386/Kconfig.cpu b/arch/i386/Kconfig.cpu
index 79603b3471f9..eb130482ba18 100644
--- a/arch/i386/Kconfig.cpu
+++ b/arch/i386/Kconfig.cpu
@@ -311,5 +311,5 @@ config X86_OOSTORE
311 311
312config X86_TSC 312config X86_TSC
313 bool 313 bool
314 depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MGEODEGX1) && !X86_NUMAQ 314 depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MGEODEGX1 || MGEODE_LX) && !X86_NUMAQ
315 default y 315 default y
diff --git a/arch/i386/boot/video.S b/arch/i386/boot/video.S
index 0000a2674537..c9343c3a8082 100644
--- a/arch/i386/boot/video.S
+++ b/arch/i386/boot/video.S
@@ -97,6 +97,7 @@
97#define PARAM_VESAPM_OFF 0x30 97#define PARAM_VESAPM_OFF 0x30
98#define PARAM_LFB_PAGES 0x32 98#define PARAM_LFB_PAGES 0x32
99#define PARAM_VESA_ATTRIB 0x34 99#define PARAM_VESA_ATTRIB 0x34
100#define PARAM_CAPABILITIES 0x36
100 101
101/* Define DO_STORE according to CONFIG_VIDEO_RETAIN */ 102/* Define DO_STORE according to CONFIG_VIDEO_RETAIN */
102#ifdef CONFIG_VIDEO_RETAIN 103#ifdef CONFIG_VIDEO_RETAIN
@@ -233,6 +234,10 @@ mopar_gr:
233 movw 18(%di), %ax 234 movw 18(%di), %ax
234 movl %eax, %fs:(PARAM_LFB_SIZE) 235 movl %eax, %fs:(PARAM_LFB_SIZE)
235 236
237# store mode capabilities
238 movl 10(%di), %eax
239 movl %eax, %fs:(PARAM_CAPABILITIES)
240
236# switching the DAC to 8-bit is for <= 8 bpp only 241# switching the DAC to 8-bit is for <= 8 bpp only
237 movw %fs:(PARAM_LFB_DEPTH), %ax 242 movw %fs:(PARAM_LFB_DEPTH), %ax
238 cmpw $8, %ax 243 cmpw $8, %ax
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
index 033066176b3e..030a0007a4e0 100644
--- a/arch/i386/kernel/acpi/boot.c
+++ b/arch/i386/kernel/acpi/boot.c
@@ -168,7 +168,7 @@ int __init acpi_parse_mcfg(unsigned long phys_addr, unsigned long size)
168 unsigned long i; 168 unsigned long i;
169 int config_size; 169 int config_size;
170 170
171 if (!phys_addr || !size) 171 if (!phys_addr || !size || !cpu_has_apic)
172 return -EINVAL; 172 return -EINVAL;
173 173
174 mcfg = (struct acpi_table_mcfg *)__acpi_map_table(phys_addr, size); 174 mcfg = (struct acpi_table_mcfg *)__acpi_map_table(phys_addr, size);
@@ -215,7 +215,7 @@ static int __init acpi_parse_madt(unsigned long phys_addr, unsigned long size)
215{ 215{
216 struct acpi_table_madt *madt = NULL; 216 struct acpi_table_madt *madt = NULL;
217 217
218 if (!phys_addr || !size) 218 if (!phys_addr || !size || !cpu_has_apic)
219 return -EINVAL; 219 return -EINVAL;
220 220
221 madt = (struct acpi_table_madt *)__acpi_map_table(phys_addr, size); 221 madt = (struct acpi_table_madt *)__acpi_map_table(phys_addr, size);
@@ -693,6 +693,9 @@ static int __init acpi_parse_madt_lapic_entries(void)
693{ 693{
694 int count; 694 int count;
695 695
696 if (!cpu_has_apic)
697 return -ENODEV;
698
696 /* 699 /*
697 * Note that the LAPIC address is obtained from the MADT (32-bit value) 700 * Note that the LAPIC address is obtained from the MADT (32-bit value)
698 * and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value). 701 * and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value).
@@ -751,6 +754,9 @@ static int __init acpi_parse_madt_ioapic_entries(void)
751 return -ENODEV; 754 return -ENODEV;
752 } 755 }
753 756
757 if (!cpu_has_apic)
758 return -ENODEV;
759
754 /* 760 /*
755 * if "noapic" boot option, don't look for IO-APICs 761 * if "noapic" boot option, don't look for IO-APICs
756 */ 762 */
diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c
index 6273bf74c203..254cee9f0b7b 100644
--- a/arch/i386/kernel/apic.c
+++ b/arch/i386/kernel/apic.c
@@ -62,6 +62,18 @@ int apic_verbosity;
62 62
63static void apic_pm_activate(void); 63static void apic_pm_activate(void);
64 64
65int modern_apic(void)
66{
67 unsigned int lvr, version;
68 /* AMD systems use old APIC versions, so check the CPU */
69 if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
70 boot_cpu_data.x86 >= 0xf)
71 return 1;
72 lvr = apic_read(APIC_LVR);
73 version = GET_APIC_VERSION(lvr);
74 return version >= 0x14;
75}
76
65/* 77/*
66 * 'what should we do if we get a hw irq event on an illegal vector'. 78 * 'what should we do if we get a hw irq event on an illegal vector'.
67 * each architecture has to answer this themselves. 79 * each architecture has to answer this themselves.
@@ -119,10 +131,7 @@ void enable_NMI_through_LVT0 (void * dummy)
119 131
120int get_physical_broadcast(void) 132int get_physical_broadcast(void)
121{ 133{
122 unsigned int lvr, version; 134 if (modern_apic())
123 lvr = apic_read(APIC_LVR);
124 version = GET_APIC_VERSION(lvr);
125 if (!APIC_INTEGRATED(version) || version >= 0x14)
126 return 0xff; 135 return 0xff;
127 else 136 else
128 return 0xf; 137 return 0xf;
@@ -349,9 +358,9 @@ int __init verify_local_APIC(void)
349 358
350void __init sync_Arb_IDs(void) 359void __init sync_Arb_IDs(void)
351{ 360{
352 /* Unsupported on P4 - see Intel Dev. Manual Vol. 3, Ch. 8.6.1 */ 361 /* Unsupported on P4 - see Intel Dev. Manual Vol. 3, Ch. 8.6.1
353 unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR)); 362 And not needed on AMD */
354 if (ver >= 0x14) /* P4 or higher */ 363 if (modern_apic())
355 return; 364 return;
356 /* 365 /*
357 * Wait for idle. 366 * Wait for idle.
diff --git a/arch/i386/kernel/cpu/amd.c b/arch/i386/kernel/cpu/amd.c
index 0810f81f2a05..ff2b2154ac1b 100644
--- a/arch/i386/kernel/cpu/amd.c
+++ b/arch/i386/kernel/cpu/amd.c
@@ -212,8 +212,6 @@ static void __init init_amd(struct cpuinfo_x86 *c)
212 212
213 if (cpuid_eax(0x80000000) >= 0x80000008) { 213 if (cpuid_eax(0x80000000) >= 0x80000008) {
214 c->x86_max_cores = (cpuid_ecx(0x80000008) & 0xff) + 1; 214 c->x86_max_cores = (cpuid_ecx(0x80000008) & 0xff) + 1;
215 if (c->x86_max_cores & (c->x86_max_cores - 1))
216 c->x86_max_cores = 1;
217 } 215 }
218 216
219 if (cpuid_eax(0x80000000) >= 0x80000007) { 217 if (cpuid_eax(0x80000000) >= 0x80000007) {
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
index 712a26bd4457..7c0e160a2145 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
@@ -46,7 +46,7 @@
46 46
47#define PFX "powernow-k8: " 47#define PFX "powernow-k8: "
48#define BFX PFX "BIOS error: " 48#define BFX PFX "BIOS error: "
49#define VERSION "version 1.60.1" 49#define VERSION "version 1.60.2"
50#include "powernow-k8.h" 50#include "powernow-k8.h"
51 51
52/* serialize freq changes */ 52/* serialize freq changes */
@@ -55,7 +55,7 @@ static DEFINE_MUTEX(fidvid_mutex);
55static struct powernow_k8_data *powernow_data[NR_CPUS]; 55static struct powernow_k8_data *powernow_data[NR_CPUS];
56 56
57#ifndef CONFIG_SMP 57#ifndef CONFIG_SMP
58static cpumask_t cpu_core_map[1] = { CPU_MASK_ALL }; 58static cpumask_t cpu_core_map[1];
59#endif 59#endif
60 60
61/* Return a frequency in MHz, given an input fid */ 61/* Return a frequency in MHz, given an input fid */
@@ -910,6 +910,9 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
910 unsigned int newstate; 910 unsigned int newstate;
911 int ret = -EIO; 911 int ret = -EIO;
912 912
913 if (!data)
914 return -EINVAL;
915
913 /* only run on specific CPU from here on */ 916 /* only run on specific CPU from here on */
914 oldmask = current->cpus_allowed; 917 oldmask = current->cpus_allowed;
915 set_cpus_allowed(current, cpumask_of_cpu(pol->cpu)); 918 set_cpus_allowed(current, cpumask_of_cpu(pol->cpu));
@@ -969,6 +972,9 @@ static int powernowk8_verify(struct cpufreq_policy *pol)
969{ 972{
970 struct powernow_k8_data *data = powernow_data[pol->cpu]; 973 struct powernow_k8_data *data = powernow_data[pol->cpu];
971 974
975 if (!data)
976 return -EINVAL;
977
972 return cpufreq_frequency_table_verify(pol, data->powernow_table); 978 return cpufreq_frequency_table_verify(pol, data->powernow_table);
973} 979}
974 980
@@ -977,7 +983,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
977{ 983{
978 struct powernow_k8_data *data; 984 struct powernow_k8_data *data;
979 cpumask_t oldmask = CPU_MASK_ALL; 985 cpumask_t oldmask = CPU_MASK_ALL;
980 int rc, i; 986 int rc;
981 987
982 if (!cpu_online(pol->cpu)) 988 if (!cpu_online(pol->cpu))
983 return -ENODEV; 989 return -ENODEV;
@@ -1063,8 +1069,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
1063 printk("cpu_init done, current fid 0x%x, vid 0x%x\n", 1069 printk("cpu_init done, current fid 0x%x, vid 0x%x\n",
1064 data->currfid, data->currvid); 1070 data->currfid, data->currvid);
1065 1071
1066 for_each_cpu_mask(i, cpu_core_map[pol->cpu]) 1072 powernow_data[pol->cpu] = data;
1067 powernow_data[i] = data;
1068 1073
1069 return 0; 1074 return 0;
1070 1075
@@ -1104,6 +1109,9 @@ static unsigned int powernowk8_get (unsigned int cpu)
1104 if (!data) 1109 if (!data)
1105 return -EINVAL; 1110 return -EINVAL;
1106 1111
1112 if (!data)
1113 return -EINVAL;
1114
1107 set_cpus_allowed(current, cpumask_of_cpu(cpu)); 1115 set_cpus_allowed(current, cpumask_of_cpu(cpu));
1108 if (smp_processor_id() != cpu) { 1116 if (smp_processor_id() != cpu) {
1109 printk(KERN_ERR PFX "limiting to CPU %d failed in powernowk8_get\n", cpu); 1117 printk(KERN_ERR PFX "limiting to CPU %d failed in powernowk8_get\n", cpu);
diff --git a/arch/i386/kernel/i386_ksyms.c b/arch/i386/kernel/i386_ksyms.c
index 055325056a74..036a9857936f 100644
--- a/arch/i386/kernel/i386_ksyms.c
+++ b/arch/i386/kernel/i386_ksyms.c
@@ -19,7 +19,6 @@ EXPORT_SYMBOL(__put_user_2);
19EXPORT_SYMBOL(__put_user_4); 19EXPORT_SYMBOL(__put_user_4);
20EXPORT_SYMBOL(__put_user_8); 20EXPORT_SYMBOL(__put_user_8);
21 21
22EXPORT_SYMBOL(strpbrk);
23EXPORT_SYMBOL(strstr); 22EXPORT_SYMBOL(strstr);
24 23
25#ifdef CONFIG_SMP 24#ifdef CONFIG_SMP
diff --git a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c
index 8d8aa9d1796d..34d21e21e012 100644
--- a/arch/i386/kernel/mpparse.c
+++ b/arch/i386/kernel/mpparse.c
@@ -38,12 +38,6 @@
38int smp_found_config; 38int smp_found_config;
39unsigned int __initdata maxcpus = NR_CPUS; 39unsigned int __initdata maxcpus = NR_CPUS;
40 40
41#ifdef CONFIG_HOTPLUG_CPU
42#define CPU_HOTPLUG_ENABLED (1)
43#else
44#define CPU_HOTPLUG_ENABLED (0)
45#endif
46
47/* 41/*
48 * Various Linux-internal data structures created from the 42 * Various Linux-internal data structures created from the
49 * MP-table. 43 * MP-table.
@@ -110,21 +104,6 @@ static int __init mpf_checksum(unsigned char *mp, int len)
110static int mpc_record; 104static int mpc_record;
111static struct mpc_config_translation *translation_table[MAX_MPC_ENTRY] __initdata; 105static struct mpc_config_translation *translation_table[MAX_MPC_ENTRY] __initdata;
112 106
113#ifdef CONFIG_X86_NUMAQ
114static int MP_valid_apicid(int apicid, int version)
115{
116 return hweight_long(apicid & 0xf) == 1 && (apicid >> 4) != 0xf;
117}
118#else
119static int MP_valid_apicid(int apicid, int version)
120{
121 if (version >= 0x14)
122 return apicid < 0xff;
123 else
124 return apicid < 0xf;
125}
126#endif
127
128static void __devinit MP_processor_info (struct mpc_config_processor *m) 107static void __devinit MP_processor_info (struct mpc_config_processor *m)
129{ 108{
130 int ver, apicid; 109 int ver, apicid;
@@ -190,12 +169,6 @@ static void __devinit MP_processor_info (struct mpc_config_processor *m)
190 169
191 ver = m->mpc_apicver; 170 ver = m->mpc_apicver;
192 171
193 if (!MP_valid_apicid(apicid, ver)) {
194 printk(KERN_WARNING "Processor #%d INVALID. (Max ID: %d).\n",
195 m->mpc_apicid, MAX_APICS);
196 return;
197 }
198
199 /* 172 /*
200 * Validate version 173 * Validate version
201 */ 174 */
@@ -225,7 +198,14 @@ static void __devinit MP_processor_info (struct mpc_config_processor *m)
225 cpu_set(num_processors, cpu_possible_map); 198 cpu_set(num_processors, cpu_possible_map);
226 num_processors++; 199 num_processors++;
227 200
228 if (CPU_HOTPLUG_ENABLED || (num_processors > 8)) { 201 /*
202 * Would be preferable to switch to bigsmp when CONFIG_HOTPLUG_CPU=y
203 * but we need to work other dependencies like SMP_SUSPEND etc
204 * before this can be done without some confusion.
205 * if (CPU_HOTPLUG_ENABLED || num_processors > 8)
206 * - Ashok Raj <ashok.raj@intel.com>
207 */
208 if (num_processors > 8) {
229 switch (boot_cpu_data.x86_vendor) { 209 switch (boot_cpu_data.x86_vendor) {
230 case X86_VENDOR_INTEL: 210 case X86_VENDOR_INTEL:
231 if (!APIC_XAPIC(ver)) { 211 if (!APIC_XAPIC(ver)) {
@@ -249,6 +229,13 @@ static void __init MP_bus_info (struct mpc_config_bus *m)
249 229
250 mpc_oem_bus_info(m, str, translation_table[mpc_record]); 230 mpc_oem_bus_info(m, str, translation_table[mpc_record]);
251 231
232 if (m->mpc_busid >= MAX_MP_BUSSES) {
233 printk(KERN_WARNING "MP table busid value (%d) for bustype %s "
234 " is too large, max. supported is %d\n",
235 m->mpc_busid, str, MAX_MP_BUSSES - 1);
236 return;
237 }
238
252 if (strncmp(str, BUSTYPE_ISA, sizeof(BUSTYPE_ISA)-1) == 0) { 239 if (strncmp(str, BUSTYPE_ISA, sizeof(BUSTYPE_ISA)-1) == 0) {
253 mp_bus_id_to_type[m->mpc_busid] = MP_BUS_ISA; 240 mp_bus_id_to_type[m->mpc_busid] = MP_BUS_ISA;
254 } else if (strncmp(str, BUSTYPE_EISA, sizeof(BUSTYPE_EISA)-1) == 0) { 241 } else if (strncmp(str, BUSTYPE_EISA, sizeof(BUSTYPE_EISA)-1) == 0) {
diff --git a/arch/i386/kernel/reboot_fixups.c b/arch/i386/kernel/reboot_fixups.c
index 10e21a4773dd..99aab41a05b0 100644
--- a/arch/i386/kernel/reboot_fixups.c
+++ b/arch/i386/kernel/reboot_fixups.c
@@ -51,7 +51,5 @@ void mach_reboot_fixups(void)
51 51
52 cur->reboot_fixup(dev); 52 cur->reboot_fixup(dev);
53 } 53 }
54
55 printk(KERN_WARNING "No reboot fixup found for your hardware\n");
56} 54}
57 55
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index eacc3f0a2ea4..80cb3b2d0997 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -963,6 +963,36 @@ efi_memory_present_wrapper(unsigned long start, unsigned long end, void *arg)
963 return 0; 963 return 0;
964} 964}
965 965
966 /*
967 * This function checks if the entire range <start,end> is mapped with type.
968 *
969 * Note: this function only works correct if the e820 table is sorted and
970 * not-overlapping, which is the case
971 */
972int __init
973e820_all_mapped(unsigned long start, unsigned long end, unsigned type)
974{
975 int i;
976 for (i = 0; i < e820.nr_map; i++) {
977 struct e820entry *ei = &e820.map[i];
978 if (type && ei->type != type)
979 continue;
980 /* is the region (part) in overlap with the current region ?*/
981 if (ei->addr >= end || ei->addr + ei->size <= start)
982 continue;
983 /* if the region is at the beginning of <start,end> we move
984 * start to the end of the region since it's ok until there
985 */
986 if (ei->addr <= start)
987 start = ei->addr + ei->size;
988 /* if start is now at or beyond end, we're done, full
989 * coverage */
990 if (start >= end)
991 return 1; /* we're done */
992 }
993 return 0;
994}
995
966/* 996/*
967 * Find the highest page frame number we have available 997 * Find the highest page frame number we have available
968 */ 998 */
@@ -1317,8 +1347,8 @@ legacy_init_iomem_resources(struct resource *code_resource, struct resource *dat
1317/* 1347/*
1318 * Request address space for all standard resources 1348 * Request address space for all standard resources
1319 * 1349 *
1320 * This is called just before pcibios_assign_resources(), which is also 1350 * This is called just before pcibios_init(), which is also a
1321 * an fs_initcall, but is linked in later (in arch/i386/pci/i386.c). 1351 * subsys_initcall, but is linked in later (in arch/i386/pci/common.c).
1322 */ 1352 */
1323static int __init request_standard_resources(void) 1353static int __init request_standard_resources(void)
1324{ 1354{
@@ -1339,7 +1369,7 @@ static int __init request_standard_resources(void)
1339 return 0; 1369 return 0;
1340} 1370}
1341 1371
1342fs_initcall(request_standard_resources); 1372subsys_initcall(request_standard_resources);
1343 1373
1344static void __init register_memory(void) 1374static void __init register_memory(void)
1345{ 1375{
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index e38527994590..2d22f5761b1d 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -365,6 +365,9 @@ void die(const char * str, struct pt_regs * regs, long err)
365 365
366 if (++die.lock_owner_depth < 3) { 366 if (++die.lock_owner_depth < 3) {
367 int nl = 0; 367 int nl = 0;
368 unsigned long esp;
369 unsigned short ss;
370
368 handle_BUG(regs); 371 handle_BUG(regs);
369 printk(KERN_EMERG "%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); 372 printk(KERN_EMERG "%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter);
370#ifdef CONFIG_PREEMPT 373#ifdef CONFIG_PREEMPT
@@ -387,8 +390,19 @@ void die(const char * str, struct pt_regs * regs, long err)
387 printk("\n"); 390 printk("\n");
388 if (notify_die(DIE_OOPS, str, regs, err, 391 if (notify_die(DIE_OOPS, str, regs, err,
389 current->thread.trap_no, SIGSEGV) != 392 current->thread.trap_no, SIGSEGV) !=
390 NOTIFY_STOP) 393 NOTIFY_STOP) {
391 show_registers(regs); 394 show_registers(regs);
395 /* Executive summary in case the oops scrolled away */
396 esp = (unsigned long) (&regs->esp);
397 savesegment(ss, ss);
398 if (user_mode(regs)) {
399 esp = regs->esp;
400 ss = regs->xss & 0xffff;
401 }
402 printk(KERN_EMERG "EIP: [<%08lx>] ", regs->eip);
403 print_symbol("%s", regs->eip);
404 printk(" SS:ESP %04x:%08lx\n", ss, esp);
405 }
392 else 406 else
393 regs = NULL; 407 regs = NULL;
394 } else 408 } else
diff --git a/arch/i386/mach-voyager/voyager_cat.c b/arch/i386/mach-voyager/voyager_cat.c
index 23967fe658d3..3039539de51e 100644
--- a/arch/i386/mach-voyager/voyager_cat.c
+++ b/arch/i386/mach-voyager/voyager_cat.c
@@ -106,9 +106,15 @@ voyager_module_t *voyager_cat_list;
106 106
107/* the I/O port assignments for the VIC and QIC */ 107/* the I/O port assignments for the VIC and QIC */
108static struct resource vic_res = { 108static struct resource vic_res = {
109 "Voyager Interrupt Controller", 0xFC00, 0xFC6F }; 109 .name = "Voyager Interrupt Controller",
110 .start = 0xFC00,
111 .end = 0xFC6F
112};
110static struct resource qic_res = { 113static struct resource qic_res = {
111 "Quad Interrupt Controller", 0xFC70, 0xFCFF }; 114 .name = "Quad Interrupt Controller",
115 .start = 0xFC70,
116 .end = 0xFCFF
117};
112 118
113/* This function is used to pack a data bit stream inside a message. 119/* This function is used to pack a data bit stream inside a message.
114 * It writes num_bits of the data buffer in msg starting at start_bit. 120 * It writes num_bits of the data buffer in msg starting at start_bit.
diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c
index 9f66ac582a8b..ae6534ad8161 100644
--- a/arch/i386/mm/init.c
+++ b/arch/i386/mm/init.c
@@ -651,6 +651,7 @@ void __init mem_init(void)
651 * Specifically, in the case of x86, we will always add 651 * Specifically, in the case of x86, we will always add
652 * memory to the highmem for now. 652 * memory to the highmem for now.
653 */ 653 */
654#ifdef CONFIG_HOTPLUG_MEMORY
654#ifndef CONFIG_NEED_MULTIPLE_NODES 655#ifndef CONFIG_NEED_MULTIPLE_NODES
655int add_memory(u64 start, u64 size) 656int add_memory(u64 start, u64 size)
656{ 657{
@@ -667,6 +668,7 @@ int remove_memory(u64 start, u64 size)
667 return -EINVAL; 668 return -EINVAL;
668} 669}
669#endif 670#endif
671#endif
670 672
671kmem_cache_t *pgd_cache; 673kmem_cache_t *pgd_cache;
672kmem_cache_t *pmd_cache; 674kmem_cache_t *pmd_cache;
diff --git a/arch/i386/pci/direct.c b/arch/i386/pci/direct.c
index 99012b93bd12..5d81fb510375 100644
--- a/arch/i386/pci/direct.c
+++ b/arch/i386/pci/direct.c
@@ -4,6 +4,7 @@
4 4
5#include <linux/pci.h> 5#include <linux/pci.h>
6#include <linux/init.h> 6#include <linux/init.h>
7#include <linux/dmi.h>
7#include "pci.h" 8#include "pci.h"
8 9
9/* 10/*
@@ -18,8 +19,10 @@ int pci_conf1_read(unsigned int seg, unsigned int bus,
18{ 19{
19 unsigned long flags; 20 unsigned long flags;
20 21
21 if (!value || (bus > 255) || (devfn > 255) || (reg > 255)) 22 if ((bus > 255) || (devfn > 255) || (reg > 255)) {
23 *value = -1;
22 return -EINVAL; 24 return -EINVAL;
25 }
23 26
24 spin_lock_irqsave(&pci_config_lock, flags); 27 spin_lock_irqsave(&pci_config_lock, flags);
25 28
@@ -91,8 +94,10 @@ static int pci_conf2_read(unsigned int seg, unsigned int bus,
91 unsigned long flags; 94 unsigned long flags;
92 int dev, fn; 95 int dev, fn;
93 96
94 if (!value || (bus > 255) || (devfn > 255) || (reg > 255)) 97 if ((bus > 255) || (devfn > 255) || (reg > 255)) {
98 *value = -1;
95 return -EINVAL; 99 return -EINVAL;
100 }
96 101
97 dev = PCI_SLOT(devfn); 102 dev = PCI_SLOT(devfn);
98 fn = PCI_FUNC(devfn); 103 fn = PCI_FUNC(devfn);
@@ -188,6 +193,10 @@ static int __init pci_sanity_check(struct pci_raw_ops *o)
188 193
189 if (pci_probe & PCI_NO_CHECKS) 194 if (pci_probe & PCI_NO_CHECKS)
190 return 1; 195 return 1;
196 /* Assume Type 1 works for newer systems.
197 This handles machines that don't have anything on PCI Bus 0. */
198 if (dmi_get_year(DMI_BIOS_DATE) >= 2001)
199 return 1;
191 200
192 for (devfn = 0; devfn < 0x100; devfn++) { 201 for (devfn = 0; devfn < 0x100; devfn++) {
193 if (o->read(0, 0, devfn, PCI_CLASS_DEVICE, 2, &x)) 202 if (o->read(0, 0, devfn, PCI_CLASS_DEVICE, 2, &x))
diff --git a/arch/i386/pci/mmconfig.c b/arch/i386/pci/mmconfig.c
index 613789071f30..6b1ea0c9a570 100644
--- a/arch/i386/pci/mmconfig.c
+++ b/arch/i386/pci/mmconfig.c
@@ -12,14 +12,20 @@
12#include <linux/pci.h> 12#include <linux/pci.h>
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/acpi.h> 14#include <linux/acpi.h>
15#include <asm/e820.h>
15#include "pci.h" 16#include "pci.h"
16 17
18#define MMCONFIG_APER_SIZE (256*1024*1024)
19
20/* Assume systems with more busses have correct MCFG */
21#define MAX_CHECK_BUS 16
22
17#define mmcfg_virt_addr ((void __iomem *) fix_to_virt(FIX_PCIE_MCFG)) 23#define mmcfg_virt_addr ((void __iomem *) fix_to_virt(FIX_PCIE_MCFG))
18 24
19/* The base address of the last MMCONFIG device accessed */ 25/* The base address of the last MMCONFIG device accessed */
20static u32 mmcfg_last_accessed_device; 26static u32 mmcfg_last_accessed_device;
21 27
22static DECLARE_BITMAP(fallback_slots, 32); 28static DECLARE_BITMAP(fallback_slots, MAX_CHECK_BUS*32);
23 29
24/* 30/*
25 * Functions for accessing PCI configuration space with MMCONFIG accesses 31 * Functions for accessing PCI configuration space with MMCONFIG accesses
@@ -29,8 +35,8 @@ static u32 get_base_addr(unsigned int seg, int bus, unsigned devfn)
29 int cfg_num = -1; 35 int cfg_num = -1;
30 struct acpi_table_mcfg_config *cfg; 36 struct acpi_table_mcfg_config *cfg;
31 37
32 if (seg == 0 && bus == 0 && 38 if (seg == 0 && bus < MAX_CHECK_BUS &&
33 test_bit(PCI_SLOT(devfn), fallback_slots)) 39 test_bit(PCI_SLOT(devfn) + 32*bus, fallback_slots))
34 return 0; 40 return 0;
35 41
36 while (1) { 42 while (1) {
@@ -74,8 +80,10 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int bus,
74 unsigned long flags; 80 unsigned long flags;
75 u32 base; 81 u32 base;
76 82
77 if (!value || (bus > 255) || (devfn > 255) || (reg > 4095)) 83 if ((bus > 255) || (devfn > 255) || (reg > 4095)) {
84 *value = -1;
78 return -EINVAL; 85 return -EINVAL;
86 }
79 87
80 base = get_base_addr(seg, bus, devfn); 88 base = get_base_addr(seg, bus, devfn);
81 if (!base) 89 if (!base)
@@ -146,29 +154,34 @@ static struct pci_raw_ops pci_mmcfg = {
146 Normally this can be expressed in the MCFG by not listing them 154 Normally this can be expressed in the MCFG by not listing them
147 and assigning suitable _SEGs, but this isn't implemented in some BIOS. 155 and assigning suitable _SEGs, but this isn't implemented in some BIOS.
148 Instead try to discover all devices on bus 0 that are unreachable using MM 156 Instead try to discover all devices on bus 0 that are unreachable using MM
149 and fallback for them. 157 and fallback for them. */
150 We only do this for bus 0/seg 0 */
151static __init void unreachable_devices(void) 158static __init void unreachable_devices(void)
152{ 159{
153 int i; 160 int i, k;
154 unsigned long flags; 161 unsigned long flags;
155 162
156 for (i = 0; i < 32; i++) { 163 for (k = 0; k < MAX_CHECK_BUS; k++) {
157 u32 val1; 164 for (i = 0; i < 32; i++) {
158 u32 addr; 165 u32 val1;
159 166 u32 addr;
160 pci_conf1_read(0, 0, PCI_DEVFN(i, 0), 0, 4, &val1); 167
161 if (val1 == 0xffffffff) 168 pci_conf1_read(0, k, PCI_DEVFN(i, 0), 0, 4, &val1);
162 continue; 169 if (val1 == 0xffffffff)
163 170 continue;
164 /* Locking probably not needed, but safer */ 171
165 spin_lock_irqsave(&pci_config_lock, flags); 172 /* Locking probably not needed, but safer */
166 addr = get_base_addr(0, 0, PCI_DEVFN(i, 0)); 173 spin_lock_irqsave(&pci_config_lock, flags);
167 if (addr != 0) 174 addr = get_base_addr(0, k, PCI_DEVFN(i, 0));
168 pci_exp_set_dev_base(addr, 0, PCI_DEVFN(i, 0)); 175 if (addr != 0)
169 if (addr == 0 || readl((u32 __iomem *)mmcfg_virt_addr) != val1) 176 pci_exp_set_dev_base(addr, k, PCI_DEVFN(i, 0));
170 set_bit(i, fallback_slots); 177 if (addr == 0 ||
171 spin_unlock_irqrestore(&pci_config_lock, flags); 178 readl((u32 __iomem *)mmcfg_virt_addr) != val1) {
179 set_bit(i, fallback_slots);
180 printk(KERN_NOTICE
181 "PCI: No mmconfig possible on %x:%x\n", k, i);
182 }
183 spin_unlock_irqrestore(&pci_config_lock, flags);
184 }
172 } 185 }
173} 186}
174 187
@@ -183,6 +196,14 @@ void __init pci_mmcfg_init(void)
183 (pci_mmcfg_config[0].base_address == 0)) 196 (pci_mmcfg_config[0].base_address == 0))
184 return; 197 return;
185 198
199 if (!e820_all_mapped(pci_mmcfg_config[0].base_address,
200 pci_mmcfg_config[0].base_address + MMCONFIG_APER_SIZE,
201 E820_RESERVED)) {
202 printk(KERN_ERR "PCI: BIOS Bug: MCFG area is not E820-reserved\n");
203 printk(KERN_ERR "PCI: Not using MMCONFIG.\n");
204 return;
205 }
206
186 printk(KERN_INFO "PCI: Using MMCONFIG\n"); 207 printk(KERN_INFO "PCI: Using MMCONFIG\n");
187 raw_pci_ops = &pci_mmcfg; 208 raw_pci_ops = &pci_mmcfg;
188 pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF; 209 pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF;