[PATCH] iommu/qcom: Replace zero-length array with flexible-array member

2020-02-12 Thread Gustavo A. R. Silva
The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By ma

Re: [PATCH] iommu/arm-smmu: fix the module name to be consistent with older kernel

2020-02-12 Thread Li Yang
On Wed, Feb 12, 2020 at 4:50 AM Will Deacon wrote: > > On Tue, Feb 11, 2020 at 06:37:20PM -0600, Li Yang wrote: > > Commit cd221bd24ff5 ("iommu/arm-smmu: Allow building as a module") > > introduced a side effect that changed the module name from arm-smmu to > > arm-smmu-mod. This breaks the users

Re: [PATCH v2] xprtrdma: Fix DMA scatter-gather list mapping imbalance

2020-02-12 Thread Chuck Lever
> On Feb 12, 2020, at 11:03 AM, Andre Tomt wrote: > > On 12.02.2020 14:48, Chuck Lever wrote: >>> On Feb 12, 2020, at 8:43 AM, Chuck Lever wrote: >>> >>> The @nents value that was passed to ib_dma_map_sg() has to be passed >>> to the matching ib_dma_unmap_sg() call. If ib_dma_map_sg() choses

Re: [PATCH v2] xprtrdma: Fix DMA scatter-gather list mapping imbalance

2020-02-12 Thread Andre Tomt
On 12.02.2020 14:48, Chuck Lever wrote: On Feb 12, 2020, at 8:43 AM, Chuck Lever wrote: The @nents value that was passed to ib_dma_map_sg() has to be passed to the matching ib_dma_unmap_sg() call. If ib_dma_map_sg() choses to concatenate sg entries, it will return a different nents value than i

Re: [PATCH] iommu/vt-d: consider real PCI device when checking if mapping is needed

2020-02-12 Thread Robin Murphy
On 12/02/2020 3:17 am, Daniel Drake wrote: On Wed, Feb 12, 2020 at 12:03 AM Derrick, Jonathan wrote: On Tue, 2020-02-11 at 17:13 +0800, Daniel Drake wrote: The PCI devices handled by intel-iommu may have a DMA requester on another bus, such as VMD subdevices needing to use the VMD endpoint. T

Re: [PATCH v2] xprtrdma: Fix DMA scatter-gather list mapping imbalance

2020-02-12 Thread Chuck Lever
> On Feb 12, 2020, at 8:43 AM, Chuck Lever wrote: > > The @nents value that was passed to ib_dma_map_sg() has to be passed > to the matching ib_dma_unmap_sg() call. If ib_dma_map_sg() choses to > concatenate sg entries, it will return a different nents value than > it was passed. > > The bug

[PATCH v2] xprtrdma: Fix DMA scatter-gather list mapping imbalance

2020-02-12 Thread Chuck Lever
The @nents value that was passed to ib_dma_map_sg() has to be passed to the matching ib_dma_unmap_sg() call. If ib_dma_map_sg() choses to concatenate sg entries, it will return a different nents value than it was passed. The bug was exposed by recent changes to the AMD IOMMU driver, which enabled

Re: [PATCH V9 06/10] iommu/vt-d: Add svm/sva invalidate function

2020-02-12 Thread Auger Eric
Hi Jacob, On 1/29/20 7:01 AM, Jacob Pan wrote: > When Shared Virtual Address (SVA) is enabled for a guest OS via > vIOMMU, we need to provide invalidation support at IOMMU API and driver > level. This patch adds Intel VT-d specific function to implement > iommu passdown invalidate API for shared v

Re: [PATCH V9 07/10] iommu/vt-d: Cache virtual command capability register

2020-02-12 Thread Auger Eric
Hi Jacob, On 1/29/20 7:01 AM, Jacob Pan wrote: > Virtual command registers are used in the guest only, to prevent > vmexit cost, we cache the capability and store it during initialization. > > Signed-off-by: Jacob Pan I sent my R-b in https://lkml.org/lkml/2019/11/8/228 Also Baolo did. Do I miss

Re: [PATCH V9 05/10] iommu/vt-d: Support flushing more translation cache types

2020-02-12 Thread Auger Eric
Hi Jacob, On 1/29/20 7:01 AM, Jacob Pan wrote: > When Shared Virtual Memory is exposed to a guest via vIOMMU, scalable > IOTLB invalidation may be passed down from outside IOMMU subsystems. > This patch adds invalidation functions that can be used for additional > translation cache types. > > Sig

Re: [PATCH V9 03/10] iommu/vt-d: Add nested translation helper function

2020-02-12 Thread Auger Eric
Hi Jacob, On 1/29/20 7:01 AM, Jacob Pan wrote: > Nested translation mode is supported in VT-d 3.0 Spec.CH 3.8. > With PASID granular translation type set to 0x11b, translation > result from the first level(FL) also subject to a second level(SL) > page table translation. This mode is used for SVA vi

Re: [PATCH V9 02/10] iommu/uapi: Define a mask for bind data

2020-02-12 Thread Auger Eric
Hi Jacob, On 1/29/20 7:01 AM, Jacob Pan wrote: > Memory type related guest PASID bind data can be grouped together for > one simple check. Those are flags related to memory type. > Link: > https://lore.kernel.org/linux-iommu/20200109095123.17ed5e6b@jacob-builder/ not sure the link is really helpf

Re: [PATCH] iommu/arm-smmu: fix the module name to be consistent with older kernel

2020-02-12 Thread Will Deacon
On Tue, Feb 11, 2020 at 06:37:20PM -0600, Li Yang wrote: > Commit cd221bd24ff5 ("iommu/arm-smmu: Allow building as a module") > introduced a side effect that changed the module name from arm-smmu to > arm-smmu-mod. This breaks the users of kernel parameters for the driver > (e.g. arm-smmu.disable_