提交 9f81ca8d 编写于 作者: J Joerg Roedel

iommu/amd: Don't call early_amd_iommu_init() when AMD IOMMU is disabled

Don't even try to initialize the AMD IOMMU hardware when amd_iommu=off has been
passed on the kernel command line.

References: https://bugzilla.kernel.org/show_bug.cgi?id=212133
References: https://bugzilla.suse.com/show_bug.cgi?id=1183132
Cc: stable@vger.kernel.org # v5.11
Signed-off-by: NJoerg Roedel <jroedel@suse.de>
Link: https://lore.kernel.org/r/20210317091037.31374-3-joro@8bytes.orgAcked-by: NHuang Rui <ray.huang@amd.com>
上级 072a03e0
...@@ -2919,12 +2919,12 @@ static int __init state_next(void) ...@@ -2919,12 +2919,12 @@ static int __init state_next(void)
} }
break; break;
case IOMMU_IVRS_DETECTED: case IOMMU_IVRS_DETECTED:
ret = early_amd_iommu_init(); if (amd_iommu_disabled) {
init_state = ret ? IOMMU_INIT_ERROR : IOMMU_ACPI_FINISHED;
if (init_state == IOMMU_ACPI_FINISHED && amd_iommu_disabled) {
pr_info("AMD IOMMU disabled\n");
init_state = IOMMU_CMDLINE_DISABLED; init_state = IOMMU_CMDLINE_DISABLED;
ret = -EINVAL; ret = -EINVAL;
} else {
ret = early_amd_iommu_init();
init_state = ret ? IOMMU_INIT_ERROR : IOMMU_ACPI_FINISHED;
} }
break; break;
case IOMMU_ACPI_FINISHED: case IOMMU_ACPI_FINISHED:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册