Re: [Resend RFC PATCH V2 07/12] HV/Vmbus: Initialize VMbus ring buffer for Isolation VM

2021-04-18 Thread Christoph Hellwig
On Thu, Apr 15, 2021 at 04:24:15PM -0400, Konrad Rzeszutek Wilk wrote: > So you are exposing these two: > EXPORT_SYMBOL_GPL(get_vm_area); > EXPORT_SYMBOL_GPL(ioremap_page_range); > > But if you used vmap wouldn't you get the same thing for free? Yes, this needs to go into some vmap version, pre

Re: [PATCH 1/1] mm: Fix struct page layout on 32-bit systems

2021-04-18 Thread Christoph Hellwig
On Fri, Apr 16, 2021 at 04:27:55PM +0100, Matthew Wilcox wrote: > On Thu, Apr 15, 2021 at 08:08:32PM +0200, Jesper Dangaard Brouer wrote: > > See below patch. Where I swap32 the dma address to satisfy > > page->compound having bit zero cleared. (It is the simplest fix I could > > come up with). >

Re: [Resend RFC PATCH V2 12/12] HV/Storvsc: Add Isolation VM support for storvsc driver

2021-04-14 Thread Christoph Hellwig
Same comments as for the net driver. In addition to all the poking into kernel internals the fact that this is duplicated in the two main drivers should have been a huge red flag.

Re: [Resend RFC PATCH V2 11/12] HV/Netvsc: Add Isolation VM support for netvsc driver

2021-04-14 Thread Christoph Hellwig
> +struct dma_range { > + dma_addr_t dma; > + u32 mapping_size; > +}; That's a rather generic name that is bound to create a conflict sooner or later. > #include "hyperv_net.h" > #include "netvsc_trace.h" > +#include "../../hv/hyperv_vmbus.h" Please move public interfaces out of the pr

Re: [Resend RFC PATCH V2 10/12] HV/IOMMU: Add Hyper-V dma ops support

2021-04-14 Thread Christoph Hellwig
> +static dma_addr_t hyperv_map_page(struct device *dev, struct page *page, > + unsigned long offset, size_t size, > + enum dma_data_direction dir, > + unsigned long attrs) > +{ > + phys_addr_t map, phys =

Re: [Resend RFC PATCH V2 08/12] UIO/Hyper-V: Not load UIO HV driver in the isolation VM.

2021-04-14 Thread Christoph Hellwig
On Wed, Apr 14, 2021 at 10:49:41AM -0400, Tianyu Lan wrote: > From: Tianyu Lan > > UIO HV driver should not load in the isolation VM for security reason. > Return ENOTSUPP in the hv_uio_probe() in the isolation VM. What is the "security reason"? After all a user can simply patch the code and ju

Re: [Resend RFC PATCH V2 04/12] HV: Add Write/Read MSR registers via ghcb

2021-04-14 Thread Christoph Hellwig
> +EXPORT_SYMBOL_GPL(hv_ghcb_msr_write); Just curious, who is going to use all these exports? These seems like extremely low-level functionality. Isn't there a way to build a more useful higher level API?

Re: [Resend RFC PATCH V2 03/12] x86/Hyper-V: Add new hvcall guest address host visibility support

2021-04-14 Thread Christoph Hellwig
> +/* > + * hv_set_mem_host_visibility - Set host visibility for specified memory. > + */ I don't think this comment really clarifies anything over the function name. What is 'host visibility' > +int hv_set_mem_host_visibility(void *kbuffer, u32 size, u32 visibility) Should size be a size_t? Sh

Re: [PATCH rdma-next 01/10] RDMA: Add access flags to ib_alloc_mr() and ib_mr_pool_init()

2021-04-06 Thread Christoph Hellwig
On Tue, Apr 06, 2021 at 04:54:57PM +0200, Christoph Hellwig wrote: > That is something everyone gets wrong at first (yourself included) The yourself here should have been a yours truly or "myself", sorry.

Re: [PATCH rdma-next 01/10] RDMA: Add access flags to ib_alloc_mr() and ib_mr_pool_init()

2021-04-06 Thread Christoph Hellwig
On Tue, Apr 06, 2021 at 11:40:39AM -0300, Jason Gunthorpe wrote: > Yes, but the complexity is how the drivers are constructed they are > designed to reject flags they don't know about.. > > Hum, it looks like someone has already been in here and we now have a > IB_ACCESS_OPTIONAL concept. > > So

Re: [PATCH rdma-next 01/10] RDMA: Add access flags to ib_alloc_mr() and ib_mr_pool_init()

2021-04-06 Thread Christoph Hellwig
On Tue, Apr 06, 2021 at 11:04:37AM -0300, Jason Gunthorpe wrote: > It might be idiodic, but I have to keep the uverbs thing working > too. > > There is a lot of assumption baked in to all the drivers that > user/kernel is the same thing, we'd have to go in and break this. > > Essentially #2 ends

Re: [PATCH rdma-next 01/10] RDMA: Add access flags to ib_alloc_mr() and ib_mr_pool_init()

2021-04-06 Thread Christoph Hellwig
On Tue, Apr 06, 2021 at 09:13:12AM -0300, Jason Gunthorpe wrote: > So we broadly have two choice > 1) Diverge the kernel and user interfaces and make the RDMA drivers > special case all the kernel stuff to force > ACCESS_RELAXED_ORDERING when they are building MRs and processing > FMR

Re: [PATCH rdma-next 01/10] RDMA: Add access flags to ib_alloc_mr() and ib_mr_pool_init()

2021-04-05 Thread Christoph Hellwig
On Tue, Apr 06, 2021 at 08:23:28AM +0300, Leon Romanovsky wrote: > The same proposal (enable unconditionally) was raised during > submission preparations and we decided to follow same pattern > as other verbs objects which receive flag parameter. A flags argument can be added when it actually is n

Re: [PATCH rdma-next 01/10] RDMA: Add access flags to ib_alloc_mr() and ib_mr_pool_init()

2021-04-05 Thread Christoph Hellwig
On Mon, Apr 05, 2021 at 08:23:55AM +0300, Leon Romanovsky wrote: > From: Avihai Horon > > Add access flags parameter to ib_alloc_mr() and to ib_mr_pool_init(), > and refactor relevant code. This parameter is used to pass MR access > flags during MR allocation. > > In the following patches, the n

Re: [PATCH rdma-next 00/10] Enable relaxed ordering for ULPs

2021-04-05 Thread Christoph Hellwig
On Mon, Apr 05, 2021 at 08:23:54AM +0300, Leon Romanovsky wrote: > From: Leon Romanovsky > > >From Avihai, > > Relaxed Ordering is a PCIe mechanism that relaxes the strict ordering > imposed on PCI transactions, and thus, can improve performance. > > Until now, relaxed ordering could be set onl

[PATCH 14/20] iommu: remove DOMAIN_ATTR_PAGING

2021-04-01 Thread Christoph Hellwig
DOMAIN_ATTR_PAGING is never used. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Acked-by: Li Yang --- drivers/iommu/iommu.c | 5 - include/linux/iommu.h | 1 - 2 files changed, 6 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index b212bf0261820b

[PATCH 16/20] iommu: remove DOMAIN_ATTR_NESTING

2021-04-01 Thread Christoph Hellwig
Use an explicit enable_nesting method instead. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Acked-by: Li Yang --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 43 - drivers/iommu/arm/arm-smmu/arm-smmu.c | 30 +++--- drivers/iommu/intel/iommu.c

[PATCH 11/20] iommu/fsl_pamu: remove the snoop_id field

2021-04-01 Thread Christoph Hellwig
The snoop_id is always set to ~(u32)0. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 5 ++--- drivers/iommu/fsl_pamu_domain.h | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/fsl_pamu_domain.c

[PATCH 20/20] iommu: remove iommu_domain_{get,set}_attr

2021-04-01 Thread Christoph Hellwig
Remove the now unused iommu attr infrastructure. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon --- drivers/iommu/iommu.c | 26 -- include/linux/iommu.h | 36 2 files changed, 62 deletions(-) diff --git a/drivers/iommu

[PATCH 07/20] iommu/fsl_pamu: replace DOMAIN_ATTR_FSL_PAMU_STASH with a direct call

2021-04-01 Thread Christoph Hellwig
Add a fsl_pamu_configure_l1_stash API that qman_portal can call directly instead of indirecting through the iommu attr API. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Acked-by: Li Yang --- arch/powerpc/include/asm/fsl_pamu_stash.h | 12 +++- drivers/iommu/fsl_pamu_domain.c

[PATCH 06/20] iommu/fsl_pamu: remove ->domain_window_enable

2021-04-01 Thread Christoph Hellwig
use the iommu_domain_geometry structure instead. Remove the now unused ->domain_window_enable iommu method. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 182 +++- drivers/iommu/fsl_pamu_domain.h | 15 --- drivers/io

[PATCH 08/20] iommu/fsl_pamu: merge pamu_set_liodn and map_liodn

2021-04-01 Thread Christoph Hellwig
Merge the two fuctions that configure the ppaace into a single coherent function. I somehow doubt we need the two pamu_config_ppaace calls, but keep the existing behavior just to be on the safe side. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 65

[PATCH 13/20] iommu/fsl_pamu: hardcode the window address and size in pamu_config_ppaace

2021-04-01 Thread Christoph Hellwig
The win_addr and win_size parameters are always set to 0 and 1 << 36 respectively, so just hard code them. Signed-off-by: Christoph Hellwig --- drivers/iommu/fsl_pamu.c| 23 --- drivers/iommu/fsl_pamu.h| 3 +-- drivers/iommu/fsl_pamu_domain.

[PATCH 10/20] iommu/fsl_pamu: enable the liodn when attaching a device

2021-04-01 Thread Christoph Hellwig
Instead of a separate call to enable all devices from the list, just enable the liodn once the device is attached to the iommu domain. This also remove the DOMAIN_ATTR_FSL_PAMU_ENABLE iommu_attr. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Acked-by: Li Yang --- drivers/iommu

cleanup unused or almost unused IOMMU APIs and the FSL PAMU driver v3

2021-04-01 Thread Christoph Hellwig
Hi all, there are a bunch of IOMMU APIs that are entirely unused, or only used as a private communication channel between the FSL PAMU driver and it's only consumer, the qbman portal driver. So this series drops a huge chunk of entirely unused FSL PAMU functionality, then drops all kinds of unuse

[PATCH 17/20] iommu: remove iommu_set_cmd_line_dma_api and iommu_cmd_line_dma_api

2021-04-01 Thread Christoph Hellwig
Don't obsfucate the trivial bit flag check. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon --- drivers/iommu/iommu.c | 23 +-- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 58d1d11a8

[PATCH 03/20] iommu/fsl_pamu: remove support for setting DOMAIN_ATTR_GEOMETRY

2021-04-01 Thread Christoph Hellwig
The default geometry is the same as the one set by qman_port given that FSL_PAMU depends on having 64-bit physical and thus DMA addresses. Remove the support to update the geometry and remove the now pointless geom_size field. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Acked-by: Li

[PATCH 19/20] iommu: remove DOMAIN_ATTR_IO_PGTABLE_CFG

2021-04-01 Thread Christoph Hellwig
Use an explicit set_pgtable_quirks method instead that just passes the actual quirk bitmask instead. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Acked-by: Li Yang --- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 5 +- drivers/iommu/arm/arm-smmu/arm-smmu.c | 64

[PATCH 18/20] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-04-01 Thread Christoph Hellwig
flushing a new IOMMU_CMD_LINE_STRICT is used to turn the value into a tristate to represent the default if not overriden by an explicit parameter. Signed-off-by: Robin Murphy . [ported on top of the other iommu_attr changes and added a few small missing bits] Signed-off-by: Christoph Hellwig

[PATCH 09/20] iommu/fsl_pamu: merge handle_attach_device into fsl_pamu_attach_device

2021-04-01 Thread Christoph Hellwig
No good reason to split this functionality over two functions. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 59 +++-- 1 file changed, 20 insertions(+), 39 deletions(-) diff --git a/drivers/iommu

[PATCH 04/20] iommu/fsl_pamu: merge iommu_alloc_dma_domain into fsl_pamu_domain_alloc

2021-04-01 Thread Christoph Hellwig
Keep the functionality to allocate the domain together. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 34 ++--- 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/drivers/iommu

[PATCH 05/20] iommu/fsl_pamu: remove support for multiple windows

2021-04-01 Thread Christoph Hellwig
The only domains allocated forces use of a single window. Remove all the code related to multiple window support, as well as the need for qman_portal to force a single window. Remove the now unused DOMAIN_ATTR_WINDOWS iommu_attr. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Acked-by

[PATCH 12/20] iommu/fsl_pamu: remove the rpn and snoop_id arguments to pamu_config_ppaac

2021-04-01 Thread Christoph Hellwig
These are always wired to fixed values, so don't bother passing them as arguments. Signed-off-by: Christoph Hellwig --- drivers/iommu/fsl_pamu.c| 14 +++--- drivers/iommu/fsl_pamu.h| 3 +-- drivers/iommu/fsl_pamu_domain.c | 6 +++--- 3 files changed, 7 inser

[PATCH 02/20] iommu/fsl_pamu: remove fsl_pamu_get_domain_attr

2021-04-01 Thread Christoph Hellwig
None of the values returned by this function are ever queried. Also remove the DOMAIN_ATTR_FSL_PAMUV1 enum value that is not otherwise used. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 30

[PATCH 15/20] iommu: remove DOMAIN_ATTR_GEOMETRY

2021-04-01 Thread Christoph Hellwig
The geometry information can be trivially queried from the iommu_domain struture. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Acked-by: Li Yang --- drivers/iommu/iommu.c | 20 +++- drivers/vfio/vfio_iommu_type1.c | 26 -- drivers

[PATCH 01/20] iommu: remove the unused domain_window_disable method

2021-04-01 Thread Christoph Hellwig
domain_window_disable is wired up by fsl_pamu, but never actually called. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 48 - include/linux/iommu.h | 2 -- 2 files changed, 50 deletions

Re: [PATCH 16/18] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-04-01 Thread Christoph Hellwig
For now I'll just pass the iommu_domain to iommu_get_dma_strict, so that we can check for it. We can do additional cleanups on top of that later.

Re: [PATCH 11/18] iommu/fsl_pamu: remove the snoop_id field

2021-04-01 Thread Christoph Hellwig
On Tue, Mar 30, 2021 at 01:58:17PM +0100, Will Deacon wrote: > pamu_config_ppaace() takes quite a few useless parameters at this stage, > but anyway: I'll see it it makes sense to throw in another patch at the end to cut it down a bit more. > Acked-by: Will Deacon > > Do you know if this driver

Re: [PATCH 08/18] iommu/fsl_pamu: merge pamu_set_liodn and map_liodn

2021-04-01 Thread Christoph Hellwig
On Tue, Mar 30, 2021 at 01:46:51PM +0100, Will Deacon wrote: > > + ret = pamu_config_ppaace(liodn, geom->aperture_start, > > +geom->aperture_end - 1, ~(u32)0, > > +0, dma_domain->snoop_id, dma_domain->stash_id, > > +

Re: [PATCH 06/18] iommu/fsl_pamu: remove ->domain_window_enable

2021-04-01 Thread Christoph Hellwig
On Tue, Mar 30, 2021 at 01:40:09PM +0100, Will Deacon wrote: > > + ret = pamu_config_ppaace(liodn, geom->aperture_start, > > +geom->aperture_end - 1, ~(u32)0, > > You're passing 'geom->aperture_end - 1' as the size here, but the old code > seemed to _add_ 1: > > > -

Re: [PATCH 05/18] iommu/fsl_pamu: remove support for multiple windows

2021-04-01 Thread Christoph Hellwig
On Tue, Mar 30, 2021 at 01:22:34PM +0100, Will Deacon wrote: > > * win_arr contains information of the configured > > * windows for a domain. This is allocated only > > * when the number of windows for the domain are > > * set. > > */ > > The last part of this comment is n

Re: [PATCH v5 01/11] file: Export __receive_fd() to modules

2021-03-25 Thread Christoph Hellwig
On Mon, Mar 15, 2021 at 05:46:43PM +0800, Yongji Xie wrote: > On Mon, Mar 15, 2021 at 5:08 PM Christoph Hellwig wrote: > > > > On Mon, Mar 15, 2021 at 01:37:11PM +0800, Xie Yongji wrote: > > > Export __receive_fd() so that some modules can use > > > it to pass

Re: [PATCH 15/17] iommu: remove DOMAIN_ATTR_NESTING

2021-03-24 Thread Christoph Hellwig
On Thu, Mar 25, 2021 at 06:12:37AM +, Tian, Kevin wrote: > Agree. The vSVA series is still undergoing a refactor according to Jason's > comment thus won't be ready in short term. It's better to let this one > go in first. Would be great to get a few more reviews while we're at it :)

Re: [PATCH next-queue v3 1/3] Revert "PCI: Make pci_enable_ptm() private"

2021-03-23 Thread Christoph Hellwig
On Tue, Mar 23, 2021 at 11:40:11AM -0700, Vinicius Costa Gomes wrote: > > Without an EXPORT_SYMBOL_GPL this is not going to be very useful for > > your driver. > > Unless I am missing something here, the commit that made > 'pci_enable_ptm()' private didn't remove the 'EXPORT_SYMBOL' from the > fun

Re: [PATCH next-queue v3 1/3] Revert "PCI: Make pci_enable_ptm() private"

2021-03-23 Thread Christoph Hellwig
On Mon, Mar 22, 2021 at 09:18:20AM -0700, Vinicius Costa Gomes wrote: > Make pci_enable_ptm() accessible from the drivers. > > Even if PTM still works on the platform I am using without calling > this function, it might be possible that it's not always the case. > > Exposing this to the driver en

[PATCH 18/18] iommu: remove iommu_domain_{get,set}_attr

2021-03-16 Thread Christoph Hellwig
Remove the now unused iommu attr infrastructure. Signed-off-by: Christoph Hellwig --- drivers/iommu/iommu.c | 26 -- include/linux/iommu.h | 36 2 files changed, 62 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu

[PATCH 17/18] iommu: remove DOMAIN_ATTR_IO_PGTABLE_CFG

2021-03-16 Thread Christoph Hellwig
Use an explicit set_pgtable_quirks method instead that just passes the actual quirk bitmask instead. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 5 +- drivers/iommu/arm/arm-smmu/arm-smmu.c | 64 + drivers/iommu/arm

[PATCH 16/18] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-03-16 Thread Christoph Hellwig
flushing a new IOMMU_CMD_LINE_STRICT is used to turn the value into a tristate to represent the default if not overriden by an explicit parameter. Signed-off-by: Robin Murphy . [ported on top of the other iommu_attr changes and added a few small missing bits] Signed-off-by: Christoph Hellwig

[PATCH 15/18] iommu: remove iommu_set_cmd_line_dma_api and iommu_cmd_line_dma_api

2021-03-16 Thread Christoph Hellwig
Don't obsfucate the trivial bit flag check. Signed-off-by: Christoph Hellwig --- drivers/iommu/iommu.c | 23 +-- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 58d1d11a8d5c10..052cef11ae30df 100644

[PATCH 14/18] iommu: remove DOMAIN_ATTR_NESTING

2021-03-16 Thread Christoph Hellwig
Use an explicit enable_nesting method instead. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 43 - drivers/iommu/arm/arm-smmu/arm-smmu.c | 30 +++--- drivers/iommu/intel/iommu.c | 31

[PATCH 13/18] iommu: remove DOMAIN_ATTR_GEOMETRY

2021-03-16 Thread Christoph Hellwig
The geometry information can be trivially queried from the iommu_domain struture. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/iommu/iommu.c | 20 +++- drivers/vfio/vfio_iommu_type1.c | 26 -- drivers/vhost/vdpa.c

[PATCH 12/18] iommu: remove DOMAIN_ATTR_PAGING

2021-03-16 Thread Christoph Hellwig
DOMAIN_ATTR_PAGING is never used. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/iommu/iommu.c | 5 - include/linux/iommu.h | 1 - 2 files changed, 6 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index b212bf0261820b..9a4cda390993e6 100644 --- a

[PATCH 11/18] iommu/fsl_pamu: remove the snoop_id field

2021-03-16 Thread Christoph Hellwig
The snoop_id is always set to ~(u32)0. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 5 ++--- drivers/iommu/fsl_pamu_domain.h | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu

[PATCH 10/18] iommu/fsl_pamu: enable the liodn when attaching a device

2021-03-16 Thread Christoph Hellwig
Instead of a separate call to enable all devices from the list, just enablde the liodn one the device is attached to the iommu domain. This also remove the DOMAIN_ATTR_FSL_PAMU_ENABLE iommu_attr. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 47

[PATCH 09/18] iommu/fsl_pamu: merge handle_attach_device into fsl_pamu_attach_device

2021-03-16 Thread Christoph Hellwig
No good reason to split this functionality over two functions. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 59 +++-- 1 file changed, 20 insertions(+), 39 deletions(-) diff --git a/drivers/iommu/fsl_pamu_domain.c b

[PATCH 08/18] iommu/fsl_pamu: merge pamu_set_liodn and map_liodn

2021-03-16 Thread Christoph Hellwig
Merge the two fuctions that configure the ppaace into a single coherent function. I somehow doubt we need the two pamu_config_ppaace calls, but keep the existing behavior just to be on the safe side. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 65

[PATCH 07/18] iommu/fsl_pamu: replace DOMAIN_ATTR_FSL_PAMU_STASH with a direct call

2021-03-16 Thread Christoph Hellwig
Add a fsl_pamu_configure_l1_stash API that qman_portal can call directly instead of indirecting through the iommu attr API. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- arch/powerpc/include/asm/fsl_pamu_stash.h | 12 +++- drivers/iommu/fsl_pamu_domain.c | 16

[PATCH 06/18] iommu/fsl_pamu: remove ->domain_window_enable

2021-03-16 Thread Christoph Hellwig
use the iommu_domain_geometry structure instead. Remove the now unused ->domain_window_enable iommu method. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 182 +++- drivers/iommu/fsl_pamu_domain.h | 17 --- drivers/io

[PATCH 05/18] iommu/fsl_pamu: remove support for multiple windows

2021-03-16 Thread Christoph Hellwig
The only domains allocated forces use of a single window. Remove all the code related to multiple window support, as well as the need for qman_portal to force a single window. Remove the now unused DOMAIN_ATTR_WINDOWS iommu_attr. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers

[PATCH 04/18] iommu/fsl_pamu: merge iommu_alloc_dma_domain into fsl_pamu_domain_alloc

2021-03-16 Thread Christoph Hellwig
Keep the functionality to allocate the domain together. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 34 ++--- 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu

[PATCH 02/18] iommu/fsl_pamu: remove fsl_pamu_get_domain_attr

2021-03-16 Thread Christoph Hellwig
None of the values returned by this function are ever queried. Also remove the DOMAIN_ATTR_FSL_PAMUV1 enum value that is not otherwise used. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 30 -- include/linux/iommu.h

[PATCH 01/18] iommu: remove the unused domain_window_disable method

2021-03-16 Thread Christoph Hellwig
domain_window_disable is wired up by fsl_pamu, but never actually called. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 48 - include/linux/iommu.h | 2 -- 2 files changed, 50 deletions(-) diff --git a

cleanup unused or almost unused IOMMU APIs and the FSL PAMU driver v2

2021-03-16 Thread Christoph Hellwig
Hi all, there are a bunch of IOMMU APIs that are entirely unused, or only used as a private communication channel between the FSL PAMU driver and it's only consumer, the qbman portal driver. So this series drops a huge chunk of entirely unused FSL PAMU functionality, then drops all kinds of unuse

[PATCH 03/18] iommu/fsl_pamu: remove support for setting DOMAIN_ATTR_GEOMETRY

2021-03-16 Thread Christoph Hellwig
The default geometry is the same as the one set by qman_port given that FSL_PAMU depends on having 64-bit physical and thus DMA addresses. Remove the support to update the geometry and remove the now pointless geom_size field. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers

Re: [PATCH v5 01/11] file: Export __receive_fd() to modules

2021-03-15 Thread Christoph Hellwig
On Mon, Mar 15, 2021 at 01:37:11PM +0800, Xie Yongji wrote: > Export __receive_fd() so that some modules can use > it to pass file descriptor between processes. I really don't think any non-core code should do that, especilly not modular mere driver code.

Re: [PATCH 14/17] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-03-15 Thread Christoph Hellwig
On Fri, Mar 12, 2021 at 04:18:24PM +, Robin Murphy wrote: >> Let me know what you think of the version here: >> >> http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/iommu-cleanup >> >> I'll happily switch the patch to you as the author if you're fine with >> that as well. > > I st

Re: [PATCH 15/17] iommu: remove DOMAIN_ATTR_NESTING

2021-03-14 Thread Christoph Hellwig
On Sun, Mar 14, 2021 at 11:44:52AM +0100, Auger Eric wrote: > As mentionned by Robin, there are series planning to use > DOMAIN_ATTR_NESTING to get info about the nested caps of the iommu (ARM > and Intel): > > [Patch v8 00/10] vfio: expose virtual Shared Virtual Addressing to VMs > patches 1, 2,

Re: [PATCH 14/17] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-03-11 Thread Christoph Hellwig
On Wed, Mar 10, 2021 at 06:39:57PM +, Robin Murphy wrote: >> Actually... Just mirroring the iommu_dma_strict value into >> struct iommu_domain should solve all of that with very little >> boilerplate code. > > Yes, my initial thought was to directly replace the attribute with a > common flag at

module refcount issues in the liquidio driver

2021-03-10 Thread Christoph Hellwig
Hi all, I just stumbled over the odd handling of module refcounts in the liquidio driver. The big red flag is the call to module_refcount in liquidio_watchdog, which will do the wrong thing for any external module refcount, like a userspace open. But more importantly the whole concept of acquiri

Re: [PATCH 14/17] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-03-10 Thread Christoph Hellwig
On Wed, Mar 10, 2021 at 10:15:01AM +0100, Christoph Hellwig wrote: > On Thu, Mar 04, 2021 at 03:25:27PM +, Robin Murphy wrote: > > On 2021-03-01 08:42, Christoph Hellwig wrote: > >> Use explicit methods for setting and querying the information instead. > > > > N

Re: [PATCH 14/17] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-03-10 Thread Christoph Hellwig
On Thu, Mar 04, 2021 at 03:25:27PM +, Robin Murphy wrote: > On 2021-03-01 08:42, Christoph Hellwig wrote: >> Use explicit methods for setting and querying the information instead. > > Now that everyone's using iommu-dma, is there any point in bouncing this > through th

Re: [Freedreno] [PATCH 16/17] iommu: remove DOMAIN_ATTR_IO_PGTABLE_CFG

2021-03-10 Thread Christoph Hellwig
On Fri, Mar 05, 2021 at 10:00:12AM +, Will Deacon wrote: > > But one thing I'm not sure about is whether > > IO_PGTABLE_QUIRK_ARM_OUTER_WBWA is something that other devices > > *should* be using as well, but just haven't gotten around to yet. > > The intention is certainly that this would be a

Re: [PATCH 14/17] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-03-10 Thread Christoph Hellwig
On Thu, Mar 04, 2021 at 03:25:27PM +, Robin Murphy wrote: > On 2021-03-01 08:42, Christoph Hellwig wrote: >> Use explicit methods for setting and querying the information instead. > > Now that everyone's using iommu-dma, is there any point in bouncing this > through th

Re: [PATCH 2/5] mm/page_alloc: Add a bulk page allocator

2021-03-09 Thread Christoph Hellwig
Would vmalloc be another good user of this API? > + /* May set ALLOC_NOFRAGMENT, fragmentation will return 1 page. */ > + if (!prepare_alloc_pages(gfp_mask, 0, preferred_nid, nodemask, &ac, > &alloc_mask, &alloc_flags)) This crazy long line is really hard to follow. > + ret

[PATCH 16/17] iommu: remove DOMAIN_ATTR_IO_PGTABLE_CFG

2021-03-01 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 2 +- drivers/iommu/arm/arm-smmu/arm-smmu.c | 40 +++-- drivers/iommu/iommu.c | 9 ++ include/linux/iommu.h | 9 +- 4 files changed, 29 insertions

[PATCH 14/17] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-03-01 Thread Christoph Hellwig
Use explicit methods for setting and querying the information instead. Also remove the now unused iommu_domain_get_attr functionality. Signed-off-by: Christoph Hellwig --- drivers/iommu/amd/iommu.c | 23 ++--- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 47

[PATCH 13/17] iommu: remove DOMAIN_ATTR_GEOMETRY

2021-03-01 Thread Christoph Hellwig
The geometry information can be trivially queried from the iommu_domain struture. Signed-off-by: Christoph Hellwig --- drivers/iommu/iommu.c | 20 +++- drivers/soc/fsl/qbman/qman_portal.c | 1 + drivers/vfio/vfio_iommu_type1.c | 26

[PATCH 15/17] iommu: remove DOMAIN_ATTR_NESTING

2021-03-01 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 40 ++--- drivers/iommu/arm/arm-smmu/arm-smmu.c | 30 ++-- drivers/iommu/intel/iommu.c | 28 +-- drivers/iommu/iommu.c | 8

[PATCH 17/17] iommu: remove iommu_domain_set_attr

2021-03-01 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- drivers/iommu/iommu.c | 17 - include/linux/iommu.h | 27 --- 2 files changed, 44 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 8490aefd4b41f8..b04e6cefe8520d 100644 --- a/drivers/iommu

[PATCH 11/17] iommu/fsl_pamu: remove the snoop_id field

2021-03-01 Thread Christoph Hellwig
The snoop_id is always set to ~(u32)0. Signed-off-by: Christoph Hellwig --- drivers/iommu/fsl_pamu_domain.c | 5 ++--- drivers/iommu/fsl_pamu_domain.h | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c index

[PATCH 12/17] iommu: remove DOMAIN_ATTR_PAGING

2021-03-01 Thread Christoph Hellwig
DOMAIN_ATTR_PAGING is never used. Signed-off-by: Christoph Hellwig --- drivers/iommu/iommu.c | 5 - include/linux/iommu.h | 1 - 2 files changed, 6 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index b212bf0261820b..9a4cda390993e6 100644 --- a/drivers/iommu

[PATCH 09/17] iommu/fsl_pamu: merge handle_attach_device into fsl_pamu_attach_device

2021-03-01 Thread Christoph Hellwig
No good reason to split this functionality over two functions. Signed-off-by: Christoph Hellwig --- drivers/iommu/fsl_pamu_domain.c | 59 +++-- 1 file changed, 20 insertions(+), 39 deletions(-) diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu

[PATCH 10/17] iommu/fsl_pamu: enable the liodn when attaching a device

2021-03-01 Thread Christoph Hellwig
Instead of a separate call to enable all devices from the list, just enablde the liodn one the device is attached to the iommu domain. This also remove the DOMAIN_ATTR_FSL_PAMU_ENABLE iommu_attr. Signed-off-by: Christoph Hellwig --- drivers/iommu/fsl_pamu_domain.c | 47

[PATCH 08/17] iommu/fsl_pamu: merge pamu_set_liodn and map_liodn

2021-03-01 Thread Christoph Hellwig
Merge the two fuctions that configure the ppaace into a single coherent function. I somehow doubt we need the two pamu_config_ppaace calls, but keep the existing behavior just to be on the safe side. Signed-off-by: Christoph Hellwig --- drivers/iommu/fsl_pamu_domain.c | 65

[PATCH 07/17] iommu/fsl_pamu: replace DOMAIN_ATTR_FSL_PAMU_STASH with a direct call

2021-03-01 Thread Christoph Hellwig
Add a fsl_pamu_configure_l1_stash API that qman_portal can call directly instead of indirecting through the iommu attr API. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/fsl_pamu_stash.h | 12 +++- drivers/iommu/fsl_pamu_domain.c | 16 +++- drivers

[PATCH 06/17] iommu/fsl_pamu: remove ->domain_window_enable

2021-03-01 Thread Christoph Hellwig
use the iommu_domain_geometry structure instead. Remove the now unused ->domain_window_enable iommu method. Signed-off-by: Christoph Hellwig --- drivers/iommu/fsl_pamu_domain.c | 182 +++- drivers/iommu/fsl_pamu_domain.h | 17 --- drivers/iommu/iomm

[PATCH 05/17] iommu/fsl_pamu: remove support for multiple windows

2021-03-01 Thread Christoph Hellwig
The only domains allocated forces use of a single window. Remove all the code related to multiple window support, as well as the need for qman_portal to force a single window. Remove the now unused DOMAIN_ATTR_WINDOWS iommu_attr. Signed-off-by: Christoph Hellwig --- drivers/iommu/fsl_pamu.c

[PATCH 03/17] iommu/fsl_pamu: remove support for setting DOMAIN_ATTR_GEOMETRY

2021-03-01 Thread Christoph Hellwig
The default geometry is the same as the one set by qman_port given that FSL_PAMU depends on having 64-bit physical and thus DMA addresses. Remove the support to update the geometry and remove the now pointless geom_size field. Signed-off-by: Christoph Hellwig --- drivers/iommu

[PATCH 04/17] iommu/fsl_pamu: merge iommu_alloc_dma_domain into fsl_pamu_domain_alloc

2021-03-01 Thread Christoph Hellwig
Keep the functionality to allocate the domain together. Signed-off-by: Christoph Hellwig --- drivers/iommu/fsl_pamu_domain.c | 34 ++--- 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c

[PATCH 01/17] iommu: remove the unused domain_window_disable method

2021-03-01 Thread Christoph Hellwig
domain_window_disable is wired up by fsl_pamu, but never actually called. Signed-off-by: Christoph Hellwig --- drivers/iommu/fsl_pamu_domain.c | 48 - include/linux/iommu.h | 2 -- 2 files changed, 50 deletions(-) diff --git a/drivers/iommu

[PATCH 02/17] iommu/fsl_pamu: remove fsl_pamu_get_domain_attr

2021-03-01 Thread Christoph Hellwig
None of the values returned by this function are ever queried. Also remove the DOMAIN_ATTR_FSL_PAMUV1 enum value that is not otherwise used. Signed-off-by: Christoph Hellwig --- drivers/iommu/fsl_pamu_domain.c | 30 -- include/linux/iommu.h | 4 2

cleanup unused or almost unused IOMMU APIs and the FSL PAMU driver

2021-03-01 Thread Christoph Hellwig
Hi all, there are a bunch of IOMMU APIs that are entirely unused, or only used as a private communication channel between the FSL PAMU driver and it's only consumer, the qbman portal driver. So this series drops a huge chunk of entirely unused FSL PAMU functionality, then drops all kinds of unuse

Re: [PATCH] kallsyms: make arch_get_kallsym static

2021-02-25 Thread Christoph Hellwig
On Thu, Feb 25, 2021 at 03:08:37PM +0800, Jiapeng Chong wrote: > Fix the following sparse warning: > > kernel/kallsyms.c:457:12: warning: symbol 'arch_get_kallsym' was not > declared. Should it be static? > > Reported-by: Abaci Robot > Signed-off-by: Jiapeng Chong Please just remove the functi

Re: [PATCH net-next v1 1/6] lan743x: boost performance on cpu archs w/o dma cache snooping

2021-02-05 Thread Christoph Hellwig
This is a pattern we've seen in a few other net driver, so we should be ok. It just is rather hairy and needs a good justification, which seems to be given here.

Re: [PATCH v3 net-next 01/21] iov_iter: Introduce new procedures for copy to iter/pages

2021-02-03 Thread Christoph Hellwig
On Tue, Feb 02, 2021 at 08:00:51PM +0200, Or Gerlitz wrote: > will look into this, any idea for a more suitable location? Maybe just a new file under lib/ for now? > > Overly long line. But we're also looking into generic helpers for > > this kind of things, not sure if they made it to linux-nex

Re: [PATCH v3 net-next 07/21] nvme-tcp: Add DDP data-path

2021-02-03 Thread Christoph Hellwig
On Wed, Feb 03, 2021 at 12:56:35AM -0800, Sagi Grimberg wrote: > >>> Given how much ddp code there is can you split it into a separate file? >> >> mmm, do we need to check the preferences or get to a consensus among >> the maintainers for that one? > > Not sure if moving it would be better here. Gi

Re: [PATCH v3 net-next 07/21] nvme-tcp: Add DDP data-path

2021-02-01 Thread Christoph Hellwig
Given how much ddp code there is can you split it into a separate file?

Re: [PATCH v3 net-next 06/21] nvme-tcp: Add DDP offload control path

2021-02-01 Thread Christoph Hellwig
> +static > +int nvme_tcp_offload_socket(struct nvme_tcp_queue *queue) Please use the same coding style as the rest of the file, and not some weirdo version.

Re: [PATCH v3 net-next 01/21] iov_iter: Introduce new procedures for copy to iter/pages

2021-02-01 Thread Christoph Hellwig
On Mon, Feb 01, 2021 at 12:04:49PM +0200, Boris Pismenny wrote: > +static __always_inline __must_check > +size_t ddp_copy_to_iter(const void *addr, size_t bytes, struct iov_iter *i) > +{ > + if (unlikely(!check_copy_size(addr, bytes, true))) > + return 0; > + else > +

Re: [PATCH net-next v4 0/4] remove compat_alloc_user_space()

2021-01-27 Thread Christoph Hellwig
Just curious: what is the status of the various compat_alloc_user_space removal patches? It would be great to kill the function off for good.

  1   2   3   4   5   6   7   8   9   10   >