Re: [PATCH v3 3/4] crypto: ccp: Skip SNP INIT for kdump boot

From: Vasant Hegde
Date: Thu Jul 17 2025 - 01:57:01 EST


Hi Ashish,


On 7/17/2025 3:33 AM, Kalra, Ashish wrote:
> Hello Vasant,
>
> On 7/16/2025 4:20 AM, Vasant Hegde wrote:
>>
>>
>> On 7/16/2025 12:57 AM, Ashish Kalra wrote:
>>> From: Ashish Kalra <ashish.kalra@xxxxxxx>
>>>
>>> If SNP is enabled and initialized in the previous kernel then SNP is
>>> already initialized for kdump boot and attempting SNP INIT again
>>> during kdump boot causes SNP INIT failure and eventually leads to
>>> IOMMU failures.
>>>
>>> Skip SNP INIT if doing kdump boot.
>>
>> Just double checking, do we need check for snp_rmptable_init()?
>>
>
> Do you mean adding this check in snp_rmptable_init() ?
>
> We already have a check there for kexec boot:
>
> snp_rmptable_init()
> {
> ...
> ...
> /*
> * Check if SEV-SNP is already enabled, this can happen in case of
> * kexec boot.
> */
> rdmsrq(MSR_AMD64_SYSCFG, val);
> if (val & MSR_AMD64_SYSCFG_SNP_EN)
> goto skip_enable;

Ah Ok. thanks!

>
> And we still have to map the RMP table in the kernel as SNP is still enabled
> and initialized in this case for kdump boot, so that is still required as
> part of snp_rmptable_init().
>
> Additionally, for this patch i also have to skip SEV INIT similar to what we
> are doing for SNP INIT as we get SEV INIT failure warnings as SEV is also
> initialized during this kdump boot similar to SNP.

Sure thanks!

-Vasant