From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from g4t3427.houston.hp.com ([15.201.208.55]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YYT9J-00010n-Fj for kexec@lists.infradead.org; Thu, 19 Mar 2015 05:37:42 +0000 From: "Li, Zhen-Hua" Subject: [PATCH v9 03/10] iommu/vt-d: Function to get old context entry Date: Thu, 19 Mar 2015 13:36:21 +0800 Message-Id: <1426743388-26908-4-git-send-email-zhen-hual@hp.com> In-Reply-To: <1426743388-26908-1-git-send-email-zhen-hual@hp.com> References: <1426743388-26908-1-git-send-email-zhen-hual@hp.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: dwmw2@infradead.org, indou.takao@jp.fujitsu.com, bhe@redhat.com, joro@8bytes.org, vgoyal@redhat.com, dyoung@redhat.com Cc: jerry.hoemann@hp.com, tom.vaden@hp.com, rwright@hp.com, linux-pci@vger.kernel.org, kexec@lists.infradead.org, iommu@lists.linux-foundation.org, lisa.mitchell@hp.com, linux-kernel@vger.kernel.org, alex.williamson@redhat.com, zhen-hual@hp.com, ddutile@redhat.com, doug.hatch@hp.com, ishii.hironobu@jp.fujitsu.com, bhelgaas@google.com, billsumnerlinux@gmail.com, li.zhang6@hp.com 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 --- 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 _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec