Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756241AbcCCCuY (ORCPT ); Wed, 2 Mar 2016 21:50:24 -0500 Received: from mail-vk0-f50.google.com ([209.85.213.50]:34308 "EHLO mail-vk0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752989AbcCCCuW (ORCPT ); Wed, 2 Mar 2016 21:50:22 -0500 MIME-Version: 1.0 In-Reply-To: References: <20160302162530.GA8362@pd.tnic> <086BE61B-DCCC-4105-90A2-295A487C7F6F@zytor.com> <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> Date: Wed, 2 Mar 2016 18:50:21 -0800 X-Google-Sender-Auth: d-95AWE2l4051xZ1OPs5RYT_Bac Message-ID: Subject: Re: [RFC PATCH] x86: Make sure verify_cpu has a good stack From: Yinghai Lu To: "H. Peter Anvin" Cc: Borislav Petkov , 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: 950 Lines: 26 On Wed, Mar 2, 2016 at 5:00 PM, Yinghai Lu wrote: > On Wed, Mar 2, 2016 at 4:13 PM, Yinghai Lu wrote: >> On Wed, Mar 2, 2016 at 2:32 PM, H. Peter Anvin wrote: >>> >>> I'm trying to think of any reason why we couldn't simply have a symbol at the top of the initial stack? Then a simple leaq would suffice; this is for the BSP after all. >> >> Why do we need to call verify_cpu in arch/x86/kernel/head_64.S aka the >> vmlinux again ? >> >> Is that already called in arch/x86/boot/compressed/head_64.S? > > that calling is from startup_32, so may add another calling in startup_64, > so can avoid calling from arch/x86/kernel/head_64.S > at the same time, the "call verify_cpu" in arch/x86/kernel/head_64.s::secondary_startup_64() is not needed. As APs already go through arch/x86/realmode/rm/trampoline_64.S::trampoline_start(), and it already call verify_cpu in 16bit mode. Thanks Yinghai