aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386/kernel')
-rw-r--r--arch/i386/kernel/alternative.c21
-rw-r--r--arch/i386/kernel/cpu/cpufreq/longhaul.c2
-rw-r--r--arch/i386/kernel/nmi.c17
-rw-r--r--arch/i386/kernel/vmi.c9
-rw-r--r--arch/i386/kernel/vmlinux.lds.S2
5 files changed, 19 insertions, 32 deletions
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/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c
index a1f1b715bcf8..2b030d6ccbf7 100644
--- a/arch/i386/kernel/cpu/cpufreq/longhaul.c
+++ b/arch/i386/kernel/cpu/cpufreq/longhaul.c
@@ -758,7 +758,7 @@ static int __init longhaul_cpu_init(struct cpufreq_policy *policy)
758 NULL, (void *)&pr); 758 NULL, (void *)&pr);
759 759
760 /* Check ACPI support for C3 state */ 760 /* Check ACPI support for C3 state */
761 if (pr != NULL && longhaul_version != TYPE_LONGHAUL_V1) { 761 if (pr != NULL && longhaul_version == TYPE_POWERSAVER) {
762 cx = &pr->power.states[ACPI_STATE_C3]; 762 cx = &pr->power.states[ACPI_STATE_C3];
763 if (cx->address > 0 && cx->latency <= 1000) { 763 if (cx->address > 0 && cx->latency <= 1000) {
764 longhaul_flags |= USE_ACPI_C3; 764 longhaul_flags |= USE_ACPI_C3;
diff --git a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c
index a98ba88a8c0c..84c3497efb60 100644
--- a/arch/i386/kernel/nmi.c
+++ b/arch/i386/kernel/nmi.c
@@ -41,16 +41,17 @@ int nmi_watchdog_enabled;
41 * different subsystems this reservation system just tries to coordinate 41 * different subsystems this reservation system just tries to coordinate
42 * things a little 42 * things a little
43 */ 43 */
44static DEFINE_PER_CPU(unsigned long, perfctr_nmi_owner);
45static DEFINE_PER_CPU(unsigned long, evntsel_nmi_owner[3]);
46
47static cpumask_t backtrace_mask = CPU_MASK_NONE;
48 44
49/* this number is calculated from Intel's MSR_P4_CRU_ESCR5 register and it's 45/* this number is calculated from Intel's MSR_P4_CRU_ESCR5 register and it's
50 * offset from MSR_P4_BSU_ESCR0. It will be the max for all platforms (for now) 46 * offset from MSR_P4_BSU_ESCR0. It will be the max for all platforms (for now)
51 */ 47 */
52#define NMI_MAX_COUNTER_BITS 66 48#define NMI_MAX_COUNTER_BITS 66
49#define NMI_MAX_COUNTER_LONGS BITS_TO_LONGS(NMI_MAX_COUNTER_BITS)
53 50
51static DEFINE_PER_CPU(unsigned long, perfctr_nmi_owner[NMI_MAX_COUNTER_LONGS]);
52static DEFINE_PER_CPU(unsigned long, evntsel_nmi_owner[NMI_MAX_COUNTER_LONGS]);
53
54static cpumask_t backtrace_mask = CPU_MASK_NONE;
54/* nmi_active: 55/* nmi_active:
55 * >0: the lapic NMI watchdog is active, but can be disabled 56 * >0: the lapic NMI watchdog is active, but can be disabled
56 * <0: the lapic NMI watchdog has not been set up, and cannot 57 * <0: the lapic NMI watchdog has not been set up, and cannot
@@ -125,7 +126,7 @@ int avail_to_resrv_perfctr_nmi_bit(unsigned int counter)
125 int cpu; 126 int cpu;
126 BUG_ON(counter > NMI_MAX_COUNTER_BITS); 127 BUG_ON(counter > NMI_MAX_COUNTER_BITS);
127 for_each_possible_cpu (cpu) { 128 for_each_possible_cpu (cpu) {
128 if (test_bit(counter, &per_cpu(perfctr_nmi_owner, cpu))) 129 if (test_bit(counter, &per_cpu(perfctr_nmi_owner, cpu)[0]))
129 return 0; 130 return 0;
130 } 131 }
131 return 1; 132 return 1;
@@ -141,7 +142,7 @@ int avail_to_resrv_perfctr_nmi(unsigned int msr)
141 BUG_ON(counter > NMI_MAX_COUNTER_BITS); 142 BUG_ON(counter > NMI_MAX_COUNTER_BITS);
142 143
143 for_each_possible_cpu (cpu) { 144 for_each_possible_cpu (cpu) {
144 if (test_bit(counter, &per_cpu(perfctr_nmi_owner, cpu))) 145 if (test_bit(counter, &per_cpu(perfctr_nmi_owner, cpu)[0]))
145 return 0; 146 return 0;
146 } 147 }
147 return 1; 148 return 1;
@@ -156,7 +157,7 @@ static int __reserve_perfctr_nmi(int cpu, unsigned int msr)
156 counter = nmi_perfctr_msr_to_bit(msr); 157 counter = nmi_perfctr_msr_to_bit(msr);
157 BUG_ON(counter > NMI_MAX_COUNTER_BITS); 158 BUG_ON(counter > NMI_MAX_COUNTER_BITS);
158 159
159 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]))
160 return 1; 161 return 1;
161 return 0; 162 return 0;
162} 163}
@@ -170,7 +171,7 @@ static void __release_perfctr_nmi(int cpu, unsigned int msr)
170 counter = nmi_perfctr_msr_to_bit(msr); 171 counter = nmi_perfctr_msr_to_bit(msr);
171 BUG_ON(counter > NMI_MAX_COUNTER_BITS); 172 BUG_ON(counter > NMI_MAX_COUNTER_BITS);
172 173
173 clear_bit(counter, &per_cpu(perfctr_nmi_owner, cpu)); 174 clear_bit(counter, &per_cpu(perfctr_nmi_owner, cpu)[0]);
174} 175}
175 176
176int reserve_perfctr_nmi(unsigned int msr) 177int reserve_perfctr_nmi(unsigned int msr)
diff --git a/arch/i386/kernel/vmi.c b/arch/i386/kernel/vmi.c
index edc339fa5038..697a70e8c0c9 100644
--- a/arch/i386/kernel/vmi.c
+++ b/arch/i386/kernel/vmi.c
@@ -712,11 +712,14 @@ static void *vmi_get_function(int vmicall)
712do { \ 712do { \
713 reloc = call_vrom_long_func(vmi_rom, get_reloc, \ 713 reloc = call_vrom_long_func(vmi_rom, get_reloc, \
714 VMI_CALL_##vmicall); \ 714 VMI_CALL_##vmicall); \
715 if (rel->type != VMI_RELOCATION_NONE) { \ 715 if (rel->type == VMI_RELOCATION_CALL_REL) \
716 BUG_ON(rel->type != VMI_RELOCATION_CALL_REL); \
717 paravirt_ops.opname = (void *)rel->eip; \ 716 paravirt_ops.opname = (void *)rel->eip; \
718 } else if (rel->type == VMI_RELOCATION_NOP) \ 717 else if (rel->type == VMI_RELOCATION_NOP) \
719 paravirt_ops.opname = (void *)vmi_nop; \ 718 paravirt_ops.opname = (void *)vmi_nop; \
719 else if (rel->type != VMI_RELOCATION_NONE) \
720 printk(KERN_WARNING "VMI: Unknown relocation " \
721 "type %d for " #vmicall"\n",\
722 rel->type); \
720} while (0) 723} while (0)
721 724
722/* 725/*
diff --git a/arch/i386/kernel/vmlinux.lds.S b/arch/i386/kernel/vmlinux.lds.S
index ca51610955df..6f38f818380b 100644
--- a/arch/i386/kernel/vmlinux.lds.S
+++ b/arch/i386/kernel/vmlinux.lds.S
@@ -26,7 +26,7 @@ OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
26OUTPUT_ARCH(i386) 26OUTPUT_ARCH(i386)
27ENTRY(phys_startup_32) 27ENTRY(phys_startup_32)
28jiffies = jiffies_64; 28jiffies = jiffies_64;
29_proxy_pda = 0; 29_proxy_pda = 1;
30 30
31PHDRS { 31PHDRS {
32 text PT_LOAD FLAGS(5); /* R_E */ 32 text PT_LOAD FLAGS(5); /* R_E */