Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 136709
b: refs/heads/master
c: 11e3a84
h: refs/heads/master
i:
  136707: fb2fb05
v: v3
  • Loading branch information
Jeremy Fitzhardinge authored and Tejun Heo committed Jan 31, 2009
1 parent e68e087 commit e3f7556
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 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: 552be871e67ff577ed36beb2f53d078b42304739
refs/heads/master: 11e3a840cd5b731cdd8f6f956dfae78a8046d09c
1 change: 1 addition & 0 deletions trunk/arch/x86/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,7 @@ extern struct desc_ptr early_gdt_descr;

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

static inline unsigned long get_debugctlmsr(void)
Expand Down
18 changes: 12 additions & 6 deletions trunk/arch/x86/kernel/cpu/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,16 @@ static char __cpuinit *table_lookup_model(struct cpuinfo_x86 *c)

__u32 cleared_cpu_caps[NCAPINTS] __cpuinitdata;

void load_percpu_segment(int cpu)
{
#ifdef CONFIG_X86_32
loadsegment(fs, __KERNEL_PERCPU);
#else
loadsegment(gs, 0);
wrmsrl(MSR_GS_BASE, (unsigned long)per_cpu(irq_stack_union.gs_base, cpu));
#endif
}

/* Current gdt points %fs at the "master" per-cpu area: after this,
* it's on the real one. */
void switch_to_new_gdt(int cpu)
Expand All @@ -263,12 +273,8 @@ void switch_to_new_gdt(int cpu)
gdt_descr.size = GDT_SIZE - 1;
load_gdt(&gdt_descr);
/* Reload the per-cpu base */
#ifdef CONFIG_X86_32
loadsegment(fs, __KERNEL_PERCPU);
#else
loadsegment(gs, 0);
wrmsrl(MSR_GS_BASE, (unsigned long)per_cpu(irq_stack_union.gs_base, cpu));
#endif

load_percpu_segment(cpu);
}

static struct cpu_dev *cpu_devs[X86_VENDOR_NUM] = {};
Expand Down

0 comments on commit e3f7556

Please sign in to comment.