Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80036
b: refs/heads/master
c: 7818a1e
h: refs/heads/master
v: v3
  • Loading branch information
Glauber de Oliveira Costa authored and Ingo Molnar committed Jan 30, 2008
1 parent a541aa7 commit 749948d
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 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: ca241c75037b32e0216a68e39ad2801d04fa1f87
refs/heads/master: 7818a1e0294debee02d5135e17b89f28b8871887
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/process_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
/*
* Reload esp0, LDT and the page table pointer:
*/
tss->x86_tss.sp0 = next->sp0;
load_sp0(tss, next);

/*
* Switch DS and ES.
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/smpboot_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ static int __cpuinit do_boot_cpu(int cpu, int apicid)
start_rip = setup_trampoline();

init_rsp = c_idle.idle->thread.sp;
per_cpu(init_tss, cpu).x86_tss.sp0 = init_rsp;
load_sp0(&per_cpu(init_tss, cpu), &c_idle.idle->thread);
initial_code = start_secondary;
clear_tsk_thread_flag(c_idle.idle, TIF_FORK);

Expand Down
22 changes: 21 additions & 1 deletion trunk/include/asm-x86/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,22 @@ static inline void native_set_iopl_mask(unsigned mask)
#endif
}

static inline void native_load_sp0(struct tss_struct *tss,
struct thread_struct *thread)
{
tss->x86_tss.sp0 = thread->sp0;
#ifdef CONFIG_X86_32
/* Only happens when SEP is enabled, no need to test "SEP"arately */
if (unlikely(tss->x86_tss.ss1 != thread->sysenter_cs)) {
tss->x86_tss.ss1 = thread->sysenter_cs;
wrmsr(MSR_IA32_SYSENTER_CS, thread->sysenter_cs, 0);
}
#endif
}

#ifndef CONFIG_PARAVIRT
#ifdef CONFIG_PARAVIRT
#include <asm/paravirt.h>
#else
#define __cpuid native_cpuid
#define paravirt_enabled() 0

Expand All @@ -206,6 +220,12 @@ static inline void native_set_iopl_mask(unsigned mask)
#define set_debugreg(value, register) \
native_set_debugreg(register, value)

static inline void load_sp0(struct tss_struct *tss,
struct thread_struct *thread)
{
native_load_sp0(tss, thread);
}

#define set_iopl_mask native_set_iopl_mask
#endif /* CONFIG_PARAVIRT */

Expand Down
20 changes: 0 additions & 20 deletions trunk/include/asm-x86/processor_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,26 +278,6 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);

#define KSTK_ESP(task) (task_pt_regs(task)->sp)

static inline void native_load_sp0(struct tss_struct *tss, struct thread_struct *thread)
{
tss->x86_tss.sp0 = thread->sp0;
/* This can only happen when SEP is enabled, no need to test "SEP"arately */
if (unlikely(tss->x86_tss.ss1 != thread->sysenter_cs)) {
tss->x86_tss.ss1 = thread->sysenter_cs;
wrmsr(MSR_IA32_SYSENTER_CS, thread->sysenter_cs, 0);
}
}

#ifdef CONFIG_PARAVIRT
#include <asm/paravirt.h>
#else

static inline void load_sp0(struct tss_struct *tss, struct thread_struct *thread)
{
native_load_sp0(tss, thread);
}
#endif /* CONFIG_PARAVIRT */

/* generic versions from gas */
#define GENERIC_NOP1 ".byte 0x90\n"
#define GENERIC_NOP2 ".byte 0x89,0xf6\n"
Expand Down

0 comments on commit 749948d

Please sign in to comment.