diff options
Diffstat (limited to 'arch/i386')
25 files changed, 235 insertions, 65 deletions
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig index 6c02336fe2..a801d9d486 100644 --- a/arch/i386/Kconfig +++ b/arch/i386/Kconfig | |||
@@ -1285,6 +1285,8 @@ source "fs/Kconfig.binfmt" | |||
1285 | 1285 | ||
1286 | endmenu | 1286 | endmenu |
1287 | 1287 | ||
1288 | source "net/Kconfig" | ||
1289 | |||
1288 | source "drivers/Kconfig" | 1290 | source "drivers/Kconfig" |
1289 | 1291 | ||
1290 | source "fs/Kconfig" | 1292 | source "fs/Kconfig" |
diff --git a/arch/i386/kernel/acpi/Makefile b/arch/i386/kernel/acpi/Makefile index ee75cb286c..5e291a20c0 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 0000000000..4c3036ba65 --- /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 39d32484f6..44d886c745 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/cpu/common.c b/arch/i386/kernel/cpu/common.c index 2203a9d202..4553ffd94b 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 1a49adb1f4..e86ea486c3 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 7dcbf70fc1..327a55d4d1 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 96a75d0458..a2c33c1a46 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 64d91f73a0..169ac8e0db 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 d66b09e0c8..764cac64e2 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 de13512455..99c9f26820 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/kprobes.c b/arch/i386/kernel/kprobes.c index fc8b175217..a6d8c45961 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 d66bf489a2..8ac8e9fd56 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 3db9a04aec..468500a7e8 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 2854c35737..0ee9dee8af 100644 --- a/arch/i386/kernel/time.c +++ b/arch/i386/kernel/time.c | |||
@@ -91,7 +91,7 @@ EXPORT_SYMBOL(rtc_lock); | |||
91 | DEFINE_SPINLOCK(i8253_lock); | 91 | DEFINE_SPINLOCK(i8253_lock); |
92 | EXPORT_SYMBOL(i8253_lock); | 92 | EXPORT_SYMBOL(i8253_lock); |
93 | 93 | ||
94 | struct timer_opts *cur_timer = &timer_none; | 94 | struct timer_opts *cur_timer __read_mostly = &timer_none; |
95 | 95 | ||
96 | /* | 96 | /* |
97 | * 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_hpet.c b/arch/i386/kernel/timers/timer_hpet.c index d766e0963a..ef8dac5dd3 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/vmlinux.lds.S b/arch/i386/kernel/vmlinux.lds.S index 7e01a528a8..761972f8cb 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 */ |
diff --git a/arch/i386/mach-voyager/voyager_basic.c b/arch/i386/mach-voyager/voyager_basic.c index 3e439ce5e1..8680080a6a 100644 --- a/arch/i386/mach-voyager/voyager_basic.c +++ b/arch/i386/mach-voyager/voyager_basic.c | |||
@@ -36,6 +36,7 @@ | |||
36 | * Power off function, if any | 36 | * Power off function, if any |
37 | */ | 37 | */ |
38 | void (*pm_power_off)(void); | 38 | void (*pm_power_off)(void); |
39 | EXPORT_SYMBOL(pm_power_off); | ||
39 | 40 | ||
40 | int voyager_level = 0; | 41 | int voyager_level = 0; |
41 | 42 | ||
diff --git a/arch/i386/mach-voyager/voyager_smp.c b/arch/i386/mach-voyager/voyager_smp.c index 8c8527593d..0e1f4208b0 100644 --- a/arch/i386/mach-voyager/voyager_smp.c +++ b/arch/i386/mach-voyager/voyager_smp.c | |||
@@ -10,6 +10,7 @@ | |||
10 | * the voyager hal to provide the functionality | 10 | * the voyager hal to provide the functionality |
11 | */ | 11 | */ |
12 | #include <linux/config.h> | 12 | #include <linux/config.h> |
13 | #include <linux/module.h> | ||
13 | #include <linux/mm.h> | 14 | #include <linux/mm.h> |
14 | #include <linux/kernel_stat.h> | 15 | #include <linux/kernel_stat.h> |
15 | #include <linux/delay.h> | 16 | #include <linux/delay.h> |
@@ -40,6 +41,7 @@ static unsigned long cpu_irq_affinity[NR_CPUS] __cacheline_aligned = { [0 ... NR | |||
40 | /* per CPU data structure (for /proc/cpuinfo et al), visible externally | 41 | /* per CPU data structure (for /proc/cpuinfo et al), visible externally |
41 | * indexed physically */ | 42 | * indexed physically */ |
42 | struct cpuinfo_x86 cpu_data[NR_CPUS] __cacheline_aligned; | 43 | struct cpuinfo_x86 cpu_data[NR_CPUS] __cacheline_aligned; |
44 | EXPORT_SYMBOL(cpu_data); | ||
43 | 45 | ||
44 | /* physical ID of the CPU used to boot the system */ | 46 | /* physical ID of the CPU used to boot the system */ |
45 | unsigned char boot_cpu_id; | 47 | unsigned char boot_cpu_id; |
@@ -72,6 +74,7 @@ static volatile unsigned long smp_invalidate_needed; | |||
72 | /* Bitmask of currently online CPUs - used by setup.c for | 74 | /* Bitmask of currently online CPUs - used by setup.c for |
73 | /proc/cpuinfo, visible externally but still physical */ | 75 | /proc/cpuinfo, visible externally but still physical */ |
74 | cpumask_t cpu_online_map = CPU_MASK_NONE; | 76 | cpumask_t cpu_online_map = CPU_MASK_NONE; |
77 | EXPORT_SYMBOL(cpu_online_map); | ||
75 | 78 | ||
76 | /* Bitmask of CPUs present in the system - exported by i386_syms.c, used | 79 | /* Bitmask of CPUs present in the system - exported by i386_syms.c, used |
77 | * by scheduler but indexed physically */ | 80 | * by scheduler but indexed physically */ |
@@ -238,6 +241,7 @@ static cpumask_t smp_commenced_mask = CPU_MASK_NONE; | |||
238 | /* This is for the new dynamic CPU boot code */ | 241 | /* This is for the new dynamic CPU boot code */ |
239 | cpumask_t cpu_callin_map = CPU_MASK_NONE; | 242 | cpumask_t cpu_callin_map = CPU_MASK_NONE; |
240 | cpumask_t cpu_callout_map = CPU_MASK_NONE; | 243 | cpumask_t cpu_callout_map = CPU_MASK_NONE; |
244 | EXPORT_SYMBOL(cpu_callout_map); | ||
241 | 245 | ||
242 | /* The per processor IRQ masks (these are usually kept in sync) */ | 246 | /* The per processor IRQ masks (these are usually kept in sync) */ |
243 | static __u16 vic_irq_mask[NR_CPUS] __cacheline_aligned; | 247 | static __u16 vic_irq_mask[NR_CPUS] __cacheline_aligned; |
@@ -978,6 +982,7 @@ void flush_tlb_page(struct vm_area_struct * vma, unsigned long va) | |||
978 | 982 | ||
979 | preempt_enable(); | 983 | preempt_enable(); |
980 | } | 984 | } |
985 | EXPORT_SYMBOL(flush_tlb_page); | ||
981 | 986 | ||
982 | /* enable the requested IRQs */ | 987 | /* enable the requested IRQs */ |
983 | static void | 988 | static void |
@@ -1109,6 +1114,7 @@ smp_call_function (void (*func) (void *info), void *info, int retry, | |||
1109 | 1114 | ||
1110 | return 0; | 1115 | return 0; |
1111 | } | 1116 | } |
1117 | EXPORT_SYMBOL(smp_call_function); | ||
1112 | 1118 | ||
1113 | /* Sorry about the name. In an APIC based system, the APICs | 1119 | /* Sorry about the name. In an APIC based system, the APICs |
1114 | * themselves are programmed to send a timer interrupt. This is used | 1120 | * themselves are programmed to send a timer interrupt. This is used |
diff --git a/arch/i386/mm/ioremap.c b/arch/i386/mm/ioremap.c index 6b25afc933..f379b8d675 100644 --- a/arch/i386/mm/ioremap.c +++ b/arch/i386/mm/ioremap.c | |||
@@ -228,7 +228,8 @@ EXPORT_SYMBOL(ioremap_nocache); | |||
228 | void iounmap(volatile void __iomem *addr) | 228 | void iounmap(volatile void __iomem *addr) |
229 | { | 229 | { |
230 | struct vm_struct *p; | 230 | struct vm_struct *p; |
231 | if ((void __force *) addr <= high_memory) | 231 | |
232 | if ((void __force *)addr <= high_memory) | ||
232 | return; | 233 | return; |
233 | 234 | ||
234 | /* | 235 | /* |
@@ -241,9 +242,10 @@ void iounmap(volatile void __iomem *addr) | |||
241 | return; | 242 | return; |
242 | 243 | ||
243 | write_lock(&vmlist_lock); | 244 | write_lock(&vmlist_lock); |
244 | p = __remove_vm_area((void *) (PAGE_MASK & (unsigned long __force) addr)); | 245 | p = __remove_vm_area((void *)(PAGE_MASK & (unsigned long __force)addr)); |
245 | if (!p) { | 246 | if (!p) { |
246 | printk(KERN_WARNING "iounmap: bad address %p\n", addr); | 247 | printk(KERN_WARNING "iounmap: bad address %p\n", addr); |
248 | dump_stack(); | ||
247 | goto out_unlock; | 249 | goto out_unlock; |
248 | } | 250 | } |
249 | 251 | ||
diff --git a/arch/i386/pci/common.c b/arch/i386/pci/common.c index 87325263cd..70bcd53451 100644 --- a/arch/i386/pci/common.c +++ b/arch/i386/pci/common.c | |||
@@ -165,6 +165,7 @@ static int __init pcibios_init(void) | |||
165 | if ((pci_probe & PCI_BIOS_SORT) && !(pci_probe & PCI_NO_SORT)) | 165 | if ((pci_probe & PCI_BIOS_SORT) && !(pci_probe & PCI_NO_SORT)) |
166 | pcibios_sort(); | 166 | pcibios_sort(); |
167 | #endif | 167 | #endif |
168 | pci_assign_unassigned_resources(); | ||
168 | return 0; | 169 | return 0; |
169 | } | 170 | } |
170 | 171 | ||
diff --git a/arch/i386/pci/i386.c b/arch/i386/pci/i386.c index c205ea7e23..93a364c821 100644 --- a/arch/i386/pci/i386.c +++ b/arch/i386/pci/i386.c | |||
@@ -106,11 +106,16 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list) | |||
106 | if ((dev = bus->self)) { | 106 | if ((dev = bus->self)) { |
107 | for (idx = PCI_BRIDGE_RESOURCES; idx < PCI_NUM_RESOURCES; idx++) { | 107 | for (idx = PCI_BRIDGE_RESOURCES; idx < PCI_NUM_RESOURCES; idx++) { |
108 | r = &dev->resource[idx]; | 108 | r = &dev->resource[idx]; |
109 | if (!r->start) | 109 | if (!r->flags) |
110 | continue; | 110 | continue; |
111 | pr = pci_find_parent_resource(dev, r); | 111 | pr = pci_find_parent_resource(dev, r); |
112 | if (!pr || request_resource(pr, r) < 0) | 112 | if (!r->start || !pr || request_resource(pr, r) < 0) { |
113 | printk(KERN_ERR "PCI: Cannot allocate resource region %d of bridge %s\n", idx, pci_name(dev)); | 113 | printk(KERN_ERR "PCI: Cannot allocate resource region %d of bridge %s\n", idx, pci_name(dev)); |
114 | /* Something is wrong with the region. | ||
115 | Invalidate the resource to prevent child | ||
116 | resource allocations in this range. */ | ||
117 | r->flags = 0; | ||
118 | } | ||
114 | } | 119 | } |
115 | } | 120 | } |
116 | pcibios_allocate_bus_resources(&bus->children); | 121 | pcibios_allocate_bus_resources(&bus->children); |
@@ -227,7 +232,7 @@ int pcibios_enable_resources(struct pci_dev *dev, int mask) | |||
227 | 232 | ||
228 | pci_read_config_word(dev, PCI_COMMAND, &cmd); | 233 | pci_read_config_word(dev, PCI_COMMAND, &cmd); |
229 | old_cmd = cmd; | 234 | old_cmd = cmd; |
230 | for(idx=0; idx<6; idx++) { | 235 | for(idx = 0; idx < PCI_NUM_RESOURCES; idx++) { |
231 | /* Only set up the requested stuff */ | 236 | /* Only set up the requested stuff */ |
232 | if (!(mask & (1<<idx))) | 237 | if (!(mask & (1<<idx))) |
233 | continue; | 238 | continue; |
diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c index 78ca1ecbb9..766b104ac1 100644 --- a/arch/i386/pci/irq.c +++ b/arch/i386/pci/irq.c | |||
@@ -1051,24 +1051,28 @@ static int __init pcibios_irq_init(void) | |||
1051 | subsys_initcall(pcibios_irq_init); | 1051 | subsys_initcall(pcibios_irq_init); |
1052 | 1052 | ||
1053 | 1053 | ||
1054 | static void pirq_penalize_isa_irq(int irq) | 1054 | static void pirq_penalize_isa_irq(int irq, int active) |
1055 | { | 1055 | { |
1056 | /* | 1056 | /* |
1057 | * If any ISAPnP device reports an IRQ in its list of possible | 1057 | * If any ISAPnP device reports an IRQ in its list of possible |
1058 | * IRQ's, we try to avoid assigning it to PCI devices. | 1058 | * IRQ's, we try to avoid assigning it to PCI devices. |
1059 | */ | 1059 | */ |
1060 | if (irq < 16) | 1060 | if (irq < 16) { |
1061 | pirq_penalty[irq] += 100; | 1061 | if (active) |
1062 | pirq_penalty[irq] += 1000; | ||
1063 | else | ||
1064 | pirq_penalty[irq] += 100; | ||
1065 | } | ||
1062 | } | 1066 | } |
1063 | 1067 | ||
1064 | void pcibios_penalize_isa_irq(int irq) | 1068 | void pcibios_penalize_isa_irq(int irq, int active) |
1065 | { | 1069 | { |
1066 | #ifdef CONFIG_ACPI_PCI | 1070 | #ifdef CONFIG_ACPI_PCI |
1067 | if (!acpi_noirq) | 1071 | if (!acpi_noirq) |
1068 | acpi_penalize_isa_irq(irq); | 1072 | acpi_penalize_isa_irq(irq, active); |
1069 | else | 1073 | else |
1070 | #endif | 1074 | #endif |
1071 | pirq_penalize_isa_irq(irq); | 1075 | pirq_penalize_isa_irq(irq, active); |
1072 | } | 1076 | } |
1073 | 1077 | ||
1074 | static int pirq_enable_irq(struct pci_dev *dev) | 1078 | static int pirq_enable_irq(struct pci_dev *dev) |
diff --git a/arch/i386/pci/visws.c b/arch/i386/pci/visws.c index 6a92487844..314c933b6b 100644 --- a/arch/i386/pci/visws.c +++ b/arch/i386/pci/visws.c | |||
@@ -21,7 +21,7 @@ static int pci_visws_enable_irq(struct pci_dev *dev) { return 0; } | |||
21 | 21 | ||
22 | int (*pcibios_enable_irq)(struct pci_dev *dev) = &pci_visws_enable_irq; | 22 | int (*pcibios_enable_irq)(struct pci_dev *dev) = &pci_visws_enable_irq; |
23 | 23 | ||
24 | void __init pcibios_penalize_isa_irq(int irq) {} | 24 | void __init pcibios_penalize_isa_irq(int irq, int active) {} |
25 | 25 | ||
26 | 26 | ||
27 | unsigned int pci_bus0, pci_bus1; | 27 | unsigned int pci_bus0, pci_bus1; |
diff --git a/arch/i386/power/cpu.c b/arch/i386/power/cpu.c index 0e6b45b612..c547c1af6f 100644 --- a/arch/i386/power/cpu.c +++ b/arch/i386/power/cpu.c | |||
@@ -137,6 +137,7 @@ void __restore_processor_state(struct saved_context *ctxt) | |||
137 | 137 | ||
138 | fix_processor_context(); | 138 | fix_processor_context(); |
139 | do_fpu_end(); | 139 | do_fpu_end(); |
140 | mtrr_ap_init(); | ||
140 | } | 141 | } |
141 | 142 | ||
142 | void restore_processor_state(void) | 143 | void restore_processor_state(void) |