Re: [PATCH v17 3/3] vfio/nvgrace-gpu: Add vfio pci variant module for grace hopper

2024-02-09 Thread Jason Gunthorpe
On Fri, Feb 09, 2024 at 08:55:31AM -0700, Alex Williamson wrote: > I think Kevin's point is also relative to this latter scenario, in the > L1 instance of the nvgrace-gpu driver the mmap of the usemem BAR is > cachable, but in the L2 instance of the driver where we only use the > vfio-pci-core ops

Re: [RFC v1 0/8] vhost-vdpa: add support for iommufd

2023-11-10 Thread Jason Gunthorpe
On Thu, Nov 09, 2023 at 06:48:46PM -0500, Michael S. Tsirkin wrote: > On Tue, Nov 07, 2023 at 11:52:17AM -0400, Jason Gunthorpe wrote: > > On Tue, Nov 07, 2023 at 09:30:21AM -0500, Michael S. Tsirkin wrote: > > > On Tue, Nov 07, 2023 at 10:12:37AM -0400, Jason Gunthorpe

Re: [PATCH for-next v3 4/7] RDMA/rxe: Add page invalidation support

2023-01-16 Thread Jason Gunthorpe
On Fri, Dec 23, 2022 at 03:51:55PM +0900, Daisuke Matsuda wrote: > +static bool rxe_ib_invalidate_range(struct mmu_interval_notifier *mni, > + const struct mmu_notifier_range *range, > + unsigned long cur_seq) > +{ > + struct

Re: [PATCH for-next v3 3/7] RDMA/rxe: Cleanup code for responder Atomic operations

2023-01-16 Thread Jason Gunthorpe
On Fri, Dec 23, 2022 at 03:51:54PM +0900, Daisuke Matsuda wrote: > @@ -733,60 +734,83 @@ static enum resp_states process_flush(struct rxe_qp *qp, > /* Guarantee atomicity of atomic operations at the machine level. */ > static DEFINE_SPINLOCK(atomic_ops_lock); > > -static enum resp_states

Re: [PATCH] mm: fix missing wake-up event for FSDAX pages

2022-07-21 Thread Jason Gunthorpe
On Mon, Jul 11, 2022 at 07:39:17PM -0700, Dan Williams wrote: > Muchun Song wrote: > > On Mon, Jul 04, 2022 at 11:38:16AM +0100, Matthew Wilcox wrote: > > > On Mon, Jul 04, 2022 at 03:40:54PM +0800, Muchun Song wrote: > > > > FSDAX page refcounts are 1-based, rather than 0-based: if refcount is >

Re: RDMA/rpma + fsdax(ext4) was broken since 36f30e486d

2021-08-27 Thread Jason Gunthorpe
On Fri, Aug 27, 2021 at 09:42:21AM -0700, Dan Williams wrote: > On Fri, Aug 27, 2021 at 6:05 AM Li, Zhijian wrote: > > > > > > on 2021/8/27 20:10, Jason Gunthorpe wrote: > > > On Fri, Aug 27, 2021 at 08:15:40AM +, lizhij...@fujitsu.com wrote: >

Re: RDMA/rpma + fsdax(ext4) was broken since 36f30e486d

2021-08-27 Thread Jason Gunthorpe
On Fri, Aug 27, 2021 at 09:05:21PM +0800, Li, Zhijian wrote: > > on 2021/8/27 20:10, Jason Gunthorpe wrote: > > On Fri, Aug 27, 2021 at 08:15:40AM +, lizhij...@fujitsu.com wrote: > > > i looked over the change-log of hmm_vma_handle_pte(), and found that > > >

Re: RDMA/rpma + fsdax(ext4) was broken since 36f30e486d

2021-08-27 Thread Jason Gunthorpe
On Fri, Aug 27, 2021 at 08:15:40AM +, lizhij...@fujitsu.com wrote: > i looked over the change-log of hmm_vma_handle_pte(), and found that before > 4055062 ("mm/hmm: add missing call to hmm_pte_need_fault in HMM_PFN_SPECIAL > handling") > > hmm_vma_handle_pte() will not check pte_special(pte)

Re: [RFC PATCH 2/3] vfio/hisilicon: register the driver to vfio

2021-04-20 Thread Jason Gunthorpe
On Tue, Apr 20, 2021 at 04:04:57PM -0600, Alex Williamson wrote: > > The migration control registers must be on a different VF from the VF > > being plugged into a guest and the two VFs have to be in different > > IOMMU groups to ensure they are isolated from each other. > > I think that's a

Re: [PATCH] RDMA/mlx4: remove an unused variable

2021-04-20 Thread Jason Gunthorpe
On Tue, Apr 20, 2021 at 05:28:33PM +0200, Christophe JAILLET wrote: > 'in6' is unused. It is just declared and filled-in. > It can be removed. > > This is a left over from commit 5ea8bbfc4929 > ("mlx4: Implement IP based gids support for RoCE/SRIOV") > > Signed-off-by: Christophe JAILLET > ---

Re: [PATCH] infiniband: ulp: Remove unnecessary struct declaration

2021-04-20 Thread Jason Gunthorpe
On Thu, Apr 15, 2021 at 05:21:16PM +0800, Wan Jiabing wrote: > struct ipoib_cm_tx is defined at 245th line. > And the definition is independent on the MACRO. > The declaration here is unnecessary. Remove it. > > Signed-off-by: Wan Jiabing > Reviewed-by: Christoph Lameter > --- >

Re: [RFC PATCH 2/3] vfio/hisilicon: register the driver to vfio

2021-04-20 Thread Jason Gunthorpe
On Tue, Apr 20, 2021 at 09:28:46PM +0800, liulongfang wrote: > >> So, I still don't understand what the security risk you are talking about > >> is, > >> and what do you think the security design should look like? > >> Can you elaborate on it? > > > > Each security domain must have its own PCI

Re: [RFC PATCH 2/3] vfio/hisilicon: register the driver to vfio

2021-04-20 Thread Jason Gunthorpe
On Tue, Apr 20, 2021 at 08:50:12PM +0800, liulongfang wrote: > On 2021/4/19 20:33, Jason Gunthorpe wrote: > > On Mon, Apr 19, 2021 at 08:24:40PM +0800, liulongfang wrote: > > > >>> I'm also confused how this works securely at all, as a general rule a > >>>

Re: KASAN: use-after-free Read in cma_cancel_operation, rdma_listen

2021-04-19 Thread Jason Gunthorpe
On Tue, Apr 13, 2021 at 10:19:25PM +0800, Hao Sun wrote: > Jason Gunthorpe 于2021年4月13日周二 下午9:45写道: > > > > On Tue, Apr 13, 2021 at 09:42:43PM +0800, Hao Sun wrote: > > > Jason Gunthorpe 于2021年4月13日周二 下午9:34写道: > > > > > > > > On Tue, Apr 13, 2021

Re: [RFC PATCH 2/3] vfio/hisilicon: register the driver to vfio

2021-04-19 Thread Jason Gunthorpe
On Mon, Apr 19, 2021 at 08:24:40PM +0800, liulongfang wrote: > > I'm also confused how this works securely at all, as a general rule a > > VFIO PCI driver cannot access the MMIO memory of the function it is > > planning to assign to the guest. There is a lot of danger that the > > guest could

Re: [PATCH] node: fix device cleanups in error handling code

2021-04-16 Thread Jason Gunthorpe
1 file changed, 12 insertions(+), 14 deletions(-) Wow, yikes, that "kfree_const(dev->kobj.name);" is really creative Reviewed-by: Jason Gunthorpe Though I dislike ignoring the error code from dev_set_name(), I think Greg would prefer this: diff --git a/drivers/base/node.c b/driv

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-16 Thread Jason Gunthorpe
On Fri, Apr 16, 2021 at 10:23:32AM -0700, Jacob Pan wrote: > Perhaps similar to cgroup v1 vs v2, it took a long time and with known > limitations in v1. cgroup v2 is still having transition problems, if anything it is a cautionary tale to think really hard about uAPI because transitioning can be

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-16 Thread Jason Gunthorpe
On Fri, Apr 16, 2021 at 04:26:19PM +0200, Auger Eric wrote: > This was largely done during several confs including plumber, KVM forum, > for several years. Also API docs were shared on the ML. I don't remember > any voice was raised at those moments. I don't think anyone objects to the high

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-16 Thread Jason Gunthorpe
On Fri, Apr 16, 2021 at 03:38:02PM +0200, Auger Eric wrote: > The redesign requirement came pretty late in the development process. > The iommu user API is upstream for a while, the VFIO interfaces have > been submitted a long time ago and under review for a bunch of time. > Redesigning

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-15 Thread Jason Gunthorpe
On Thu, Apr 15, 2021 at 03:11:19PM +0200, Auger Eric wrote: > Hi Jason, > > On 4/1/21 6:03 PM, Jason Gunthorpe wrote: > > On Thu, Apr 01, 2021 at 02:08:17PM +, Liu, Yi L wrote: > > > >> DMA page faults are delivered to root-complex via page request message and &

Re: [RFC PATCH 2/3] vfio/hisilicon: register the driver to vfio

2021-04-15 Thread Jason Gunthorpe
On Tue, Apr 13, 2021 at 11:36:22AM +0800, Longfang Liu wrote: > Register the live migration driver of the accelerator module to vfio > > Signed-off-by: Longfang Liu > drivers/vfio/pci/vfio_pci.c | 11 +++ > drivers/vfio/pci/vfio_pci_private.h | 9 + > 2 files changed,

Re: linux-next: manual merge of the vfio tree with the drm tree

2021-04-15 Thread Jason Gunthorpe
On Thu, Apr 15, 2021 at 04:47:34PM +1000, Stephen Rothwell wrote: > Hi all, > > Today's linux-next merge of the vfio tree got a conflict in: > > drivers/gpu/drm/i915/gvt/gvt.c > > between commit: > > 9ff06c385300 ("drm/i915/gvt: Remove references to struct drm_device.pdev") > > from the

Re: [PATCH 2/2] iommu/sva: Remove mm parameter from SVA bind API

2021-04-15 Thread Jason Gunthorpe
On Thu, Apr 15, 2021 at 01:33:24PM +0800, Lu Baolu wrote: > Hi Jason, > > On 4/14/21 7:26 PM, Jason Gunthorpe wrote: > > On Wed, Apr 14, 2021 at 02:22:09PM +0800, Lu Baolu wrote: > > > > > I still worry about supervisor pasid allocation. > > > > > &g

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

2021-04-14 Thread Jason Gunthorpe
On Wed, Apr 14, 2021 at 02:41:52PM +, David Laight wrote: > So whatever driver initialises the target needs to configure whatever > target-specific register enables the RO transfers themselves. RDMA in general, and mlx5 in particular, is a layered design: mlx5_core <- owns the PCI function,

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

2021-04-14 Thread Jason Gunthorpe
On Wed, Apr 14, 2021 at 10:16:28AM -0400, Tom Talpey wrote: > On 4/12/2021 6:48 PM, Jason Gunthorpe wrote: > > On Mon, Apr 12, 2021 at 04:20:47PM -0400, Tom Talpey wrote: > > > > > So the issue is only in testing all the providers and platforms, > > > to be sure

Re: [PATCH 2/2] iommu/sva: Remove mm parameter from SVA bind API

2021-04-14 Thread Jason Gunthorpe
On Wed, Apr 14, 2021 at 02:22:09PM +0800, Lu Baolu wrote: > I still worry about supervisor pasid allocation. > > If we use iommu_sva_alloc_pasid() to allocate a supervisor pasid, which > mm should the pasid be set? I've ever thought about passing _mm to > iommu_sva_alloc_pasid(). But if you add

Re: [syzbot] WARNING in unsafe_follow_pfn

2021-04-13 Thread Jason Gunthorpe
On Tue, Apr 13, 2021 at 07:20:12PM +0200, Dmitry Vyukov wrote: > > > Plus users are going to be seeing this as well. According to the commit > > > message for 69bacee7f9ad ("mm: Add unsafe_follow_pfn") "Unfortunately > > > there's some users where this is not fixable (like v4l userptr of iomem >

Re: [PATCH] RDMA/hw/qib/qib_iba7322: remove useless function

2021-04-13 Thread Jason Gunthorpe
On Tue, Apr 13, 2021 at 05:11:03PM +0800, Jiapeng Chong wrote: > Fix the following clang warning: > > drivers/infiniband/hw/qib/qib_iba7322.c:803:19: warning: unused function > 'qib_read_ureg' [-Wunused-function]. > > Reported-by: Abaci Robot > Signed-off-by: Jiapeng Chong > --- >

Re: [PATCH for-next v3 0/2] Introduce rdma_set_min_rnr_timer() and use it in RDS

2021-04-13 Thread Jason Gunthorpe
On Tue, Apr 13, 2021 at 09:29:41AM +0300, Leon Romanovsky wrote: > On Mon, Apr 12, 2021 at 07:58:47PM -0300, Jason Gunthorpe wrote: > > On Wed, Mar 31, 2021 at 08:43:12PM +0200, Håkon Bugge wrote: > > > ib_modify_qp() is an expensive operation on some HCAs running > > &g

Re: KASAN: use-after-free Read in cma_cancel_operation, rdma_listen

2021-04-13 Thread Jason Gunthorpe
On Tue, Apr 13, 2021 at 09:42:43PM +0800, Hao Sun wrote: > Jason Gunthorpe 于2021年4月13日周二 下午9:34写道: > > > > On Tue, Apr 13, 2021 at 11:36:41AM +0800, Hao Sun wrote: > > > Hi > > > > > > When using Healer(https://github.com/SunHao-0/healer/tree/dev) to fu

Re: [PATCH] nvme: Drop WQ_MEM_RECLAIM flag from core workqueues

2021-04-13 Thread Jason Gunthorpe
On Tue, Apr 13, 2021 at 10:54:04AM +0200, Daniel Wagner wrote: > Hmm, I am struggling with your last statement. If a worker does an > allocation it might block. I understand this is something which a worker > in a WQ_MEM_RECLAIM context is not allowed to do. > > My aim is still to get rid of the

Re: KASAN: use-after-free Read in cma_cancel_operation, rdma_listen

2021-04-13 Thread Jason Gunthorpe
On Tue, Apr 13, 2021 at 11:36:41AM +0800, Hao Sun wrote: > Hi > > When using Healer(https://github.com/SunHao-0/healer/tree/dev) to fuzz > the Linux kernel, I found two use-after-free bugs which have been > reported a long time ago by Syzbot. > Although the corresponding patches have been merged

Re: [PATCH for-next v3 0/2] Introduce rdma_set_min_rnr_timer() and use it in RDS

2021-04-12 Thread Jason Gunthorpe
On Wed, Mar 31, 2021 at 08:43:12PM +0200, Håkon Bugge wrote: > ib_modify_qp() is an expensive operation on some HCAs running > virtualized. This series removes two ib_modify_qp() calls from RDS. > > I am sending this as a v3, even though it is the first sent to > net. This because the IB Core

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

2021-04-12 Thread Jason Gunthorpe
On Mon, Apr 12, 2021 at 04:20:47PM -0400, Tom Talpey wrote: > So the issue is only in testing all the providers and platforms, > to be sure this new behavior isn't tickling anything that went > unnoticed all along, because no RDMA provider ever issued RO. The mlx5 ethernet driver has run in RO

Re: [PATCH for-next v3 0/2] Introduce rdma_set_min_rnr_timer() and use it in RDS

2021-04-12 Thread Jason Gunthorpe
On Mon, Apr 12, 2021 at 06:35:35PM +, Haakon Bugge wrote: > > > > On 7 Apr 2021, at 18:41, Haakon Bugge wrote: > > > > > > > >> On 1 Apr 2021, at 19:51, Jason Gunthorpe wrote: > >> > >> On Wed, Mar 31, 2021 at 07:54:17PM +,

Re: [PATCH -next] IB/hfi1: Fix error return code in parse_platform_config()

2021-04-12 Thread Jason Gunthorpe
On Thu, Apr 08, 2021 at 11:31:40AM +, Wang Wensheng wrote: > Fix to return a negative error code from the error handling > case instead of 0, as done elsewhere in this function. > > Fixes: 7724105686e7 ("IB/hfi1: add driver files") > Reported-by: Hulk Robot > Signed-off-by: Wang Wensheng >

Re: [PATCH -next] RDMA/bnxt_re: Fix error return code in bnxt_qplib_cq_process_terminal()

2021-04-12 Thread Jason Gunthorpe
On Thu, Apr 08, 2021 at 11:31:37AM +, Wang Wensheng wrote: > Fix to return a negative error code from the error handling > case instead of 0, as done elsewhere in this function. > > Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") > Reported-by: Hulk Robot > Signed-off-by: Wang

Re: [PATCH -next] RDMA/qedr: Fix error return code in qedr_iw_connect()

2021-04-12 Thread Jason Gunthorpe
On Thu, Apr 08, 2021 at 11:31:35AM +, Wang Wensheng wrote: > Fix to return a negative error code from the error handling > case instead of 0, as done elsewhere in this function. > > Fixes: 82af6d19d8d9 ("RDMA/qedr: Fix synchronization methods and memory leaks > in qedr") > Reported-by: Hulk

Re: [PATCH -next] RDMA/srpt: Fix error return code in srpt_cm_req_recv()

2021-04-12 Thread Jason Gunthorpe
On Thu, Apr 08, 2021 at 09:50:30AM -0700, Bart Van Assche wrote: > On 4/8/21 4:31 AM, Wang Wensheng wrote: > > Fix to return a negative error code from the error handling > > case instead of 0, as done elsewhere in this function. > > > > Fixes: db7683d7deb2 ("IB/srpt: Fix login-related race

Re: [PATCH] nvme: Drop WQ_MEM_RECLAIM flag from core workqueues

2021-04-12 Thread Jason Gunthorpe
On Mon, Apr 12, 2021 at 02:49:09PM +0200, Daniel Wagner wrote: > I've grepped through the code and didn't find anything which supports > the guarantee claim. Neither mm nor schedule seems to care about this > flag nor workqueue.c (except the early init bits). Or I must miss > something. It is

Re: [PATCH] nvme: Drop WQ_MEM_RECLAIM flag from core workqueues

2021-04-12 Thread Jason Gunthorpe
On Mon, Apr 12, 2021 at 02:23:30PM +0200, Daniel Wagner wrote: > Drop the WQ_MEM_RECLAIM flag as it is not needed and introduces > warnings. > > The documentation says "all wq which might be used in the memory > reclaim paths MUST have this flag set. The wq is guaranteed to have at > least one

Re: [PATCH] HSI: core: fix resource leaks in hsi_add_client_from_dt()

2021-04-09 Thread Jason Gunthorpe
() This movement looks OK though Reviewed-by: Jason Gunthorpe Jason

Re: [PATCH v1 01/14] vfio: Create vfio_fs_type with inode per device

2021-04-09 Thread Jason Gunthorpe
On Fri, Apr 09, 2021 at 08:24:00AM -0600, Alex Williamson wrote: > > > #define DRIVER_VERSION "0.3" > > > #define DRIVER_AUTHOR"Alex Williamson " > > > #define DRIVER_DESC "VFIO - User Level meta-driver" > > > > > > +#define VFIO_MAGIC 0x5646494f /* "VFIO" */ > > Move to

Re: linux-next: Signed-off-by missing for commit in the rdma tree

2021-04-09 Thread Jason Gunthorpe
On Fri, Apr 09, 2021 at 12:20:09PM -0400, Dennis Dalessandro wrote: > On 4/8/2021 6:00 PM, Stephen Rothwell wrote: > > Hi all, > > > > Commit > > > >042a00f93aad ("IB/{ipoib,hfi1}: Add a timeout handler for rdma_netdev") > > > > is missing a Signed-off-by from its author. > > Doh! That's

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

2021-04-09 Thread Jason Gunthorpe
On Fri, Apr 09, 2021 at 10:26:21AM -0400, Tom Talpey wrote: > My belief is that the biggest risk is from situations where completions > are batched, and therefore polling is used to detect them without > interrupts (which explicitly). We don't do this in the kernel. All kernel ULPs only read

[GIT PULL] Please pull RDMA subsystem changes

2021-04-08 Thread Jason Gunthorpe
Hi Linus, Nothing very exciting here, just a few small bug fixes. No red flags for this release have shown up. Thanks, Jason The following changes since commit a5e13c6df0e41702d2b2c77c8ad41677ebb065b3: Linux 5.12-rc5 (2021-03-28 15:48:16 -0700) are available in the Git repository at:

Re: [PATCH v1 2/2] drivers/gpu/drm: don't select DMA_CMA or CMA from aspeed or etnaviv

2021-04-08 Thread Jason Gunthorpe
On Thu, Apr 08, 2021 at 01:38:17PM +0200, Daniel Vetter wrote: > If you want to change this, we need automatic conflict resolution like apt > and other package managers have, with suggestions how to fix the config if > you want to enable a driver, but some of its requirements are missing. The >

Re: [PATCH rdma-next 4/8] IB/core: Skip device which doesn't have necessary capabilities

2021-04-08 Thread Jason Gunthorpe
On Wed, Apr 07, 2021 at 03:44:35PM +, Parav Pandit wrote: > > If it returns EOPNOTUPP then the remove is never called so if it allocated > > memory and left it allocated then it is leaking memory. > > > I probably confused you. There is no leak today because add_one > allocates memory, and

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-08 Thread Jason Gunthorpe
On Wed, Apr 07, 2021 at 11:50:02PM +, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Wednesday, April 7, 2021 8:21 PM > > > > On Wed, Apr 07, 2021 at 02:08:33AM +, Tian, Kevin wrote: > > > > > > Because if you don't then we

Re: [PATCH v3] IB/mlx5: Reduce max order of memory allocated for xlt update

2021-04-07 Thread Jason Gunthorpe
On Sat, Apr 03, 2021 at 04:53:55AM +, Praveen Kumar Kannoju wrote: > To update xlt (during mlx5_ib_reg_user_mr()), the driver can request up to > 1 MB (order-8) memory, depending on the size of the MR. This costly > allocation can sometimes take very long to return (a few seconds). This >

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-07 Thread Jason Gunthorpe
On Wed, Apr 07, 2021 at 08:43:50PM +0200, Jean-Philippe Brucker wrote: > * Get a container handle out of /dev/ioasid (or /dev/iommu, really.) > No operation available since we don't know what the device and IOMMU > capabilities are. > > * Attach the handle to a VF. With VFIO that would be >

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

2021-04-07 Thread Jason Gunthorpe
On Tue, Apr 06, 2021 at 04:54:57PM +0200, Christoph Hellwig wrote: > 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

Re: [PATCH rdma-next 4/8] IB/core: Skip device which doesn't have necessary capabilities

2021-04-07 Thread Jason Gunthorpe
On Wed, Apr 07, 2021 at 03:06:35PM +, Parav Pandit wrote: > > > > From: Jason Gunthorpe > > Sent: Tuesday, April 6, 2021 9:17 PM > > > > On Mon, Apr 05, 2021 at 08:49:56AM +0300, Leon Romanovsky wrote: > > > @@ -2293,6 +2295,17 @@ static v

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-07 Thread Jason Gunthorpe
On Wed, Apr 07, 2021 at 02:08:33AM +, Tian, Kevin wrote: > > Because if you don't then we enter insane world where a PASID is being > > created under /dev/ioasid but its translation path flows through setup > > done by VFIO and the whole user API becomes an incomprehensible mess. > > > > How

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-07 Thread Jason Gunthorpe
On Wed, Apr 07, 2021 at 08:17:50AM +, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Tuesday, April 6, 2021 8:43 PM > > > > On Tue, Apr 06, 2021 at 09:35:17AM +0800, Jason Wang wrote: > > > > > > VFIO and VDPA has no buisness having map/unma

Re: [PATCH v8 7/9] vfio/mdev: Add iommu related member in mdev_device

2021-04-07 Thread Jason Gunthorpe
On Wed, Apr 07, 2021 at 09:58:05AM +0800, Lu Baolu wrote: > I've ever tried to implement a bus iommu_ops for mdev devices. > > https://lore.kernel.org/lkml/20201030045809.957927-1-baolu...@linux.intel.com/ > > Any comments? You still have the symbol_get, so something continues to be wrong with

Re: [PATCH v8 7/9] vfio/mdev: Add iommu related member in mdev_device

2021-04-06 Thread Jason Gunthorpe
On Mon, Mar 25, 2019 at 09:30:34AM +0800, Lu Baolu wrote: > A parent device might create different types of mediated > devices. For example, a mediated device could be created > by the parent device with full isolation and protection > provided by the IOMMU. One usage case could be found on >

Re: [PATCH rdma-next 4/8] IB/core: Skip device which doesn't have necessary capabilities

2021-04-06 Thread Jason Gunthorpe
On Mon, Apr 05, 2021 at 08:49:56AM +0300, Leon Romanovsky wrote: > @@ -2293,6 +2295,17 @@ static void ib_sa_event(struct ib_event_handler > *handler, > } > } > > +static bool ib_sa_client_supported(struct ib_device *device) > +{ > + unsigned int i; > + > +

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

2021-04-06 Thread Jason Gunthorpe
On Tue, Apr 06, 2021 at 04:15:52PM +0200, Christoph Hellwig wrote: > 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 d

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

2021-04-06 Thread Jason Gunthorpe
On Tue, Apr 06, 2021 at 02:30:34PM +0200, Christoph Hellwig wrote: > 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

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-06 Thread Jason Gunthorpe
On Tue, Apr 06, 2021 at 09:35:17AM +0800, Jason Wang wrote: > > VFIO and VDPA has no buisness having map/unmap interfaces once we have > > /dev/ioasid. That all belongs in the iosaid side. > > > > I know they have those interfaces today, but that doesn't mean we have > > to keep using them for

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-06 Thread Jason Gunthorpe
On Tue, Apr 06, 2021 at 01:27:15AM +, Tian, Kevin wrote: > > and here is one example why using existing VFIO/VDPA interface makes > sense. say dev1 (w/ sva) and dev2 (w/o sva) are placed in a single VFIO > container. Forget about SVA, it is an irrelevant detail of how a PASID is

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-06 Thread Jason Gunthorpe
On Tue, Apr 06, 2021 at 01:02:05AM +, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Tuesday, April 6, 2021 7:40 AM > > > > On Fri, Apr 02, 2021 at 07:58:02AM +, Tian, Kevin wrote: > > > > From: Jason Gunthorpe > > > > Sent: Thursd

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-06 Thread Jason Gunthorpe
On Tue, Apr 06, 2021 at 12:37:35AM +, Tian, Kevin wrote: > With nested translation it is GVA->GPA->HPA. The kernel needs to > fix fault related to GPA->HPA (managed by VFIO/VDPA) while > handle_mm_fault only handles HVA->HPA. In this case, the 2nd-level > page fault is expected to be

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

2021-04-06 Thread Jason Gunthorpe
On Tue, Apr 06, 2021 at 08:58:54AM +0300, Leon Romanovsky wrote: > On Tue, Apr 06, 2021 at 07:27:17AM +0200, Christoph Hellwig wrote: > > On Tue, Apr 06, 2021 at 08:23:28AM +0300, Leon Romanovsky wrote: > > > The same proposal (enable unconditionally) was raised during > > > submission

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

2021-04-06 Thread Jason Gunthorpe
On Tue, Apr 06, 2021 at 08:09:43AM +0300, Leon Romanovsky wrote: > On Tue, Apr 06, 2021 at 10:37:38AM +0800, Honggang LI wrote: > > On Mon, Apr 05, 2021 at 08:23:54AM +0300, Leon Romanovsky wrote: > > > From: Leon Romanovsky > > > > > > From Avihai, > > > > > > Relaxed Ordering is a PCIe

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

2021-04-06 Thread Jason Gunthorpe
On Mon, Apr 05, 2021 at 11:42:31PM +, Chuck Lever III wrote: > We need to get a better idea what correctness testing has been done, > and whether positive correctness testing results can be replicated > on a variety of platforms. RO has been rolling out slowly on mlx5 over a few years and

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-05 Thread Jason Gunthorpe
On Fri, Apr 02, 2021 at 08:22:28AM +, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Tuesday, March 30, 2021 9:29 PM > > > > > > > > First, userspace may use ioasid in a non-SVA scenario where ioasid is > > > bound to specific securit

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-05 Thread Jason Gunthorpe
On Fri, Apr 02, 2021 at 07:58:02AM +, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Thursday, April 1, 2021 9:47 PM > > > > On Thu, Apr 01, 2021 at 01:43:36PM +, Liu, Yi L wrote: > > > > From: Jason Gunthorpe > > > > Sent: Thursd

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-05 Thread Jason Gunthorpe
On Fri, Apr 02, 2021 at 07:30:23AM +, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Friday, April 2, 2021 12:04 AM > > > > On Thu, Apr 01, 2021 at 02:08:17PM +, Liu, Yi L wrote: > > > > > DMA page faults are delivered t

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

2021-04-05 Thread Jason Gunthorpe
On Mon, Apr 05, 2021 at 03:41:15PM +0200, Christoph Hellwig wrote: > 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,

Re: CFI violation in drivers/infiniband/core/sysfs.c

2021-04-04 Thread Jason Gunthorpe
On Fri, Apr 02, 2021 at 06:29:55PM -0700, Kees Cook wrote: > On Fri, Apr 02, 2021 at 08:30:18PM -0300, Jason Gunthorpe wrote: > > On Fri, Apr 02, 2021 at 04:03:30PM -0700, Kees Cook wrote: > > > > > > relevant. It seems to me that the hw_counters 'struct attribute_gro

Re: CFI violation in drivers/infiniband/core/sysfs.c

2021-04-02 Thread Jason Gunthorpe
On Fri, Apr 02, 2021 at 04:03:30PM -0700, Kees Cook wrote: > > relevant. It seems to me that the hw_counters 'struct attribute_group' > > should probably be its own kobj within both of these structures so they > > can have their own sysfs ops (unless there is some other way to do this > > that I

Re: [PATCH -next] RDMA/uverbs: Fix -Wunused-function warning

2021-04-01 Thread Jason Gunthorpe
On Thu, Apr 01, 2021 at 10:10:28AM +0800, YueHaibing wrote: > make W=1 warns this: > > In file included from drivers/infiniband/sw/rdmavt/mmap.c:51:0: > ./include/rdma/uverbs_ioctl.h:937:1: > warning: ‘_uverbs_get_const_unsigned’ defined but not used > [-Wunused-function] >

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-01 Thread Jason Gunthorpe
On Thu, Apr 01, 2021 at 07:04:01AM +, Liu, Yi L wrote: > After reading your reply in > https://lore.kernel.org/linux-iommu/20210331123801.gd1463...@nvidia.com/#t > So you mean /dev/ioasid FD is per-VM instead of per-ioasid, so above skeleton > doesn't suit your idea. You can do it one PASID

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-01 Thread Jason Gunthorpe
On Thu, Apr 01, 2021 at 01:43:36PM +, Liu, Yi L wrote: > > From: Jason Gunthorpe > > Sent: Thursday, April 1, 2021 9:16 PM > > > > On Thu, Apr 01, 2021 at 01:10:48PM +, Liu, Yi L wrote: > > > > From: Jason Gunthorpe > > > > Sent: Thursda

Re: [PATCH -next] IB/srpt: Fix passing zero to 'PTR_ERR'

2021-04-01 Thread Jason Gunthorpe
On Wed, Mar 24, 2021 at 10:09:39PM +0800, YueHaibing wrote: > Fix smatch warning: > > drivers/infiniband/ulp/srpt/ib_srpt.c:2341 srpt_cm_req_recv() warn: passing > zero to 'PTR_ERR' > > Use PTR_ERR_OR_ZERO instead of PTR_ERR > > Fixes: 847462de3a0a ("IB/srpt: Fix srpt_cm_req_recv() error path

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-01 Thread Jason Gunthorpe
On Thu, Apr 01, 2021 at 01:10:48PM +, Liu, Yi L wrote: > > From: Jason Gunthorpe > > Sent: Thursday, April 1, 2021 7:47 PM > [...] > > I'm worried Intel views the only use of PASID in a guest is with > > ENQCMD, but that is not consistent with the industry. We ne

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-01 Thread Jason Gunthorpe
On Thu, Apr 01, 2021 at 01:38:46PM +, Liu, Yi L wrote: > > From: Jean-Philippe Brucker > > Sent: Thursday, April 1, 2021 8:05 PM > [...] > > > > Also wondering about: > > > > * Querying IOMMU nesting capabilities before binding page tables (which > > page table formats are supported?). We

Re: [bug report] node: Add memory-side caching attributes

2021-04-01 Thread Jason Gunthorpe
On Thu, Apr 01, 2021 at 05:06:52PM +0300, Dan Carpenter wrote: > > diff --git a/drivers/base/node.c b/drivers/base/node.c > > index f449dbb2c74666..89c28952863977 100644 > > +++ b/drivers/base/node.c > > @@ -319,25 +319,24 @@ void node_add_cache(unsigned int nid, struct > > node_cache_attrs

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-01 Thread Jason Gunthorpe
On Thu, Apr 01, 2021 at 02:05:00PM +0200, Jean-Philippe Brucker wrote: > On Thu, Apr 01, 2021 at 07:04:01AM +, Liu, Yi L wrote: > > > - how about AMD and ARM's vSVA support? Their PASID allocation and page > > > table > > > happens within guest. They only need to bind the guest PASID table

Re: [v2 PATCH] mm: gup: remove FOLL_SPLIT

2021-04-01 Thread Jason Gunthorpe
3 files changed, 2 insertions(+), 32 deletions(-) Reviewed-by: Jason Gunthorpe Jason

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-01 Thread Jason Gunthorpe
On Thu, Apr 01, 2021 at 10:23:55AM -0700, Jacob Pan wrote: > Hi Jason, > > On Wed, 31 Mar 2021 21:37:05 -0300, Jason Gunthorpe wrote: > > > On Wed, Mar 31, 2021 at 04:46:21PM -0700, Jacob Pan wrote: > > > Hi Jason, > > > > > > On Wed, 31 Mar 2021

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-01 Thread Jason Gunthorpe
On Thu, Apr 01, 2021 at 02:08:17PM +, Liu, Yi L wrote: > DMA page faults are delivered to root-complex via page request message and > it is per-device according to PCIe spec. Page request handling flow is: > > 1) iommu driver receives a page request from device > 2) iommu driver parses the

Re: [PATCH for-next v3 0/2] Introduce rdma_set_min_rnr_timer() and use it in RDS

2021-04-01 Thread Jason Gunthorpe
On Wed, Mar 31, 2021 at 07:54:17PM +, Santosh Shilimkar wrote: > [...] > > Thanks Haakon. Patchset looks fine by me. > Acked-by: Santosh Shilimkar Jakub/Dave are you OK if I take this RDS patch rdma to rdma's tree? Thanks, Jason

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-01 Thread Jason Gunthorpe
On Thu, Apr 01, 2021 at 04:38:44AM +, Liu, Yi L wrote: > > From: Jason Gunthorpe > > Sent: Wednesday, March 31, 2021 8:41 PM > > > > On Wed, Mar 31, 2021 at 07:38:36AM +, Liu, Yi L wrote: > > > > > The reason is /dev/ioasid FD is per-VM since the

Re: [PATCH v7 5/8] mm: Device exclusive memory access

2021-04-01 Thread Jason Gunthorpe
On Thu, Apr 01, 2021 at 01:20:05PM +1100, Alistair Popple wrote: > On Thursday, 1 April 2021 11:48:13 AM AEDT Jason Gunthorpe wrote: > > On Thu, Apr 01, 2021 at 11:45:57AM +1100, Alistair Popple wrote: > > > On Thursday, 1 April 2021 12:46:04 AM AEDT Jason Gunthorpe wrote: >

Re: [PATCH 8/9] vfio/pci: export nvlink2 support into vendor vfio_pci drivers

2021-04-01 Thread Jason Gunthorpe
On Mon, Mar 29, 2021 at 05:10:53PM -0600, Alex Williamson wrote: > On Tue, 23 Mar 2021 16:32:13 -0300 > Jason Gunthorpe wrote: > > > On Mon, Mar 22, 2021 at 10:40:16AM -0600, Alex Williamson wrote: > > > > > Of course if you start looking at features like migrat

Re: [bug report] node: Add memory-side caching attributes

2021-04-01 Thread Jason Gunthorpe
On Thu, Apr 01, 2021 at 12:00:39PM +0300, Dan Carpenter wrote: > Hi Keith, > > I've been trying to figure out ways Smatch can check for device managed > resources. Like adding rules that if we call dev_set_name(>bar) > then it's device managaged and if there is a kfree(foo) without calling >

Re: [PATCH v6 00/27] Memory Folios

2021-04-01 Thread Jason Gunthorpe
On Thu, Apr 01, 2021 at 01:52:01PM +0100, Matthew Wilcox wrote: > On Thu, Apr 01, 2021 at 09:28:03AM -0300, Jason Gunthorpe wrote: > > On Thu, Apr 01, 2021 at 12:26:56PM +0100, Matthew Wilcox wrote: > > > On Thu, Apr 01, 2021 at 08:05:37AM +0100, Christoph Hellwig wrote: >

Re: [syzbot] WARNING in unsafe_follow_pfn

2021-04-01 Thread Jason Gunthorpe
On Wed, Mar 31, 2021 at 07:29:22AM +0300, Dan Carpenter wrote: > On Tue, Mar 30, 2021 at 07:04:30PM +0200, Paolo Bonzini wrote: > > On 30/03/21 17:26, syzbot wrote: > > > Hello, > > > > > > syzbot found the following issue on: > > > > > > HEAD commit:93129492 Add linux-next specific files

Re: [PATCH v6 00/27] Memory Folios

2021-04-01 Thread Jason Gunthorpe
On Thu, Apr 01, 2021 at 12:26:56PM +0100, Matthew Wilcox wrote: > On Thu, Apr 01, 2021 at 08:05:37AM +0100, Christoph Hellwig wrote: > > On Wed, Mar 31, 2021 at 07:47:01PM +0100, Matthew Wilcox (Oracle) wrote: > > > - Mirror members of struct page (for pagecache / anon) into struct folio, > > >

Re: [PATCH v7 5/8] mm: Device exclusive memory access

2021-03-31 Thread Jason Gunthorpe
On Thu, Apr 01, 2021 at 11:45:57AM +1100, Alistair Popple wrote: > On Thursday, 1 April 2021 12:46:04 AM AEDT Jason Gunthorpe wrote: > > On Thu, Apr 01, 2021 at 12:27:52AM +1100, Alistair Popple wrote: > > > On Thursday, 1 April 2021 12:18:54 AM AEDT Jason Gunthorpe wrote: >

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-03-31 Thread Jason Gunthorpe
On Wed, Mar 31, 2021 at 04:46:21PM -0700, Jacob Pan wrote: > Hi Jason, > > On Wed, 31 Mar 2021 09:38:01 -0300, Jason Gunthorpe wrote: > > > > > Get rid of the ioasid set. > > > > > > > > Each driver has its own list of allowed ioasids. &

Re: [PATCH -next] RDMA/iw_cxgb4: Use DEFINE_SPINLOCK() for spinlock

2021-03-31 Thread Jason Gunthorpe
On Wed, Mar 31, 2021 at 10:01:05AM +0800, Tang Yizhou wrote: > spinlock can be initialized automatically with DEFINE_SPINLOCK() > rather than explicitly calling spin_lock_init(). > > Reported-by: Hulk Robot > Signed-off-by: Tang Yizhou > --- > drivers/infiniband/hw/cxgb4/cm.c | 3 +-- > 1 file

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-03-31 Thread Jason Gunthorpe
On Wed, Mar 31, 2021 at 11:20:30AM -0700, Jacob Pan wrote: > Hi Jason, > > On Wed, 31 Mar 2021 14:31:48 -0300, Jason Gunthorpe wrote: > > > > > We should try to avoid hidden behind the scenes kernel > > > > interconnections between subsystems. > >

Re: [PATCH v2] IB/mlx5: Reduce max order of memory allocated for xlt update

2021-03-31 Thread Jason Gunthorpe
On Thu, Mar 25, 2021 at 11:39:28AM -0300, Jason Gunthorpe wrote: > On Tue, Mar 23, 2021 at 09:27:38PM -0700, Aruna Ramakrishna wrote: > > > > Do you have benchmarks that show the performance of the high order > > > pages is not relavent? I'm a bit surprised to hear that &g

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-03-31 Thread Jason Gunthorpe
On Wed, Mar 31, 2021 at 09:34:57AM -0700, Jacob Pan wrote: > "3.3 PASID translation > To support PASID isolation for Shared Work Queues used by VMs, the CPU must > provide a way for the PASID to be communicated to the device in the DMWr > transaction. On Intel CPUs, the CPU provides a PASID

Re: [PATCH v3 3/4] cxl/mem: Do not rely on device_add() side effects for dev_set_name() failures

2021-03-31 Thread Jason Gunthorpe
On Wed, Mar 31, 2021 at 09:04:32AM -0700, Dan Williams wrote: > On Wed, Mar 31, 2021 at 6:10 AM Jason Gunthorpe wrote: > > > > On Tue, Mar 30, 2021 at 04:36:42PM -0700, Dan Williams wrote: > > > +static int cxl_mem_add_memdev(struct cxl_mem *cxlm) > > > +{ >

Re: [PATCH v7 5/8] mm: Device exclusive memory access

2021-03-31 Thread Jason Gunthorpe
On Thu, Apr 01, 2021 at 12:27:52AM +1100, Alistair Popple wrote: > On Thursday, 1 April 2021 12:18:54 AM AEDT Jason Gunthorpe wrote: > > On Wed, Mar 31, 2021 at 11:59:28PM +1100, Alistair Popple wrote: > > > > > I guess that makes sense as the split could go either way a

  1   2   3   4   5   6   7   8   9   10   >