aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-09-30 23:45:41 -0400
committerJeff Garzik <jeff@garzik.org>2006-09-30 23:45:41 -0400
commit1c7da74c4aab595a994beb5fe728ebf0d0b41f59 (patch)
tree64128abdf9550ebb51d8f3ee6732d7350b9c62f2 /arch/i386
parentaebb1153ac54ddbbd3d3f0481a193f4bf0ead53b (diff)
parent1bdfd554be94def718323659173517c5d4a69d25 (diff)
Merge branch 'master' into upstream
Diffstat (limited to 'arch/i386')
-rw-r--r--arch/i386/defconfig7
-rw-r--r--arch/i386/kernel/apm.c36
-rw-r--r--arch/i386/kernel/efi.c4
-rw-r--r--arch/i386/kernel/nmi.c3
-rw-r--r--arch/i386/kernel/setup.c10
-rw-r--r--arch/i386/kernel/smpboot.c5
-rw-r--r--arch/i386/kernel/srat.c7
-rw-r--r--arch/i386/kernel/traps.c2
-rw-r--r--arch/i386/lib/usercopy.c2
-rw-r--r--arch/i386/mm/fault.c4
-rw-r--r--arch/i386/oprofile/op_model_ppro.c20
11 files changed, 59 insertions, 41 deletions
diff --git a/arch/i386/defconfig b/arch/i386/defconfig
index 1a29bfa26d..ee2d79bd8a 100644
--- a/arch/i386/defconfig
+++ b/arch/i386/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.18-git5 3# Linux kernel version: 2.6.18-git7
4# Tue Sep 26 09:30:47 2006 4# Wed Sep 27 21:53:10 2006
5# 5#
6CONFIG_X86_32=y 6CONFIG_X86_32=y
7CONFIG_GENERIC_TIME=y 7CONFIG_GENERIC_TIME=y
@@ -210,6 +210,7 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
210CONFIG_PM=y 210CONFIG_PM=y
211CONFIG_PM_LEGACY=y 211CONFIG_PM_LEGACY=y
212# CONFIG_PM_DEBUG is not set 212# CONFIG_PM_DEBUG is not set
213CONFIG_PM_SYSFS_DEPRECATED=y
213 214
214# 215#
215# ACPI (Advanced Configuration and Power Interface) Support 216# ACPI (Advanced Configuration and Power Interface) Support
@@ -292,6 +293,7 @@ CONFIG_PCI_DIRECT=y
292CONFIG_PCI_MMCONFIG=y 293CONFIG_PCI_MMCONFIG=y
293# CONFIG_PCIEPORTBUS is not set 294# CONFIG_PCIEPORTBUS is not set
294CONFIG_PCI_MSI=y 295CONFIG_PCI_MSI=y
296# CONFIG_PCI_MULTITHREAD_PROBE is not set
295# CONFIG_PCI_DEBUG is not set 297# CONFIG_PCI_DEBUG is not set
296CONFIG_ISA_DMA_API=y 298CONFIG_ISA_DMA_API=y
297# CONFIG_ISA is not set 299# CONFIG_ISA is not set
@@ -1427,6 +1429,7 @@ CONFIG_KPROBES=y
1427# 1429#
1428CONFIG_TRACE_IRQFLAGS_SUPPORT=y 1430CONFIG_TRACE_IRQFLAGS_SUPPORT=y
1429# CONFIG_PRINTK_TIME is not set 1431# CONFIG_PRINTK_TIME is not set
1432# CONFIG_ENABLE_MUST_CHECK is not set
1430CONFIG_MAGIC_SYSRQ=y 1433CONFIG_MAGIC_SYSRQ=y
1431CONFIG_UNUSED_SYMBOLS=y 1434CONFIG_UNUSED_SYMBOLS=y
1432CONFIG_DEBUG_KERNEL=y 1435CONFIG_DEBUG_KERNEL=y
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c
index ff9ce4b5ea..b42f2d914a 100644
--- a/arch/i386/kernel/apm.c
+++ b/arch/i386/kernel/apm.c
@@ -225,6 +225,7 @@
225#include <linux/smp_lock.h> 225#include <linux/smp_lock.h>
226#include <linux/dmi.h> 226#include <linux/dmi.h>
227#include <linux/suspend.h> 227#include <linux/suspend.h>
228#include <linux/kthread.h>
228 229
229#include <asm/system.h> 230#include <asm/system.h>
230#include <asm/uaccess.h> 231#include <asm/uaccess.h>
@@ -402,8 +403,6 @@ static int realmode_power_off = 1;
402#else 403#else
403static int realmode_power_off; 404static int realmode_power_off;
404#endif 405#endif
405static int exit_kapmd __read_mostly;
406static int kapmd_running __read_mostly;
407#ifdef CONFIG_APM_ALLOW_INTS 406#ifdef CONFIG_APM_ALLOW_INTS
408static int allow_ints = 1; 407static int allow_ints = 1;
409#else 408#else
@@ -419,6 +418,8 @@ static const struct desc_struct bad_bios_desc = { 0, 0x00409200 };
419 418
420static const char driver_version[] = "1.16ac"; /* no spaces */ 419static const char driver_version[] = "1.16ac"; /* no spaces */
421 420
421static struct task_struct *kapmd_task;
422
422/* 423/*
423 * APM event names taken from the APM 1.2 specification. These are 424 * APM event names taken from the APM 1.2 specification. These are
424 * the message codes that the BIOS uses to tell us about events 425 * the message codes that the BIOS uses to tell us about events
@@ -1423,7 +1424,7 @@ static void apm_mainloop(void)
1423 set_current_state(TASK_INTERRUPTIBLE); 1424 set_current_state(TASK_INTERRUPTIBLE);
1424 for (;;) { 1425 for (;;) {
1425 schedule_timeout(APM_CHECK_TIMEOUT); 1426 schedule_timeout(APM_CHECK_TIMEOUT);
1426 if (exit_kapmd) 1427 if (kthread_should_stop())
1427 break; 1428 break;
1428 /* 1429 /*
1429 * Ok, check all events, check for idle (and mark us sleeping 1430 * Ok, check all events, check for idle (and mark us sleeping
@@ -1706,12 +1707,6 @@ static int apm(void *unused)
1706 char * power_stat; 1707 char * power_stat;
1707 char * bat_stat; 1708 char * bat_stat;
1708 1709
1709 kapmd_running = 1;
1710
1711 daemonize("kapmd");
1712
1713 current->flags |= PF_NOFREEZE;
1714
1715#ifdef CONFIG_SMP 1710#ifdef CONFIG_SMP
1716 /* 2002/08/01 - WT 1711 /* 2002/08/01 - WT
1717 * This is to avoid random crashes at boot time during initialization 1712 * This is to avoid random crashes at boot time during initialization
@@ -1821,7 +1816,6 @@ static int apm(void *unused)
1821 console_blank_hook = NULL; 1816 console_blank_hook = NULL;
1822#endif 1817#endif
1823 } 1818 }
1824 kapmd_running = 0;
1825 1819
1826 return 0; 1820 return 0;
1827} 1821}
@@ -2220,7 +2214,7 @@ static int __init apm_init(void)
2220{ 2214{
2221 struct proc_dir_entry *apm_proc; 2215 struct proc_dir_entry *apm_proc;
2222 struct desc_struct *gdt; 2216 struct desc_struct *gdt;
2223 int ret; 2217 int err;
2224 2218
2225 dmi_check_system(apm_dmi_table); 2219 dmi_check_system(apm_dmi_table);
2226 2220
@@ -2329,12 +2323,17 @@ static int __init apm_init(void)
2329 if (apm_proc) 2323 if (apm_proc)
2330 apm_proc->owner = THIS_MODULE; 2324 apm_proc->owner = THIS_MODULE;
2331 2325
2332 ret = kernel_thread(apm, NULL, CLONE_KERNEL | SIGCHLD); 2326 kapmd_task = kthread_create(apm, NULL, "kapmd");
2333 if (ret < 0) { 2327 if (IS_ERR(kapmd_task)) {
2334 printk(KERN_ERR "apm: disabled - Unable to start kernel thread.\n"); 2328 printk(KERN_ERR "apm: disabled - Unable to start kernel "
2329 "thread.\n");
2330 err = PTR_ERR(kapmd_task);
2331 kapmd_task = NULL;
2335 remove_proc_entry("apm", NULL); 2332 remove_proc_entry("apm", NULL);
2336 return -ENOMEM; 2333 return err;
2337 } 2334 }
2335 kapmd_task->flags |= PF_NOFREEZE;
2336 wake_up_process(kapmd_task);
2338 2337
2339 if (num_online_cpus() > 1 && !smp ) { 2338 if (num_online_cpus() > 1 && !smp ) {
2340 printk(KERN_NOTICE 2339 printk(KERN_NOTICE
@@ -2384,9 +2383,10 @@ static void __exit apm_exit(void)
2384 remove_proc_entry("apm", NULL); 2383 remove_proc_entry("apm", NULL);
2385 if (power_off) 2384 if (power_off)
2386 pm_power_off = NULL; 2385 pm_power_off = NULL;
2387 exit_kapmd = 1; 2386 if (kapmd_task) {
2388 while (kapmd_running) 2387 kthread_stop(kapmd_task);
2389 schedule(); 2388 kapmd_task = NULL;
2389 }
2390#ifdef CONFIG_PM_LEGACY 2390#ifdef CONFIG_PM_LEGACY
2391 pm_active = 0; 2391 pm_active = 0;
2392#endif 2392#endif
diff --git a/arch/i386/kernel/efi.c b/arch/i386/kernel/efi.c
index fe15804211..f943698947 100644
--- a/arch/i386/kernel/efi.c
+++ b/arch/i386/kernel/efi.c
@@ -65,7 +65,7 @@ static unsigned long efi_rt_eflags;
65static DEFINE_SPINLOCK(efi_rt_lock); 65static DEFINE_SPINLOCK(efi_rt_lock);
66static pgd_t efi_bak_pg_dir_pointer[2]; 66static pgd_t efi_bak_pg_dir_pointer[2];
67 67
68static void efi_call_phys_prelog(void) 68static void efi_call_phys_prelog(void) __acquires(efi_rt_lock)
69{ 69{
70 unsigned long cr4; 70 unsigned long cr4;
71 unsigned long temp; 71 unsigned long temp;
@@ -109,7 +109,7 @@ static void efi_call_phys_prelog(void)
109 load_gdt(cpu_gdt_descr); 109 load_gdt(cpu_gdt_descr);
110} 110}
111 111
112static void efi_call_phys_epilog(void) 112static void efi_call_phys_epilog(void) __releases(efi_rt_lock)
113{ 113{
114 unsigned long cr4; 114 unsigned long cr4;
115 struct Xgt_desc_struct *cpu_gdt_descr = &per_cpu(cpu_gdt_descr, 0); 115 struct Xgt_desc_struct *cpu_gdt_descr = &per_cpu(cpu_gdt_descr, 0);
diff --git a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c
index dbda706fdd..0fc4997fb1 100644
--- a/arch/i386/kernel/nmi.c
+++ b/arch/i386/kernel/nmi.c
@@ -31,6 +31,9 @@
31 31
32#include "mach_traps.h" 32#include "mach_traps.h"
33 33
34int unknown_nmi_panic;
35int nmi_watchdog_enabled;
36
34/* perfctr_nmi_owner tracks the ownership of the perfctr registers: 37/* perfctr_nmi_owner tracks the ownership of the perfctr registers:
35 * evtsel_nmi_owner tracks the ownership of the event selection 38 * evtsel_nmi_owner tracks the ownership of the event selection
36 * - different performance counters/ event selection may be reserved for 39 * - different performance counters/ event selection may be reserved for
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 814cdebf73..000cf03751 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -209,9 +209,6 @@ static struct resource adapter_rom_resources[] = { {
209 .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM 209 .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM
210} }; 210} };
211 211
212#define ADAPTER_ROM_RESOURCES \
213 (sizeof adapter_rom_resources / sizeof adapter_rom_resources[0])
214
215static struct resource video_rom_resource = { 212static struct resource video_rom_resource = {
216 .name = "Video ROM", 213 .name = "Video ROM",
217 .start = 0xc0000, 214 .start = 0xc0000,
@@ -273,9 +270,6 @@ static struct resource standard_io_resources[] = { {
273 .flags = IORESOURCE_BUSY | IORESOURCE_IO 270 .flags = IORESOURCE_BUSY | IORESOURCE_IO
274} }; 271} };
275 272
276#define STANDARD_IO_RESOURCES \
277 (sizeof standard_io_resources / sizeof standard_io_resources[0])
278
279#define romsignature(x) (*(unsigned short *)(x) == 0xaa55) 273#define romsignature(x) (*(unsigned short *)(x) == 0xaa55)
280 274
281static int __init romchecksum(unsigned char *rom, unsigned long length) 275static int __init romchecksum(unsigned char *rom, unsigned long length)
@@ -332,7 +326,7 @@ static void __init probe_roms(void)
332 } 326 }
333 327
334 /* check for adapter roms on 2k boundaries */ 328 /* check for adapter roms on 2k boundaries */
335 for (i = 0; i < ADAPTER_ROM_RESOURCES && start < upper; start += 2048) { 329 for (i = 0; i < ARRAY_SIZE(adapter_rom_resources) && start < upper; start += 2048) {
336 rom = isa_bus_to_virt(start); 330 rom = isa_bus_to_virt(start);
337 if (!romsignature(rom)) 331 if (!romsignature(rom))
338 continue; 332 continue;
@@ -1272,7 +1266,7 @@ static int __init request_standard_resources(void)
1272 request_resource(&iomem_resource, &video_ram_resource); 1266 request_resource(&iomem_resource, &video_ram_resource);
1273 1267
1274 /* request I/O space for devices used on all i[345]86 PCs */ 1268 /* request I/O space for devices used on all i[345]86 PCs */
1275 for (i = 0; i < STANDARD_IO_RESOURCES; i++) 1269 for (i = 0; i < ARRAY_SIZE(standard_io_resources); i++)
1276 request_resource(&ioport_resource, &standard_io_resources[i]); 1270 request_resource(&ioport_resource, &standard_io_resources[i]);
1277 return 0; 1271 return 0;
1278} 1272}
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index 020d873b7d..82b26d5ce4 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -102,6 +102,8 @@ u8 x86_cpu_to_apicid[NR_CPUS] __read_mostly =
102 { [0 ... NR_CPUS-1] = 0xff }; 102 { [0 ... NR_CPUS-1] = 0xff };
103EXPORT_SYMBOL(x86_cpu_to_apicid); 103EXPORT_SYMBOL(x86_cpu_to_apicid);
104 104
105u8 apicid_2_node[MAX_APICID];
106
105/* 107/*
106 * Trampoline 80x86 program as an array. 108 * Trampoline 80x86 program as an array.
107 */ 109 */
@@ -645,7 +647,7 @@ static void map_cpu_to_logical_apicid(void)
645{ 647{
646 int cpu = smp_processor_id(); 648 int cpu = smp_processor_id();
647 int apicid = logical_smp_processor_id(); 649 int apicid = logical_smp_processor_id();
648 int node = apicid_to_node(apicid); 650 int node = apicid_to_node(hard_smp_processor_id());
649 651
650 if (!node_online(node)) 652 if (!node_online(node))
651 node = first_online_node; 653 node = first_online_node;
@@ -954,6 +956,7 @@ static int __devinit do_boot_cpu(int apicid, int cpu)
954 956
955 irq_ctx_init(cpu); 957 irq_ctx_init(cpu);
956 958
959 x86_cpu_to_apicid[cpu] = apicid;
957 /* 960 /*
958 * This grunge runs the startup process for 961 * This grunge runs the startup process for
959 * the targeted processor. 962 * the targeted processor.
diff --git a/arch/i386/kernel/srat.c b/arch/i386/kernel/srat.c
index 32413122c4..f7e735c077 100644
--- a/arch/i386/kernel/srat.c
+++ b/arch/i386/kernel/srat.c
@@ -30,6 +30,7 @@
30#include <linux/nodemask.h> 30#include <linux/nodemask.h>
31#include <asm/srat.h> 31#include <asm/srat.h>
32#include <asm/topology.h> 32#include <asm/topology.h>
33#include <asm/smp.h>
33 34
34/* 35/*
35 * proximity macros and definitions 36 * proximity macros and definitions
@@ -54,6 +55,7 @@ struct node_memory_chunk_s {
54static struct node_memory_chunk_s node_memory_chunk[MAXCHUNKS]; 55static struct node_memory_chunk_s node_memory_chunk[MAXCHUNKS];
55 56
56static int num_memory_chunks; /* total number of memory chunks */ 57static int num_memory_chunks; /* total number of memory chunks */
58static u8 __initdata apicid_to_pxm[MAX_APICID];
57 59
58extern void * boot_ioremap(unsigned long, unsigned long); 60extern void * boot_ioremap(unsigned long, unsigned long);
59 61
@@ -69,6 +71,8 @@ static void __init parse_cpu_affinity_structure(char *p)
69 /* mark this node as "seen" in node bitmap */ 71 /* mark this node as "seen" in node bitmap */
70 BMAP_SET(pxm_bitmap, cpu_affinity->proximity_domain); 72 BMAP_SET(pxm_bitmap, cpu_affinity->proximity_domain);
71 73
74 apicid_to_pxm[cpu_affinity->apic_id] = cpu_affinity->proximity_domain;
75
72 printk("CPU 0x%02X in proximity domain 0x%02X\n", 76 printk("CPU 0x%02X in proximity domain 0x%02X\n",
73 cpu_affinity->apic_id, cpu_affinity->proximity_domain); 77 cpu_affinity->apic_id, cpu_affinity->proximity_domain);
74} 78}
@@ -235,6 +239,9 @@ static int __init acpi20_parse_srat(struct acpi_table_srat *sratp)
235 printk("Number of logical nodes in system = %d\n", num_online_nodes()); 239 printk("Number of logical nodes in system = %d\n", num_online_nodes());
236 printk("Number of memory chunks in system = %d\n", num_memory_chunks); 240 printk("Number of memory chunks in system = %d\n", num_memory_chunks);
237 241
242 for (i = 0; i < MAX_APICID; i++)
243 apicid_2_node[i] = pxm_to_node(apicid_to_pxm[i]);
244
238 for (j = 0; j < num_memory_chunks; j++){ 245 for (j = 0; j < num_memory_chunks; j++){
239 struct node_memory_chunk_s * chunk = &node_memory_chunk[j]; 246 struct node_memory_chunk_s * chunk = &node_memory_chunk[j];
240 printk("chunk %d nid %d start_pfn %08lx end_pfn %08lx\n", 247 printk("chunk %d nid %d start_pfn %08lx end_pfn %08lx\n",
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index a13037fe0e..6820b8d643 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -57,6 +57,8 @@
57 57
58#include "mach_traps.h" 58#include "mach_traps.h"
59 59
60int panic_on_unrecovered_nmi;
61
60asmlinkage int system_call(void); 62asmlinkage int system_call(void);
61 63
62struct desc_struct default_ldt[] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, 64struct desc_struct default_ldt[] = { { 0, 0 }, { 0, 0 }, { 0, 0 },
diff --git a/arch/i386/lib/usercopy.c b/arch/i386/lib/usercopy.c
index efc7e7d5f4..08502fc6d0 100644
--- a/arch/i386/lib/usercopy.c
+++ b/arch/i386/lib/usercopy.c
@@ -739,7 +739,7 @@ survive:
739 retval = get_user_pages(current, current->mm, 739 retval = get_user_pages(current, current->mm,
740 (unsigned long )to, 1, 1, 0, &pg, NULL); 740 (unsigned long )to, 1, 1, 0, &pg, NULL);
741 741
742 if (retval == -ENOMEM && current->pid == 1) { 742 if (retval == -ENOMEM && is_init(current)) {
743 up_read(&current->mm->mmap_sem); 743 up_read(&current->mm->mmap_sem);
744 blk_congestion_wait(WRITE, HZ/50); 744 blk_congestion_wait(WRITE, HZ/50);
745 goto survive; 745 goto survive;
diff --git a/arch/i386/mm/fault.c b/arch/i386/mm/fault.c
index 5e17a3f43b..2581575786 100644
--- a/arch/i386/mm/fault.c
+++ b/arch/i386/mm/fault.c
@@ -440,7 +440,7 @@ good_area:
440 case 1: /* read, present */ 440 case 1: /* read, present */
441 goto bad_area; 441 goto bad_area;
442 case 0: /* read, not present */ 442 case 0: /* read, not present */
443 if (!(vma->vm_flags & (VM_READ | VM_EXEC))) 443 if (!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)))
444 goto bad_area; 444 goto bad_area;
445 } 445 }
446 446
@@ -589,7 +589,7 @@ no_context:
589 */ 589 */
590out_of_memory: 590out_of_memory:
591 up_read(&mm->mmap_sem); 591 up_read(&mm->mmap_sem);
592 if (tsk->pid == 1) { 592 if (is_init(tsk)) {
593 yield(); 593 yield();
594 down_read(&mm->mmap_sem); 594 down_read(&mm->mmap_sem);
595 goto survive; 595 goto survive;
diff --git a/arch/i386/oprofile/op_model_ppro.c b/arch/i386/oprofile/op_model_ppro.c
index f88e05ba8e..ca2447e05e 100644
--- a/arch/i386/oprofile/op_model_ppro.c
+++ b/arch/i386/oprofile/op_model_ppro.c
@@ -138,11 +138,14 @@ static int ppro_check_ctrs(struct pt_regs * const regs,
138static void ppro_start(struct op_msrs const * const msrs) 138static void ppro_start(struct op_msrs const * const msrs)
139{ 139{
140 unsigned int low,high; 140 unsigned int low,high;
141 int i;
141 142
142 if (reset_value[0]) { 143 for (i = 0; i < NUM_COUNTERS; ++i) {
143 CTRL_READ(low, high, msrs, 0); 144 if (reset_value[i]) {
144 CTRL_SET_ACTIVE(low); 145 CTRL_READ(low, high, msrs, i);
145 CTRL_WRITE(low, high, msrs, 0); 146 CTRL_SET_ACTIVE(low);
147 CTRL_WRITE(low, high, msrs, i);
148 }
146 } 149 }
147} 150}
148 151
@@ -150,11 +153,14 @@ static void ppro_start(struct op_msrs const * const msrs)
150static void ppro_stop(struct op_msrs const * const msrs) 153static void ppro_stop(struct op_msrs const * const msrs)
151{ 154{
152 unsigned int low,high; 155 unsigned int low,high;
156 int i;
153 157
154 if (reset_value[0]) { 158 for (i = 0; i < NUM_COUNTERS; ++i) {
155 CTRL_READ(low, high, msrs, 0); 159 if (!reset_value[i])
160 continue;
161 CTRL_READ(low, high, msrs, i);
156 CTRL_SET_INACTIVE(low); 162 CTRL_SET_INACTIVE(low);
157 CTRL_WRITE(low, high, msrs, 0); 163 CTRL_WRITE(low, high, msrs, i);
158 } 164 }
159} 165}
160 166