[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4b68fd05-5d21-0472-42c3-6cf6f1f9f967@amd.com>
Date: Tue, 7 Nov 2023 16:33:41 -0600
From: "Kalra, Ashish" <ashish.kalra@....com>
To: Borislav Petkov <bp@...en8.de>
Cc: Michael Roth <michael.roth@....com>, kvm@...r.kernel.org,
linux-coco@...ts.linux.dev, linux-mm@...ck.org,
linux-crypto@...r.kernel.org, x86@...nel.org,
linux-kernel@...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, 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,
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,
jarkko@...nel.org, nikunj.dadhania@....com, pankaj.gupta@....com,
liam.merwick@...cle.com, zhi.a.wang@...el.com,
Brijesh Singh <brijesh.singh@....com>
Subject: Re: [PATCH v10 06/50] x86/sev: Add the host SEV-SNP initialization
support
On 11/7/2023 4:08 PM, Borislav Petkov wrote:
> static int __init snp_rmptable_init(void)
> {
> - int family, model;
> -
> - if (!cpu_feature_enabled(X86_FEATURE_SEV_SNP))
> + if (!amd_iommu_snp_en)
> return 0;
>
We will still need some method to tell the IOMMU driver if SNP
support/feature is disabled by this function, for example, when CPU
family and model is not supported by SNP and we jump to no_snp label.
The reliable way for this to work is to ensure snp_rmptable_init() is
called before IOMMU initialization and then IOMMU initialization depends
on SNP feature flag setup by snp_rmptable_init() to enable SNP support
on IOMMU or not.
If snp_rmptable_init() is called after IOMMU initialization and it
detects an issue with SNP support it will clear the SNP feature but the
IOMMU driver does not get notified about it, therefore,
snp_rmptable_init() should get called before IOMMU initialization or as
part of IOMMU initialization, for example, amd_iommu_enable() calling
snp_rmptable_init() before calling iommu_snp_enable().
Thanks,
Ashish
Powered by blists - more mailing lists