[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160302195053.GG8362@pd.tnic>
Date: Wed, 2 Mar 2016 20:50:53 +0100
From: Borislav Petkov <bp@...en8.de>
To: "H. Peter Anvin" <hpa@...or.com>
Cc: Brian Gerst <brgerst@...il.com>, X86 ML <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Tom Lendacky <thomas.lendacky@....com>
Subject: Re: [RFC PATCH] x86: Make sure verify_cpu has a good stack
On Wed, Mar 02, 2016 at 10:39:05AM -0800, H. Peter Anvin wrote:
> Well, we definitely should use %rip-relative addressing if we can.
Right you are.
> However, even so I believe this breaks if the kernel is loaded anywhere
> but its default load address. I think we need to do something like:
>
> movq stack_start(%rip), %rax
> leaq __START_KERNEL_map(%rip), %rdx
> subq %rdx, %rax
> movq %rax, %rsp
>
> The use of temporary registers avoids clobbering a valid stack pointer
> for even a single instruction if we are given one.
Yeah, we should be prudent and make this as sturdy as possible. I did this:
CONFIG_PHYSICAL_START=0x100beef
and it aligned startup_64 up to ffffffff82000000. It seems to boot fine
in kvm. But better safe than sorry.
Thanks.
--
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.
Powered by blists - more mailing lists