Commit 5eef51c3 authored by David Woodhouse's avatar David Woodhouse

[PATCH] Restore SYSENTER setup on swsusp resume.

parent 3bedbd4b
...@@ -32,6 +32,8 @@ unsigned long saved_context_eax, saved_context_ebx, saved_context_ecx, saved_con ...@@ -32,6 +32,8 @@ unsigned long saved_context_eax, saved_context_ebx, saved_context_ecx, saved_con
unsigned long saved_context_esp, saved_context_ebp, saved_context_esi, saved_context_edi; unsigned long saved_context_esp, saved_context_ebp, saved_context_esi, saved_context_edi;
unsigned long saved_context_eflags; unsigned long saved_context_eflags;
extern void enable_sep_cpu(void *);
void save_processor_state(void) void save_processor_state(void)
{ {
kernel_fpu_begin(); kernel_fpu_begin();
...@@ -96,6 +98,12 @@ void restore_processor_state(void) ...@@ -96,6 +98,12 @@ void restore_processor_state(void)
asm volatile ("lidt %0" :: "m" (saved_context.idt_limit)); asm volatile ("lidt %0" :: "m" (saved_context.idt_limit));
asm volatile ("lldt %0" :: "m" (saved_context.ldt)); asm volatile ("lldt %0" :: "m" (saved_context.ldt));
/*
* sysenter MSRs
*/
if (boot_cpu_has(X86_FEATURE_SEP))
enable_sep_cpu(NULL);
fix_processor_context(); fix_processor_context();
do_fpu_end(); do_fpu_end();
} }
......
...@@ -35,7 +35,7 @@ struct fake_sep_struct { ...@@ -35,7 +35,7 @@ struct fake_sep_struct {
unsigned char stack[0]; unsigned char stack[0];
} __attribute__((aligned(8192))); } __attribute__((aligned(8192)));
static void __init enable_sep_cpu(void *info) void enable_sep_cpu(void *info)
{ {
int cpu = get_cpu(); int cpu = get_cpu();
struct tss_struct *tss = init_tss + cpu; struct tss_struct *tss = init_tss + cpu;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment