From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A02ABC433EF for ; Wed, 17 Nov 2021 13:11:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3382F61ABD for ; Wed, 17 Nov 2021 13:11:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3382F61ABD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=alien8.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id A374E6B0072; Wed, 17 Nov 2021 08:11:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9E69A6B0073; Wed, 17 Nov 2021 08:11:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8FC486B0074; Wed, 17 Nov 2021 08:11:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0050.hostedemail.com [216.40.44.50]) by kanga.kvack.org (Postfix) with ESMTP id 81EEA6B0072 for ; Wed, 17 Nov 2021 08:11:41 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 3919A8631E for ; Wed, 17 Nov 2021 13:11:31 +0000 (UTC) X-FDA: 78818458782.13.51ADB4D Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by imf27.hostedemail.com (Postfix) with ESMTP id 881A2700009B for ; Wed, 17 Nov 2021 13:11:29 +0000 (UTC) Received: from zn.tnic (p200300ec2f13a300a559e3e7ac095ca4.dip0.t-ipconnect.de [IPv6:2003:ec:2f13:a300:a559:e3e7:ac09:5ca4]) (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 8086E1EC051E; Wed, 17 Nov 2021 14:11:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1637154688; 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=ALEk0hpWexx1uJP+VlOkANLAH949xQs8c0lPv5drCRk=; b=eE5HYa8PJYy2qraGlEjSQ3OwljdXLGSLLo/wYzi+AKx+gDrhTQil/J35E0iAq2850IYc/p z7Ihif2mEgnblXMZbsWL5Q5Ql9Ab1Ep9l7ZHeWAVVQyVdMdZ9qdO4jqhu5RvNGtF5evPaS 8h9ClG6c2q0yv1sMhabGOXo+3zZN0AU= Date: Wed, 17 Nov 2021 14:11:20 +0100 From: Borislav Petkov To: Michael Roth Cc: Brijesh Singh , x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-efi@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-coco@lists.linux.dev, linux-mm@kvack.org, Thomas Gleixner , Ingo Molnar , Joerg Roedel , Tom Lendacky , "H. Peter Anvin" , Ard Biesheuvel , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Jim Mattson , Andy Lutomirski , Dave Hansen , Sergio Lopez , Peter Gonda , Peter Zijlstra , Srinivas Pandruvada , David Rientjes , Dov Murik , Tobin Feldman-Fitzthum , Vlastimil Babka , "Kirill A . Shutemov" , Andi Kleen , "Dr . David Alan Gilbert" , tony.luck@intel.com, marcorr@google.com, sathyanarayanan.kuppuswamy@linux.intel.com Subject: Re: [PATCH v7 02/45] x86/sev: detect/setup SEV/SME features earlier in boot Message-ID: References: <20211110220731.2396491-1-brijesh.singh@amd.com> <20211110220731.2396491-3-brijesh.singh@amd.com> <20211115201715.gv24iugujwhxmrdp@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20211115201715.gv24iugujwhxmrdp@amd.com> X-Stat-Signature: t9pg1ka3huty7hxt8kyci49si3ougr73 X-Rspamd-Queue-Id: 881A2700009B X-Rspamd-Server: rspam07 Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=alien8.de header.s=dkim header.b=eE5HYa8P; spf=pass (imf27.hostedemail.com: domain of bp@alien8.de designates 5.9.137.197 as permitted sender) smtp.mailfrom=bp@alien8.de; dmarc=pass (policy=none) header.from=alien8.de X-HE-Tag: 1637154689-539207 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Nov 15, 2021 at 02:17:15PM -0600, Michael Roth wrote: > but in order for that to happen soon enough to make use of the CPUID > table for all CPUID intructions, it needs to be moved to just after the first > #VC handler is setup (where snp_cpuid_init() used to be in v6). So, it needs to happen after the initial IDT is loaded on the BSP in startup_64_setup_env(). So why don't you call sme_enable() right after the startup_64_setup_env() call and add a comment above it to explain why this call needs to happen there? Instead of sticking that call in startup_64_setup_env() where it doesn't belong conceptually - enabling SME doesn't really have anything to do with setting up early environment... Hmm. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette