[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yr7Pm/E9WsAjirV0@zn.tnic>
Date: Fri, 1 Jul 2022 12:42:35 +0200
From: Borislav Petkov <bp@...en8.de>
To: Ashish Kalra <Ashish.Kalra@....com>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
linux-coco@...ts.linux.dev, linux-mm@...ck.org,
linux-crypto@...r.kernel.org, tglx@...utronix.de, mingo@...hat.com,
jroedel@...e.de, thomas.lendacky@....com, hpa@...or.com,
ardb@...nel.org, pbonzini@...hat.com, seanjc@...gle.com,
vkuznets@...hat.com, wanpengli@...cent.com, jmattson@...gle.com,
luto@...nel.org, dave.hansen@...ux.intel.com, slp@...hat.com,
pgonda@...gle.com, peterz@...radead.org,
srinivas.pandruvada@...ux.intel.com, rientjes@...gle.com,
dovmurik@...ux.ibm.com, tobin@....com, michael.roth@....com,
vbabka@...e.cz, kirill@...temov.name, ak@...ux.intel.com,
tony.luck@...el.com, marcorr@...gle.com,
sathyanarayanan.kuppuswamy@...ux.intel.com, alpergun@...gle.com,
dgilbert@...hat.com, jarkko@...nel.org
Subject: Re: [PATCH Part2 v6 02/49] iommu/amd: Introduce function to check
SEV-SNP support
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
Powered by blists - more mailing lists