Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 136708
b: refs/heads/master
c: 552be87
h: refs/heads/master
v: v3
  • Loading branch information
Brian Gerst authored and Tejun Heo committed Jan 31, 2009
1 parent fb2fb05 commit e68e087
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2749ebe320ff9f77548d10fcc0a3464ac21c8e58
refs/heads/master: 552be871e67ff577ed36beb2f53d078b42304739
2 changes: 1 addition & 1 deletion trunk/arch/x86/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ extern int sysenter_setup(void);
extern struct desc_ptr early_gdt_descr;

extern void cpu_set_gdt(int);
extern void switch_to_new_gdt(void);
extern void switch_to_new_gdt(int);
extern void cpu_init(void);

static inline unsigned long get_debugctlmsr(void)
Expand Down
7 changes: 3 additions & 4 deletions trunk/arch/x86/kernel/cpu/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,9 @@ __u32 cleared_cpu_caps[NCAPINTS] __cpuinitdata;

/* Current gdt points %fs at the "master" per-cpu area: after this,
* it's on the real one. */
void switch_to_new_gdt(void)
void switch_to_new_gdt(int cpu)
{
struct desc_ptr gdt_descr;
int cpu = smp_processor_id();

gdt_descr.address = (long)get_cpu_gdt_table(cpu);
gdt_descr.size = GDT_SIZE - 1;
Expand Down Expand Up @@ -993,7 +992,7 @@ void __cpuinit cpu_init(void)
* and set up the GDT descriptor:
*/

switch_to_new_gdt();
switch_to_new_gdt(cpu);
loadsegment(fs, 0);

load_idt((const struct desc_ptr *)&idt_descr);
Expand Down Expand Up @@ -1098,7 +1097,7 @@ void __cpuinit cpu_init(void)
clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE);

load_idt(&idt_descr);
switch_to_new_gdt();
switch_to_new_gdt(cpu);

/*
* Set up and load the per-CPU TSS and LDT
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/setup_percpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void __init setup_per_cpu_areas(void)
* area. Reload any changed state for the boot CPU.
*/
if (cpu == boot_cpu_id)
switch_to_new_gdt();
switch_to_new_gdt(cpu);

DBG("PERCPU: cpu %4d %p\n", cpu, ptr);
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
void __init native_smp_prepare_boot_cpu(void)
{
int me = smp_processor_id();
switch_to_new_gdt();
switch_to_new_gdt(me);
/* already set me in cpu_online_mask in boot_cpu_init() */
cpumask_set_cpu(me, cpu_callout_mask);
per_cpu(cpu_state, me) = CPU_ONLINE;
Expand Down
11 changes: 6 additions & 5 deletions trunk/arch/x86/mach-voyager/voyager_smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1746,12 +1746,13 @@ static void __init voyager_smp_prepare_cpus(unsigned int max_cpus)

static void __cpuinit voyager_smp_prepare_boot_cpu(void)
{
switch_to_new_gdt();
int cpu = smp_processor_id();
switch_to_new_gdt(cpu);

cpu_set(smp_processor_id(), cpu_online_map);
cpu_set(smp_processor_id(), cpu_callout_map);
cpu_set(smp_processor_id(), cpu_possible_map);
cpu_set(smp_processor_id(), cpu_present_map);
cpu_set(cpu, cpu_online_map);
cpu_set(cpu, cpu_callout_map);
cpu_set(cpu, cpu_possible_map);
cpu_set(cpu, cpu_present_map);
}

static int __cpuinit voyager_cpu_up(unsigned int cpu)
Expand Down

0 comments on commit e68e087

Please sign in to comment.