Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1667791 > unrolled thread
| Started by | Joerg Roedel <joro@8bytes.org> |
|---|---|
| First post | 2017-06-16 16:20 +0200 |
| Last post | 2017-06-16 16:20 +0200 |
| Articles | 2 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH 0/7] iommu/amd: Disable previously enabled IOMMUs at boot Joerg Roedel <joro@8bytes.org> - 2017-06-16 16:20 +0200
[PATCH 6/7] iommu/amd: Free IOMMU resources when disabled on command line Joerg Roedel <joro@8bytes.org> - 2017-06-16 16:20 +0200
| From | Joerg Roedel <joro@8bytes.org> |
|---|---|
| Date | 2017-06-16 16:20 +0200 |
| Subject | [PATCH 0/7] iommu/amd: Disable previously enabled IOMMUs at boot |
| Message-ID | <tT0gp-1a4-3@gated-at.bofh.it> |
Hi, here is a patch-set refactoring the AMD IOMMU init code a bit to make sure the IOMMUs get disabled at boot, even when amd_iommu=off is specified on the kernel command line. The patch-set is tested with various combinations of kernel command-line parameters and with kexec. It applies to the x86/amd branch of the iommu-tree. Regards, Joerg Joerg Roedel (7): iommu/amd: Disable IOMMUs at boot if they are enabled iommu/amd: Rename free_on_init_error() iommu/amd: Add new init-state IOMMU_CMDLINE_DISABLED iommu/amd: Check for error states first in iommu_go_to_state() iommu/amd: Set global pointers to NULL after freeing them iommu/amd: Free IOMMU resources when disabled on command line iommu/amd: Remove amd_iommu_disabled check from amd_iommu_detect() drivers/iommu/amd_iommu_init.c | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) -- 2.7.4
[toc] | [next] | [standalone]
| From | Joerg Roedel <joro@8bytes.org> |
|---|---|
| Date | 2017-06-16 16:20 +0200 |
| Subject | [PATCH 6/7] iommu/amd: Free IOMMU resources when disabled on command line |
| Message-ID | <tT0gr-1a4-35@gated-at.bofh.it> |
| In reply to | #1667791 |
From: Joerg Roedel <jroedel@suse.de>
After we made sure that all IOMMUs have been disabled we
need to make sure that all resources we allocated are
released again.
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
drivers/iommu/amd_iommu_init.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index d04898c..eedd3d3 100644
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -2428,6 +2428,13 @@ static int __init state_next(void)
case IOMMU_IVRS_DETECTED:
ret = early_amd_iommu_init();
init_state = ret ? IOMMU_INIT_ERROR : IOMMU_ACPI_FINISHED;
+ if (init_state == IOMMU_ACPI_FINISHED && amd_iommu_disabled) {
+ pr_info("AMD-Vi: AMD IOMMU disabled on kernel command-line\n");
+ free_dma_resources();
+ free_iommu_resources();
+ init_state = IOMMU_CMDLINE_DISABLED;
+ ret = -EINVAL;
+ }
break;
case IOMMU_ACPI_FINISHED:
early_enable_iommus();
--
2.7.4
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web