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 Mon, 27 Nov 2017, Josh Poimboeuf wrote:
> 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.

Yes, Borislav noticed that as well. That's a left over from the early
versions where the trampoline did not exist.

Thanks,

tglx

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