[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <551E450F.4030903@hp.com>
Date: Fri, 03 Apr 2015 15:45:19 +0800
From: "Li, ZhenHua" <zhen-hual@...com>
To: Joerg Roedel <joro@...tes.org>
CC: dwmw2@...radead.org, indou.takao@...fujitsu.com, bhe@...hat.com,
vgoyal@...hat.com, dyoung@...hat.com,
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,
rwright@...com, "Li, ZhenHua" <zhen-hual@...com>
Subject: Re: [PATCH v9 07/10] iommu/vt-d: enable kdump support in iommu module
Hi Joerg,
Thinking about it carefully, I think you suggestions are very helpful,
and the checks should be:
* All these things should be done in the second kernel, not only the
kdump kernel. Sometimes user may use kexec manually start a new kernel.
* Copying those tables should only happen in the second kernel, only in
this situation: iommu is enabled in both first and second kernel.
So, I think we can do this:
1. Use a new variable iommu_enabled_in_last_kernel;
2. When iommu module is loaded, it means the iommu is enabled in current
kernel. Then we check DMA_GSTS_TES:
* if DMA_GSTS_TES is set, then it should be the second kernel(kexec
starts this kernel manually, or it is kdump kernel), and the first
kernel used iommu tables. Here we need to copy these tables; then set
iommu_enabled_in_last_kernel to 1.
* if DMA_GSTS_TES is NOT set, then we do not need to care about
these tables.
3. Replace all
#ifdef CONFIG_CRASH_DUMP
if (is_kdump_kernel()) {
// Do some thing
}
#endif
To:
if (iommu_enabled_in_last_kernel) {
// Do some thing
}
Do you agree with these?
Thanks
Zhenhua
On 04/02/2015 07:06 PM, Joerg Roedel wrote:
> On Thu, Mar 19, 2015 at 01:36:25PM +0800, Li, Zhen-Hua wrote:
>> +#ifdef CONFIG_CRASH_DUMP
>> + if (is_kdump_kernel())
>> + __iommu_update_old_root_entry(iommu, bus);
>> +#endif
>
> All the is_kdump_kernel checks in this patch (and maybe in other patches
> too) should really be checks whether translation on the IOMMU was
> enabled or not when the kernel booted. You might also boot from a kernel
> that had translation disabled into a kdump kernel that wants to enable
> it. In this case these checks would break.
>
> Speaking of booting from kernels with translation disabled, there is a
> valid use of is_kdump_enabled(), to omit iommu initialization in the
> kdump kernel when translation was disabled before. But the other checks
> should depend on the state the iommu had when booting the kdump kernel.
>
>
> Joerg
>
--
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