RE: Does a new booting kernel by "kexec -l" need to copy IR table from previous kernel?

2017-04-28 Thread Zhuo, Qiuxu
Hi Joerg Roedel,

> From: j...@8bytes.org [mailto:j...@8bytes.org] 
> Yes, that is true. But the messages are harmless and you are safe to ignore 
> them in your usecase. 
> We only care about the kdump case when copying the old IR and DMAR tables 
> into the new kernel, 
> because in the  kdump case the old kernel crashed and left devices in an 
> undefined state, so that 
> they might still send DMA and IRQ requests to the new kernel, corrupting data 
> or causing spurious/blocked irqs. 
> Blocked IRQs or DMA requests might even break devices so that the new kernel 
> can't initialize them anymore.
...
> That is why we want to make sure, that no spurious IRQ or DMA requests are 
> blocked when the new
>  kernel initializes the IOMMU. In the non-kdump case we can assume that the 
> old kernel put the devices
> into a defined state where they are not sending spurious requests.

Thanks so much for your detail and clear comments, get it now.  Send you a 
patch " Don't print the failure message
when booting non-kdump kernel" to make it less alarming or misleading. Please 
review it, thanks!

BR
qiuxu


___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: Does a new booting kernel by "kexec -l" need to copy IR table from previous kernel?

2017-04-27 Thread Raj, Ashok
Hi Joerg,

On Thu, Apr 27, 2017 at 06:12:38PM +0200, j...@8bytes.org wrote:
> On Thu, Apr 27, 2017 at 03:34:06PM +, Zhuo, Qiuxu wrote:
> > It looks like the printk is misleading and it’s nothing actually
> > failed, but just it isn’t copying if the new kernel is not a kdump
> > kernel.
> 
> Yes, that is true. But the messages are harmless and you are safe to
> ignore them in your usecase. We only care about the kdump case when

Looks like maybe sanitizing the message to make it less disturbing 
should be enough :-) 

> copying the old IR and DMAR tables into the new kernel, because in the
> kdump case the old kernel crashed and left devices in an undefined
> state, so that they might still send DMA and IRQ requests to the new
> kernel, corrupting data or causing spurious/blocked irqs. Blocked IRQs
> or DMA requests might even break devices so that the new kernel can't
> initialize them anymore.

Cheers,
Ashok
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: Does a new booting kernel by "kexec -l" need to copy IR table from previous kernel?

2017-04-27 Thread j...@8bytes.org
On Thu, Apr 27, 2017 at 03:34:06PM +, Zhuo, Qiuxu wrote:
> It looks like the printk is misleading and it’s nothing actually
> failed, but just it isn’t copying if the new kernel is not a kdump
> kernel.

Yes, that is true. But the messages are harmless and you are safe to
ignore them in your usecase. We only care about the kdump case when
copying the old IR and DMAR tables into the new kernel, because in the
kdump case the old kernel crashed and left devices in an undefined
state, so that they might still send DMA and IRQ requests to the new
kernel, corrupting data or causing spurious/blocked irqs. Blocked IRQs
or DMA requests might even break devices so that the new kernel can't
initialize them anymore.

That is why we want to make sure, that no spurious IRQ or DMA requests
are blocked when the new kernel initializes the IOMMU. In the non-kdump
case we can assume that the old kernel put the devices into a defined
state where they are not sending spurious requests.

>For kdump kernel can we just reinitializing IR table(as like normal
> kernel boot from power on) to handle the “spurious interrupts” issue instead 
> of
> copying IR  table from previous kernel?
> 
>For booting a new kernel by “kexec -l” (my test case), do we still need
> to copy IR table from previous kernel to handle the “spurious interrupts”
> issue?

As I said, for your case there is no need to do the copying and you can
ignore the messages.


Regards,

Joerg

___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu