Re: [PATCH] iommu/vt-d: Fix broken device issue when using iommu=pt

2014-08-11 Thread Yijing Wang
extern struct iommu_table_entry __iommu_table[], __iommu_table_end[]; @@ -146,6 +148,7 @@ void dma_generic_free_coherent(struct device *dev, size_t size, void *vaddr, */ static __init int iommu_setup(char *p) { +char *end; iommu_merge = 1; if (!p) @@ -192,6

[PATCH] iommu/vt-d: Don't store SIRTP request

2014-08-11 Thread Jan Kiszka
Don't store the SIRTP request bit in the register state. It will otherwise become sticky and could request an Interrupt Remap Table Pointer update on each command register write. Found while starting to emulate IR in QEMU, not by observing problems on real hardware. Signed-off-by: Jan Kiszka

Re: [PATCH] iommu/vt-d: Fix broken device issue when using iommu=pt

2014-08-11 Thread Linda Knippers
On 8/11/2014 12:43 AM, Alex Williamson wrote: On Mon, 2014-08-11 at 10:54 +0800, Yijing Wang wrote: We found some strange devices in HP C7000 and Huawei Server. These devices can not be enumerated by OS, but they still did DMA read/write without OS management. Because iommu will not create

[PATCH v5 0/1] Add iommu map_sg/unmap_sg API

2014-08-11 Thread Olav Haugan
Patch for adding map_sg/unmap_sg to the generic IOMMU API. v4 - v5: * Simplified logic in map_sg on error * Moved fallback to separate function for both map an unmap and pointed all drivers to these fallbacks. v3 - v4: * Removed BUG_ON in both map_sg and unmap_sg * Removed PAGE_ALIGN of length

Re: [PATCH v5 1/1] iommu-api: Add map_sg/unmap_sg functions

2014-08-11 Thread Konrad Rzeszutek Wilk
On Mon, Aug 11, 2014 at 03:45:50PM -0700, Olav Haugan wrote: Mapping and unmapping are more often than not in the critical path. map_sg and unmap_sg allows IOMMU driver implementations to optimize the process of mapping and unmapping buffers into the IOMMU page tables. Instead of mapping a

Re: [PATCH v5 1/1] iommu-api: Add map_sg/unmap_sg functions

2014-08-11 Thread Hiroshi Doyu
Hi Olav, Olav Haugan ohau...@codeaurora.org writes: @@ -93,6 +94,10 @@ enum iommu_attr { * @detach_dev: detach device from an iommu domain * @map: map a physically contiguous memory region to an iommu domain * @unmap: unmap a physically contiguous memory region from an iommu domain +

Re: [PATCH] iommu/vt-d: Fix broken device issue when using iommu=pt

2014-08-11 Thread Jiang Liu
On 2014/8/12 9:37, Yijing Wang wrote: On 2014/8/11 22:59, Linda Knippers wrote: On 8/11/2014 12:43 AM, Alex Williamson wrote: On Mon, 2014-08-11 at 10:54 +0800, Yijing Wang wrote: We found some strange devices in HP C7000 and Huawei Server. These devices can not be enumerated by OS, but

Re: [PATCH] iommu/vt-d: Fix broken device issue when using iommu=pt

2014-08-11 Thread Jiang Liu
On 2014/8/12 9:37, Yijing Wang wrote: On 2014/8/11 22:59, Linda Knippers wrote: On 8/11/2014 12:43 AM, Alex Williamson wrote: On Mon, 2014-08-11 at 10:54 +0800, Yijing Wang wrote: We found some strange devices in HP C7000 and Huawei Server. These devices can not be enumerated by OS, but they

Re: [PATCH] iommu/vt-d: Fix broken device issue when using iommu=pt

2014-08-11 Thread Yijing Wang
On 2014/8/12 11:18, Jiang Liu wrote: On 2014/8/12 9:37, Yijing Wang wrote: On 2014/8/11 22:59, Linda Knippers wrote: On 8/11/2014 12:43 AM, Alex Williamson wrote: On Mon, 2014-08-11 at 10:54 +0800, Yijing Wang wrote: We found some strange devices in HP C7000 and Huawei Server. These devices