On Thu, Feb 14, 2019 at 01:41:47AM +, YueHaibing wrote:
> There is no need to have the 'struct dentry *d_swiotlb_usage' variable
> static since new value always be assigned before use it.
FYI, this is in swiotlb_create_debugfs, not swiotlb_dma_supported.
___
Hi Jean,
On 2/13/19 7:55 PM, Jean-Philippe Brucker wrote:
Hi,
I have a few boring nits and one question below
Thanks a lot for reviewing my patch.
On 13/02/2019 04:02, Lu Baolu wrote:
Sharing a physical PCI device in a finer-granularity way
is becoming a consensus in the industry. IOMMU v
There is no need to have the 'struct dentry *d_swiotlb_usage' variable
static since new value always be assigned before use it.
Signed-off-by: YueHaibing
---
kernel/dma/swiotlb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index
On Mon, Feb 11, 2019 at 01:50:31PM -0800,
sathyanarayanan.kuppusw...@linux.intel.com wrote:
> From: Kuppuswamy Sathyanarayanan
>
> Return the PRG Response PASID Required bit in the Page Request
> Status Register.
>
> As per PCIe spec r4.0, sec 10.5.2.3, if this bit is Set then the device
> expe
On Mon, Feb 11, 2019 at 01:44:34PM -0800,
sathyanarayanan.kuppusw...@linux.intel.com wrote:
> From: Kuppuswamy Sathyanarayanan
>
> Return the Page Aligned Request bit in the ATS Capability Register.
>
> As per PCIe spec r4.0, sec 10.5.1.2, If Page Aligned Request bit is
> set, then it indicates
On Wed, Feb 13, 2019 at 12:24 PM Christoph Hellwig wrote:
>
> On Tue, Feb 12, 2019 at 02:40:23PM -0600, Rob Herring wrote:
> > > diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
> > > index 3607fd2810e4..f8c66a9472a4 100644
> > > --- a/drivers/of/Kconfig
> > > +++ b/drivers/of/Kconfig
> > > @@
With most of the previous functionality now elsewhere a lot of the
headers included in this file are not needed.
Signed-off-by: Christoph Hellwig
---
arch/arm64/mm/dma-mapping.c | 11 ---
1 file changed, 11 deletions(-)
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mappin
Sorry,
plese ignore this thread. This just resend the start of the
dma-mapping for-next branch instead of the actual series that
sits on top of it.
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/list
Signed-off-by: Christoph Hellwig
Acked-by: Robin Murphy
---
arch/arm64/mm/dma-mapping.c | 15 +--
1 file changed, 1 insertion(+), 14 deletions(-)
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
index bf49e982c978..ad46594b3799 100644
--- a/arch/arm64/mm/dma-ma
Signed-off-by: Christoph Hellwig
Acked-by: Robin Murphy
---
drivers/iommu/dma-iommu.c | 13 +
include/linux/dma-iommu.h | 13 +
2 files changed, 2 insertions(+), 24 deletions(-)
diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
index 35a5c219b82e..625d60
For entirely dma coherent architectures there is no requirement to ever
remap dma coherent allocation. Move all the remap and pool code under
CONFIG_DMA_DIRECT_REMAP ifdefs, and drop the Kconfig dependency.
Signed-off-by: Christoph Hellwig
---
drivers/iommu/Kconfig | 1 -
drivers/iommu/dma
There is no need to remap for pte attributes, or for a virtually
contiguous address, so just don't do it.
Signed-off-by: Christoph Hellwig
---
drivers/iommu/dma-iommu.c | 9 -
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iomm
Move the call to dma_common_pages_remap / dma_common_free_remap into
__iommu_dma_alloc / __iommu_dma_free and rename those functions to
better describe what they do. This keeps the functionality that
allocates and remaps a non-contigous array of pages nicely abstracted
out from the calling code.
Move the vm_area handling into a new iommu_dma_get_sgtable_remap helper.
Inline __iommu_dma_get_sgtable_page into the main function to simplify
the code flow a bit.
Signed-off-by: Christoph Hellwig
---
drivers/iommu/dma-iommu.c | 54 +--
1 file changed, 24 in
There is nothing really arm64 specific in the iommu_dma_ops
implementation, so move it to dma-iommu.c and keep a lot of symbols
self-contained. Note the implementation does depend on the
DMA_DIRECT_REMAP infrastructure for now, so we'll have to make the
DMA_IOMMU support depend on it, but this wil
Move the vm_area handling into __iommu_dma_mmap, which is renamed
to iommu_dma_mmap_remap.
Inline __iommu_dma_mmap_pfn into the main function to simplify the code
flow a bit.
Signed-off-by: Christoph Hellwig
---
drivers/iommu/dma-iommu.c | 50 ++-
1 file chan
Reorder the checks a bit so that a non-remapped allocation is the
fallthrough case, as this will ease making remapping conditional.
Also get rid of the confusing game with the size and iosize variables
and rename the handle argument to the more standard dma_handle.
Signed-off-by: Christoph Hellwig
Split all functionality related to non-coherent devices into a
separate helper, and make the decision flow more obvious.
Signed-off-by: Christoph Hellwig
---
drivers/iommu/dma-iommu.c | 51 +++
1 file changed, 25 insertions(+), 26 deletions(-)
diff --git a/dr
This keeps the code together and will simplify compiling the code
out on architectures that are always dma coherent.
Signed-off-by: Christoph Hellwig
---
drivers/iommu/dma-iommu.c | 51 +--
1 file changed, 38 insertions(+), 13 deletions(-)
diff --git a/driver
This moves the last remaning non-dispatch code out of iommu_dma_alloc,
preparing to refactor the allocation method selection.
Signed-off-by: Christoph Hellwig
---
drivers/iommu/dma-iommu.c | 48 +++
1 file changed, 29 insertions(+), 19 deletions(-)
diff --git
Moving this function up to its unmap counterpart helps to keep related
code together for the following changes.
Signed-off-by: Christoph Hellwig
---
drivers/iommu/dma-iommu.c | 46 +++
1 file changed, 23 insertions(+), 23 deletions(-)
diff --git a/drivers/iom
This keeps the code together and will simplify using it in different
ways.
Signed-off-by: Christoph Hellwig
---
drivers/iommu/dma-iommu.c | 110 --
1 file changed, 59 insertions(+), 51 deletions(-)
diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-io
arch_dma_prep_coherent can handle physically contiguous ranges larger
than PAGE_SIZE just fine, which means we don't need a page-based
iterator.
Signed-off-by: Christoph Hellwig
---
drivers/iommu/dma-iommu.c | 14 +-
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/drive
We now have a arch_dma_prep_coherent architecture hook that is used
for the generic DMA remap allocator, and we should use the same
interface for the dma-iommu code.
Signed-off-by: Christoph Hellwig
---
arch/arm64/mm/dma-mapping.c | 8 +---
drivers/iommu/dma-iommu.c | 8 +++-
include/l
No need for a __KERNEL__ guard outside uapi and add a missing comment
describing the #else cpp statement. Last but not least include
instead of the asm version, which is frowned upon.
Signed-off-by: Christoph Hellwig
---
include/linux/dma-iommu.h | 7 +++
1 file changed, 3 insertions(+), 4
Add a Kconfig symbol that indicates an architecture provides a
arch_dma_prep_coherent implementation, and provide a stub otherwise.
This will allow the generic dma-iommu code to it while still allowing
to be built for cache coherent architectures.
Signed-off-by: Christoph Hellwig
---
arch/arm64
The nr_pages checks should be done for all mmap requests, not just those
using remap_pfn_range.
Signed-off-by: Christoph Hellwig
---
arch/arm64/mm/dma-mapping.c | 21 -
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/
DMA allocations that can't sleep may return non-remapped addresses, but
we do not properly handle them in the mmap and get_sgtable methods.
Resolve non-vmalloc addresses using virt_to_page to handle this corner
case.
Signed-off-by: Christoph Hellwig
---
arch/arm64/mm/dma-mapping.c | 12 +
Hi Robin,
please take a look at this series, which implements a completely generic
set of dma_map_ops for IOMMU drivers. This is done by taking the
existing arm64 code, moving it to drivers/iommu and then massaging it
so that it can also work for architectures with DMA remapping. This
should hel
Use WARN_ON_ONCE to print a stack trace and return a proper error
code instead.
Signed-off-by: Christoph Hellwig
Reviewed-by: Robin Murphy
Tested-by: Marek Szyprowski
---
include/linux/dma-mapping.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/linux/dma-mapping
Hi Robin,
please take a look at this series, which implements a completely generic
set of dma_map_ops for IOMMU drivers. This is done by taking the
existing arm64 code, moving it to drivers/iommu and then massaging it
so that it can also work for architectures with DMA remapping. This
should hel
Instead provide a proper implementation in the direct mapping code, and
also wire it up for arm and powerpc, leaving an error return for all the
IOMMU or virtual mapping instances for which we'd have to wire up an
actual implementation
Signed-off-by: Christoph Hellwig
Tested-by: Marek Szyprowski
On Tue, Feb 12, 2019 at 02:40:23PM -0600, Rob Herring wrote:
> > diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
> > index 3607fd2810e4..f8c66a9472a4 100644
> > --- a/drivers/of/Kconfig
> > +++ b/drivers/of/Kconfig
> > @@ -43,6 +43,7 @@ config OF_FLATTREE
> >
> > config OF_EARLY_FLATTREE
> >
On 2/13/19 12:26 AM, Tian, Kevin wrote:
From: iommu-boun...@lists.linux-foundation.org [mailto:iommu-
boun...@lists.linux-foundation.org] On Behalf Of
sathyanarayanan.kuppusw...@linux.intel.com
Sent: Tuesday, February 12, 2019 5:51 AM
To: bhelg...@google.com; j...@8bytes.org; dw...@infradead.or
On Tue, Feb 12, 2019 at 02:24:19PM -0600, Rob Herring wrote:
> Looks like this one isn't a dependency, so I can take it if you want.
Sure, please go ahead.
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/
On Wed, Feb 13, 2019 at 07:29:31AM +, Lee Jones wrote:
> I would normally have taken this, but I fear it will conflict with
> [PATCH 06/12]. For that reason, just take my:
>
> Acked-by: Lee Jones
Yes, I'll need it for the later patches in the series.
Thanks for the review.
__
Oops, sorry. Please ignore the first two patches in this series. They
have already been merged independently.
Logan
On 2019-02-13 10:54 a.m., Logan Gunthorpe wrote:
> Currently the Intel IOMMU uses the default dma_[un]map_resource()
> implementations does nothing and simply returns the physical
Thanks Catalin and Paul. I've merged this into the dma-mapping
for-next branch.
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
Thanks, applied to the dma-mapping for-next branch.
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
On Wed, Feb 13, 2019 at 12:26:33AM -0800, Tian, Kevin wrote:
> >
> > diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
> > index 1457f931218e..af2e4a011787 100644
> > --- a/drivers/iommu/intel-iommu.c
> > +++ b/drivers/iommu/intel-iommu.c
> > @@ -1399,7 +1399,8 @@ static void
The NTB MSI library allows passing MSI interrupts across a memory
window. This offers similar functionality to doorbells or messages
except will often have much better latency and the client can
potentially use significantly more remote interrupts than typical hardware
provides for doorbells. (Whic
Seeing the we want to use more interrupts in the NTB MSI code
we need to be able allocate more (sometimes virtual) interrupts
in the switchtec driver. Therefore add a module parameter to
request to allocate additional interrupts.
This puts virtually no limit on the number of MSI interrupts availab
Introduce a tool to test NTB MSI interrupts similar to the other
NTB test tools. This tool creates a debugfs directory for each
NTB device with the following files:
port
irqX_occurrences
peerX/port
peerX/count
peerX/trigger
The 'port' file tells the user the local port number and the
'occurrences
For NTB devices, we want to be able to trigger MSI interrupts
through a memory window. In these cases we may want to use
more interrupts than the NTB PCI device has available in its MSI-X
table.
We allow for this by creating a new 'virtual' interrupt. These
interrupts are allocated as usual but ar
Currently the Intel IOMMU uses the default dma_[un]map_resource()
implementations does nothing and simply returns the physical address
unmodified.
However, this doesn't create the IOVA entries necessary for addresses
mapped this way to work when the IOMMU is enabled. Thus, when the
IOMMU is enable
The current code uses set_irte_sid() with SVT_VERIFY_BUS and PCI_DEVID
to set the SID value. However, this is very confusing because, with
SVT_VERIFY_BUS, the SID value is not a PCI devfn address, but the start
and end bus numbers to match against.
According to the Intel Virtualization Technology
The kbuild system does not support having multiple source files in
a module if one of those source files has the same name as the module.
Therefore, we must rename ntb.c to core.c, while the module remains
ntb.ko.
This is similar to the way the nvme modules are structured.
Signed-off-by: Logan G
Introduce the module parameter 'use_msi' which, when set uses
MSI interrupts instead of doorbells for each queue pair (QP). T
he parameter is only available if NTB MSI support is configured into
the kernel. We also require there to be more than one memory window
(MW) so that an extra one is availab
When a device has multiple aliases that all are from the same bus,
we program the IRTE to accept requests from any matching device on the
bus.
This is so NTB devices which can have requests from multiple bus-devfns
can pass MSI interrupts through across the bridge.
Signed-off-by: Logan Gunthorpe
When the ntb_msi_test module is available, the test code will trigger
each of the interrupts and ensure the corresponding occurrences files
gets incremented.
Signed-off-by: Logan Gunthorpe
Cc: Jon Mason
Cc: Dave Jiang
Cc: Allen Hubbe
---
tools/testing/selftests/ntb/ntb_test.sh | 54 ++
Note: this version will likely trivially conflict with some cleanup
patches I sent to Bjorn. So this is meant for review purposes only.
If there are no objections, I'd like to look at getting it merged in
the next cycle through the NTB tree.
--
Changes in v2:
* Cleaned up the changes in intel_ir
Presently, when ntb_transport is used with DMA and the IOMMU turned on,
it fails with errors from the IOMMU such as:
DMAR: DRHD: handling fault status reg 202
DMAR: [DMA Write] Request device [00:04.0] fault addr
381fc034 [fault reason 05] PTE Write access is not set
This is becau
When using multi-ports each port uses resources (dbs, msgs, mws, etc)
on every other port. Creating a mapping for these resources such that
each port has a corresponding resource on every other port is a bit
tricky.
Introduce the ntb_peer_resource_idx() function for this purpose.
It returns the pe
On 1/22/19 11:51 PM, Nicolas Boichat wrote:
> Hi Andrew,
>
> On Fri, Jan 11, 2019 at 6:21 PM Joerg Roedel wrote:
>>
>> On Wed, Jan 02, 2019 at 01:51:45PM +0800, Nicolas Boichat wrote:
>> > Does anyone have any further comment on this series? If not, which
>> > maintainer is going to pick this up?
Convert to use vm_map_pages() to map range of kernel
memory to user vma.
Signed-off-by: Souptick Joarder
---
drivers/iommu/dma-iommu.c | 12 +---
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
index d19f3d6..bacebff 100
Previouly drivers have their own way of mapping range of
kernel pages/memory into user vma and this was done by
invoking vm_insert_page() within a loop.
As this pattern is common across different drivers, it can
be generalized by creating new functions and use it across
the drivers.
vm_map_pages(
Previouly drivers have their own way of mapping range of
kernel pages/memory into user vma and this was done by
invoking vm_insert_page() within a loop.
As this pattern is common across different drivers, it can
be generalized by creating new functions and use it across
the drivers.
vm_map_pages(
Hi,
I have a few boring nits and one question below
On 13/02/2019 04:02, Lu Baolu wrote:
> Sharing a physical PCI device in a finer-granularity way
> is becoming a consensus in the industry. IOMMU vendors
> are also engaging efforts to support such sharing as well
> as possible. Among the efforts
On Mon, 11 Feb 2019, Christoph Hellwig wrote:
> This API is primarily used through DT entries, but two architectures
> and two drivers call it directly. So instead of selecting the config
> symbol for random architectures pull it in implicitly for the actual
> users. Also rename the Kconfig opti
On Mon, 11 Feb 2019, Christoph Hellwig wrote:
> Currently the sm501 mfd driver can be compiled without any dependencies,
> but through the use of dma_declare_coherent it really depends on
> having DMA and iomem support. Normally we don't explicitly require DMA
> support as we have stubs for it if
> From: iommu-boun...@lists.linux-foundation.org [mailto:iommu-
> boun...@lists.linux-foundation.org] On Behalf Of
> sathyanarayanan.kuppusw...@linux.intel.com
> Sent: Tuesday, February 12, 2019 5:51 AM
> To: bhelg...@google.com; j...@8bytes.org; dw...@infradead.org
> Cc: Raj, Ashok ; linux-...@vge
61 matches
Mail list logo