diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-07-13 16:23:51 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-07-13 16:23:51 -0400 |
commit | 327309e899662b482c58cf25f574513d38b5788c (patch) | |
tree | 069de438aa0e92dd9b6ba28e6b207e2cd07151a5 /arch/i386/kernel | |
parent | 0c168775709faa74c1b87f1e61046e0c51ade7f3 (diff) | |
parent | c32511e2718618f0b53479eb36e07439aa363a74 (diff) |
Merge upstream 2.6.13-rc3 into ieee80211 branch of netdev-2.6.
Diffstat (limited to 'arch/i386/kernel')
-rw-r--r-- | arch/i386/kernel/acpi/Makefile | 4 | ||||
-rw-r--r-- | arch/i386/kernel/acpi/cstate.c | 103 | ||||
-rw-r--r-- | arch/i386/kernel/acpi/wakeup.S | 5 | ||||
-rw-r--r-- | arch/i386/kernel/apic.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/apm.c | 5 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/common.c | 5 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/gx-suspmod.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/intel.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/mtrr/generic.c | 22 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/mtrr/main.c | 76 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/mtrr/mtrr.h | 1 | ||||
-rw-r--r-- | arch/i386/kernel/io_apic.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/kprobes.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/smpboot.c | 18 | ||||
-rw-r--r-- | arch/i386/kernel/syscall_table.S | 3 | ||||
-rw-r--r-- | arch/i386/kernel/time.c | 7 | ||||
-rw-r--r-- | arch/i386/kernel/timers/timer_cyclone.c | 4 | ||||
-rw-r--r-- | arch/i386/kernel/timers/timer_hpet.c | 4 | ||||
-rw-r--r-- | arch/i386/kernel/timers/timer_pit.c | 4 | ||||
-rw-r--r-- | arch/i386/kernel/timers/timer_tsc.c | 3 | ||||
-rw-r--r-- | arch/i386/kernel/vmlinux.lds.S | 3 |
22 files changed, 213 insertions, 66 deletions
diff --git a/arch/i386/kernel/acpi/Makefile b/arch/i386/kernel/acpi/Makefile index ee75cb286cfe..5e291a20c03d 100644 --- a/arch/i386/kernel/acpi/Makefile +++ b/arch/i386/kernel/acpi/Makefile | |||
@@ -2,3 +2,7 @@ obj-$(CONFIG_ACPI_BOOT) := boot.o | |||
2 | obj-$(CONFIG_X86_IO_APIC) += earlyquirk.o | 2 | obj-$(CONFIG_X86_IO_APIC) += earlyquirk.o |
3 | obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o | 3 | obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o |
4 | 4 | ||
5 | ifneq ($(CONFIG_ACPI_PROCESSOR),) | ||
6 | obj-y += cstate.o | ||
7 | endif | ||
8 | |||
diff --git a/arch/i386/kernel/acpi/cstate.c b/arch/i386/kernel/acpi/cstate.c new file mode 100644 index 000000000000..4c3036ba65df --- /dev/null +++ b/arch/i386/kernel/acpi/cstate.c | |||
@@ -0,0 +1,103 @@ | |||
1 | /* | ||
2 | * arch/i386/kernel/acpi/cstate.c | ||
3 | * | ||
4 | * Copyright (C) 2005 Intel Corporation | ||
5 | * Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> | ||
6 | * - Added _PDC for SMP C-states on Intel CPUs | ||
7 | */ | ||
8 | |||
9 | #include <linux/kernel.h> | ||
10 | #include <linux/module.h> | ||
11 | #include <linux/init.h> | ||
12 | #include <linux/acpi.h> | ||
13 | |||
14 | #include <acpi/processor.h> | ||
15 | #include <asm/acpi.h> | ||
16 | |||
17 | static void acpi_processor_power_init_intel_pdc(struct acpi_processor_power | ||
18 | *pow) | ||
19 | { | ||
20 | struct acpi_object_list *obj_list; | ||
21 | union acpi_object *obj; | ||
22 | u32 *buf; | ||
23 | |||
24 | /* allocate and initialize pdc. It will be used later. */ | ||
25 | obj_list = kmalloc(sizeof(struct acpi_object_list), GFP_KERNEL); | ||
26 | if (!obj_list) { | ||
27 | printk(KERN_ERR "Memory allocation error\n"); | ||
28 | return; | ||
29 | } | ||
30 | |||
31 | obj = kmalloc(sizeof(union acpi_object), GFP_KERNEL); | ||
32 | if (!obj) { | ||
33 | printk(KERN_ERR "Memory allocation error\n"); | ||
34 | kfree(obj_list); | ||
35 | return; | ||
36 | } | ||
37 | |||
38 | buf = kmalloc(12, GFP_KERNEL); | ||
39 | if (!buf) { | ||
40 | printk(KERN_ERR "Memory allocation error\n"); | ||
41 | kfree(obj); | ||
42 | kfree(obj_list); | ||
43 | return; | ||
44 | } | ||
45 | |||
46 | buf[0] = ACPI_PDC_REVISION_ID; | ||
47 | buf[1] = 1; | ||
48 | buf[2] = ACPI_PDC_C_CAPABILITY_SMP; | ||
49 | |||
50 | obj->type = ACPI_TYPE_BUFFER; | ||
51 | obj->buffer.length = 12; | ||
52 | obj->buffer.pointer = (u8 *) buf; | ||
53 | obj_list->count = 1; | ||
54 | obj_list->pointer = obj; | ||
55 | pow->pdc = obj_list; | ||
56 | |||
57 | return; | ||
58 | } | ||
59 | |||
60 | /* Initialize _PDC data based on the CPU vendor */ | ||
61 | void acpi_processor_power_init_pdc(struct acpi_processor_power *pow, | ||
62 | unsigned int cpu) | ||
63 | { | ||
64 | struct cpuinfo_x86 *c = cpu_data + cpu; | ||
65 | |||
66 | pow->pdc = NULL; | ||
67 | if (c->x86_vendor == X86_VENDOR_INTEL) | ||
68 | acpi_processor_power_init_intel_pdc(pow); | ||
69 | |||
70 | return; | ||
71 | } | ||
72 | |||
73 | EXPORT_SYMBOL(acpi_processor_power_init_pdc); | ||
74 | |||
75 | /* | ||
76 | * Initialize bm_flags based on the CPU cache properties | ||
77 | * On SMP it depends on cache configuration | ||
78 | * - When cache is not shared among all CPUs, we flush cache | ||
79 | * before entering C3. | ||
80 | * - When cache is shared among all CPUs, we use bm_check | ||
81 | * mechanism as in UP case | ||
82 | * | ||
83 | * This routine is called only after all the CPUs are online | ||
84 | */ | ||
85 | void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags, | ||
86 | unsigned int cpu) | ||
87 | { | ||
88 | struct cpuinfo_x86 *c = cpu_data + cpu; | ||
89 | |||
90 | flags->bm_check = 0; | ||
91 | if (num_online_cpus() == 1) | ||
92 | flags->bm_check = 1; | ||
93 | else if (c->x86_vendor == X86_VENDOR_INTEL) { | ||
94 | /* | ||
95 | * Today all CPUs that support C3 share cache. | ||
96 | * TBD: This needs to look at cache shared map, once | ||
97 | * multi-core detection patch makes to the base. | ||
98 | */ | ||
99 | flags->bm_check = 1; | ||
100 | } | ||
101 | } | ||
102 | |||
103 | EXPORT_SYMBOL(acpi_processor_power_init_bm_check); | ||
diff --git a/arch/i386/kernel/acpi/wakeup.S b/arch/i386/kernel/acpi/wakeup.S index 39d32484f6f5..44d886c745ec 100644 --- a/arch/i386/kernel/acpi/wakeup.S +++ b/arch/i386/kernel/acpi/wakeup.S | |||
@@ -74,8 +74,9 @@ wakeup_code: | |||
74 | movw %ax,%fs | 74 | movw %ax,%fs |
75 | movw $0x0e00 + 'i', %fs:(0x12) | 75 | movw $0x0e00 + 'i', %fs:(0x12) |
76 | 76 | ||
77 | # need a gdt | 77 | # need a gdt -- use lgdtl to force 32-bit operands, in case |
78 | lgdt real_save_gdt - wakeup_code | 78 | # the GDT is located past 16 megabytes. |
79 | lgdtl real_save_gdt - wakeup_code | ||
79 | 80 | ||
80 | movl real_save_cr0 - wakeup_code, %eax | 81 | movl real_save_cr0 - wakeup_code, %eax |
81 | movl %eax, %cr0 | 82 | movl %eax, %cr0 |
diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c index 93df90bbb87e..bd1dbf3bd223 100644 --- a/arch/i386/kernel/apic.c +++ b/arch/i386/kernel/apic.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <asm/desc.h> | 35 | #include <asm/desc.h> |
36 | #include <asm/arch_hooks.h> | 36 | #include <asm/arch_hooks.h> |
37 | #include <asm/hpet.h> | 37 | #include <asm/hpet.h> |
38 | #include <asm/i8253.h> | ||
38 | 39 | ||
39 | #include <mach_apic.h> | 40 | #include <mach_apic.h> |
40 | 41 | ||
@@ -879,7 +880,6 @@ fake_ioapic_page: | |||
879 | */ | 880 | */ |
880 | static unsigned int __devinit get_8254_timer_count(void) | 881 | static unsigned int __devinit get_8254_timer_count(void) |
881 | { | 882 | { |
882 | extern spinlock_t i8253_lock; | ||
883 | unsigned long flags; | 883 | unsigned long flags; |
884 | 884 | ||
885 | unsigned int count; | 885 | unsigned int count; |
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c index d48ce9290963..064211d5f41b 100644 --- a/arch/i386/kernel/apm.c +++ b/arch/i386/kernel/apm.c | |||
@@ -228,10 +228,10 @@ | |||
228 | #include <asm/system.h> | 228 | #include <asm/system.h> |
229 | #include <asm/uaccess.h> | 229 | #include <asm/uaccess.h> |
230 | #include <asm/desc.h> | 230 | #include <asm/desc.h> |
231 | #include <asm/i8253.h> | ||
231 | 232 | ||
232 | #include "io_ports.h" | 233 | #include "io_ports.h" |
233 | 234 | ||
234 | extern spinlock_t i8253_lock; | ||
235 | extern unsigned long get_cmos_time(void); | 235 | extern unsigned long get_cmos_time(void); |
236 | extern void machine_real_restart(unsigned char *, int); | 236 | extern void machine_real_restart(unsigned char *, int); |
237 | 237 | ||
@@ -1168,8 +1168,7 @@ static void get_time_diff(void) | |||
1168 | static void reinit_timer(void) | 1168 | static void reinit_timer(void) |
1169 | { | 1169 | { |
1170 | #ifdef INIT_TIMER_AFTER_SUSPEND | 1170 | #ifdef INIT_TIMER_AFTER_SUSPEND |
1171 | unsigned long flags; | 1171 | unsigned long flags; |
1172 | extern spinlock_t i8253_lock; | ||
1173 | 1172 | ||
1174 | spin_lock_irqsave(&i8253_lock, flags); | 1173 | spin_lock_irqsave(&i8253_lock, flags); |
1175 | /* set the clock to 100 Hz */ | 1174 | /* set the clock to 100 Hz */ |
diff --git a/arch/i386/kernel/cpu/common.c b/arch/i386/kernel/cpu/common.c index 2203a9d20212..4553ffd94b1f 100644 --- a/arch/i386/kernel/cpu/common.c +++ b/arch/i386/kernel/cpu/common.c | |||
@@ -435,6 +435,11 @@ void __devinit identify_cpu(struct cpuinfo_x86 *c) | |||
435 | if (c == &boot_cpu_data) | 435 | if (c == &boot_cpu_data) |
436 | sysenter_setup(); | 436 | sysenter_setup(); |
437 | enable_sep_cpu(); | 437 | enable_sep_cpu(); |
438 | |||
439 | if (c == &boot_cpu_data) | ||
440 | mtrr_bp_init(); | ||
441 | else | ||
442 | mtrr_ap_init(); | ||
438 | } | 443 | } |
439 | 444 | ||
440 | #ifdef CONFIG_X86_HT | 445 | #ifdef CONFIG_X86_HT |
diff --git a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c b/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c index 1a49adb1f4a6..e86ea486c311 100644 --- a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c +++ b/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c | |||
@@ -190,7 +190,7 @@ static __init struct pci_dev *gx_detect_chipset(void) | |||
190 | 190 | ||
191 | /* detect which companion chip is used */ | 191 | /* detect which companion chip is used */ |
192 | while ((gx_pci = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, gx_pci)) != NULL) { | 192 | while ((gx_pci = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, gx_pci)) != NULL) { |
193 | if ((pci_match_device (gx_chipset_tbl, gx_pci)) != NULL) { | 193 | if ((pci_match_id(gx_chipset_tbl, gx_pci)) != NULL) { |
194 | return gx_pci; | 194 | return gx_pci; |
195 | } | 195 | } |
196 | } | 196 | } |
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c index 7dcbf70fc16f..327a55d4d1c6 100644 --- a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c +++ b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c | |||
@@ -375,7 +375,7 @@ static int centrino_cpu_init_acpi(struct cpufreq_policy *policy) | |||
375 | arg0.buffer.pointer = (u8 *) arg0_buf; | 375 | arg0.buffer.pointer = (u8 *) arg0_buf; |
376 | arg0_buf[0] = ACPI_PDC_REVISION_ID; | 376 | arg0_buf[0] = ACPI_PDC_REVISION_ID; |
377 | arg0_buf[1] = 1; | 377 | arg0_buf[1] = 1; |
378 | arg0_buf[2] = ACPI_PDC_EST_CAPABILITY_SMP | ACPI_PDC_EST_CAPABILITY_MSR; | 378 | arg0_buf[2] = ACPI_PDC_EST_CAPABILITY_SMP_MSR; |
379 | 379 | ||
380 | p.pdc = &arg_list; | 380 | p.pdc = &arg_list; |
381 | 381 | ||
diff --git a/arch/i386/kernel/cpu/intel.c b/arch/i386/kernel/cpu/intel.c index 96a75d045835..a2c33c1a46c5 100644 --- a/arch/i386/kernel/cpu/intel.c +++ b/arch/i386/kernel/cpu/intel.c | |||
@@ -25,7 +25,7 @@ extern int trap_init_f00f_bug(void); | |||
25 | /* | 25 | /* |
26 | * Alignment at which movsl is preferred for bulk memory copies. | 26 | * Alignment at which movsl is preferred for bulk memory copies. |
27 | */ | 27 | */ |
28 | struct movsl_mask movsl_mask; | 28 | struct movsl_mask movsl_mask __read_mostly; |
29 | #endif | 29 | #endif |
30 | 30 | ||
31 | void __devinit early_intel_workaround(struct cpuinfo_x86 *c) | 31 | void __devinit early_intel_workaround(struct cpuinfo_x86 *c) |
diff --git a/arch/i386/kernel/cpu/mtrr/generic.c b/arch/i386/kernel/cpu/mtrr/generic.c index 64d91f73a0a4..169ac8e0db68 100644 --- a/arch/i386/kernel/cpu/mtrr/generic.c +++ b/arch/i386/kernel/cpu/mtrr/generic.c | |||
@@ -67,13 +67,6 @@ void __init get_mtrr_state(void) | |||
67 | mtrr_state.enabled = (lo & 0xc00) >> 10; | 67 | mtrr_state.enabled = (lo & 0xc00) >> 10; |
68 | } | 68 | } |
69 | 69 | ||
70 | /* Free resources associated with a struct mtrr_state */ | ||
71 | void __init finalize_mtrr_state(void) | ||
72 | { | ||
73 | kfree(mtrr_state.var_ranges); | ||
74 | mtrr_state.var_ranges = NULL; | ||
75 | } | ||
76 | |||
77 | /* Some BIOS's are fucked and don't set all MTRRs the same! */ | 70 | /* Some BIOS's are fucked and don't set all MTRRs the same! */ |
78 | void __init mtrr_state_warn(void) | 71 | void __init mtrr_state_warn(void) |
79 | { | 72 | { |
@@ -334,6 +327,9 @@ static void generic_set_mtrr(unsigned int reg, unsigned long base, | |||
334 | */ | 327 | */ |
335 | { | 328 | { |
336 | unsigned long flags; | 329 | unsigned long flags; |
330 | struct mtrr_var_range *vr; | ||
331 | |||
332 | vr = &mtrr_state.var_ranges[reg]; | ||
337 | 333 | ||
338 | local_irq_save(flags); | 334 | local_irq_save(flags); |
339 | prepare_set(); | 335 | prepare_set(); |
@@ -342,11 +338,15 @@ static void generic_set_mtrr(unsigned int reg, unsigned long base, | |||
342 | /* The invalid bit is kept in the mask, so we simply clear the | 338 | /* The invalid bit is kept in the mask, so we simply clear the |
343 | relevant mask register to disable a range. */ | 339 | relevant mask register to disable a range. */ |
344 | mtrr_wrmsr(MTRRphysMask_MSR(reg), 0, 0); | 340 | mtrr_wrmsr(MTRRphysMask_MSR(reg), 0, 0); |
341 | memset(vr, 0, sizeof(struct mtrr_var_range)); | ||
345 | } else { | 342 | } else { |
346 | mtrr_wrmsr(MTRRphysBase_MSR(reg), base << PAGE_SHIFT | type, | 343 | vr->base_lo = base << PAGE_SHIFT | type; |
347 | (base & size_and_mask) >> (32 - PAGE_SHIFT)); | 344 | vr->base_hi = (base & size_and_mask) >> (32 - PAGE_SHIFT); |
348 | mtrr_wrmsr(MTRRphysMask_MSR(reg), -size << PAGE_SHIFT | 0x800, | 345 | vr->mask_lo = -size << PAGE_SHIFT | 0x800; |
349 | (-size & size_and_mask) >> (32 - PAGE_SHIFT)); | 346 | vr->mask_hi = (-size & size_and_mask) >> (32 - PAGE_SHIFT); |
347 | |||
348 | mtrr_wrmsr(MTRRphysBase_MSR(reg), vr->base_lo, vr->base_hi); | ||
349 | mtrr_wrmsr(MTRRphysMask_MSR(reg), vr->mask_lo, vr->mask_hi); | ||
350 | } | 350 | } |
351 | 351 | ||
352 | post_set(); | 352 | post_set(); |
diff --git a/arch/i386/kernel/cpu/mtrr/main.c b/arch/i386/kernel/cpu/mtrr/main.c index d66b09e0c820..764cac64e211 100644 --- a/arch/i386/kernel/cpu/mtrr/main.c +++ b/arch/i386/kernel/cpu/mtrr/main.c | |||
@@ -332,6 +332,8 @@ int mtrr_add_page(unsigned long base, unsigned long size, | |||
332 | 332 | ||
333 | error = -EINVAL; | 333 | error = -EINVAL; |
334 | 334 | ||
335 | /* No CPU hotplug when we change MTRR entries */ | ||
336 | lock_cpu_hotplug(); | ||
335 | /* Search for existing MTRR */ | 337 | /* Search for existing MTRR */ |
336 | down(&main_lock); | 338 | down(&main_lock); |
337 | for (i = 0; i < num_var_ranges; ++i) { | 339 | for (i = 0; i < num_var_ranges; ++i) { |
@@ -372,6 +374,7 @@ int mtrr_add_page(unsigned long base, unsigned long size, | |||
372 | error = i; | 374 | error = i; |
373 | out: | 375 | out: |
374 | up(&main_lock); | 376 | up(&main_lock); |
377 | unlock_cpu_hotplug(); | ||
375 | return error; | 378 | return error; |
376 | } | 379 | } |
377 | 380 | ||
@@ -461,6 +464,8 @@ int mtrr_del_page(int reg, unsigned long base, unsigned long size) | |||
461 | return -ENXIO; | 464 | return -ENXIO; |
462 | 465 | ||
463 | max = num_var_ranges; | 466 | max = num_var_ranges; |
467 | /* No CPU hotplug when we change MTRR entries */ | ||
468 | lock_cpu_hotplug(); | ||
464 | down(&main_lock); | 469 | down(&main_lock); |
465 | if (reg < 0) { | 470 | if (reg < 0) { |
466 | /* Search for existing MTRR */ | 471 | /* Search for existing MTRR */ |
@@ -501,6 +506,7 @@ int mtrr_del_page(int reg, unsigned long base, unsigned long size) | |||
501 | error = reg; | 506 | error = reg; |
502 | out: | 507 | out: |
503 | up(&main_lock); | 508 | up(&main_lock); |
509 | unlock_cpu_hotplug(); | ||
504 | return error; | 510 | return error; |
505 | } | 511 | } |
506 | /** | 512 | /** |
@@ -544,21 +550,9 @@ static void __init init_ifs(void) | |||
544 | centaur_init_mtrr(); | 550 | centaur_init_mtrr(); |
545 | } | 551 | } |
546 | 552 | ||
547 | static void __init init_other_cpus(void) | 553 | /* The suspend/resume methods are only for CPU without MTRR. CPU using generic |
548 | { | 554 | * MTRR driver doesn't require this |
549 | if (use_intel()) | 555 | */ |
550 | get_mtrr_state(); | ||
551 | |||
552 | /* bring up the other processors */ | ||
553 | set_mtrr(~0U,0,0,0); | ||
554 | |||
555 | if (use_intel()) { | ||
556 | finalize_mtrr_state(); | ||
557 | mtrr_state_warn(); | ||
558 | } | ||
559 | } | ||
560 | |||
561 | |||
562 | struct mtrr_value { | 556 | struct mtrr_value { |
563 | mtrr_type ltype; | 557 | mtrr_type ltype; |
564 | unsigned long lbase; | 558 | unsigned long lbase; |
@@ -611,13 +605,13 @@ static struct sysdev_driver mtrr_sysdev_driver = { | |||
611 | 605 | ||
612 | 606 | ||
613 | /** | 607 | /** |
614 | * mtrr_init - initialize mtrrs on the boot CPU | 608 | * mtrr_bp_init - initialize mtrrs on the boot CPU |
615 | * | 609 | * |
616 | * This needs to be called early; before any of the other CPUs are | 610 | * This needs to be called early; before any of the other CPUs are |
617 | * initialized (i.e. before smp_init()). | 611 | * initialized (i.e. before smp_init()). |
618 | * | 612 | * |
619 | */ | 613 | */ |
620 | static int __init mtrr_init(void) | 614 | void __init mtrr_bp_init(void) |
621 | { | 615 | { |
622 | init_ifs(); | 616 | init_ifs(); |
623 | 617 | ||
@@ -674,12 +668,48 @@ static int __init mtrr_init(void) | |||
674 | if (mtrr_if) { | 668 | if (mtrr_if) { |
675 | set_num_var_ranges(); | 669 | set_num_var_ranges(); |
676 | init_table(); | 670 | init_table(); |
677 | init_other_cpus(); | 671 | if (use_intel()) |
678 | 672 | get_mtrr_state(); | |
679 | return sysdev_driver_register(&cpu_sysdev_class, | ||
680 | &mtrr_sysdev_driver); | ||
681 | } | 673 | } |
682 | return -ENXIO; | ||
683 | } | 674 | } |
684 | 675 | ||
685 | subsys_initcall(mtrr_init); | 676 | void mtrr_ap_init(void) |
677 | { | ||
678 | unsigned long flags; | ||
679 | |||
680 | if (!mtrr_if || !use_intel()) | ||
681 | return; | ||
682 | /* | ||
683 | * Ideally we should hold main_lock here to avoid mtrr entries changed, | ||
684 | * but this routine will be called in cpu boot time, holding the lock | ||
685 | * breaks it. This routine is called in two cases: 1.very earily time | ||
686 | * of software resume, when there absolutely isn't mtrr entry changes; | ||
687 | * 2.cpu hotadd time. We let mtrr_add/del_page hold cpuhotplug lock to | ||
688 | * prevent mtrr entry changes | ||
689 | */ | ||
690 | local_irq_save(flags); | ||
691 | |||
692 | mtrr_if->set_all(); | ||
693 | |||
694 | local_irq_restore(flags); | ||
695 | } | ||
696 | |||
697 | static int __init mtrr_init_finialize(void) | ||
698 | { | ||
699 | if (!mtrr_if) | ||
700 | return 0; | ||
701 | if (use_intel()) | ||
702 | mtrr_state_warn(); | ||
703 | else { | ||
704 | /* The CPUs haven't MTRR and seemes not support SMP. They have | ||
705 | * specific drivers, we use a tricky method to support | ||
706 | * suspend/resume for them. | ||
707 | * TBD: is there any system with such CPU which supports | ||
708 | * suspend/resume? if no, we should remove the code. | ||
709 | */ | ||
710 | sysdev_driver_register(&cpu_sysdev_class, | ||
711 | &mtrr_sysdev_driver); | ||
712 | } | ||
713 | return 0; | ||
714 | } | ||
715 | subsys_initcall(mtrr_init_finialize); | ||
diff --git a/arch/i386/kernel/cpu/mtrr/mtrr.h b/arch/i386/kernel/cpu/mtrr/mtrr.h index de1351245599..99c9f2682041 100644 --- a/arch/i386/kernel/cpu/mtrr/mtrr.h +++ b/arch/i386/kernel/cpu/mtrr/mtrr.h | |||
@@ -91,7 +91,6 @@ extern struct mtrr_ops * mtrr_if; | |||
91 | 91 | ||
92 | extern unsigned int num_var_ranges; | 92 | extern unsigned int num_var_ranges; |
93 | 93 | ||
94 | void finalize_mtrr_state(void); | ||
95 | void mtrr_state_warn(void); | 94 | void mtrr_state_warn(void); |
96 | char *mtrr_attrib_to_str(int x); | 95 | char *mtrr_attrib_to_str(int x); |
97 | void mtrr_wrmsr(unsigned, unsigned, unsigned); | 96 | void mtrr_wrmsr(unsigned, unsigned, unsigned); |
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c index 35eb8e29c485..6578f40bd501 100644 --- a/arch/i386/kernel/io_apic.c +++ b/arch/i386/kernel/io_apic.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <asm/smp.h> | 37 | #include <asm/smp.h> |
38 | #include <asm/desc.h> | 38 | #include <asm/desc.h> |
39 | #include <asm/timer.h> | 39 | #include <asm/timer.h> |
40 | #include <asm/i8259.h> | ||
40 | 41 | ||
41 | #include <mach_apic.h> | 42 | #include <mach_apic.h> |
42 | 43 | ||
@@ -1566,7 +1567,6 @@ void print_all_local_APICs (void) | |||
1566 | 1567 | ||
1567 | void /*__init*/ print_PIC(void) | 1568 | void /*__init*/ print_PIC(void) |
1568 | { | 1569 | { |
1569 | extern spinlock_t i8259A_lock; | ||
1570 | unsigned int v; | 1570 | unsigned int v; |
1571 | unsigned long flags; | 1571 | unsigned long flags; |
1572 | 1572 | ||
diff --git a/arch/i386/kernel/kprobes.c b/arch/i386/kernel/kprobes.c index fc8b17521761..a6d8c45961d3 100644 --- a/arch/i386/kernel/kprobes.c +++ b/arch/i386/kernel/kprobes.c | |||
@@ -537,7 +537,7 @@ static struct kprobe trampoline_p = { | |||
537 | .pre_handler = trampoline_probe_handler | 537 | .pre_handler = trampoline_probe_handler |
538 | }; | 538 | }; |
539 | 539 | ||
540 | int __init arch_init(void) | 540 | int __init arch_init_kprobes(void) |
541 | { | 541 | { |
542 | return register_kprobe(&trampoline_p); | 542 | return register_kprobe(&trampoline_p); |
543 | } | 543 | } |
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c index d66bf489a2e9..8ac8e9fd5614 100644 --- a/arch/i386/kernel/smpboot.c +++ b/arch/i386/kernel/smpboot.c | |||
@@ -68,21 +68,21 @@ EXPORT_SYMBOL(smp_num_siblings); | |||
68 | #endif | 68 | #endif |
69 | 69 | ||
70 | /* Package ID of each logical CPU */ | 70 | /* Package ID of each logical CPU */ |
71 | int phys_proc_id[NR_CPUS] = {[0 ... NR_CPUS-1] = BAD_APICID}; | 71 | int phys_proc_id[NR_CPUS] __read_mostly = {[0 ... NR_CPUS-1] = BAD_APICID}; |
72 | EXPORT_SYMBOL(phys_proc_id); | 72 | EXPORT_SYMBOL(phys_proc_id); |
73 | 73 | ||
74 | /* Core ID of each logical CPU */ | 74 | /* Core ID of each logical CPU */ |
75 | int cpu_core_id[NR_CPUS] = {[0 ... NR_CPUS-1] = BAD_APICID}; | 75 | int cpu_core_id[NR_CPUS] __read_mostly = {[0 ... NR_CPUS-1] = BAD_APICID}; |
76 | EXPORT_SYMBOL(cpu_core_id); | 76 | EXPORT_SYMBOL(cpu_core_id); |
77 | 77 | ||
78 | cpumask_t cpu_sibling_map[NR_CPUS]; | 78 | cpumask_t cpu_sibling_map[NR_CPUS] __read_mostly; |
79 | EXPORT_SYMBOL(cpu_sibling_map); | 79 | EXPORT_SYMBOL(cpu_sibling_map); |
80 | 80 | ||
81 | cpumask_t cpu_core_map[NR_CPUS]; | 81 | cpumask_t cpu_core_map[NR_CPUS] __read_mostly; |
82 | EXPORT_SYMBOL(cpu_core_map); | 82 | EXPORT_SYMBOL(cpu_core_map); |
83 | 83 | ||
84 | /* bitmap of online cpus */ | 84 | /* bitmap of online cpus */ |
85 | cpumask_t cpu_online_map; | 85 | cpumask_t cpu_online_map __read_mostly; |
86 | EXPORT_SYMBOL(cpu_online_map); | 86 | EXPORT_SYMBOL(cpu_online_map); |
87 | 87 | ||
88 | cpumask_t cpu_callin_map; | 88 | cpumask_t cpu_callin_map; |
@@ -100,7 +100,7 @@ static int __devinitdata tsc_sync_disabled; | |||
100 | struct cpuinfo_x86 cpu_data[NR_CPUS] __cacheline_aligned; | 100 | struct cpuinfo_x86 cpu_data[NR_CPUS] __cacheline_aligned; |
101 | EXPORT_SYMBOL(cpu_data); | 101 | EXPORT_SYMBOL(cpu_data); |
102 | 102 | ||
103 | u8 x86_cpu_to_apicid[NR_CPUS] = | 103 | u8 x86_cpu_to_apicid[NR_CPUS] __read_mostly = |
104 | { [0 ... NR_CPUS-1] = 0xff }; | 104 | { [0 ... NR_CPUS-1] = 0xff }; |
105 | EXPORT_SYMBOL(x86_cpu_to_apicid); | 105 | EXPORT_SYMBOL(x86_cpu_to_apicid); |
106 | 106 | ||
@@ -550,10 +550,10 @@ extern struct { | |||
550 | #ifdef CONFIG_NUMA | 550 | #ifdef CONFIG_NUMA |
551 | 551 | ||
552 | /* which logical CPUs are on which nodes */ | 552 | /* which logical CPUs are on which nodes */ |
553 | cpumask_t node_2_cpu_mask[MAX_NUMNODES] = | 553 | cpumask_t node_2_cpu_mask[MAX_NUMNODES] __read_mostly = |
554 | { [0 ... MAX_NUMNODES-1] = CPU_MASK_NONE }; | 554 | { [0 ... MAX_NUMNODES-1] = CPU_MASK_NONE }; |
555 | /* which node each logical CPU is on */ | 555 | /* which node each logical CPU is on */ |
556 | int cpu_2_node[NR_CPUS] = { [0 ... NR_CPUS-1] = 0 }; | 556 | int cpu_2_node[NR_CPUS] __read_mostly = { [0 ... NR_CPUS-1] = 0 }; |
557 | EXPORT_SYMBOL(cpu_2_node); | 557 | EXPORT_SYMBOL(cpu_2_node); |
558 | 558 | ||
559 | /* set up a mapping between cpu and node. */ | 559 | /* set up a mapping between cpu and node. */ |
@@ -581,7 +581,7 @@ static inline void unmap_cpu_to_node(int cpu) | |||
581 | 581 | ||
582 | #endif /* CONFIG_NUMA */ | 582 | #endif /* CONFIG_NUMA */ |
583 | 583 | ||
584 | u8 cpu_2_logical_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID }; | 584 | u8 cpu_2_logical_apicid[NR_CPUS] __read_mostly = { [0 ... NR_CPUS-1] = BAD_APICID }; |
585 | 585 | ||
586 | static void map_cpu_to_logical_apicid(void) | 586 | static void map_cpu_to_logical_apicid(void) |
587 | { | 587 | { |
diff --git a/arch/i386/kernel/syscall_table.S b/arch/i386/kernel/syscall_table.S index 3db9a04aec6e..468500a7e894 100644 --- a/arch/i386/kernel/syscall_table.S +++ b/arch/i386/kernel/syscall_table.S | |||
@@ -291,3 +291,6 @@ ENTRY(sys_call_table) | |||
291 | .long sys_keyctl | 291 | .long sys_keyctl |
292 | .long sys_ioprio_set | 292 | .long sys_ioprio_set |
293 | .long sys_ioprio_get /* 290 */ | 293 | .long sys_ioprio_get /* 290 */ |
294 | .long sys_inotify_init | ||
295 | .long sys_inotify_add_watch | ||
296 | .long sys_inotify_rm_watch | ||
diff --git a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c index e68d9fdb0759..0ee9dee8af06 100644 --- a/arch/i386/kernel/time.c +++ b/arch/i386/kernel/time.c | |||
@@ -68,7 +68,8 @@ | |||
68 | 68 | ||
69 | #include "io_ports.h" | 69 | #include "io_ports.h" |
70 | 70 | ||
71 | extern spinlock_t i8259A_lock; | 71 | #include <asm/i8259.h> |
72 | |||
72 | int pit_latch_buggy; /* extern */ | 73 | int pit_latch_buggy; /* extern */ |
73 | 74 | ||
74 | #include "do_timer.h" | 75 | #include "do_timer.h" |
@@ -85,10 +86,12 @@ extern unsigned long wall_jiffies; | |||
85 | DEFINE_SPINLOCK(rtc_lock); | 86 | DEFINE_SPINLOCK(rtc_lock); |
86 | EXPORT_SYMBOL(rtc_lock); | 87 | EXPORT_SYMBOL(rtc_lock); |
87 | 88 | ||
89 | #include <asm/i8253.h> | ||
90 | |||
88 | DEFINE_SPINLOCK(i8253_lock); | 91 | DEFINE_SPINLOCK(i8253_lock); |
89 | EXPORT_SYMBOL(i8253_lock); | 92 | EXPORT_SYMBOL(i8253_lock); |
90 | 93 | ||
91 | struct timer_opts *cur_timer = &timer_none; | 94 | struct timer_opts *cur_timer __read_mostly = &timer_none; |
92 | 95 | ||
93 | /* | 96 | /* |
94 | * This is a special lock that is owned by the CPU and holds the index | 97 | * This is a special lock that is owned by the CPU and holds the index |
diff --git a/arch/i386/kernel/timers/timer_cyclone.c b/arch/i386/kernel/timers/timer_cyclone.c index f6f1206a11bb..13892a65c941 100644 --- a/arch/i386/kernel/timers/timer_cyclone.c +++ b/arch/i386/kernel/timers/timer_cyclone.c | |||
@@ -17,9 +17,9 @@ | |||
17 | #include <asm/io.h> | 17 | #include <asm/io.h> |
18 | #include <asm/pgtable.h> | 18 | #include <asm/pgtable.h> |
19 | #include <asm/fixmap.h> | 19 | #include <asm/fixmap.h> |
20 | #include "io_ports.h" | 20 | #include <asm/i8253.h> |
21 | 21 | ||
22 | extern spinlock_t i8253_lock; | 22 | #include "io_ports.h" |
23 | 23 | ||
24 | /* Number of usecs that the last interrupt was delayed */ | 24 | /* Number of usecs that the last interrupt was delayed */ |
25 | static int delay_at_last_interrupt; | 25 | static int delay_at_last_interrupt; |
diff --git a/arch/i386/kernel/timers/timer_hpet.c b/arch/i386/kernel/timers/timer_hpet.c index d766e0963ac1..ef8dac5dd33b 100644 --- a/arch/i386/kernel/timers/timer_hpet.c +++ b/arch/i386/kernel/timers/timer_hpet.c | |||
@@ -18,7 +18,7 @@ | |||
18 | #include "mach_timer.h" | 18 | #include "mach_timer.h" |
19 | #include <asm/hpet.h> | 19 | #include <asm/hpet.h> |
20 | 20 | ||
21 | static unsigned long hpet_usec_quotient; /* convert hpet clks to usec */ | 21 | static unsigned long __read_mostly hpet_usec_quotient; /* convert hpet clks to usec */ |
22 | static unsigned long tsc_hpet_quotient; /* convert tsc to hpet clks */ | 22 | static unsigned long tsc_hpet_quotient; /* convert tsc to hpet clks */ |
23 | static unsigned long hpet_last; /* hpet counter value at last tick*/ | 23 | static unsigned long hpet_last; /* hpet counter value at last tick*/ |
24 | static unsigned long last_tsc_low; /* lsb 32 bits of Time Stamp Counter */ | 24 | static unsigned long last_tsc_low; /* lsb 32 bits of Time Stamp Counter */ |
@@ -180,7 +180,7 @@ static int __init init_hpet(char* override) | |||
180 | /************************************************************/ | 180 | /************************************************************/ |
181 | 181 | ||
182 | /* tsc timer_opts struct */ | 182 | /* tsc timer_opts struct */ |
183 | static struct timer_opts timer_hpet = { | 183 | static struct timer_opts timer_hpet __read_mostly = { |
184 | .name = "hpet", | 184 | .name = "hpet", |
185 | .mark_offset = mark_offset_hpet, | 185 | .mark_offset = mark_offset_hpet, |
186 | .get_offset = get_offset_hpet, | 186 | .get_offset = get_offset_hpet, |
diff --git a/arch/i386/kernel/timers/timer_pit.c b/arch/i386/kernel/timers/timer_pit.c index 967d5453cd0e..06de036a820c 100644 --- a/arch/i386/kernel/timers/timer_pit.c +++ b/arch/i386/kernel/timers/timer_pit.c | |||
@@ -15,9 +15,8 @@ | |||
15 | #include <asm/smp.h> | 15 | #include <asm/smp.h> |
16 | #include <asm/io.h> | 16 | #include <asm/io.h> |
17 | #include <asm/arch_hooks.h> | 17 | #include <asm/arch_hooks.h> |
18 | #include <asm/i8253.h> | ||
18 | 19 | ||
19 | extern spinlock_t i8259A_lock; | ||
20 | extern spinlock_t i8253_lock; | ||
21 | #include "do_timer.h" | 20 | #include "do_timer.h" |
22 | #include "io_ports.h" | 21 | #include "io_ports.h" |
23 | 22 | ||
@@ -166,7 +165,6 @@ struct init_timer_opts __initdata timer_pit_init = { | |||
166 | 165 | ||
167 | void setup_pit_timer(void) | 166 | void setup_pit_timer(void) |
168 | { | 167 | { |
169 | extern spinlock_t i8253_lock; | ||
170 | unsigned long flags; | 168 | unsigned long flags; |
171 | 169 | ||
172 | spin_lock_irqsave(&i8253_lock, flags); | 170 | spin_lock_irqsave(&i8253_lock, flags); |
diff --git a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c index f46e625bab67..8f4e4d5bc560 100644 --- a/arch/i386/kernel/timers/timer_tsc.c +++ b/arch/i386/kernel/timers/timer_tsc.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include "mach_timer.h" | 24 | #include "mach_timer.h" |
25 | 25 | ||
26 | #include <asm/hpet.h> | 26 | #include <asm/hpet.h> |
27 | #include <asm/i8253.h> | ||
27 | 28 | ||
28 | #ifdef CONFIG_HPET_TIMER | 29 | #ifdef CONFIG_HPET_TIMER |
29 | static unsigned long hpet_usec_quotient; | 30 | static unsigned long hpet_usec_quotient; |
@@ -35,8 +36,6 @@ static inline void cpufreq_delayed_get(void); | |||
35 | 36 | ||
36 | int tsc_disable __devinitdata = 0; | 37 | int tsc_disable __devinitdata = 0; |
37 | 38 | ||
38 | extern spinlock_t i8253_lock; | ||
39 | |||
40 | static int use_tsc; | 39 | static int use_tsc; |
41 | /* Number of usecs that the last interrupt was delayed */ | 40 | /* Number of usecs that the last interrupt was delayed */ |
42 | static int delay_at_last_interrupt; | 41 | static int delay_at_last_interrupt; |
diff --git a/arch/i386/kernel/vmlinux.lds.S b/arch/i386/kernel/vmlinux.lds.S index 7e01a528a83a..761972f8cb6c 100644 --- a/arch/i386/kernel/vmlinux.lds.S +++ b/arch/i386/kernel/vmlinux.lds.S | |||
@@ -57,6 +57,9 @@ SECTIONS | |||
57 | *(.data.cacheline_aligned) | 57 | *(.data.cacheline_aligned) |
58 | } | 58 | } |
59 | 59 | ||
60 | /* rarely changed data like cpu maps */ | ||
61 | . = ALIGN(32); | ||
62 | .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) { *(.data.read_mostly) } | ||
60 | _edata = .; /* End of data section */ | 63 | _edata = .; /* End of data section */ |
61 | 64 | ||
62 | . = ALIGN(THREAD_SIZE); /* init_task */ | 65 | . = ALIGN(THREAD_SIZE); /* init_task */ |