From: Bill Sumner <bill.sumner@hp.com>
To: dwmw2@infradead.org, indou.takao@jp.fujitsu.com, bhe@redhat.com,
joro@8bytes.org
Cc: linux-pci@vger.kernel.org, kexec@lists.infradead.org,
alex.williamson@redhat.com, linux-kernel@vger.kernel.org,
iommu@lists.linux-foundation.org, ddutile@redhat.com,
doug.hatch@hp.com, ishii.hironobu@jp.fujitsu.com,
bhelgaas@google.com, zhenhua@hp.com, bill.sumner@hp.com
Subject: [PATCH 7/8] Add domain-id functions to intel-iommu-kdump.c
Date: Tue, 15 Apr 2014 17:09:08 -0600 [thread overview]
Message-ID: <1397603349-30930-8-git-send-email-bill.sumner@hp.com> (raw)
In-Reply-To: <1397603349-30930-1-git-send-email-bill.sumner@hp.com>
intel_iommu_did_to_domain_values_entry()
intel_iommu_get_dids_from_old_kernel()
Signed-off-by: Bill Sumner <bill.sumner@hp.com>
---
drivers/iommu/intel-iommu-kdump.c | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/drivers/iommu/intel-iommu-kdump.c b/drivers/iommu/intel-iommu-kdump.c
index 4e653e048..f3c777e 100644
--- a/drivers/iommu/intel-iommu-kdump.c
+++ b/drivers/iommu/intel-iommu-kdump.c
@@ -53,6 +53,45 @@ static struct list_head *domain_values_list;
/* ========================================================================
+ * Interfaces for when a new domain in the crashdump kernel needs some
+ * values from the panicked kernel's context entries
+ * ------------------------------------------------------------------------
+ */
+
+
+struct domain_values_entry *intel_iommu_did_to_domain_values_entry(int did,
+ struct intel_iommu *iommu)
+{
+ struct domain_values_entry *dve; /* iterator */
+
+ list_for_each_entry(dve, &domain_values_list[iommu->seq_id], link)
+ if (dve->did == did)
+ return dve;
+ return NULL;
+}
+
+
+/* Mark domain-id's from old kernel as in-use on this iommu so that a new
+ * domain-id is allocated in the case where there is a device in the new kernel
+ * that was not in the old kernel -- and therefore a new domain-id is needed.
+ */
+int intel_iommu_get_dids_from_old_kernel(struct intel_iommu *iommu)
+{
+ struct domain_values_entry *dve; /* iterator */
+
+ pr_info("IOMMU:%d Domain ids from panicked kernel:\n", iommu->seq_id);
+
+ list_for_each_entry(dve, &domain_values_list[iommu->seq_id], link) {
+ set_bit(dve->did, iommu->domain_ids);
+ pr_info("DID did:%d(0x%4.4x)\n", dve->did, dve->did);
+ }
+
+ pr_info("----------------------------------------\n");
+ return 0;
+}
+
+
+/* ========================================================================
* Copy iommu translation tables from old kernel into new kernel.
* Entry to this set of functions is: intel_iommu_copy_translation_tables()
* ------------------------------------------------------------------------
--
Bill Sumner <bill.sumner@hp.com>
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2014-04-15 23:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-15 23:09 [PATCH 0/8] Fix crashdump failure caused by legacy DMA/IO Bill Sumner
2014-04-15 23:09 ` [PATCH 1/8] Fix a few existing lines that checkpatch.pl will complain about later Bill Sumner
2014-04-15 23:09 ` [PATCH 2/8] Consolidate all .h lines at front of intel-iommu.c file Bill Sumner
2014-04-19 14:05 ` Baoquan He
2014-04-15 23:09 ` [PATCH 3/8] Create intel-iommu-private.h Bill Sumner
2014-04-15 23:09 ` [PATCH 4/8] Update iommu_attach_domain() and its callers Bill Sumner
2014-04-15 23:09 ` [PATCH 5/8] Add new definitions & prototypes to intel-iommu-private.h Bill Sumner
2014-04-15 23:09 ` [PATCH 6/8] Create intel-iommu-kdump.c Bill Sumner
2014-04-15 23:09 ` Bill Sumner [this message]
2014-04-15 23:09 ` [PATCH 8/8] Add remaining changes to intel-iommu.c to fix crashdump Bill Sumner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1397603349-30930-8-git-send-email-bill.sumner@hp.com \
--to=bill.sumner@hp.com \
--cc=alex.williamson@redhat.com \
--cc=bhe@redhat.com \
--cc=bhelgaas@google.com \
--cc=ddutile@redhat.com \
--cc=doug.hatch@hp.com \
--cc=dwmw2@infradead.org \
--cc=indou.takao@jp.fujitsu.com \
--cc=iommu@lists.linux-foundation.org \
--cc=ishii.hironobu@jp.fujitsu.com \
--cc=joro@8bytes.org \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=zhenhua@hp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox