Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3220028rwl; Mon, 27 Mar 2023 10:50:11 -0700 (PDT) X-Google-Smtp-Source: AK7set9nRdIGpPTYtBJWciJ/DdS7DcKyVCdWlRTlTKAurUdW+Ny3NRr2+lBkrtl5ZWe/8ZrSNenR X-Received: by 2002:a05:6a00:174b:b0:594:1f1c:3d3a with SMTP id j11-20020a056a00174b00b005941f1c3d3amr20081610pfc.15.1679939411218; Mon, 27 Mar 2023 10:50:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679939411; cv=none; d=google.com; s=arc-20160816; b=ZMBo9Wz8vzORor4P4OmCxm4IH3rDewiXrvRMJi5ALbxxc+IOttjWzVNSGfahei6z0i fbL+GD9TG23+hQrf8F3JQWh6WievGdORl5Q+VKfPdpjNuDlOaQAsYYkUHoEDMkNNui4f 4lw2jLmdap4mOQaYpYzvjgTMTK/xeH0QyAC8MZB/Tgp2QFL/N8KfXGk1SCs+fL6vunxs NdnVQFr8tr0hifwmmwP73RJXg67M/U7UpaZz4F9EXlM3cL7/unJZiJihY9XdFB43/Wgu sgSNM15FRI+2IgTPlivPRFBY+6sOAg//ca9oI0HEeDHlsZX0CPlAp0ISYvc8dUpkF9W/ yz9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PHYrWpJG1Eo5CYWlM+Samk6UV4vi/6VkdcGtjWhhz3E=; b=FDWRHhSC5u74PzFoeig304Z5qxaesoolOm43Mobw/aJS7PX8e43/HmWFe+CKjqxcFf srm6Mt5MXCE2OYY1S7+oBqud4iGiaCPcV/4Sd2Rj2TTp0l/GBKB8Av38KYz8x5fp4sgG mpJ7xh8q2lsyfJN5VxIHf8UCnXB2dgOIysBBcnlOaucpJNRLh6JBPb2mAkM/lso1KYVd IVX9yYzxnJh2AM9W5WL0kkqpLbt+lSczx50fOl4ItOR1T5jO0Vu7POtrept3X+krd1u1 huLb9jf80VIT9xbrjWtR8C1GLRcxgQmqf+f06liokZiIb80Q2G+G53j8B3NWmH4LbL9N Hrdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=LZDmm7cV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f189-20020a6238c6000000b00627dd2b5307si11001134pfa.102.2023.03.27.10.49.59; Mon, 27 Mar 2023 10:50:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=LZDmm7cV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232056AbjC0RsI (ORCPT + 99 others); Mon, 27 Mar 2023 13:48:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231820AbjC0Rr5 (ORCPT ); Mon, 27 Mar 2023 13:47:57 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58A061998; Mon, 27 Mar 2023 10:47:54 -0700 (PDT) Received: from zn.tnic (p5de8e687.dip0.t-ipconnect.de [93.232.230.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id BDDD41EC0529; Mon, 27 Mar 2023 19:47:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1679939272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=PHYrWpJG1Eo5CYWlM+Samk6UV4vi/6VkdcGtjWhhz3E=; b=LZDmm7cVkLs74Dbe0DlzjSdfqAT+3TtQyaFNdMA9us8RBVGTPJxp7kGYP2nSIqFdZmO3IM w0iesHwUQJ63xT/yaLzE24dVC1hIvYleoyD1KsNXozhyootNzO7SsmvB+B8Pkbtna1ALRl 9cvTub7Xj+bhQZHfg5y4hrUDIh6Hbtc= Date: Mon, 27 Mar 2023 19:47:46 +0200 From: Borislav Petkov To: Brian Gerst Cc: David Woodhouse , Usama Arif , tglx@linutronix.de, kim.phillips@amd.com, piotrgorski@cachyos.org, oleksandr@natalenko.name, arjan@linux.intel.com, mingo@redhat.com, dave.hansen@linux.intel.com, hpa@zytor.com, x86@kernel.org, pbonzini@redhat.com, paulmck@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, rcu@vger.kernel.org, mimoja@mimoja.de, hewenliang4@huawei.com, thomas.lendacky@amd.com, seanjc@google.com, pmenzel@molgen.mpg.de, fam.zheng@bytedance.com, punit.agrawal@bytedance.com, simon.evans@bytedance.com, liangma@liangbit.com, gpiccoli@igalia.com, Sabin Rapan Subject: Re: [PATCH v16 8/8] x86/smpboot: Allow parallel bringup for SEV-ES Message-ID: <20230327174746.GBZCHWwqIa4+nj1/qR@fat_crate.local> References: <20230321194008.785922-1-usama.arif@bytedance.com> <20230321194008.785922-9-usama.arif@bytedance.com> <20230322224735.GAZBuFh9ld6FuYEyoH@fat_crate.local> <70628793e6777d07f27f43152df497e780925d18.camel@infradead.org> <20230323085138.GAZBwTGly7iOlvxrD4@fat_crate.local> <4dbdd277c4b26ae4b971a910209a3279f79f6837.camel@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 23, 2023 at 10:23:02AM -0400, Brian Gerst wrote: > Making sure that the stack protector is either disabled or properly > set up, and disabling any instrumentation/profiling/debug crap that > isn't initialized yet. Lemme dump brain of what Tom and I were talking about today so that it is documented somewhere. * re: stack protector: I was thinking to mark this function __attribute__((no_stack_protector)) but gcc added the function attribute way later: ~/src/gcc/gcc.git> git tag --contains 346b302d09c1e6db56d9fe69048acb32fbb97845 basepoints/gcc-12 basepoints/gcc-13 releases/gcc-11.1.0 releases/gcc-11.2.0 releases/gcc-11.3.0 releases/gcc-12.1.0 releases/gcc-12.2.0 which means, that function would have to live somewhere in a file which has stack protector disabled. One possible place would be arch/x86/mm/mem_encrypt_identity.c which is kinda related. * re: stack: in order to be able to call a C function that early, we'd have to put the VA of the initial stack back into %rsp as we switch pagetables a bit earlier in there (thx Tom). So by then, doing all that cargo-cult just in order to not have a bunch of lines in asm doesn't sound all that great anymore. * The __head per-function attribute is easily solved by lifting the __head define into a common header. So meh, dunno. I guess we can do the asm thing for now, until a cleaner solution without too many warts presents itself. As to exporting cc_vendor: https://lore.kernel.org/r/20230318115634.9392-1-bp@alien8.de I'll redo those and the SEV-ES patch won't have to add cc_get_vendor(). Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette