[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1434178047-17809-10-git-send-email-joro@8bytes.org>
Date: Sat, 13 Jun 2015 08:47:17 +0200
From: Joerg Roedel <joro@...tes.org>
To: iommu@...ts.linux-foundation.org
Cc: David Woodhouse <dwmw2@...radead.org>, zhen-hual@...com,
bhe@...hat.com, ddutile@...hat.com, alex.williamson@...hat.com,
dyoung@...hat.com, linux-kernel@...r.kernel.org,
jroedel@...tes.org, joro@...tes.org, Joerg Roedel <jroedel@...e.de>
Subject: [PATCH 09/19] iommu/vt-d: Don't do early domain assignment if kdump kernel
From: Joerg Roedel <jroedel@...e.de>
When we copied over context tables from an old kernel, we
need to defer assignment of devices to domains until the
device driver takes over. So skip this part of
initialization when we copied over translation tables from
the old kernel.
Signed-off-by: Joerg Roedel <jroedel@...e.de>
---
drivers/iommu/intel-iommu.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index bf87236..39bc3d6 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -2981,6 +2981,7 @@ static int __init init_dmars(void)
{
struct dmar_drhd_unit *drhd;
struct dmar_rmrr_unit *rmrr;
+ bool copied_tables = false;
struct device *dev;
struct intel_iommu *iommu;
int i, ret;
@@ -3071,6 +3072,7 @@ static int __init init_dmars(void)
} else {
pr_info("Copied translation tables from previous kernel for %s\n",
iommu->name);
+ copied_tables = true;
}
}
@@ -3099,6 +3101,15 @@ static int __init init_dmars(void)
check_tylersburg_isoch();
/*
+ * If we copied translations from a previous kernel in the kdump
+ * case, we can not assign the devices to domains now, as that
+ * would eliminate the old mappings. So skip this part and defer
+ * the assignment to device driver initialization time.
+ */
+ if (copied_tables)
+ goto domains_done;
+
+ /*
* If pass through is not set or not enabled, setup context entries for
* identity mappings for rmrr, gfx, and isa and may fall back to static
* identity mapping if iommu_identity_mapping is set.
@@ -3137,6 +3148,8 @@ static int __init init_dmars(void)
iommu_prepare_isa();
+domains_done:
+
/*
* for each drhd
* enable fault log
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists