Re: [RFC PATCH] x86: Make sure verify_cpu has a good stack

From: Yinghai Lu
Date: Thu Mar 03 2016 - 20:18:39 EST


On Thu, Mar 3, 2016 at 4:28 AM, Borislav Petkov <bp@xxxxxxxxx> wrote:
>
> 04633df0c43d ("x86/cpu: Call verify_cpu() after having entered long mode too")
> added the call to verify_cpu() for sanitizing CPU configuration.
>
> The latter uses the stack minimally and it can happen that we land in
> startup_64() directly from a 64-bit bootloader. Then we want to use our
> own, known good stack.
>
> Do that.
>
> APs don't need this as the trampoline sets up a stack for them.

Even more than that. For AP verify_cpu already get called in trampoline.

arch/x86/realmode/rm/trampoline_64.S::trampoline_start().

So you remove verify_cpu calling in secondary_startup_64.

Yinghai