File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -3232,28 +3232,29 @@ static void iommu_snp_enable(void)
3232
3232
return ;
3233
3233
/*
3234
3234
* The SNP support requires that IOMMU must be enabled, and is
3235
- * not configured in the passthrough mode .
3235
+ * configured with V1 page table (DTE[Mode] = 0 is not supported) .
3236
3236
*/
3237
3237
if (no_iommu || iommu_default_passthrough ()) {
3238
3238
pr_err ("SNP: IOMMU disabled or configured in passthrough mode, SNP cannot be supported.\n" );
3239
- cc_platform_clear (CC_ATTR_HOST_SEV_SNP );
3240
- return ;
3239
+ goto disable_snp ;
3240
+ }
3241
+
3242
+ if (amd_iommu_pgtable != AMD_IOMMU_V1 ) {
3243
+ pr_warn ("SNP: IOMMU is configured with V2 page table mode, SNP cannot be supported.\n" );
3244
+ goto disable_snp ;
3241
3245
}
3242
3246
3243
3247
amd_iommu_snp_en = check_feature (FEATURE_SNP );
3244
3248
if (!amd_iommu_snp_en ) {
3245
3249
pr_err ("SNP: IOMMU SNP feature not enabled, SNP cannot be supported.\n" );
3246
- cc_platform_clear (CC_ATTR_HOST_SEV_SNP );
3247
- return ;
3250
+ goto disable_snp ;
3248
3251
}
3249
3252
3250
3253
pr_info ("IOMMU SNP support enabled.\n" );
3254
+ return ;
3251
3255
3252
- /* Enforce IOMMU v1 pagetable when SNP is enabled. */
3253
- if (amd_iommu_pgtable != AMD_IOMMU_V1 ) {
3254
- pr_warn ("Forcing use of AMD IOMMU v1 page table due to SNP.\n" );
3255
- amd_iommu_pgtable = AMD_IOMMU_V1 ;
3256
- }
3256
+ disable_snp :
3257
+ cc_platform_clear (CC_ATTR_HOST_SEV_SNP );
3257
3258
#endif
3258
3259
}
3259
3260
You can’t perform that action at this time.
0 commit comments