lkml.org 
[lkml]   [2017]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] x86/mm/kaiser: Prepare the x86/entry assembly code for entry/exit CR3 switching
On Sun, Nov 26, 2017 at 03:55:53PM +0100, Ingo Molnar wrote:
> @@ -198,6 +201,14 @@ ENTRY(entry_SYSCALL_64)
>
> swapgs
> movq %rsp, PER_CPU_VAR(rsp_scratch)
> +
> + /*
> + * The kernel CR3 is needed to map the process stack, but we
> + * need a scratch register to be able to load CR3. %rsp is
> + * clobberable right now, so use it as a scratch register.
> + * %rsp will look crazy here for a couple instructions.
> + */
> + SWITCH_TO_KERNEL_CR3 scratch_reg=%rsp
> movq PER_CPU_VAR(cpu_current_top_of_stack), %rsp

I think it doesn't make sense to have a SWITCH_TO_KERNEL_CR3 here. This
code is the (future) kaiser-disabled path, where SWITCH_TO_KERNEL_CR3 is
a no-op anyway.

--
Josh

\
 
 \ /
  Last update: 2017-11-27 14:30    [W:0.083 / U:3.428 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site