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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51AA4C47074 for ; Thu, 4 Jan 2024 10:58:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D25A46B0346; Thu, 4 Jan 2024 05:58:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CB0FC6B0348; Thu, 4 Jan 2024 05:58:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B0B186B0347; Thu, 4 Jan 2024 05:58:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 955CC6B0341 for ; Thu, 4 Jan 2024 05:58:36 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 6100AC07EC for ; Thu, 4 Jan 2024 10:58:36 +0000 (UTC) X-FDA: 81641330232.07.809C327 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by imf15.hostedemail.com (Postfix) with ESMTP id 1E0E7A000E for ; Thu, 4 Jan 2024 10:58:32 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=nx4cPqwW; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=qJfs4+dt; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=nx4cPqwW; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=qJfs4+dt; dmarc=pass (policy=none) header.from=suse.de; spf=pass (imf15.hostedemail.com: domain of jroedel@suse.de designates 195.135.223.131 as permitted sender) smtp.mailfrom=jroedel@suse.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1704365913; h=from:from:sender: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=6FWhN0ERbLuq8LWOeEYEp5w2T8EZulnYOzaESG0ouas=; b=oGbdEP6iKVWn43lTp7a/+yrPy2gebeC8S9i0eBDm3Uvj8tREpBhWAg8mjnrMgZz/8ZO7lq GPb8mPYjn3U6ZkD/Q7D4j0Tr67zIjIdr/L2IZo6Rq1pCxmlo1KnRhpJbdR/U7vgelwHNRd fgAvcoltOzHaThgeQR4B5QCsoPV5ceA= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=nx4cPqwW; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=qJfs4+dt; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=nx4cPqwW; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=qJfs4+dt; dmarc=pass (policy=none) header.from=suse.de; spf=pass (imf15.hostedemail.com: domain of jroedel@suse.de designates 195.135.223.131 as permitted sender) smtp.mailfrom=jroedel@suse.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1704365913; a=rsa-sha256; cv=none; b=kJqKWltpzgGz7cgjWrncAR8IbaFpuoCzIl12f/lJCJBqZjRwmSsEPaBk3uL1ngOUB2eDEL SG+ZBSxM36MrFKYedMN38FEZOeuWqGbn/0mLz587T/9EEbfG5GOy0jjdjRobXswV+XGh/Z bccqlTwtpxxhYoQTONsgKA3AISWk8p0= Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 538B81F801; Thu, 4 Jan 2024 10:58:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1704365911; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6FWhN0ERbLuq8LWOeEYEp5w2T8EZulnYOzaESG0ouas=; b=nx4cPqwWT06+c71Bp/tUfL1DFD8Wk6I4/6fpmoH4DBiyiep8bQJGW6hBB4I/4jW9A9o7Ib 59Lb8BOdJEEvkK4V95KL9K9/DJ9aEZQXaEskNLpPLFmodzCIyLKtHbiwwygkCNqzTd6PTt b+DSumKZ54Ov8JK5BwiwP+iAQbHuptE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1704365911; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6FWhN0ERbLuq8LWOeEYEp5w2T8EZulnYOzaESG0ouas=; b=qJfs4+dtTrWOHQYruY68fbWEBOy6QjIbgBt7eWJbCC4ghP4mAVTyV6hmwusl3PEdNRfDIC GH5GDXnN/9zhwsDA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1704365911; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6FWhN0ERbLuq8LWOeEYEp5w2T8EZulnYOzaESG0ouas=; b=nx4cPqwWT06+c71Bp/tUfL1DFD8Wk6I4/6fpmoH4DBiyiep8bQJGW6hBB4I/4jW9A9o7Ib 59Lb8BOdJEEvkK4V95KL9K9/DJ9aEZQXaEskNLpPLFmodzCIyLKtHbiwwygkCNqzTd6PTt b+DSumKZ54Ov8JK5BwiwP+iAQbHuptE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1704365911; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6FWhN0ERbLuq8LWOeEYEp5w2T8EZulnYOzaESG0ouas=; b=qJfs4+dtTrWOHQYruY68fbWEBOy6QjIbgBt7eWJbCC4ghP4mAVTyV6hmwusl3PEdNRfDIC GH5GDXnN/9zhwsDA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 76DC213722; Thu, 4 Jan 2024 10:58:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id Uy/HG1aPlmVJewAAD6G6ig (envelope-from ); Thu, 04 Jan 2024 10:58:30 +0000 Date: Thu, 4 Jan 2024 11:58:29 +0100 From: Joerg Roedel To: Michael Roth Cc: x86@kernel.org, kvm@vger.kernel.org, linux-coco@lists.linux.dev, linux-mm@kvack.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, thomas.lendacky@amd.com, hpa@zytor.com, ardb@kernel.org, pbonzini@redhat.com, seanjc@google.com, vkuznets@redhat.com, jmattson@google.com, luto@kernel.org, dave.hansen@linux.intel.com, slp@redhat.com, pgonda@google.com, peterz@infradead.org, srinivas.pandruvada@linux.intel.com, rientjes@google.com, tobin@ibm.com, bp@alien8.de, vbabka@suse.cz, kirill@shutemov.name, ak@linux.intel.com, tony.luck@intel.com, sathyanarayanan.kuppuswamy@linux.intel.com, alpergun@google.com, jarkko@kernel.org, ashish.kalra@amd.com, nikunj.dadhania@amd.com, pankaj.gupta@amd.com, liam.merwick@oracle.com, zhi.a.wang@intel.com Subject: Re: [PATCH v1 03/26] iommu/amd: Don't rely on external callers to enable IOMMU SNP support Message-ID: References: <20231230161954.569267-1-michael.roth@amd.com> <20231230161954.569267-4-michael.roth@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231230161954.569267-4-michael.roth@amd.com> X-Rspam-User: X-Stat-Signature: 4ntpifwemy67zik6r4448844yr3cfmz4 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 1E0E7A000E X-HE-Tag: 1704365912-898644 X-HE-Meta: U2FsdGVkX1/pDpijr/imrb94+WkqjhOnRQLqU3qqq6nId4Xaw3I0T1fO3mddCIvubGgVoBvp7ppi8us9GwRvlm30SuwR7aHTKb91zcof0oF8NvjwWsopbBohQr+xS4eOBqsV8lcj9GC3UdBlTSL6YWj4uRaEprxI1nTDnGdZQ5V4PLMTEb28Ir+ye6bBL/VuYLHSvOzzs6h6bMW6sb00gRLi+TA9hZITe16z2L1YzAcAz8kG+Y5HIilR/iZfCVK4nEFfkWjdJs4WpntZFx1awh/SZr52gnRcoxPKnPaVFiDsebLsb/YYaOutVUvg0P5Ol70ZzUMIQ9Tqdlg+ap3b9yAgmHV/bs35ZqKFqiKDi7CcvyrLSCGc8xCp/bgjr5PgtdgZLvnGUfzN+mP55ZCCD4SRkcOHIYqqICXjINuD9pkIxzghweLfdbiGboltyO5F3Ofeori+efV7INbkRVRM3xjvsy6K2P0EKjYi3/+sp9DWZRZ6ikJmsXYQsxS7MvU3VSzWkcmKIC8j43m761QcW72eOv+ByxwVWIZ6MjCuj0eY1kMY8kV5VS90eInU5tdk12a+BvlrTKpOinIV2kgDVpBYCT4FTIVYzjRpDah4lRk9SrAwlsDh/Uv32yliIkaHLNHlLMGZMEu9cBx75EWeafMkg8qe08ywUKkL3uligf2Y1eV+Ctr6cmSKdczW3WVbjslmKVZ3VNDurmDqhSxD53WipH76LfbwvqZCIVZiDSEbjw7Z2V/LnIppP+bNshfZ7+V05H2cYz+NWLS3IB5FCBI9sFt0HxmQfrK8MMKcZjOorysZLVfVIXoCxhYIh8ZN0EDRAi0ri6YIjPxnUVi3NLuPQz6edcCaWfdIHT96QeQGYjIyiSAWCGdlfP11oAkkQ9dtH0KB3HKr/wBgCuSzYTIAnWW7c0hqFxP+3enynuSWltKRR6McHs/GoG12BBB7shMGfNqjZxV282owJyy ksoB145c lbEVGghqF45VQrKV/5BYF9MLn3t0Mk8vkGk66vxMCdhwHF0LCLaLYiqyu4BixIZsav7JO4vWBNruYs8yZavK8C+N0omWUUjpWmrU5vJFr4iO0FUN6A9xQAwNXs2HdTJa9dfO1a13Iorcy7FSsQXocy6fJsZ7cGnxl0gtAMhqHyyAVlDVR167ZbxrbyXYcAodakb1TGXwu2dN4JO6KBQux/eg0AEp0li2RHvqibDI6Qgn6vfRuD6qRcL7EA4o937QQbLrs/drEu8wcqt1J1BaWJuSddIkcPqOv0wcPqoaz2kjHTowHrjf+5QG9rg== 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: List-Subscribe: List-Unsubscribe: On Sat, Dec 30, 2023 at 10:19:31AM -0600, Michael Roth wrote: > From: Ashish Kalra > > Currently the expectation is that the kernel will call > amd_iommu_snp_enable() to perform various checks and set the > amd_iommu_snp_en flag that the IOMMU uses to adjust its setup routines > to account for additional requirements on hosts where SNP is enabled. > > This is somewhat fragile as it relies on this call being done prior to > IOMMU setup. It is more robust to just do this automatically as part of > IOMMU initialization, so rework the code accordingly. > > There is still a need to export information about whether or not the > IOMMU is configured in a manner compatible with SNP, so relocate the > existing amd_iommu_snp_en flag so it can be used to convey that > information in place of the return code that was previously provided by > calls to amd_iommu_snp_enable(). > > While here, also adjust the kernel messages related to IOMMU SNP > enablement for consistency/grammar/clarity. > > Suggested-by: Borislav Petkov (AMD) > Signed-off-by: Ashish Kalra > Co-developed-by: Michael Roth > Signed-off-by: Michael Roth Acked-by: Joerg Roedel -- Jörg Rödel jroedel@suse.de SUSE Software Solutions Germany GmbH Frankenstraße 146 90461 Nürnberg Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman