[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1426743388-26908-4-git-send-email-zhen-hual@hp.com>
Date: Thu, 19 Mar 2015 13:36:21 +0800
From: "Li, Zhen-Hua" <zhen-hual@...com>
To: <dwmw2@...radead.org>, <indou.takao@...fujitsu.com>,
<bhe@...hat.com>, <joro@...tes.org>, <vgoyal@...hat.com>,
<dyoung@...hat.com>
Cc: <iommu@...ts.linux-foundation.org>, <linux-kernel@...r.kernel.org>,
<linux-pci@...r.kernel.org>, <kexec@...ts.infradead.org>,
<alex.williamson@...hat.com>, <ddutile@...hat.com>,
<ishii.hironobu@...fujitsu.com>, <bhelgaas@...gle.com>,
<doug.hatch@...com>, <jerry.hoemann@...com>, <tom.vaden@...com>,
<li.zhang6@...com>, <lisa.mitchell@...com>,
<billsumnerlinux@...il.com>, <zhen-hual@...com>, <rwright@...com>
Subject: [PATCH v9 03/10] iommu/vt-d: Function to get old context entry
Interface for when a new domain in the crashdump kernel needs some
values from the panicked kernel's context entries.
Signed-off-by: Li, Zhen-Hua <zhen-hual@...com>
---
drivers/iommu/intel-iommu.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 577d5de..f7dbe70 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -369,6 +369,10 @@ static inline int first_pte_in_page(struct dma_pte *pte)
*
*/
+static struct context_entry *device_to_existing_context_entry(
+ struct intel_iommu *iommu,
+ u8 bus, u8 devfn);
+
#endif /* CONFIG_CRASH_DUMP */
@@ -4796,3 +4800,26 @@ static void __init check_tylersburg_isoch(void)
printk(KERN_WARNING "DMAR: Recommended TLB entries for ISOCH unit is 16; your BIOS set %d\n",
vtisochctrl);
}
+
+#ifdef CONFIG_CRASH_DUMP
+
+static struct context_entry *device_to_existing_context_entry(
+ struct intel_iommu *iommu,
+ u8 bus, u8 devfn)
+{
+ struct root_entry *root;
+ struct context_entry *context;
+ struct context_entry *ret;
+ unsigned long flags;
+
+ ret = NULL;
+ spin_lock_irqsave(&iommu->lock, flags);
+ root = &iommu->root_entry[bus];
+ context = get_context_addr_from_root(root);
+ if (context && context_present(context+devfn))
+ ret = &context[devfn];
+ spin_unlock_irqrestore(&iommu->lock, flags);
+ return ret;
+}
+
+#endif /* CONFIG_CRASH_DUMP */
--
2.0.0-rc0
--
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