diff options
-rw-r--r-- | Documentation/x86_64/boot-options.txt | 4 | ||||
-rw-r--r-- | arch/i386/kernel/alternative.c | 21 | ||||
-rw-r--r-- | arch/i386/kernel/nmi.c | 8 | ||||
-rw-r--r-- | arch/x86_64/kernel/pci-gart.c | 6 | ||||
-rw-r--r-- | arch/x86_64/mm/pageattr.c | 2 | ||||
-rw-r--r-- | drivers/pci/probe.c | 45 |
6 files changed, 25 insertions, 61 deletions
diff --git a/Documentation/x86_64/boot-options.txt b/Documentation/x86_64/boot-options.txt index 625a21db0c2a..85f51e5a749f 100644 --- a/Documentation/x86_64/boot-options.txt +++ b/Documentation/x86_64/boot-options.txt | |||
@@ -293,7 +293,3 @@ Debugging | |||
293 | stuck (default) | 293 | stuck (default) |
294 | 294 | ||
295 | Miscellaneous | 295 | Miscellaneous |
296 | |||
297 | noreplacement Don't replace instructions with more appropriate ones | ||
298 | for the CPU. This may be useful on asymmetric MP systems | ||
299 | where some CPUs have less capabilities than others. | ||
diff --git a/arch/i386/kernel/alternative.c b/arch/i386/kernel/alternative.c index 9eca21b49f6b..426f59b0106b 100644 --- a/arch/i386/kernel/alternative.c +++ b/arch/i386/kernel/alternative.c | |||
@@ -5,15 +5,9 @@ | |||
5 | #include <asm/alternative.h> | 5 | #include <asm/alternative.h> |
6 | #include <asm/sections.h> | 6 | #include <asm/sections.h> |
7 | 7 | ||
8 | static int no_replacement = 0; | ||
9 | static int smp_alt_once = 0; | 8 | static int smp_alt_once = 0; |
10 | static int debug_alternative = 0; | 9 | static int debug_alternative = 0; |
11 | 10 | ||
12 | static int __init noreplacement_setup(char *s) | ||
13 | { | ||
14 | no_replacement = 1; | ||
15 | return 1; | ||
16 | } | ||
17 | static int __init bootonly(char *str) | 11 | static int __init bootonly(char *str) |
18 | { | 12 | { |
19 | smp_alt_once = 1; | 13 | smp_alt_once = 1; |
@@ -25,7 +19,6 @@ static int __init debug_alt(char *str) | |||
25 | return 1; | 19 | return 1; |
26 | } | 20 | } |
27 | 21 | ||
28 | __setup("noreplacement", noreplacement_setup); | ||
29 | __setup("smp-alt-boot", bootonly); | 22 | __setup("smp-alt-boot", bootonly); |
30 | __setup("debug-alternative", debug_alt); | 23 | __setup("debug-alternative", debug_alt); |
31 | 24 | ||
@@ -252,9 +245,6 @@ void alternatives_smp_module_add(struct module *mod, char *name, | |||
252 | struct smp_alt_module *smp; | 245 | struct smp_alt_module *smp; |
253 | unsigned long flags; | 246 | unsigned long flags; |
254 | 247 | ||
255 | if (no_replacement) | ||
256 | return; | ||
257 | |||
258 | if (smp_alt_once) { | 248 | if (smp_alt_once) { |
259 | if (boot_cpu_has(X86_FEATURE_UP)) | 249 | if (boot_cpu_has(X86_FEATURE_UP)) |
260 | alternatives_smp_unlock(locks, locks_end, | 250 | alternatives_smp_unlock(locks, locks_end, |
@@ -289,7 +279,7 @@ void alternatives_smp_module_del(struct module *mod) | |||
289 | struct smp_alt_module *item; | 279 | struct smp_alt_module *item; |
290 | unsigned long flags; | 280 | unsigned long flags; |
291 | 281 | ||
292 | if (no_replacement || smp_alt_once) | 282 | if (smp_alt_once) |
293 | return; | 283 | return; |
294 | 284 | ||
295 | spin_lock_irqsave(&smp_alt, flags); | 285 | spin_lock_irqsave(&smp_alt, flags); |
@@ -320,7 +310,7 @@ void alternatives_smp_switch(int smp) | |||
320 | return; | 310 | return; |
321 | #endif | 311 | #endif |
322 | 312 | ||
323 | if (no_replacement || smp_alt_once) | 313 | if (smp_alt_once) |
324 | return; | 314 | return; |
325 | BUG_ON(!smp && (num_online_cpus() > 1)); | 315 | BUG_ON(!smp && (num_online_cpus() > 1)); |
326 | 316 | ||
@@ -386,13 +376,6 @@ extern struct paravirt_patch __start_parainstructions[], | |||
386 | void __init alternative_instructions(void) | 376 | void __init alternative_instructions(void) |
387 | { | 377 | { |
388 | unsigned long flags; | 378 | unsigned long flags; |
389 | if (no_replacement) { | ||
390 | printk(KERN_INFO "(SMP-)alternatives turned off\n"); | ||
391 | free_init_pages("SMP alternatives", | ||
392 | (unsigned long)__smp_alt_begin, | ||
393 | (unsigned long)__smp_alt_end); | ||
394 | return; | ||
395 | } | ||
396 | 379 | ||
397 | local_irq_save(flags); | 380 | local_irq_save(flags); |
398 | apply_alternatives(__alt_instructions, __alt_instructions_end); | 381 | apply_alternatives(__alt_instructions, __alt_instructions_end); |
diff --git a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c index 9f1e8c1afab7..84c3497efb60 100644 --- a/arch/i386/kernel/nmi.c +++ b/arch/i386/kernel/nmi.c | |||
@@ -126,7 +126,7 @@ int avail_to_resrv_perfctr_nmi_bit(unsigned int counter) | |||
126 | int cpu; | 126 | int cpu; |
127 | BUG_ON(counter > NMI_MAX_COUNTER_BITS); | 127 | BUG_ON(counter > NMI_MAX_COUNTER_BITS); |
128 | for_each_possible_cpu (cpu) { | 128 | for_each_possible_cpu (cpu) { |
129 | if (test_bit(counter, &per_cpu(perfctr_nmi_owner, cpu))) | 129 | if (test_bit(counter, &per_cpu(perfctr_nmi_owner, cpu)[0])) |
130 | return 0; | 130 | return 0; |
131 | } | 131 | } |
132 | return 1; | 132 | return 1; |
@@ -142,7 +142,7 @@ int avail_to_resrv_perfctr_nmi(unsigned int msr) | |||
142 | BUG_ON(counter > NMI_MAX_COUNTER_BITS); | 142 | BUG_ON(counter > NMI_MAX_COUNTER_BITS); |
143 | 143 | ||
144 | for_each_possible_cpu (cpu) { | 144 | for_each_possible_cpu (cpu) { |
145 | if (test_bit(counter, &per_cpu(perfctr_nmi_owner, cpu))) | 145 | if (test_bit(counter, &per_cpu(perfctr_nmi_owner, cpu)[0])) |
146 | return 0; | 146 | return 0; |
147 | } | 147 | } |
148 | return 1; | 148 | return 1; |
@@ -157,7 +157,7 @@ static int __reserve_perfctr_nmi(int cpu, unsigned int msr) | |||
157 | counter = nmi_perfctr_msr_to_bit(msr); | 157 | counter = nmi_perfctr_msr_to_bit(msr); |
158 | BUG_ON(counter > NMI_MAX_COUNTER_BITS); | 158 | BUG_ON(counter > NMI_MAX_COUNTER_BITS); |
159 | 159 | ||
160 | if (!test_and_set_bit(counter, &per_cpu(perfctr_nmi_owner, cpu))) | 160 | if (!test_and_set_bit(counter, &per_cpu(perfctr_nmi_owner, cpu)[0])) |
161 | return 1; | 161 | return 1; |
162 | return 0; | 162 | return 0; |
163 | } | 163 | } |
@@ -171,7 +171,7 @@ static void __release_perfctr_nmi(int cpu, unsigned int msr) | |||
171 | counter = nmi_perfctr_msr_to_bit(msr); | 171 | counter = nmi_perfctr_msr_to_bit(msr); |
172 | BUG_ON(counter > NMI_MAX_COUNTER_BITS); | 172 | BUG_ON(counter > NMI_MAX_COUNTER_BITS); |
173 | 173 | ||
174 | clear_bit(counter, &per_cpu(perfctr_nmi_owner, cpu)); | 174 | clear_bit(counter, &per_cpu(perfctr_nmi_owner, cpu)[0]); |
175 | } | 175 | } |
176 | 176 | ||
177 | int reserve_perfctr_nmi(unsigned int msr) | 177 | int reserve_perfctr_nmi(unsigned int msr) |
diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c index 2bac8c60ad61..0bae862e9a55 100644 --- a/arch/x86_64/kernel/pci-gart.c +++ b/arch/x86_64/kernel/pci-gart.c | |||
@@ -519,7 +519,11 @@ static __init int init_k8_gatt(struct agp_kern_info *info) | |||
519 | gatt_size = (aper_size >> PAGE_SHIFT) * sizeof(u32); | 519 | gatt_size = (aper_size >> PAGE_SHIFT) * sizeof(u32); |
520 | gatt = (void *)__get_free_pages(GFP_KERNEL, get_order(gatt_size)); | 520 | gatt = (void *)__get_free_pages(GFP_KERNEL, get_order(gatt_size)); |
521 | if (!gatt) | 521 | if (!gatt) |
522 | panic("Cannot allocate GATT table"); | 522 | panic("Cannot allocate GATT table"); |
523 | if (change_page_attr_addr((unsigned long)gatt, gatt_size >> PAGE_SHIFT, PAGE_KERNEL_NOCACHE)) | ||
524 | panic("Could not set GART PTEs to uncacheable pages"); | ||
525 | global_flush_tlb(); | ||
526 | |||
523 | memset(gatt, 0, gatt_size); | 527 | memset(gatt, 0, gatt_size); |
524 | agp_gatt_table = gatt; | 528 | agp_gatt_table = gatt; |
525 | 529 | ||
diff --git a/arch/x86_64/mm/pageattr.c b/arch/x86_64/mm/pageattr.c index 65c5eaa59905..081409aa3452 100644 --- a/arch/x86_64/mm/pageattr.c +++ b/arch/x86_64/mm/pageattr.c | |||
@@ -81,8 +81,8 @@ static void flush_kernel_map(void *arg) | |||
81 | void *adr = page_address(pg); | 81 | void *adr = page_address(pg); |
82 | if (cpu_has_clflush) | 82 | if (cpu_has_clflush) |
83 | cache_flush_page(adr); | 83 | cache_flush_page(adr); |
84 | __flush_tlb_one(adr); | ||
85 | } | 84 | } |
85 | __flush_tlb_all(); | ||
86 | } | 86 | } |
87 | 87 | ||
88 | static inline void flush_map(struct list_head *l) | 88 | static inline void flush_map(struct list_head *l) |
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index a4a96826d9e0..2fe1d690eb13 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -682,34 +682,7 @@ static void pci_read_irq(struct pci_dev *dev) | |||
682 | dev->irq = irq; | 682 | dev->irq = irq; |
683 | } | 683 | } |
684 | 684 | ||
685 | static void change_legacy_io_resource(struct pci_dev * dev, unsigned index, | 685 | #define LEGACY_IO_RESOURCE (IORESOURCE_IO | IORESOURCE_PCI_FIXED) |
686 | unsigned start, unsigned end) | ||
687 | { | ||
688 | unsigned base = start & PCI_BASE_ADDRESS_IO_MASK; | ||
689 | unsigned len = (end | ~PCI_BASE_ADDRESS_IO_MASK) - base + 1; | ||
690 | |||
691 | /* | ||
692 | * Some X versions get confused when the BARs reported through | ||
693 | * /sys or /proc differ from those seen in config space, thus | ||
694 | * try to update the config space values, too. | ||
695 | */ | ||
696 | if (!(pci_resource_flags(dev, index) & IORESOURCE_IO)) | ||
697 | printk(KERN_WARNING "%s: cannot adjust BAR%u (not I/O)\n", | ||
698 | pci_name(dev), index); | ||
699 | else if (pci_resource_len(dev, index) != len) | ||
700 | printk(KERN_WARNING "%s: cannot adjust BAR%u (size %04X)\n", | ||
701 | pci_name(dev), index, (unsigned)pci_resource_len(dev, index)); | ||
702 | else { | ||
703 | printk(KERN_INFO "%s: trying to change BAR%u from %04X to %04X\n", | ||
704 | pci_name(dev), index, | ||
705 | (unsigned)pci_resource_start(dev, index), base); | ||
706 | pci_write_config_dword(dev, PCI_BASE_ADDRESS_0 + index * 4, base); | ||
707 | } | ||
708 | pci_resource_start(dev, index) = start; | ||
709 | pci_resource_end(dev, index) = end; | ||
710 | pci_resource_flags(dev, index) = | ||
711 | IORESOURCE_IO | IORESOURCE_PCI_FIXED | PCI_BASE_ADDRESS_SPACE_IO; | ||
712 | } | ||
713 | 686 | ||
714 | /** | 687 | /** |
715 | * pci_setup_device - fill in class and map information of a device | 688 | * pci_setup_device - fill in class and map information of a device |
@@ -762,12 +735,20 @@ static int pci_setup_device(struct pci_dev * dev) | |||
762 | u8 progif; | 735 | u8 progif; |
763 | pci_read_config_byte(dev, PCI_CLASS_PROG, &progif); | 736 | pci_read_config_byte(dev, PCI_CLASS_PROG, &progif); |
764 | if ((progif & 1) == 0) { | 737 | if ((progif & 1) == 0) { |
765 | change_legacy_io_resource(dev, 0, 0x1F0, 0x1F7); | 738 | dev->resource[0].start = 0x1F0; |
766 | change_legacy_io_resource(dev, 1, 0x3F6, 0x3F6); | 739 | dev->resource[0].end = 0x1F7; |
740 | dev->resource[0].flags = LEGACY_IO_RESOURCE; | ||
741 | dev->resource[1].start = 0x3F6; | ||
742 | dev->resource[1].end = 0x3F6; | ||
743 | dev->resource[1].flags = LEGACY_IO_RESOURCE; | ||
767 | } | 744 | } |
768 | if ((progif & 4) == 0) { | 745 | if ((progif & 4) == 0) { |
769 | change_legacy_io_resource(dev, 2, 0x170, 0x177); | 746 | dev->resource[2].start = 0x170; |
770 | change_legacy_io_resource(dev, 3, 0x376, 0x376); | 747 | dev->resource[2].end = 0x177; |
748 | dev->resource[2].flags = LEGACY_IO_RESOURCE; | ||
749 | dev->resource[3].start = 0x376; | ||
750 | dev->resource[3].end = 0x376; | ||
751 | dev->resource[3].flags = LEGACY_IO_RESOURCE; | ||
771 | } | 752 | } |
772 | } | 753 | } |
773 | break; | 754 | break; |