Skip to content

Commit 896c80b

Browse files
amlutoIngo Molnar
authored andcommitted
x86/power/32: Move SYSENTER MSR restoration to fix_processor_context()
x86_64 restores system call MSRs in fix_processor_context(), and x86_32 restored them along with segment registers. The 64-bit variant makes more sense, so move the 32-bit code to match the 64-bit code. No side effects are expected to runtime behavior. Tested-by: Jarkko Nikula <[email protected]> Signed-off-by: Andy Lutomirski <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Acked-by: Thomas Gleixner <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Pavel Machek <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Rafael J. Wysocki <[email protected]> Cc: Zhang Rui <[email protected]> Link: http://lkml.kernel.org/r/65158f8d7ee64dd6bbc6c1c83b3b34aaa854e3ae.1513286253.git.luto@kernel.org Signed-off-by: Ingo Molnar <[email protected]>
1 parent 090edbe commit 896c80b

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

arch/x86/power/cpu.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ static void fix_processor_context(void)
174174
write_gdt_entry(desc, GDT_ENTRY_TSS, &tss, DESC_TSS);
175175

176176
syscall_init(); /* This sets MSR_*STAR and related */
177+
#else
178+
if (boot_cpu_has(X86_FEATURE_SEP))
179+
enable_sep_cpu();
177180
#endif
178181
load_TR_desc(); /* This does ltr */
179182
load_mm_ldt(current->active_mm); /* This does lldt */
@@ -237,12 +240,6 @@ static void notrace __restore_processor_state(struct saved_context *ctxt)
237240
loadsegment(fs, ctxt->fs);
238241
loadsegment(gs, ctxt->gs);
239242
loadsegment(ss, ctxt->ss);
240-
241-
/*
242-
* sysenter MSRs
243-
*/
244-
if (boot_cpu_has(X86_FEATURE_SEP))
245-
enable_sep_cpu();
246243
#else
247244
/* CONFIG_X86_64 */
248245
asm volatile ("movw %0, %%ds" :: "r" (ctxt->ds));

0 commit comments

Comments
 (0)