aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386/kernel')
-rw-r--r--arch/i386/kernel/.gitignore1
-rw-r--r--arch/i386/kernel/Makefile2
-rw-r--r--arch/i386/kernel/cpu/common.c32
-rw-r--r--arch/i386/kernel/cpu/transmeta.c1
-rw-r--r--arch/i386/kernel/efi.c12
-rw-r--r--arch/i386/kernel/head.S6
-rw-r--r--arch/i386/kernel/i386_ksyms.c2
-rw-r--r--arch/i386/kernel/io_apic.c6
-rw-r--r--arch/i386/kernel/kprobes.c16
-rw-r--r--arch/i386/kernel/mpparse.c12
-rw-r--r--arch/i386/kernel/smpboot.c10
-rw-r--r--arch/i386/kernel/syscall_table.S2
-rw-r--r--arch/i386/kernel/timers/timer_tsc.c5
-rw-r--r--arch/i386/kernel/topology.c97
-rw-r--r--arch/i386/kernel/vsyscall-sysenter.S15
15 files changed, 187 insertions, 32 deletions
diff --git a/arch/i386/kernel/.gitignore b/arch/i386/kernel/.gitignore
new file mode 100644
index 000000000000..40836ad9079c
--- /dev/null
+++ b/arch/i386/kernel/.gitignore
@@ -0,0 +1 @@
vsyscall.lds
diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile
index 60c3f76dfca4..53bb9a79e274 100644
--- a/arch/i386/kernel/Makefile
+++ b/arch/i386/kernel/Makefile
@@ -7,7 +7,7 @@ extra-y := head.o init_task.o vmlinux.lds
7obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \ 7obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \
8 ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \ 8 ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \
9 pci-dma.o i386_ksyms.o i387.o dmi_scan.o bootflag.o \ 9 pci-dma.o i386_ksyms.o i387.o dmi_scan.o bootflag.o \
10 quirks.o i8237.o 10 quirks.o i8237.o topology.o
11 11
12obj-y += cpu/ 12obj-y += cpu/
13obj-y += timers/ 13obj-y += timers/
diff --git a/arch/i386/kernel/cpu/common.c b/arch/i386/kernel/cpu/common.c
index 7eb9213734a3..4ecd4b326ded 100644
--- a/arch/i386/kernel/cpu/common.c
+++ b/arch/i386/kernel/cpu/common.c
@@ -4,6 +4,7 @@
4#include <linux/smp.h> 4#include <linux/smp.h>
5#include <linux/module.h> 5#include <linux/module.h>
6#include <linux/percpu.h> 6#include <linux/percpu.h>
7#include <linux/bootmem.h>
7#include <asm/semaphore.h> 8#include <asm/semaphore.h>
8#include <asm/processor.h> 9#include <asm/processor.h>
9#include <asm/i387.h> 10#include <asm/i387.h>
@@ -18,6 +19,9 @@
18 19
19#include "cpu.h" 20#include "cpu.h"
20 21
22DEFINE_PER_CPU(struct Xgt_desc_struct, cpu_gdt_descr);
23EXPORT_PER_CPU_SYMBOL(cpu_gdt_descr);
24
21DEFINE_PER_CPU(unsigned char, cpu_16bit_stack[CPU_16BIT_STACK_SIZE]); 25DEFINE_PER_CPU(unsigned char, cpu_16bit_stack[CPU_16BIT_STACK_SIZE]);
22EXPORT_PER_CPU_SYMBOL(cpu_16bit_stack); 26EXPORT_PER_CPU_SYMBOL(cpu_16bit_stack);
23 27
@@ -571,8 +575,9 @@ void __devinit cpu_init(void)
571 int cpu = smp_processor_id(); 575 int cpu = smp_processor_id();
572 struct tss_struct * t = &per_cpu(init_tss, cpu); 576 struct tss_struct * t = &per_cpu(init_tss, cpu);
573 struct thread_struct *thread = &current->thread; 577 struct thread_struct *thread = &current->thread;
574 struct desc_struct *gdt = get_cpu_gdt_table(cpu); 578 struct desc_struct *gdt;
575 __u32 stk16_off = (__u32)&per_cpu(cpu_16bit_stack, cpu); 579 __u32 stk16_off = (__u32)&per_cpu(cpu_16bit_stack, cpu);
580 struct Xgt_desc_struct *cpu_gdt_descr = &per_cpu(cpu_gdt_descr, cpu);
576 581
577 if (cpu_test_and_set(cpu, cpu_initialized)) { 582 if (cpu_test_and_set(cpu, cpu_initialized)) {
578 printk(KERN_WARNING "CPU#%d already initialized!\n", cpu); 583 printk(KERN_WARNING "CPU#%d already initialized!\n", cpu);
@@ -590,6 +595,25 @@ void __devinit cpu_init(void)
590 } 595 }
591 596
592 /* 597 /*
598 * This is a horrible hack to allocate the GDT. The problem
599 * is that cpu_init() is called really early for the boot CPU
600 * (and hence needs bootmem) but much later for the secondary
601 * CPUs, when bootmem will have gone away
602 */
603 if (NODE_DATA(0)->bdata->node_bootmem_map) {
604 gdt = (struct desc_struct *)alloc_bootmem_pages(PAGE_SIZE);
605 /* alloc_bootmem_pages panics on failure, so no check */
606 memset(gdt, 0, PAGE_SIZE);
607 } else {
608 gdt = (struct desc_struct *)get_zeroed_page(GFP_KERNEL);
609 if (unlikely(!gdt)) {
610 printk(KERN_CRIT "CPU%d failed to allocate GDT\n", cpu);
611 for (;;)
612 local_irq_enable();
613 }
614 }
615
616 /*
593 * Initialize the per-CPU GDT with the boot GDT, 617 * Initialize the per-CPU GDT with the boot GDT,
594 * and set up the GDT descriptor: 618 * and set up the GDT descriptor:
595 */ 619 */
@@ -601,10 +625,10 @@ void __devinit cpu_init(void)
601 ((((__u64)stk16_off) << 32) & 0xff00000000000000ULL) | 625 ((((__u64)stk16_off) << 32) & 0xff00000000000000ULL) |
602 (CPU_16BIT_STACK_SIZE - 1); 626 (CPU_16BIT_STACK_SIZE - 1);
603 627
604 cpu_gdt_descr[cpu].size = GDT_SIZE - 1; 628 cpu_gdt_descr->size = GDT_SIZE - 1;
605 cpu_gdt_descr[cpu].address = (unsigned long)gdt; 629 cpu_gdt_descr->address = (unsigned long)gdt;
606 630
607 load_gdt(&cpu_gdt_descr[cpu]); 631 load_gdt(cpu_gdt_descr);
608 load_idt(&idt_descr); 632 load_idt(&idt_descr);
609 633
610 /* 634 /*
diff --git a/arch/i386/kernel/cpu/transmeta.c b/arch/i386/kernel/cpu/transmeta.c
index bdbeb77f4e22..7214c9b577ab 100644
--- a/arch/i386/kernel/cpu/transmeta.c
+++ b/arch/i386/kernel/cpu/transmeta.c
@@ -1,4 +1,5 @@
1#include <linux/kernel.h> 1#include <linux/kernel.h>
2#include <linux/mm.h>
2#include <linux/init.h> 3#include <linux/init.h>
3#include <asm/processor.h> 4#include <asm/processor.h>
4#include <asm/msr.h> 5#include <asm/msr.h>
diff --git a/arch/i386/kernel/efi.c b/arch/i386/kernel/efi.c
index ecad519fd395..e3e42fd62401 100644
--- a/arch/i386/kernel/efi.c
+++ b/arch/i386/kernel/efi.c
@@ -103,17 +103,19 @@ static void efi_call_phys_prelog(void)
103 */ 103 */
104 local_flush_tlb(); 104 local_flush_tlb();
105 105
106 cpu_gdt_descr[0].address = __pa(cpu_gdt_descr[0].address); 106 per_cpu(cpu_gdt_descr, 0).address =
107 load_gdt((struct Xgt_desc_struct *) __pa(&cpu_gdt_descr[0])); 107 __pa(per_cpu(cpu_gdt_descr, 0).address);
108 load_gdt((struct Xgt_desc_struct *)__pa(&per_cpu(cpu_gdt_descr, 0)));
108} 109}
109 110
110static void efi_call_phys_epilog(void) 111static void efi_call_phys_epilog(void)
111{ 112{
112 unsigned long cr4; 113 unsigned long cr4;
113 114
114 cpu_gdt_descr[0].address = 115 per_cpu(cpu_gdt_descr, 0).address =
115 (unsigned long) __va(cpu_gdt_descr[0].address); 116 (unsigned long)__va(per_cpu(cpu_gdt_descr, 0).address);
116 load_gdt(&cpu_gdt_descr[0]); 117 load_gdt((struct Xgt_desc_struct *)__va(&per_cpu(cpu_gdt_descr, 0)));
118
117 cr4 = read_cr4(); 119 cr4 = read_cr4();
118 120
119 if (cr4 & X86_CR4_PSE) { 121 if (cr4 & X86_CR4_PSE) {
diff --git a/arch/i386/kernel/head.S b/arch/i386/kernel/head.S
index 5884469f6bfe..e0b7c632efbc 100644
--- a/arch/i386/kernel/head.S
+++ b/arch/i386/kernel/head.S
@@ -398,7 +398,11 @@ ignore_int:
398 pushl 32(%esp) 398 pushl 32(%esp)
399 pushl 40(%esp) 399 pushl 40(%esp)
400 pushl $int_msg 400 pushl $int_msg
401#ifdef CONFIG_EARLY_PRINTK
402 call early_printk
403#else
401 call printk 404 call printk
405#endif
402 addl $(5*4),%esp 406 addl $(5*4),%esp
403 popl %ds 407 popl %ds
404 popl %es 408 popl %es
@@ -530,5 +534,3 @@ ENTRY(cpu_gdt_table)
530 .quad 0x0000000000000000 /* 0xf0 - unused */ 534 .quad 0x0000000000000000 /* 0xf0 - unused */
531 .quad 0x0000000000000000 /* 0xf8 - GDT entry 31: double-fault TSS */ 535 .quad 0x0000000000000000 /* 0xf8 - GDT entry 31: double-fault TSS */
532 536
533 /* Be sure this is zeroed to avoid false validations in Xen */
534 .fill PAGE_SIZE_asm / 8 - GDT_ENTRIES,8,0
diff --git a/arch/i386/kernel/i386_ksyms.c b/arch/i386/kernel/i386_ksyms.c
index 3999bec50c33..055325056a74 100644
--- a/arch/i386/kernel/i386_ksyms.c
+++ b/arch/i386/kernel/i386_ksyms.c
@@ -3,8 +3,6 @@
3#include <asm/checksum.h> 3#include <asm/checksum.h>
4#include <asm/desc.h> 4#include <asm/desc.h>
5 5
6EXPORT_SYMBOL_GPL(cpu_gdt_descr);
7
8EXPORT_SYMBOL(__down_failed); 6EXPORT_SYMBOL(__down_failed);
9EXPORT_SYMBOL(__down_failed_interruptible); 7EXPORT_SYMBOL(__down_failed_interruptible);
10EXPORT_SYMBOL(__down_failed_trylock); 8EXPORT_SYMBOL(__down_failed_trylock);
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
index f2dd218d88cb..235822b3f41b 100644
--- a/arch/i386/kernel/io_apic.c
+++ b/arch/i386/kernel/io_apic.c
@@ -2566,8 +2566,10 @@ int __init io_apic_get_unique_id (int ioapic, int apic_id)
2566 spin_unlock_irqrestore(&ioapic_lock, flags); 2566 spin_unlock_irqrestore(&ioapic_lock, flags);
2567 2567
2568 /* Sanity check */ 2568 /* Sanity check */
2569 if (reg_00.bits.ID != apic_id) 2569 if (reg_00.bits.ID != apic_id) {
2570 panic("IOAPIC[%d]: Unable change apic_id!\n", ioapic); 2570 printk("IOAPIC[%d]: Unable to change apic_id!\n", ioapic);
2571 return -1;
2572 }
2571 } 2573 }
2572 2574
2573 apic_printk(APIC_VERBOSE, KERN_INFO 2575 apic_printk(APIC_VERBOSE, KERN_INFO
diff --git a/arch/i386/kernel/kprobes.c b/arch/i386/kernel/kprobes.c
index 6483eeb1a4e8..694a13997637 100644
--- a/arch/i386/kernel/kprobes.c
+++ b/arch/i386/kernel/kprobes.c
@@ -58,6 +58,11 @@ static inline int is_IF_modifier(kprobe_opcode_t opcode)
58 58
59int __kprobes arch_prepare_kprobe(struct kprobe *p) 59int __kprobes arch_prepare_kprobe(struct kprobe *p)
60{ 60{
61 /* insn: must be on special executable page on i386. */
62 p->ainsn.insn = get_insn_slot();
63 if (!p->ainsn.insn)
64 return -ENOMEM;
65
61 memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t)); 66 memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t));
62 p->opcode = *p->addr; 67 p->opcode = *p->addr;
63 return 0; 68 return 0;
@@ -77,6 +82,13 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)
77 (unsigned long) p->addr + sizeof(kprobe_opcode_t)); 82 (unsigned long) p->addr + sizeof(kprobe_opcode_t));
78} 83}
79 84
85void __kprobes arch_remove_kprobe(struct kprobe *p)
86{
87 down(&kprobe_mutex);
88 free_insn_slot(p->ainsn.insn);
89 up(&kprobe_mutex);
90}
91
80static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb) 92static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb)
81{ 93{
82 kcb->prev_kprobe.kp = kprobe_running(); 94 kcb->prev_kprobe.kp = kprobe_running();
@@ -111,7 +123,7 @@ static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
111 if (p->opcode == BREAKPOINT_INSTRUCTION) 123 if (p->opcode == BREAKPOINT_INSTRUCTION)
112 regs->eip = (unsigned long)p->addr; 124 regs->eip = (unsigned long)p->addr;
113 else 125 else
114 regs->eip = (unsigned long)&p->ainsn.insn; 126 regs->eip = (unsigned long)p->ainsn.insn;
115} 127}
116 128
117/* Called with kretprobe_lock held */ 129/* Called with kretprobe_lock held */
@@ -351,7 +363,7 @@ static void __kprobes resume_execution(struct kprobe *p,
351{ 363{
352 unsigned long *tos = (unsigned long *)&regs->esp; 364 unsigned long *tos = (unsigned long *)&regs->esp;
353 unsigned long next_eip = 0; 365 unsigned long next_eip = 0;
354 unsigned long copy_eip = (unsigned long)&p->ainsn.insn; 366 unsigned long copy_eip = (unsigned long)p->ainsn.insn;
355 unsigned long orig_eip = (unsigned long)p->addr; 367 unsigned long orig_eip = (unsigned long)p->addr;
356 368
357 switch (p->ainsn.insn[0]) { 369 switch (p->ainsn.insn[0]) {
diff --git a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c
index 0102f3d50e57..e6e2f43db85e 100644
--- a/arch/i386/kernel/mpparse.c
+++ b/arch/i386/kernel/mpparse.c
@@ -710,7 +710,7 @@ void __init get_smp_config (void)
710 * Read the physical hardware table. Anything here will 710 * Read the physical hardware table. Anything here will
711 * override the defaults. 711 * override the defaults.
712 */ 712 */
713 if (!smp_read_mpc((void *)mpf->mpf_physptr)) { 713 if (!smp_read_mpc(phys_to_virt(mpf->mpf_physptr))) {
714 smp_found_config = 0; 714 smp_found_config = 0;
715 printk(KERN_ERR "BIOS bug, MP table errors detected!...\n"); 715 printk(KERN_ERR "BIOS bug, MP table errors detected!...\n");
716 printk(KERN_ERR "... disabling SMP support. (tell your hw vendor)\n"); 716 printk(KERN_ERR "... disabling SMP support. (tell your hw vendor)\n");
@@ -915,6 +915,7 @@ void __init mp_register_ioapic (
915 u32 gsi_base) 915 u32 gsi_base)
916{ 916{
917 int idx = 0; 917 int idx = 0;
918 int tmpid;
918 919
919 if (nr_ioapics >= MAX_IO_APICS) { 920 if (nr_ioapics >= MAX_IO_APICS) {
920 printk(KERN_ERR "ERROR: Max # of I/O APICs (%d) exceeded " 921 printk(KERN_ERR "ERROR: Max # of I/O APICs (%d) exceeded "
@@ -935,9 +936,14 @@ void __init mp_register_ioapic (
935 936
936 set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address); 937 set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address);
937 if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) && (boot_cpu_data.x86 < 15)) 938 if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) && (boot_cpu_data.x86 < 15))
938 mp_ioapics[idx].mpc_apicid = io_apic_get_unique_id(idx, id); 939 tmpid = io_apic_get_unique_id(idx, id);
939 else 940 else
940 mp_ioapics[idx].mpc_apicid = id; 941 tmpid = id;
942 if (tmpid == -1) {
943 nr_ioapics--;
944 return;
945 }
946 mp_ioapics[idx].mpc_apicid = tmpid;
941 mp_ioapics[idx].mpc_apicver = io_apic_get_version(idx); 947 mp_ioapics[idx].mpc_apicver = io_apic_get_version(idx);
942 948
943 /* 949 /*
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index 255adb498268..eba7f53f8b4a 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -87,11 +87,7 @@ EXPORT_SYMBOL(cpu_online_map);
87cpumask_t cpu_callin_map; 87cpumask_t cpu_callin_map;
88cpumask_t cpu_callout_map; 88cpumask_t cpu_callout_map;
89EXPORT_SYMBOL(cpu_callout_map); 89EXPORT_SYMBOL(cpu_callout_map);
90#ifdef CONFIG_HOTPLUG_CPU
91cpumask_t cpu_possible_map = CPU_MASK_ALL;
92#else
93cpumask_t cpu_possible_map; 90cpumask_t cpu_possible_map;
94#endif
95EXPORT_SYMBOL(cpu_possible_map); 91EXPORT_SYMBOL(cpu_possible_map);
96static cpumask_t smp_commenced_mask; 92static cpumask_t smp_commenced_mask;
97 93
@@ -902,12 +898,6 @@ static int __devinit do_boot_cpu(int apicid, int cpu)
902 unsigned long start_eip; 898 unsigned long start_eip;
903 unsigned short nmi_high = 0, nmi_low = 0; 899 unsigned short nmi_high = 0, nmi_low = 0;
904 900
905 if (!cpu_gdt_descr[cpu].address &&
906 !(cpu_gdt_descr[cpu].address = get_zeroed_page(GFP_KERNEL))) {
907 printk("Failed to allocate GDT for CPU %d\n", cpu);
908 return 1;
909 }
910
911 ++cpucount; 901 ++cpucount;
912 902
913 /* 903 /*
diff --git a/arch/i386/kernel/syscall_table.S b/arch/i386/kernel/syscall_table.S
index 5a8b3fb6d27b..ac687d00a1ce 100644
--- a/arch/i386/kernel/syscall_table.S
+++ b/arch/i386/kernel/syscall_table.S
@@ -299,7 +299,7 @@ ENTRY(sys_call_table)
299 .long sys_mknodat 299 .long sys_mknodat
300 .long sys_fchownat 300 .long sys_fchownat
301 .long sys_futimesat 301 .long sys_futimesat
302 .long sys_newfstatat /* 300 */ 302 .long sys_fstatat64 /* 300 */
303 .long sys_unlinkat 303 .long sys_unlinkat
304 .long sys_renameat 304 .long sys_renameat
305 .long sys_linkat 305 .long sys_linkat
diff --git a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c
index 7c86e3c5f1c1..a7f5a2aceba2 100644
--- a/arch/i386/kernel/timers/timer_tsc.c
+++ b/arch/i386/kernel/timers/timer_tsc.c
@@ -282,6 +282,10 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
282 if (val != CPUFREQ_RESUMECHANGE) 282 if (val != CPUFREQ_RESUMECHANGE)
283 write_seqlock_irq(&xtime_lock); 283 write_seqlock_irq(&xtime_lock);
284 if (!ref_freq) { 284 if (!ref_freq) {
285 if (!freq->old){
286 ref_freq = freq->new;
287 goto end;
288 }
285 ref_freq = freq->old; 289 ref_freq = freq->old;
286 loops_per_jiffy_ref = cpu_data[freq->cpu].loops_per_jiffy; 290 loops_per_jiffy_ref = cpu_data[freq->cpu].loops_per_jiffy;
287#ifndef CONFIG_SMP 291#ifndef CONFIG_SMP
@@ -307,6 +311,7 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
307#endif 311#endif
308 } 312 }
309 313
314end:
310 if (val != CPUFREQ_RESUMECHANGE) 315 if (val != CPUFREQ_RESUMECHANGE)
311 write_sequnlock_irq(&xtime_lock); 316 write_sequnlock_irq(&xtime_lock);
312 317
diff --git a/arch/i386/kernel/topology.c b/arch/i386/kernel/topology.c
new file mode 100644
index 000000000000..67a0e1baa28b
--- /dev/null
+++ b/arch/i386/kernel/topology.c
@@ -0,0 +1,97 @@
1/*
2 * arch/i386/kernel/topology.c - Populate driverfs with topology information
3 *
4 * Written by: Matthew Dobson, IBM Corporation
5 * Original Code: Paul Dorwin, IBM Corporation, Patrick Mochel, OSDL
6 *
7 * Copyright (C) 2002, IBM Corp.
8 *
9 * All rights reserved.
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
19 * NON INFRINGEMENT. See the GNU General Public License for more
20 * details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 *
26 * Send feedback to <colpatch@us.ibm.com>
27 */
28#include <linux/init.h>
29#include <linux/smp.h>
30#include <linux/nodemask.h>
31#include <asm/cpu.h>
32
33static struct i386_cpu cpu_devices[NR_CPUS];
34
35int arch_register_cpu(int num){
36 struct node *parent = NULL;
37
38#ifdef CONFIG_NUMA
39 int node = cpu_to_node(num);
40 if (node_online(node))
41 parent = &node_devices[node].node;
42#endif /* CONFIG_NUMA */
43
44 return register_cpu(&cpu_devices[num].cpu, num, parent);
45}
46
47#ifdef CONFIG_HOTPLUG_CPU
48
49void arch_unregister_cpu(int num) {
50 struct node *parent = NULL;
51
52#ifdef CONFIG_NUMA
53 int node = cpu_to_node(num);
54 if (node_online(node))
55 parent = &node_devices[node].node;
56#endif /* CONFIG_NUMA */
57
58 return unregister_cpu(&cpu_devices[num].cpu, parent);
59}
60EXPORT_SYMBOL(arch_register_cpu);
61EXPORT_SYMBOL(arch_unregister_cpu);
62#endif /*CONFIG_HOTPLUG_CPU*/
63
64
65
66#ifdef CONFIG_NUMA
67#include <linux/mmzone.h>
68#include <asm/node.h>
69
70struct i386_node node_devices[MAX_NUMNODES];
71
72static int __init topology_init(void)
73{
74 int i;
75
76 for_each_online_node(i)
77 arch_register_node(i);
78
79 for_each_present_cpu(i)
80 arch_register_cpu(i);
81 return 0;
82}
83
84#else /* !CONFIG_NUMA */
85
86static int __init topology_init(void)
87{
88 int i;
89
90 for_each_present_cpu(i)
91 arch_register_cpu(i);
92 return 0;
93}
94
95#endif /* CONFIG_NUMA */
96
97subsys_initcall(topology_init);
diff --git a/arch/i386/kernel/vsyscall-sysenter.S b/arch/i386/kernel/vsyscall-sysenter.S
index 4daefb2ec1b2..76b728159403 100644
--- a/arch/i386/kernel/vsyscall-sysenter.S
+++ b/arch/i386/kernel/vsyscall-sysenter.S
@@ -7,6 +7,21 @@
7 * for details. 7 * for details.
8 */ 8 */
9 9
10/*
11 * The caller puts arg2 in %ecx, which gets pushed. The kernel will use
12 * %ecx itself for arg2. The pushing is because the sysexit instruction
13 * (found in entry.S) requires that we clobber %ecx with the desired %esp.
14 * User code might expect that %ecx is unclobbered though, as it would be
15 * for returning via the iret instruction, so we must push and pop.
16 *
17 * The caller puts arg3 in %edx, which the sysexit instruction requires
18 * for %eip. Thus, exactly as for arg2, we must push and pop.
19 *
20 * Arg6 is different. The caller puts arg6 in %ebp. Since the sysenter
21 * instruction clobbers %esp, the user's %esp won't even survive entry
22 * into the kernel. We store %esp in %ebp. Code in entry.S must fetch
23 * arg6 from the stack.
24 */
10 .text 25 .text
11 .globl __kernel_vsyscall 26 .globl __kernel_vsyscall
12 .type __kernel_vsyscall,@function 27 .type __kernel_vsyscall,@function