Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758041AbcCDBSg (ORCPT ); Thu, 3 Mar 2016 20:18:36 -0500 Received: from mail-vk0-f43.google.com ([209.85.213.43]:35656 "EHLO mail-vk0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756793AbcCDBSf (ORCPT ); Thu, 3 Mar 2016 20:18:35 -0500 MIME-Version: 1.0 In-Reply-To: <20160303122836.GC24621@pd.tnic> References: <20160302181556.GD8362@pd.tnic> <56D73349.3020609@zytor.com> <20160302195053.GG8362@pd.tnic> <56D75C8D.90800@zytor.com> <20160302214654.GK8362@pd.tnic> <56D7612A.4080107@zytor.com> <20160302220954.GL8362@pd.tnic> <56D76527.5020806@zytor.com> <20160302222842.GM8362@pd.tnic> <20160303122836.GC24621@pd.tnic> Date: Thu, 3 Mar 2016 17:18:34 -0800 X-Google-Sender-Auth: bNacPKxa3ie25cWzOi-1_oZVGeQ Message-ID: Subject: Re: [RFC PATCH] x86: Make sure verify_cpu has a good stack From: Yinghai Lu To: Borislav Petkov Cc: "H. Peter Anvin" , Brian Gerst , X86 ML , LKML , Tom Lendacky Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 675 Lines: 20 On Thu, Mar 3, 2016 at 4:28 AM, Borislav Petkov 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