aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386/kernel')
-rw-r--r--arch/i386/kernel/cpu/cpufreq/p4-clockmod.c9
-rw-r--r--arch/i386/kernel/cpu/cyrix.c2
-rw-r--r--arch/i386/kernel/efi.c89
-rw-r--r--arch/i386/kernel/entry.S4
-rw-r--r--arch/i386/kernel/io_apic.c32
-rw-r--r--arch/i386/kernel/nmi.c8
-rw-r--r--arch/i386/kernel/paravirt.c9
-rw-r--r--arch/i386/kernel/sysenter.c14
8 files changed, 115 insertions, 52 deletions
diff --git a/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c b/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c
index bec50170b75a..4786fedca6eb 100644
--- a/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c
+++ b/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c
@@ -51,7 +51,6 @@ enum {
51 51
52 52
53static int has_N44_O17_errata[NR_CPUS]; 53static int has_N44_O17_errata[NR_CPUS];
54static int has_N60_errata[NR_CPUS];
55static unsigned int stock_freq; 54static unsigned int stock_freq;
56static struct cpufreq_driver p4clockmod_driver; 55static struct cpufreq_driver p4clockmod_driver;
57static unsigned int cpufreq_p4_get(unsigned int cpu); 56static unsigned int cpufreq_p4_get(unsigned int cpu);
@@ -224,12 +223,6 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy)
224 case 0x0f12: 223 case 0x0f12:
225 has_N44_O17_errata[policy->cpu] = 1; 224 has_N44_O17_errata[policy->cpu] = 1;
226 dprintk("has errata -- disabling low frequencies\n"); 225 dprintk("has errata -- disabling low frequencies\n");
227 break;
228
229 case 0x0f29:
230 has_N60_errata[policy->cpu] = 1;
231 dprintk("has errata -- disabling frequencies lower than 2ghz\n");
232 break;
233 } 226 }
234 227
235 /* get max frequency */ 228 /* get max frequency */
@@ -241,8 +234,6 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy)
241 for (i=1; (p4clockmod_table[i].frequency != CPUFREQ_TABLE_END); i++) { 234 for (i=1; (p4clockmod_table[i].frequency != CPUFREQ_TABLE_END); i++) {
242 if ((i<2) && (has_N44_O17_errata[policy->cpu])) 235 if ((i<2) && (has_N44_O17_errata[policy->cpu]))
243 p4clockmod_table[i].frequency = CPUFREQ_ENTRY_INVALID; 236 p4clockmod_table[i].frequency = CPUFREQ_ENTRY_INVALID;
244 else if (has_N60_errata[policy->cpu] && ((stock_freq * i)/8) < 2000000)
245 p4clockmod_table[i].frequency = CPUFREQ_ENTRY_INVALID;
246 else 237 else
247 p4clockmod_table[i].frequency = (stock_freq * i)/8; 238 p4clockmod_table[i].frequency = (stock_freq * i)/8;
248 } 239 }
diff --git a/arch/i386/kernel/cpu/cyrix.c b/arch/i386/kernel/cpu/cyrix.c
index abcff92f994c..c0c3b59de32c 100644
--- a/arch/i386/kernel/cpu/cyrix.c
+++ b/arch/i386/kernel/cpu/cyrix.c
@@ -173,7 +173,7 @@ static void __cpuinit geode_configure(void)
173 ccr4 = getCx86(CX86_CCR4); 173 ccr4 = getCx86(CX86_CCR4);
174 ccr4 |= 0x38; /* FPU fast, DTE cache, Mem bypass */ 174 ccr4 |= 0x38; /* FPU fast, DTE cache, Mem bypass */
175 175
176 setCx86(CX86_CCR4, ccr4); 176 setCx86(CX86_CCR3, ccr3);
177 177
178 set_cx86_memwb(); 178 set_cx86_memwb();
179 set_cx86_reorder(); 179 set_cx86_reorder();
diff --git a/arch/i386/kernel/efi.c b/arch/i386/kernel/efi.c
index b92c7f0a358a..8f9c624ace6f 100644
--- a/arch/i386/kernel/efi.c
+++ b/arch/i386/kernel/efi.c
@@ -473,6 +473,70 @@ static inline void __init check_range_for_systab(efi_memory_desc_t *md)
473} 473}
474 474
475/* 475/*
476 * Wrap all the virtual calls in a way that forces the parameters on the stack.
477 */
478
479#define efi_call_virt(f, args...) \
480 ((efi_##f##_t __attribute__((regparm(0)))*)efi.systab->runtime->f)(args)
481
482static efi_status_t virt_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc)
483{
484 return efi_call_virt(get_time, tm, tc);
485}
486
487static efi_status_t virt_efi_set_time (efi_time_t *tm)
488{
489 return efi_call_virt(set_time, tm);
490}
491
492static efi_status_t virt_efi_get_wakeup_time (efi_bool_t *enabled,
493 efi_bool_t *pending,
494 efi_time_t *tm)
495{
496 return efi_call_virt(get_wakeup_time, enabled, pending, tm);
497}
498
499static efi_status_t virt_efi_set_wakeup_time (efi_bool_t enabled,
500 efi_time_t *tm)
501{
502 return efi_call_virt(set_wakeup_time, enabled, tm);
503}
504
505static efi_status_t virt_efi_get_variable (efi_char16_t *name,
506 efi_guid_t *vendor, u32 *attr,
507 unsigned long *data_size, void *data)
508{
509 return efi_call_virt(get_variable, name, vendor, attr, data_size, data);
510}
511
512static efi_status_t virt_efi_get_next_variable (unsigned long *name_size,
513 efi_char16_t *name,
514 efi_guid_t *vendor)
515{
516 return efi_call_virt(get_next_variable, name_size, name, vendor);
517}
518
519static efi_status_t virt_efi_set_variable (efi_char16_t *name,
520 efi_guid_t *vendor,
521 unsigned long attr,
522 unsigned long data_size, void *data)
523{
524 return efi_call_virt(set_variable, name, vendor, attr, data_size, data);
525}
526
527static efi_status_t virt_efi_get_next_high_mono_count (u32 *count)
528{
529 return efi_call_virt(get_next_high_mono_count, count);
530}
531
532static void virt_efi_reset_system (int reset_type, efi_status_t status,
533 unsigned long data_size,
534 efi_char16_t *data)
535{
536 efi_call_virt(reset_system, reset_type, status, data_size, data);
537}
538
539/*
476 * This function will switch the EFI runtime services to virtual mode. 540 * This function will switch the EFI runtime services to virtual mode.
477 * Essentially, look through the EFI memmap and map every region that 541 * Essentially, look through the EFI memmap and map every region that
478 * has the runtime attribute bit set in its memory descriptor and update 542 * has the runtime attribute bit set in its memory descriptor and update
@@ -525,22 +589,15 @@ void __init efi_enter_virtual_mode(void)
525 * pointers in the runtime service table to the new virtual addresses. 589 * pointers in the runtime service table to the new virtual addresses.
526 */ 590 */
527 591
528 efi.get_time = (efi_get_time_t *) efi.systab->runtime->get_time; 592 efi.get_time = virt_efi_get_time;
529 efi.set_time = (efi_set_time_t *) efi.systab->runtime->set_time; 593 efi.set_time = virt_efi_set_time;
530 efi.get_wakeup_time = (efi_get_wakeup_time_t *) 594 efi.get_wakeup_time = virt_efi_get_wakeup_time;
531 efi.systab->runtime->get_wakeup_time; 595 efi.set_wakeup_time = virt_efi_set_wakeup_time;
532 efi.set_wakeup_time = (efi_set_wakeup_time_t *) 596 efi.get_variable = virt_efi_get_variable;
533 efi.systab->runtime->set_wakeup_time; 597 efi.get_next_variable = virt_efi_get_next_variable;
534 efi.get_variable = (efi_get_variable_t *) 598 efi.set_variable = virt_efi_set_variable;
535 efi.systab->runtime->get_variable; 599 efi.get_next_high_mono_count = virt_efi_get_next_high_mono_count;
536 efi.get_next_variable = (efi_get_next_variable_t *) 600 efi.reset_system = virt_efi_reset_system;
537 efi.systab->runtime->get_next_variable;
538 efi.set_variable = (efi_set_variable_t *)
539 efi.systab->runtime->set_variable;
540 efi.get_next_high_mono_count = (efi_get_next_high_mono_count_t *)
541 efi.systab->runtime->get_next_high_mono_count;
542 efi.reset_system = (efi_reset_system_t *)
543 efi.systab->runtime->reset_system;
544} 601}
545 602
546void __init 603void __init
diff --git a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S
index 06461b8b715d..5e47683fc63a 100644
--- a/arch/i386/kernel/entry.S
+++ b/arch/i386/kernel/entry.S
@@ -302,12 +302,16 @@ sysenter_past_esp:
302 pushl $(__USER_CS) 302 pushl $(__USER_CS)
303 CFI_ADJUST_CFA_OFFSET 4 303 CFI_ADJUST_CFA_OFFSET 4
304 /*CFI_REL_OFFSET cs, 0*/ 304 /*CFI_REL_OFFSET cs, 0*/
305#ifndef CONFIG_COMPAT_VDSO
305 /* 306 /*
306 * Push current_thread_info()->sysenter_return to the stack. 307 * Push current_thread_info()->sysenter_return to the stack.
307 * A tiny bit of offset fixup is necessary - 4*4 means the 4 words 308 * A tiny bit of offset fixup is necessary - 4*4 means the 4 words
308 * pushed above; +8 corresponds to copy_thread's esp0 setting. 309 * pushed above; +8 corresponds to copy_thread's esp0 setting.
309 */ 310 */
310 pushl (TI_sysenter_return-THREAD_SIZE+8+4*4)(%esp) 311 pushl (TI_sysenter_return-THREAD_SIZE+8+4*4)(%esp)
312#else
313 pushl $SYSENTER_RETURN
314#endif
311 CFI_ADJUST_CFA_OFFSET 4 315 CFI_ADJUST_CFA_OFFSET 4
312 CFI_REL_OFFSET eip, 0 316 CFI_REL_OFFSET eip, 0
313 317
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
index 2424cc9c7b3d..6a3875f81a0a 100644
--- a/arch/i386/kernel/io_apic.c
+++ b/arch/i386/kernel/io_apic.c
@@ -1227,26 +1227,32 @@ static u8 irq_vector[NR_IRQ_VECTORS] __read_mostly = { FIRST_DEVICE_VECTOR , 0 }
1227 1227
1228static int __assign_irq_vector(int irq) 1228static int __assign_irq_vector(int irq)
1229{ 1229{
1230 static int current_vector = FIRST_DEVICE_VECTOR, offset = 0; 1230 static int current_vector = FIRST_DEVICE_VECTOR, current_offset = 0;
1231 int vector; 1231 int vector, offset, i;
1232 1232
1233 BUG_ON((unsigned)irq >= NR_IRQ_VECTORS); 1233 BUG_ON((unsigned)irq >= NR_IRQ_VECTORS);
1234 1234
1235 if (irq_vector[irq] > 0) 1235 if (irq_vector[irq] > 0)
1236 return irq_vector[irq]; 1236 return irq_vector[irq];
1237 1237
1238 current_vector += 8;
1239 if (current_vector == SYSCALL_VECTOR)
1240 current_vector += 8;
1241
1242 if (current_vector >= FIRST_SYSTEM_VECTOR) {
1243 offset++;
1244 if (!(offset % 8))
1245 return -ENOSPC;
1246 current_vector = FIRST_DEVICE_VECTOR + offset;
1247 }
1248
1249 vector = current_vector; 1238 vector = current_vector;
1239 offset = current_offset;
1240next:
1241 vector += 8;
1242 if (vector >= FIRST_SYSTEM_VECTOR) {
1243 offset = (offset + 1) % 8;
1244 vector = FIRST_DEVICE_VECTOR + offset;
1245 }
1246 if (vector == current_vector)
1247 return -ENOSPC;
1248 if (vector == SYSCALL_VECTOR)
1249 goto next;
1250 for (i = 0; i < NR_IRQ_VECTORS; i++)
1251 if (irq_vector[i] == vector)
1252 goto next;
1253
1254 current_vector = vector;
1255 current_offset = offset;
1250 irq_vector[irq] = vector; 1256 irq_vector[irq] = vector;
1251 1257
1252 return vector; 1258 return vector;
diff --git a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c
index a5e34d655965..1a6f8bb8881c 100644
--- a/arch/i386/kernel/nmi.c
+++ b/arch/i386/kernel/nmi.c
@@ -310,13 +310,7 @@ static int __init setup_nmi_watchdog(char *str)
310 310
311 if ((nmi >= NMI_INVALID) || (nmi < NMI_NONE)) 311 if ((nmi >= NMI_INVALID) || (nmi < NMI_NONE))
312 return 0; 312 return 0;
313 /* 313
314 * If any other x86 CPU has a local APIC, then
315 * please test the NMI stuff there and send me the
316 * missing bits. Right now Intel P6/P4 and AMD K7 only.
317 */
318 if ((nmi == NMI_LOCAL_APIC) && (nmi_known_cpu() == 0))
319 return 0; /* no lapic support */
320 nmi_watchdog = nmi; 314 nmi_watchdog = nmi;
321 return 1; 315 return 1;
322} 316}
diff --git a/arch/i386/kernel/paravirt.c b/arch/i386/kernel/paravirt.c
index 3dceab5828f1..e55fd05da0f5 100644
--- a/arch/i386/kernel/paravirt.c
+++ b/arch/i386/kernel/paravirt.c
@@ -566,4 +566,11 @@ struct paravirt_ops paravirt_ops = {
566 .irq_enable_sysexit = native_irq_enable_sysexit, 566 .irq_enable_sysexit = native_irq_enable_sysexit,
567 .iret = native_iret, 567 .iret = native_iret,
568}; 568};
569EXPORT_SYMBOL(paravirt_ops); 569
570/*
571 * NOTE: CONFIG_PARAVIRT is experimental and the paravirt_ops
572 * semantics are subject to change. Hence we only do this
573 * internal-only export of this, until it gets sorted out and
574 * all lowlevel CPU ops used by modules are separately exported.
575 */
576EXPORT_SYMBOL_GPL(paravirt_ops);
diff --git a/arch/i386/kernel/sysenter.c b/arch/i386/kernel/sysenter.c
index 7de9117b5a3a..5da744204d10 100644
--- a/arch/i386/kernel/sysenter.c
+++ b/arch/i386/kernel/sysenter.c
@@ -79,11 +79,6 @@ int __init sysenter_setup(void)
79#ifdef CONFIG_COMPAT_VDSO 79#ifdef CONFIG_COMPAT_VDSO
80 __set_fixmap(FIX_VDSO, __pa(syscall_page), PAGE_READONLY); 80 __set_fixmap(FIX_VDSO, __pa(syscall_page), PAGE_READONLY);
81 printk("Compat vDSO mapped to %08lx.\n", __fix_to_virt(FIX_VDSO)); 81 printk("Compat vDSO mapped to %08lx.\n", __fix_to_virt(FIX_VDSO));
82#else
83 /*
84 * In the non-compat case the ELF coredumping code needs the fixmap:
85 */
86 __set_fixmap(FIX_VDSO, __pa(syscall_page), PAGE_KERNEL_RO);
87#endif 82#endif
88 83
89 if (!boot_cpu_has(X86_FEATURE_SEP)) { 84 if (!boot_cpu_has(X86_FEATURE_SEP)) {
@@ -100,6 +95,7 @@ int __init sysenter_setup(void)
100 return 0; 95 return 0;
101} 96}
102 97
98#ifndef CONFIG_COMPAT_VDSO
103static struct page *syscall_nopage(struct vm_area_struct *vma, 99static struct page *syscall_nopage(struct vm_area_struct *vma,
104 unsigned long adr, int *type) 100 unsigned long adr, int *type)
105{ 101{
@@ -146,6 +142,13 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack)
146 vma->vm_end = addr + PAGE_SIZE; 142 vma->vm_end = addr + PAGE_SIZE;
147 /* MAYWRITE to allow gdb to COW and set breakpoints */ 143 /* MAYWRITE to allow gdb to COW and set breakpoints */
148 vma->vm_flags = VM_READ|VM_EXEC|VM_MAYREAD|VM_MAYEXEC|VM_MAYWRITE; 144 vma->vm_flags = VM_READ|VM_EXEC|VM_MAYREAD|VM_MAYEXEC|VM_MAYWRITE;
145 /*
146 * Make sure the vDSO gets into every core dump.
147 * Dumping its contents makes post-mortem fully interpretable later
148 * without matching up the same kernel and hardware config to see
149 * what PC values meant.
150 */
151 vma->vm_flags |= VM_ALWAYSDUMP;
149 vma->vm_flags |= mm->def_flags; 152 vma->vm_flags |= mm->def_flags;
150 vma->vm_page_prot = protection_map[vma->vm_flags & 7]; 153 vma->vm_page_prot = protection_map[vma->vm_flags & 7];
151 vma->vm_ops = &syscall_vm_ops; 154 vma->vm_ops = &syscall_vm_ops;
@@ -187,3 +190,4 @@ int in_gate_area_no_task(unsigned long addr)
187{ 190{
188 return 0; 191 return 0;
189} 192}
193#endif