[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170912200952.2r7xxgtbjwl7jp6j@treble>
Date: Tue, 12 Sep 2017 15:09:52 -0500
From: Josh Poimboeuf <jpoimboe@...hat.com>
To: Andy Lutomirski <luto@...nel.org>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org,
Borislav Petkov <bp@...en8.de>,
Brian Gerst <brgerst@...il.com>,
Andrew Cooper <andrew.cooper3@...rix.com>,
Juergen Gross <jgross@...e.com>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Kees Cook <keescook@...omium.org>
Subject: Re: [RFC 12/17] x86/xen/64: Clean up SP code in
cpu_initialize_context()
On Wed, Sep 06, 2017 at 02:36:57PM -0700, Andy Lutomirski wrote:
> @@ -293,12 +294,19 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle)
> #endif
> memset(&ctxt->fpu_ctxt, 0, sizeof(ctxt->fpu_ctxt));
>
> + /*
> + * Bring up the CPU in cpu_bringup_and_idle() with the stack
> + * pointing just below where pt_regs would be if it were a normal
> + * kernel entry.
> + */
> ctxt->user_regs.eip = (unsigned long)cpu_bringup_and_idle;
> ctxt->flags = VGCF_IN_KERNEL;
> ctxt->user_regs.eflags = 0x1000; /* IOPL_RING1 */
> ctxt->user_regs.ds = __USER_DS;
> ctxt->user_regs.es = __USER_DS;
> ctxt->user_regs.ss = __KERNEL_DS;
> + ctxt->user_regs.cs = __KERNEL_CS;
> + ctxt->user_regs.esp = task_top_of_stack(idle) - sizeof(struct pt_regs);
Isn't this the same as task_pt_regs(idle)?
--
Josh
Powered by blists - more mailing lists