aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-24 12:36:53 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-24 12:36:53 -0400
commitd80a7920731a964b8c3492667a8069e5385ec794 (patch)
tree939624f80222654f52dcf54a08efc7903db03317
parent32bd33e21eeab63e7265bb3cba9ed94ab1ab816e (diff)
parent8689b517be3e3f65f8ba20490beccca13c5879fa (diff)
Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6
* 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6: [PATCH] i386: Fix some warnings added by earlier patch [PATCH] x86-64: Always flush all pages in change_page_attr [PATCH] x86: Remove noreplacement option [PATCH] x86-64: make GART PTEs uncacheable
-rw-r--r--Documentation/x86_64/boot-options.txt4
-rw-r--r--arch/i386/kernel/alternative.c21
-rw-r--r--arch/i386/kernel/nmi.c8
-rw-r--r--arch/x86_64/kernel/pci-gart.c6
-rw-r--r--arch/x86_64/mm/pageattr.c2
5 files changed, 12 insertions, 29 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
295Miscellaneous 295Miscellaneous
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
8static int no_replacement = 0;
9static int smp_alt_once = 0; 8static int smp_alt_once = 0;
10static int debug_alternative = 0; 9static int debug_alternative = 0;
11 10
12static int __init noreplacement_setup(char *s)
13{
14 no_replacement = 1;
15 return 1;
16}
17static int __init bootonly(char *str) 11static 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[],
386void __init alternative_instructions(void) 376void __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
177int reserve_perfctr_nmi(unsigned int msr) 177int 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
88static inline void flush_map(struct list_head *l) 88static inline void flush_map(struct list_head *l)