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 3B0FEC43334 for ; Fri, 1 Jul 2022 10:42:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B77EA6B0071; Fri, 1 Jul 2022 06:42:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B27956B0073; Fri, 1 Jul 2022 06:42:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A15C46B0074; Fri, 1 Jul 2022 06:42:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 8EF776B0071 for ; Fri, 1 Jul 2022 06:42:55 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id 664BA602BB for ; Fri, 1 Jul 2022 10:42:55 +0000 (UTC) X-FDA: 79638193110.30.E1CE350 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by imf10.hostedemail.com (Postfix) with ESMTP id 19121C0045 for ; Fri, 1 Jul 2022 10:42:46 +0000 (UTC) Received: from zn.tnic (p200300ea970ff648329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:970f:f648:329c:23ff:fea6:a903]) (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 856321EC059D; Fri, 1 Jul 2022 12:42:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1656672159; 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=SWhCxOJUAdsvqOpxyv8QTMa/YznelRxtMa+3KCBAmCU=; b=VfMj79baSekma4xFxVrkmV7L+rj6Z2maopnfrFmPEjLleGOALxaW+uTtB/VaB/rc6JrFGe QSa+TzpouUp17YdzBr1v5gYQ4aUh8yCBG2g5HBWefZ4qFd+8Jf7s7Vy21LRImaayFJasOj mDBhXy2Dcy9SCUdJdWZpwx/+FjBmdwc= Date: Fri, 1 Jul 2022 12:42:35 +0200 From: Borislav Petkov To: Ashish Kalra Cc: x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-coco@lists.linux.dev, linux-mm@kvack.org, linux-crypto@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, jroedel@suse.de, thomas.lendacky@amd.com, hpa@zytor.com, ardb@kernel.org, pbonzini@redhat.com, seanjc@google.com, vkuznets@redhat.com, wanpengli@tencent.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, dovmurik@linux.ibm.com, tobin@ibm.com, michael.roth@amd.com, vbabka@suse.cz, kirill@shutemov.name, ak@linux.intel.com, tony.luck@intel.com, marcorr@google.com, sathyanarayanan.kuppuswamy@linux.intel.com, alpergun@google.com, dgilbert@redhat.com, jarkko@kernel.org Subject: Re: [PATCH Part2 v6 02/49] iommu/amd: Introduce function to check SEV-SNP support Message-ID: References: <12df64394b1788156c8a3c2ee8dfd62b51ab3a81.1655761627.git.ashish.kalra@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <12df64394b1788156c8a3c2ee8dfd62b51ab3a81.1655761627.git.ashish.kalra@amd.com> X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 19121C0045 Authentication-Results: imf10.hostedemail.com; dkim=temperror ("DNS error when getting key") header.d=alien8.de header.s=dkim header.b=VfMj79ba; dmarc=temperror reason="query timed out" header.from=alien8.de (policy=temperror); spf=temperror (imf10.hostedemail.com: error in processing during lookup of bp@alien8.de: DNS error) smtp.mailfrom=bp@alien8.de X-Rspam-User: X-Stat-Signature: ze6sdmcncpgs5qua4hke6bh4175eehjx X-HE-Tag: 1656672166-926034 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, Jun 20, 2022 at 10:59:19PM +0000, Ashish Kalra wrote: > +bool iommu_sev_snp_supported(void) > +{ > + struct amd_iommu *iommu; > + > + /* > + * The SEV-SNP support requires that IOMMU must be enabled, and is > + * not configured in the passthrough mode. > + */ > + if (no_iommu || iommu_default_passthrough()) { > + pr_err("SEV-SNP: IOMMU is either disabled or configured in passthrough mode.\n"); > + return false; > + } > + > + /* > + * Iterate through all the IOMMUs and verify the SNPSup feature is > + * enabled. > + */ > + for_each_iommu(iommu) { > + if (!iommu_feature(iommu, FEATURE_SNP)) { > + pr_err("SNPSup is disabled (devid: %02x:%02x.%x)\n", > + PCI_BUS_NUM(iommu->devid), PCI_SLOT(iommu->devid), > + PCI_FUNC(iommu->devid)); > + return false; > + } > + } > + > + return true; > +} > +EXPORT_SYMBOL_GPL(iommu_sev_snp_supported); Why is this function exported? -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette