Re: [PATCH] iommu/amd: Fix unity mapping initialization race

2016-07-11 Thread Wan ZongShun
> >> Sorry, why you still say this 'init_device_table_dma' can block DMA? >> I just think this function will enable DMA transfer, since we set >> the V and TV bits, right? or I misunderstand what "block DMA" mean? > > When the V and TV bits are not set, it means that all DMA from that > device-id

Re: [PATCH] iommu/amd: Fix unity mapping initialization race

2016-07-11 Thread Wan ZongShun
> >> Sorry, why you still say this 'init_device_table_dma' can block DMA? >> I just think this function will enable DMA transfer, since we set >> the V and TV bits, right? or I misunderstand what "block DMA" mean? > > When the V and TV bits are not set, it means that all DMA from that > device-id

Re: [PATCH] iommu/amd: Fix unity mapping initialization race

2016-07-11 Thread Joerg Roedel
On Mon, Jul 11, 2016 at 05:25:29PM +0800, Wan Zongshun wrote: > Okay, this patch should also better to general case not only unity-mapping. > > How about the interrupt remap function? Do we need same considering > for IV bit enable for interrupt remap? No, there are no unity mappings for irqs,

Re: [PATCH] iommu/amd: Fix unity mapping initialization race

2016-07-11 Thread Joerg Roedel
On Mon, Jul 11, 2016 at 05:25:29PM +0800, Wan Zongshun wrote: > Okay, this patch should also better to general case not only unity-mapping. > > How about the interrupt remap function? Do we need same considering > for IV bit enable for interrupt remap? No, there are no unity mappings for irqs,

Re: [PATCH] iommu/amd: Fix unity mapping initialization race

2016-07-11 Thread Wan Zongshun
On 2016年07月11日 15:19, Joerg Roedel wrote: On Sun, Jul 10, 2016 at 07:40:53PM +0800, Wan Zongshun wrote: Do you mean we need enable the V and TV bits to DTE entry after all DTEs tables were initialized completely? Yes, this is what my patch does and what fixes the bug that was reported on

Re: [PATCH] iommu/amd: Fix unity mapping initialization race

2016-07-11 Thread Wan Zongshun
On 2016年07月11日 15:19, Joerg Roedel wrote: On Sun, Jul 10, 2016 at 07:40:53PM +0800, Wan Zongshun wrote: Do you mean we need enable the V and TV bits to DTE entry after all DTEs tables were initialized completely? Yes, this is what my patch does and what fixes the bug that was reported on

Re: [PATCH] iommu/amd: Fix unity mapping initialization race

2016-07-11 Thread Joerg Roedel
On Sun, Jul 10, 2016 at 07:40:53PM +0800, Wan Zongshun wrote: > Do you mean we need enable the V and TV bits to DTE entry after all > DTEs tables were initialized completely? Yes, this is what my patch does and what fixes the bug that was reported on machines which have unity-mapping entries. >

Re: [PATCH] iommu/amd: Fix unity mapping initialization race

2016-07-11 Thread Joerg Roedel
On Sun, Jul 10, 2016 at 07:40:53PM +0800, Wan Zongshun wrote: > Do you mean we need enable the V and TV bits to DTE entry after all > DTEs tables were initialized completely? Yes, this is what my patch does and what fixes the bug that was reported on machines which have unity-mapping entries. >

Re: [PATCH] iommu/amd: Fix unity mapping initialization race

2016-07-10 Thread Wan Zongshun
On 2016年07月07日 00:00, Joerg Roedel wrote: From: Joerg Roedel There is a race condition in the AMD IOMMU init code that causes requested unity mappings to be blocked by the IOMMU for a short period of time. This results on boot failures and IO_PAGE_FAULTs on some machines.

Re: [PATCH] iommu/amd: Fix unity mapping initialization race

2016-07-10 Thread Wan Zongshun
On 2016年07月07日 00:00, Joerg Roedel wrote: From: Joerg Roedel There is a race condition in the AMD IOMMU init code that causes requested unity mappings to be blocked by the IOMMU for a short period of time. This results on boot failures and IO_PAGE_FAULTs on some machines. Fix this by making

[PATCH] iommu/amd: Fix unity mapping initialization race

2016-07-06 Thread Joerg Roedel
From: Joerg Roedel There is a race condition in the AMD IOMMU init code that causes requested unity mappings to be blocked by the IOMMU for a short period of time. This results on boot failures and IO_PAGE_FAULTs on some machines. Fix this by making sure the unity mappings are

[PATCH] iommu/amd: Fix unity mapping initialization race

2016-07-06 Thread Joerg Roedel
From: Joerg Roedel There is a race condition in the AMD IOMMU init code that causes requested unity mappings to be blocked by the IOMMU for a short period of time. This results on boot failures and IO_PAGE_FAULTs on some machines. Fix this by making sure the unity mappings are installed before