Re: [PATCH] tpm: st33zp24: check if chip is null before dereferencing

2018-04-06 Thread Jason Gunthorpe
On Fri, Apr 06, 2018 at 05:05:41PM +0100, Colin King wrote: > From: Colin Ian King > > Currently chip is being dereferenced by the call to dev_get_drvdata > before it is being null checked, hence we have a potential null > pointer dereference bug. Fix this by only dereferencing it after the > nul

Re: [PATCH v4 1/6] RDMA/bnxt_re: Eliminate duplicate barriers on weakly-ordered archs

2018-03-20 Thread Jason Gunthorpe
On Mon, Mar 19, 2018 at 10:47:43PM -0400, Sinan Kaya wrote: > Code includes wmb() followed by writel(). writel() already has a barrier on > some architectures like arm64. > > This ends up CPU observing two barriers back to back before executing the > register write. > > Since code already has an

Re: [PATCH v4 2/6] IB/mlx4: Eliminate duplicate barriers on weakly-ordered archs

2018-03-20 Thread Jason Gunthorpe
e code already has an explicit barrier call, changing writel() to > writel_relaxed(). > > Signed-off-by: Sinan Kaya > --- > drivers/infiniband/hw/mlx4/qp.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Jason Gunthorpe > diff --git a/drivers/infin

Re: [PATCH v4 4/6] infiniband: cxgb4: Eliminate duplicate barriers on weakly-ordered archs

2018-03-20 Thread Jason Gunthorpe
On Mon, Mar 19, 2018 at 10:47:46PM -0400, Sinan Kaya wrote: > Code includes wmb() followed by writel(). writel() already has a barrier on > some architectures like arm64. > > This ends up CPU observing two barriers back to back before executing the > register write. > > Since code already has an

Re: [PATCH v4 5/6] IB/nes: Eliminate duplicate barriers on weakly-ordered archs

2018-03-20 Thread Jason Gunthorpe
On Mon, Mar 19, 2018 at 10:47:47PM -0400, Sinan Kaya wrote: > Code includes barrier() followed by writel(). writel() already has a > barrier on some architectures like arm64. > > This ends up CPU observing two barriers back to back before executing the > register write. > > Create a new wrapper f

Re: [PATCH v4 6/6] RDMA/qedr: eliminate duplicate barriers on weakly-ordered archs #2

2018-03-20 Thread Jason Gunthorpe
On Mon, Mar 19, 2018 at 10:47:48PM -0400, Sinan Kaya wrote: > Code includes wmb() followed by writel() in multiple places. writel() > already has a barrier on some architectures like arm64. > > This ends up CPU observing two barriers back to back before executing the > register write. > > Since c

Re: [PATCH v4 3/6] RDMA/i40iw: Eliminate duplicate barriers on weakly-ordered archs

2018-03-20 Thread Jason Gunthorpe
rl.c | 6 -- > drivers/infiniband/hw/i40iw/i40iw_osdep.h | 1 + > drivers/infiniband/hw/i40iw/i40iw_uk.c| 2 +- > drivers/infiniband/hw/i40iw/i40iw_utils.c | 11 +++ > 4 files changed, 17 insertions(+), 3 deletions(-) The one looks fine Reviewed-by: Jason Gunthorpe Jason

Re: [PATCH v4 1/6] RDMA/bnxt_re: Eliminate duplicate barriers on weakly-ordered archs

2018-03-20 Thread Jason Gunthorpe
On Tue, Mar 20, 2018 at 10:00:49AM -0500, Sinan Kaya wrote: > On 3/20/2018 9:48 AM, Jason Gunthorpe wrote: > > On Mon, Mar 19, 2018 at 10:47:43PM -0400, Sinan Kaya wrote: > >> Code includes wmb() followed by writel(). writel() already has a barrier on > >> so

Re: [PATCH v4 1/6] RDMA/bnxt_re: Eliminate duplicate barriers on weakly-ordered archs

2018-03-20 Thread Jason Gunthorpe
On Tue, Mar 20, 2018 at 10:08:16AM -0500, Sinan Kaya wrote: > Never mind, it will break some architectures. I'll only change the first one. > > (1) On some systems, I/O stores are not strongly ordered across all CPUs, and > so for _all_ general drivers locks should be used and mmiowb() must

Re: [PATCH v4 5/6] IB/nes: Eliminate duplicate barriers on weakly-ordered archs

2018-03-20 Thread Jason Gunthorpe
On Tue, Mar 20, 2018 at 10:23:16AM -0500, Sinan Kaya wrote: > On 3/20/2018 9:54 AM, Jason Gunthorpe wrote: > > On Mon, Mar 19, 2018 at 10:47:47PM -0400, Sinan Kaya wrote: > >> Code includes barrier() followed by writel(). writel() already has a > >> barrier on so

Re: [PATCH v4 1/6] RDMA/bnxt_re: Eliminate duplicate barriers on weakly-ordered archs

2018-03-20 Thread Jason Gunthorpe
On Tue, Mar 20, 2018 at 10:30:34AM -0500, Sinan Kaya wrote: > On 3/20/2018 10:20 AM, Jason Gunthorpe wrote: > > On Tue, Mar 20, 2018 at 10:00:49AM -0500, Sinan Kaya wrote: > >> On 3/20/2018 9:48 AM, Jason Gunthorpe wrote: > >>> On Mon, Mar 19, 2018 at 10:4

Re: [PATCH v4 5/6] IB/nes: Eliminate duplicate barriers on weakly-ordered archs

2018-03-20 Thread Jason Gunthorpe
On Tue, Mar 20, 2018 at 11:08:59AM -0500, Sinan Kaya wrote: > > In this case, I strongly suspect nes really intended to say wmb() > > Should I change barrier() to wmb() or leave it alone? I have no idea if > nes is actively being maintained or if it is EOL. It is dead, and the HW doesn't work o

[GIT PULL] Please pull RDMA subsystem changes

2018-03-20 Thread Jason Gunthorpe
Hi Linus, Fourth pull request for -rc. Not much exciting here, almost entirely syzkaller fixes. This is going to be on ongoing theme for some time, I think. Both Google and Mellanox are now running syzkaller on different parts of the user API. The following changes since commit 28e9091e3119933c3

Re: [PATCH v4 3/6] RDMA/i40iw: Eliminate duplicate barriers on weakly-ordered archs

2018-03-21 Thread Jason Gunthorpe
On Mon, Mar 19, 2018 at 10:47:45PM -0400, Sinan Kaya wrote: > diff --git a/drivers/infiniband/hw/i40iw/i40iw_uk.c > b/drivers/infiniband/hw/i40iw/i40iw_uk.c > index 8afa5a6..7f0ebed 100644 > +++ b/drivers/infiniband/hw/i40iw/i40iw_uk.c > @@ -723,7 +723,7 @@ static void i40iw_cq_request_notificatio

Re: [PATCH v4 4/6] infiniband: cxgb4: Eliminate duplicate barriers on weakly-ordered archs

2018-03-22 Thread Jason Gunthorpe
On Thu, Mar 22, 2018 at 10:28:13AM -0400, Sinan Kaya wrote: >On 03/22/2018 08:48 AM, [1]ok...@codeaurora.org wrote: > > Jason, > Can you remove the writeq change if it is too late for me to fix? > This is an infrastructural issue on xtensa arch. > Probably, it won't get fix

Re: [PATCH v4 4/6] infiniband: cxgb4: Eliminate duplicate barriers on weakly-ordered archs

2018-03-22 Thread Jason Gunthorpe
On Thu, Mar 22, 2018 at 08:48:35AM -0400, ok...@codeaurora.org wrote: > On 2018-03-22 08:24, ok...@codeaurora.org wrote: > >On 2018-03-22 02:44, kbuild test robot wrote: > >>Hi Sinan, > >> > >>Thank you for the patch! Yet something to improve: > >> > >>[auto build test ERROR on linus/master] > >>[a

Re: [PATCH v4 4/6] infiniband: cxgb4: Eliminate duplicate barriers on weakly-ordered archs

2018-03-22 Thread Jason Gunthorpe
On Thu, Mar 22, 2018 at 07:44:51PM +, Casey Leedom wrote: > | From: Steve Wise > | Sent: Thursday, March 22, 2018 9:28 AM > | > | | From: Sinan Kaya > | | Date: Thursday, March 22, 2018 7:52 AM > | | > | | Isn't this a PowerPC problem? Why penalize other architectures? > | > | I worry it bre

Re: [PATCH v4 4/6] infiniband: cxgb4: Eliminate duplicate barriers on weakly-ordered archs

2018-03-22 Thread Jason Gunthorpe
On Thu, Mar 22, 2018 at 08:45:11PM +, Casey Leedom wrote: > I'm guessing~ that this line in the documentation ~may~ imply the GCC > ordering: > > ... Note that relaxed accesses to > the same peripheral are guaranteed to be ordered with respect to each > other. ... An arch can'

Re: linux-next: manual merge of the net-next tree with the rdma-fixes tree

2018-03-22 Thread Jason Gunthorpe
On Fri, Mar 23, 2018 at 12:19:00AM -0400, David Miller wrote: > From: Doug Ledford > Date: Thu, 15 Mar 2018 21:18:02 -0400 > > > Here's the commit (from the rdma git repo) with the proper merge fix > > (although it also has other minor merge stuff that needs to be ignored): > > > > 2d873449a202

Re: [PATCH] net/mlx5: remove some extraneous spaces in indentations

2018-04-10 Thread Jason Gunthorpe
On Mon, Apr 09, 2018 at 01:43:36PM +0100, Colin Ian King wrote: > From: Colin Ian King > > There are several lines where there is an extraneous space causing > indentation misalignment. Remove them. > > Cleans up Cocconelle warnings: > > ./drivers/net/ethernet/mellanox/mlx5/core/qp.c:409:3-18:

Re: [PATCH] net/mlx5: remove some extraneous spaces in indentations

2018-04-10 Thread Jason Gunthorpe
On Tue, Apr 10, 2018 at 05:22:54PM -0600, Jason Gunthorpe wrote: > On Mon, Apr 09, 2018 at 01:43:36PM +0100, Colin Ian King wrote: > > From: Colin Ian King > > > > There are several lines where there is an extraneous space causing > > indentation misalignment. Remo

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

2018-03-08 Thread Jason Gunthorpe
On Thu, Mar 08, 2018 at 08:28:45AM -0500, Doug Ledford wrote: > Anyway, I've hand edited the mbox file and I pushed a rebased version of > my wip branch. However, during the night Jason must have moved my > wip/for-rc branch to the official for-rc because it's there now, so the > only way to fix

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

2018-03-08 Thread Jason Gunthorpe
On Thu, Mar 08, 2018 at 04:40:58PM +1100, Stephen Rothwell wrote: > Hi all, > > Commit > > aa0de36a40f4 ("RDMA/mlx5: Fix integer overflow while resizing CQ") > > is missing a Signed-off-by from its author. Thanks Stephen, May I suggest to the checkpatch maintainers that checkpack should look

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

2018-03-08 Thread Jason Gunthorpe
On Thu, Mar 08, 2018 at 08:39:38AM -0800, Joe Perches wrote: > On Thu, 2018-03-08 at 09:18 -0700, Jason Gunthorpe wrote: > > On Thu, Mar 08, 2018 at 04:40:58PM +1100, Stephen Rothwell wrote: > > > Hi all, > > > > > > Commit > > > > > >

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

2018-03-08 Thread Jason Gunthorpe
On Thu, Mar 08, 2018 at 09:23:12AM -0800, Joe Perches wrote: > On Thu, 2018-03-08 at 10:03 -0700, Jason Gunthorpe wrote: > > On Thu, Mar 08, 2018 at 08:39:38AM -0800, Joe Perches wrote: > > > On Thu, 2018-03-08 at 09:18 -0700, Jason Gunthorpe wrote: > > > > On Thu, Ma

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

2018-03-08 Thread Jason Gunthorpe
On Thu, Mar 08, 2018 at 04:01:11PM -0500, Doug Ledford wrote: > On Fri, 2018-03-09 at 07:51 +1100, Stephen Rothwell wrote: > > Hi all, > > > > Commits > > > > 63cf1a902c9d ("IB/srpt: Add RDMA/CM support") > > 86af61764151 ("IB/rxe: remove unnecessary skb_clone") > > 31f1bd14cbfe ("IB/rxe: r

Re: [PATCH 3/7] RDMA/qedr: eliminate duplicate barriers on weakly-ordered archs

2018-03-13 Thread Jason Gunthorpe
This is part of a series, should we take just this patch through the rdma tree? If not: Acked-by: Jason Gunthorpe Thanks, Jason

Re: [PATCH 0/4] IB: decrease large contigous allocation

2018-09-26 Thread Jason Gunthorpe
On Wed, Sep 26, 2018 at 06:48:09PM +0300, Jan Dakinevich wrote: > On Tue, 18 Sep 2018 08:46:23 -0600 > Jason Gunthorpe wrote: > > > On Tue, Sep 18, 2018 at 04:03:42PM +0300, Jan Dakinevich wrote: > > > The size of mlx4_ib_device became too large to be allocated as > &

Re: [PATCH] RDMA: fix dependencies for rdma_user_mmap_io

2018-09-26 Thread Jason Gunthorpe
On Wed, Sep 26, 2018 at 09:36:52PM +0200, Arnd Bergmann wrote: > The mlx4 driver produces a link error when it is configured > as built-in while CONFIG_INFINIBAND_USER_ACCESS is set to =m: > > drivers/infiniband/hw/mlx4/main.o: In function `mlx4_ib_mmap': > main.c:(.text+0x1af4): undefined referen

Re: [PATCH] IB/mthca: remove redundant inner check of mdev->mthca_flags

2018-09-26 Thread Jason Gunthorpe
On Wed, Sep 26, 2018 at 01:26:08PM +0100, Colin King wrote: > From: Colin Ian King > > The inner check for mdev->mthca_flags & MTHCA_FLAG_MSI_X is redundant > as this is already true because of the previous identical check in > an outer if statement. Remove it > > Detected by cppcheck: > (warni

Re: [PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-09-26 Thread Jason Gunthorpe
On Wed, Sep 26, 2018 at 06:08:03PM -0700, Nathan Chancellor wrote: > On Mon, Sep 24, 2018 at 08:37:22PM -0600, Jason Gunthorpe wrote: > > On Mon, Sep 24, 2018 at 03:29:38PM -0700, Nick Desaulniers wrote: > > > On Mon, Sep 24, 2018 at 3:27 PM Nathan Chancellor > > > wr

Re: [PATCH v2] IB/rxe: Avoid implicit enum conversions in rxe_init functions

2018-09-26 Thread Jason Gunthorpe
On Wed, Sep 26, 2018 at 10:01:57PM -0700, Nathan Chancellor wrote: > Clang warns when an emumerated type is implicitly converted to another. > > drivers/infiniband/sw/rxe/rxe.c:106:27: warning: implicit conversion > from enumeration type 'enum rxe_device_param' to different enumeration > type 'enu

Re: [PATCH] RDMA/ucontext: fix building with CONFIG_MMU=n

2018-09-27 Thread Jason Gunthorpe
On Thu, Sep 27, 2018 at 12:10:03PM +0200, Arnd Bergmann wrote: > The zap_vma_ptes() is declared but not defined on NOMMU kernels, > causing a link error for the newly added uverbs code: > > drivers/infiniband/core/uverbs_main.o: In function > `uverbs_user_mmap_disassociate': > uverbs_main.c:(.tex

[GIT PULL] Please pull RDMA subsystem changes

2018-09-27 Thread Jason Gunthorpe
Hi Greg, Second rc pull request This has a few fixes for smaller regressions introduced this cycle and the usual various driver oops fixes. There is one long standing race bug in the comp_channel that Steve was able to reproduce, track down and fix. I believe the HFI1 driver regression breakage

Re: [PATCH] RDMA/hns: fix spelling mistake "reseved" -> "reserved"

2018-09-27 Thread Jason Gunthorpe
On Thu, Sep 27, 2018 at 02:24:30PM +0100, Colin King wrote: > From: Colin Ian King > > Trivial fix to spelling mistake in dev_err error message > > Signed-off-by: Colin Ian King > --- > drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Appl

Re: [PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-09-27 Thread Jason Gunthorpe
On Thu, Sep 27, 2018 at 01:34:16PM -0700, Nick Desaulniers wrote: > > Neither ib_qp_create_flags nor mlx4_ib_qp_flags have negative values, is > > signedness necessary? > > enums are by default restricted to the range of ints. That's not quite right, the compiler sizes the enum to be able to fi

Re: [PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-09-27 Thread Jason Gunthorpe
On Thu, Sep 27, 2018 at 03:42:24PM -0700, Nick Desaulniers wrote: > On Thu, Sep 27, 2018 at 3:33 PM Bart Van Assche wrote: > > > > On Thu, 2018-09-27 at 16:28 -0600, Jason Gunthorpe wrote: > > > On Thu, Sep 27, 2018 at 01:34:16PM -0700, Nick Desaulniers wrote:

Re: [PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-09-27 Thread Jason Gunthorpe
On Thu, Sep 27, 2018 at 05:55:43PM -0700, Nick Desaulniers wrote: > On Thu, Sep 27, 2018 at 3:58 PM Jason Gunthorpe wrote: > > > > On Thu, Sep 27, 2018 at 03:42:24PM -0700, Nick Desaulniers wrote: > > > On Thu, Sep 27, 2018 at 3:33 PM Bart Van Assche > > > wrote

Re: [PATCH 3/4] infiniband/mm: convert to the new put_user_page() call

2018-09-28 Thread Jason Gunthorpe
;m told this code here is a big performance bottleneck when the number of pages becomes very long (think >> GB of memory), so having a future path to use some kind of batching/threading sound great. Otherwise this RDMA part seems fine to me, there might be some minor conflicts however. I assume you want to run this through the -mm tree? Acked-by: Jason Gunthorpe Jason

Re: [PATCH v2] RDMA/qedr: Remove enumerated type qed_roce_ll2_tx_dest

2018-09-28 Thread Jason Gunthorpe
On Thu, Sep 27, 2018 at 01:55:58PM -0700, Nathan Chancellor wrote: > Clang warns when one enumerated type is explicitly converted to another. > > drivers/infiniband/hw/qedr/qedr_roce_cm.c:198:28: warning: implicit > conversion from enumeration type 'enum qed_roce_ll2_tx_dest' to > different enumer

Re: [PATCH 3/4] infiniband/mm: convert to the new put_user_page() call

2018-09-29 Thread Jason Gunthorpe
On Sat, Sep 29, 2018 at 09:21:17AM -0700, Matthew Wilcox wrote: > On Fri, Sep 28, 2018 at 08:12:33PM -0700, John Hubbard wrote: > > >> +++ b/drivers/infiniband/core/umem.c > > >> @@ -60,7 +60,7 @@ static void __ib_umem_release(struct ib_device *dev, > > >> struct ib_umem *umem, int d > > >>

Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce

2018-11-23 Thread Jason Gunthorpe
On Fri, Nov 23, 2018 at 04:02:42PM +0800, Kenneth Lee wrote: > It is already part of Jean's patchset. And that's why I built my solution on > VFIO in the first place. But I think the concept of SVA and PASID is not > compatible with the original VFIO concept space. You would not share your > whol

Re: [PATCH rdma-next 0/3] RDMA/hns: Updates for reset process of roce device in hip08

2018-11-23 Thread Jason Gunthorpe
On Fri, Nov 23, 2018 at 11:14:22PM +0800, Wei Hu (Xavier) wrote: > Hi, Doug and Janson > > This series mainly include updates for reset process of roce device > in hip08. > One patch adds support for reset and loading or unloading driver occur > simultaneously to ensure work normally, one stops se

Re: [PATCH rdma-next 3/3] RDMA/hns: Modify hns RoCE device's name

2018-11-23 Thread Jason Gunthorpe
On Fri, Nov 23, 2018 at 11:14:25PM +0800, Wei Hu (Xavier) wrote: > This patch modifies the name of hns RoCE device's name in order > to ensure that the name is consistent before and after reset. > > Signed-off-by: Wei Hu (Xavier) > drivers/infiniband/hw/hns/hns_roce_device.h | 1 + > drivers/inf

Re: [PATCH rdma-next 3/3] RDMA/hns: Modify hns RoCE device's name

2018-11-25 Thread Jason Gunthorpe
On Sat, Nov 24, 2018 at 09:01:19PM +0800, Wei Hu (Xavier) wrote: > > > On 2018/11/24 4:39, Jason Gunthorpe wrote: > > On Fri, Nov 23, 2018 at 11:14:25PM +0800, Wei Hu (Xavier) wrote: > >> This patch modifies the name of hns RoCE device's name in order > >>

Re: [PATCH rdma-next 3/3] RDMA/hns: Modify hns RoCE device's name

2018-11-26 Thread Jason Gunthorpe
On Mon, Nov 26, 2018 at 04:34:10PM +0800, Wei Hu (Xavier) wrote: > > > On 2018/11/26 11:13, Jason Gunthorpe wrote: > > On Sat, Nov 24, 2018 at 09:01:19PM +0800, Wei Hu (Xavier) wrote: > >> > >> On 2018/11/24 4:39, Jason Gunthorpe wrote: > >>> On

Re: [PATCH] IB/qib: fix spelling mistake "colescing" -> "coalescing"

2018-11-26 Thread Jason Gunthorpe
On Mon, Nov 26, 2018 at 04:23:20PM +, Colin King wrote: > From: Colin Ian King > > There is a spelling mistake in the module description text, fix it. > > Signed-off-by: Colin Ian King > Reviewed-by: Dennis Dalessandro > --- > drivers/infiniband/hw/qib/qib_pcie.c | 2 +- > 1 file changed,

Re: [PATCH v9 05/17] tpm: declare struct tpm_header

2018-11-20 Thread Jason Gunthorpe
On Tue, Nov 20, 2018 at 03:08:05PM +0200, Jarkko Sakkinen wrote: > On Mon, Nov 19, 2018 at 09:33:31PM +, Winkler, Tomas wrote: > > > > > > > > Decleare struct tpm_header that replaces struct tpm_input_header and > > Typo > > Thanks, will fix for the next version. > > > > struct tpm_output_

Re: [PATCH] infiniband/hw/cxgb3/cxio_hal.c: Use dma_zalloc_coherent

2018-11-21 Thread Jason Gunthorpe
On Fri, Nov 09, 2018 at 10:20:29PM +0530, Sabyasachi Gupta wrote: > Replaced dma_alloc_coherent + memset with dma_zalloc_coherent > > Signed-off-by: Sabyasachi Gupta > Acked-by: Steve Wise > Acked-by: Steve Wise > --- > drivers/infiniband/hw/cxgb3/cxio_hal.c | 3 +-- > 1 file changed, 1 insert

Re: [PATCH] infiniband/hw/cxgb4/qp.c: Use dma_zalloc_coherent

2018-11-21 Thread Jason Gunthorpe
On Mon, Nov 12, 2018 at 08:51:59PM +0530, Sabyasachi Gupta wrote: > Replaced dma_alloc_coherent + memset with dma_zalloc_coherent > > Signed-off-by: Sabyasachi Gupta > Acked-by: Steve Wise > --- > drivers/infiniband/hw/cxgb4/qp.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) Applie

[GIT PULL] Please pull RDMA subsystem changes

2018-11-29 Thread Jason Gunthorpe
Hi Linus, First rc pull request This is a bit later than usual for our first -rc but I'm not seeing anything worry-some in the RDMA tree right now. Quiet so far this -rc cycle, only a few internal driver related bugs and a small series fixing ODP bugs found by more advanced testing. The followin

Re: [PATCH] RDMA/uverbs: fix ptr_ret.cocci warnings

2018-11-29 Thread Jason Gunthorpe
On Wed, Nov 28, 2018 at 07:21:30AM +0800, kbuild test robot wrote: > From: kbuild test robot > > drivers/infiniband/core/uverbs_cmd.c:1095:1-3: WARNING: PTR_ERR_OR_ZERO can > be used > > > Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR > > Generated by: scripts/coccinelle/api/ptr_

Re: [PATCH] IB/usnic: fix spelling mistake "miniumum" -> "minimum"

2018-11-29 Thread Jason Gunthorpe
On Thu, Nov 29, 2018 at 10:42:13AM +, Colin King wrote: > From: Colin Ian King > > There is a spelling mistake in a usnic_err error message, fix it. > > Signed-off-by: Colin Ian King > --- > drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(

Re: [PATCH] RDMA/drivers: fix spelling mistake "initalize" -> "initialize"

2018-11-29 Thread Jason Gunthorpe
On Wed, Nov 28, 2018 at 03:11:16PM +, Colin King wrote: > From: Colin Ian King > > Fix spelling mistake in usnic_err error message > > Signed-off-by: Colin Ian King > --- > drivers/infiniband/hw/usnic/usnic_ib_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied to for-n

Re: [PATCH v9 14/17] tpm: remove TPM_TRANSMIT_UNLOCKED flag

2018-11-18 Thread Jason Gunthorpe
On Sun, Nov 18, 2018 at 02:47:47PM +0200, Jarkko Sakkinen wrote: > Added locking as part of tpm_try_get_ops() and tpm_put_ops() as they are > anyway used in most of the call sites except in tpmrm_release() where we > take the locks manually. > > Signed-off-by: Jarkko Sakkinen > Reviewed-by: Stefa

Re: [PATCH v2 1/3] mm/mmu_notifier: use structure for invalidate_range_start/end callback

2018-12-06 Thread Jason Gunthorpe
21 ++-- > virt/kvm/kvm_main.c | 14 +++- > 12 files changed, 102 insertions(+), 113 deletions(-) The changes to drivers/infiniband look mechanical and fine to me. It even looks like this avoids merge conflicts with the other changes to these files :) For infiniband: Acked-by: Jason Gunthorpe I assume this will go through the mm tree? Jason

Re: [PATCH] RDMA/uverbs: fix ptr_ret.cocci warnings

2018-12-03 Thread Jason Gunthorpe
On Mon, Dec 03, 2018 at 12:23:35PM -0500, Doug Ledford wrote: > On Thu, 2018-11-29 at 16:37 -0700, Jason Gunthorpe wrote: > > On Wed, Nov 28, 2018 at 07:21:30AM +0800, kbuild test robot wrote: > > > From: kbuild test robot > > > > > > drivers/infiniband

Re: linux-next: build failure after merge of the rdma tree

2018-12-03 Thread Jason Gunthorpe
On Tue, Dec 04, 2018 at 11:47:31AM +1100, Stephen Rothwell wrote: > Hi all, > > After merging the rdma tree, today's linux-next build (x86_64 > allmodconfig) failed like this: > > ERROR: "mlx5_get_send_wqe" [drivers/infiniband/hw/mlx5/mlx5_ib.ko] undefined! > > Caused by commit > > 34f4c9554d

Re: [PATCH] tpm: require to compile as part of the kernel

2018-06-29 Thread Jason Gunthorpe
On Fri, Jun 29, 2018 at 06:10:02PM +0300, Jarkko Sakkinen wrote: > Do not allow to compile TPM core as a module. TPM defines a root of > trust for integrity and keyring subsystems and should be always > available and not be loaded from the user space. There is no a > reasonable use case for a loada

Re: [PATCH] tpm: require to compile as part of the kernel

2018-06-29 Thread Jason Gunthorpe
On Fri, Jun 29, 2018 at 08:47:43PM +0300, Jarkko Sakkinen wrote: > On Fri, Jun 29, 2018 at 09:31:41AM -0600, Jason Gunthorpe wrote: > > > -#if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE) > > > - > > > +#if defined(CONFIG_TCG_TPM) > > > >

Re: [PATCH] tpm: require to compile as part of the kernel

2018-06-29 Thread Jason Gunthorpe
On Fri, Jun 29, 2018 at 08:43:28PM +0300, Jarkko Sakkinen wrote: > On Fri, Jun 29, 2018 at 09:31:41AM -0600, Jason Gunthorpe wrote: > > On Fri, Jun 29, 2018 at 06:10:02PM +0300, Jarkko Sakkinen wrote: > > > Do not allow to compile TPM core as a module. TPM defines a root

Re: [PATCH] KASAN: use-after-free Read in rdma_listen

2018-07-06 Thread Jason Gunthorpe
On Sat, Jul 07, 2018 at 03:41:30AM +0200, Tomas Bortoli wrote: > I don't have a background on usage or internals of the driver at issue > but I hope these clues will help in finding the proper fix. I think anything is useful, thanks.. The truth is that nobody is left that seems to really understa

Re: [PATCH 1/2] mm: introduce put_user_page(), placeholder version

2018-07-09 Thread Jason Gunthorpe
On Mon, Jul 09, 2018 at 01:05:53AM -0700, john.hubb...@gmail.com wrote: > From: John Hubbard > > Introduces put_user_page(), which simply calls put_page(). > This provides a safe way to update all get_user_pages*() callers, > so that they call put_user_page(), instead of put_page(). > > Also add

Re: [PATCH] IB/cm: Remove unused and erroneous msg sequence encoding

2018-07-09 Thread Jason Gunthorpe
On Wed, Jul 04, 2018 at 12:48:01PM +0200, Håkon Bugge wrote: > In cm_form_tid(), a two bit message sequence number is OR'ed into bit > 31-30 of the lower TID value. > > After commit f06d26537559 ("IB/cm: Randomize starting comm ID"), the > local_id is XOR'ed with a 32-bit random value. Hence, bit

Re: [PATCH v2] IB/mlx5: fix uaccess beyond "count" in debugfs read/write handlers

2018-07-09 Thread Jason Gunthorpe
On Fri, Jul 06, 2018 at 10:48:03PM +0200, Jann Horn wrote: > In general, accessing userspace memory beyond the length of the supplied > buffer in VFS read/write handlers can lead to both kernel memory corruption > (via kernel_read()/kernel_write(), which can e.g. be triggered via > sys_splice()) an

Re: [PATCH 0/2] mm/fs: put_user_page() proposal

2018-07-09 Thread Jason Gunthorpe
On Mon, Jul 09, 2018 at 09:47:40PM +0200, Jan Kara wrote: > On Mon 09-07-18 10:16:51, Matthew Wilcox wrote: > > On Mon, Jul 09, 2018 at 06:08:06PM +0200, Jan Kara wrote: > > > On Mon 09-07-18 18:49:37, Nicholas Piggin wrote: > > > > The problem with blocking in clear_page_dirty_for_io is that the f

Re: [PATCH] ib_srpt: use kvmalloc to allocate ring pointers

2018-07-09 Thread Jason Gunthorpe
On Mon, Jul 09, 2018 at 04:51:08PM +0300, Jan Dakinevich wrote: > An array of pointers to SRPT contexts in ib_device is over 30KiB even > in default case, in which an amount of contexts is 4095. The patch > is intended to weed out large contigous allocation for non-DMA memory. > > Signed-off-by: J

Re: linux-next: build warnings after merge of the rdma tree

2018-07-09 Thread Jason Gunthorpe
On Tue, Jul 10, 2018 at 11:33:42AM +1000, Stephen Rothwell wrote: > Hi all, > > After merging the rdma tree, today's linux-next build (x86_64 > allmodconfig) produced these warnings: > > In file included from include/linux/printk.h:336:0, > from include/linux/kernel.h:14, >

Re: linux-next: build warnings after merge of the rdma tree

2018-07-09 Thread Jason Gunthorpe
On Tue, Jul 10, 2018 at 02:05:12PM +1000, Stephen Rothwell wrote: > Hi Jason, > > On Mon, 9 Jul 2018 21:41:57 -0600 Jason Gunthorpe wrote: > > > > What compiler is producing these? I got nothing from 0-day build > > service or my local gcc-7.. > > The x86 co

Re: [Patch v2 02/15] CIFS: Add support for direct pages in rdata

2018-06-25 Thread Jason Gunthorpe
On Sat, Jun 23, 2018 at 09:50:20PM -0400, Tom Talpey wrote: > On 5/30/2018 3:47 PM, Long Li wrote: > >From: Long Li > > > >Add a function to allocate rdata without allocating pages for data > >transfer. This gives the caller an option to pass a number of pages > >that point to the data buffer. > >

[PATCH RESEND] clang-format: Set IndentWrappedFunctionNames false

2018-06-25 Thread Jason Gunthorpe
kernel/fork.c etc Acked-by: Joe Perches Signed-off-by: Jason Gunthorpe --- .clang-format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Resending outside the merge window with no change.. If there is no clear upstream path for this file (it has no MAINTAINERS entry?) I could take it to

Re: [PATCH RESEND] clang-format: Set IndentWrappedFunctionNames false

2018-06-26 Thread Jason Gunthorpe
On Tue, Jun 26, 2018 at 05:05:40PM +0200, Miguel Ojeda wrote: > Hi, > > On Tue, Jun 26, 2018 at 12:44 AM, Jason Gunthorpe wrote: > > The true option causes this indenting for functions: > > > > static struct something_very_very_long * > > function(void

Re: [PATCH 2/2] mm: set PG_dma_pinned on get_user_pages*()

2018-06-27 Thread Jason Gunthorpe
On Wed, Jun 27, 2018 at 02:42:55PM +0200, Jan Kara wrote: > On Wed 27-06-18 13:59:27, Michal Hocko wrote: > > On Wed 27-06-18 13:53:49, Jan Kara wrote: > > > On Wed 27-06-18 13:32:21, Michal Hocko wrote: > > [...] > > > > Appart from that, do we really care about 32b here? Big DIO, IB users > > > >

Re: [PATCH] vmw_pvrdma: Release netdev when vmxnet3 module is removed

2018-06-28 Thread Jason Gunthorpe
ion > has been tested by myself and the reporter with successful results. > This fix also allows the pvrdma driver to find its underlying ethernet > device in the event that vmxnet3 is loaded after pvrdma, which it was > not able to do before. > > Signed-off-by: Neil Horm

Re: [PATCH] vmw_pvrdma: Release netdev when vmxnet3 module is removed

2018-06-28 Thread Jason Gunthorpe
On Thu, Jun 28, 2018 at 03:45:26PM -0400, Neil Horman wrote: > On Thu, Jun 28, 2018 at 12:59:46PM -0600, Jason Gunthorpe wrote: > > On Thu, Jun 28, 2018 at 09:59:38AM -0400, Neil Horman wrote: > > > On repeated module load/unload cycles, its possible for the pvrmda > > &g

[GIT PULL] Please pull RDMA subsystem changes

2018-05-24 Thread Jason Gunthorpe
pec flow label type Greg Thelen (1): IB: remove redundant INFINIBAND kconfig dependencies Jason Gunthorpe (1): IB/uverbs: Fix uverbs_attr_get_obj Kalderon, Michal (1): RDMA/qedr: Fix doorbell bar mapping for dpi > 1 Leon Romanovsky (1): MAINTAINERS: Remove bouncing @me

Re: [PATCH V2 rdma-next 3/4] RDMA/hns: Add reset process for RoCE in hip08

2018-05-24 Thread Jason Gunthorpe
On Wed, May 23, 2018 at 06:16:29PM +0800, Wei Hu (Xavier) wrote: > This patch added reset process for RoCE in hip08. > > Signed-off-by: Wei Hu (Xavier) > > v1->v2: 1.Delete handle->priv = NULL in hns_roce_hw_v2_uninit_instance. > 2.Add hns_roce_hw_v2_reset_notify_init callback function, >

Re: [PATCH V2 rdma-next 4/4] RDMA/hns: Fix the illegal memory operation when cross page

2018-05-24 Thread Jason Gunthorpe
On Wed, May 23, 2018 at 06:16:30PM +0800, Wei Hu (Xavier) wrote: > This patch fixed the potential illegal operation when using the > extend sge buffer cross page in post send operation. The bug > will cause the calltrace. Should include the oops for reference here.. > Reported-by: Jie Chen > Rep

Re: [PATCH V2 rdma-next 0/4] Misc update for hns driver

2018-05-24 Thread Jason Gunthorpe
On Wed, May 23, 2018 at 06:16:26PM +0800, Wei Hu (Xavier) wrote: > This patchset included fixing bug, some optimization, reset > process for hns driver. > > v1->v2: 1.pull the patch out of the series. The name of the patch is > RDMA/hns: Implement the disassociate_ucontext API. > 2.

Re: [PATCH V2 rdma-next 3/4] RDMA/hns: Add reset process for RoCE in hip08

2018-05-25 Thread Jason Gunthorpe
On Fri, May 25, 2018 at 01:54:31PM +0800, Wei Hu (Xavier) wrote: > > > On 2018/5/25 5:31, Jason Gunthorpe wrote: > >> static const struct hnae3_client_ops hns_roce_hw_v2_ops = { > >>.init_instance = hns_roce_hw_v2_init_instance, > >>.uninit_insta

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

2018-05-13 Thread Jason Gunthorpe
On Fri, May 11, 2018 at 02:25:22PM +0900, DaeRyong Jeong wrote: > We report the crash: KASAN: use-after-free Read in cma_cancel_operation > > Note that this bug is previously reported by syzkaller. > https://syzkaller.appspot.com/bug?id=95f89b8fb9fdc42e28ad586e657fea074e4e719b > Nonetheless, this

Re: linux-next: build warning after merge of the rdma tree

2018-05-14 Thread Jason Gunthorpe
On Mon, May 07, 2018 at 09:44:54AM +1000, Stephen Rothwell wrote: > Hi all, > > After merging the rdma tree, today's linux-next build (x86_64 > allmodconfig) produced this warning: > > drivers/infiniband/hw/cxgb4/restrack.c: In function 'fill_res_qp_entry': > drivers/infiniband/hw/cxgb4/restrack.

Re: [PATCH IB/core 2/2] IB/cm: Send authentic pkey in REQ msg and check eligibility of the pkeys

2018-05-14 Thread Jason Gunthorpe
On Thu, May 10, 2018 at 05:16:28PM +0200, Håkon Bugge wrote: > We are talking about two things here. The PKey in the BTH and the > PKey in the CM REQ payload. They differ. > > I am out of office, but if my memory serves me correct, the PKey in > the BTH in the MAD packet will be the default PKey.

Re: [PATCH IB/core 2/2] IB/cm: Send authentic pkey in REQ msg and check eligibility of the pkeys

2018-05-14 Thread Jason Gunthorpe
On Fri, May 11, 2018 at 12:55:00PM +0200, Håkon Bugge wrote: > > I'll check upstream OpenSM when I get a chance to see if same problem > > exists. Oracle OpenSM forked from upstream long time ago and not sure > > how similar the path record code is. There were various impacts for the > > shared por

Re: [PATCH 2/2] mm: set PG_dma_pinned on get_user_pages*()

2018-06-17 Thread Jason Gunthorpe
On Sun, Jun 17, 2018 at 12:53:04PM -0700, Dan Williams wrote: > > diff --git a/mm/rmap.c b/mm/rmap.c > > index 6db729dc4c50..37576f0a4645 100644 > > +++ b/mm/rmap.c > > @@ -1360,6 +1360,8 @@ static bool try_to_unmap_one(struct page *page, > > struct vm_area_struct *vma, > >

Re: [PATCH v3 2/2] IB/mad: Use IDR for agent IDs

2018-06-18 Thread Jason Gunthorpe
On Wed, Jun 13, 2018 at 05:34:03AM -0700, wi...@infradead.org wrote: > Allocate agent IDs from a global IDR instead of an atomic variable. > This eliminates the possibility of reusing an ID which is already in > use after 4 billion registrations. We limit the assigned ID to be less > than 2^24 as

Re: [PATCH 2/2] mm: set PG_dma_pinned on get_user_pages*()

2018-06-18 Thread Jason Gunthorpe
On Mon, Jun 18, 2018 at 12:21:46PM -0700, Dan Williams wrote: > On Mon, Jun 18, 2018 at 11:14 AM, John Hubbard wrote: > > On 06/18/2018 10:56 AM, Dan Williams wrote: > >> On Mon, Jun 18, 2018 at 10:50 AM, John Hubbard wrote: > >>> On 06/18/2018 01:12 AM, Christoph Hellwig wrote: > On Sun, Ju

Re: [PATCH] tpm: Add module parameter for hwrng quality.

2018-06-18 Thread Jason Gunthorpe
On Mon, Jun 18, 2018 at 09:07:12PM +0300, Jarkko Sakkinen wrote: > On Fri, Jun 08, 2018 at 02:54:38PM +0800, Louis Collard wrote: > > It is now possible for drivers to easily specify a hwrng quality, however > > most do not currently do this, and in cases where they do, it may be > > desirable to o

Re: [PATCH] IB/mad: Use ID allocator routines to allocate agent number

2018-05-30 Thread Jason Gunthorpe
On Wed, May 30, 2018 at 02:22:56PM +0200, Hans Westgaard Ry wrote: > We came up with this code snippet which we think handles both preventing > immediate re-use and too big/wrapping... Isn't this basically the same as idr_alloc_cyclic ? Jason

Re: [PATCH] IB/mad: Use ID allocator routines to allocate agent number

2018-05-30 Thread Jason Gunthorpe
On Wed, May 30, 2018 at 09:32:02AM +0200, Håkon Bugge wrote: > > > > On 29 May 2018, at 18:40, Jason Gunthorpe wrote: > > > > On Tue, May 29, 2018 at 06:16:14PM +0200, Håkon Bugge wrote: > >> > >>> On 29 May 2018, at 17:49, Jason Gunthorpe wrot

Re: [PATCH] iw_cxgb4: add INFINIBAND_ADDR_TRANS dependency

2018-05-30 Thread Jason Gunthorpe
On Wed, May 30, 2018 at 11:58:18PM +0200, Arnd Bergmann wrote: > The newly added fill_res_ep_entry function fails to link if > CONFIG_INFINIBAND_ADDR_TRANS is not set: > > drivers/infiniband/hw/cxgb4/restrack.o: In function `fill_res_ep_entry': > restrack.c:(.text+0x3cc): undefined reference to `r

Re: [PATCH] IB/mad: Use ID allocator routines to allocate agent number

2018-05-30 Thread Jason Gunthorpe
On Wed, May 30, 2018 at 10:07:16PM +0200, Håkon Bugge wrote: > > > > On 30 May 2018, at 17:10, Jason Gunthorpe wrote: > > > > On Wed, May 30, 2018 at 02:22:56PM +0200, Hans Westgaard Ry wrote: > > > >> We came up with this code snippet which we think ha

Re: [PATCH] iw_cxgb4: add INFINIBAND_ADDR_TRANS dependency

2018-05-30 Thread Jason Gunthorpe
On Wed, May 30, 2018 at 05:10:35PM -0500, Steve Wise wrote: > > > On 5/30/2018 5:04 PM, Jason Gunthorpe wrote: > > On Wed, May 30, 2018 at 11:58:18PM +0200, Arnd Bergmann wrote: > >> The newly added fill_res_ep_entry function fails to link if > >> CONFIG

Re: [PATCH] iw_cxgb4: add INFINIBAND_ADDR_TRANS dependency

2018-05-30 Thread Jason Gunthorpe
On Thu, May 31, 2018 at 12:40:54AM +0200, Arnd Bergmann wrote: > > On 5/30/2018 5:25 PM, Jason Gunthorpe wrote: > >> On Wed, May 30, 2018 at 05:10:35PM -0500, Steve Wise wrote: > >>> > >>> On 5/30/2018 5:04 PM, Jason Gunthorpe wrote: > >>>> O

[GIT PULL] Please pull RDMA subsystem changes

2018-06-01 Thread Jason Gunthorpe
Hi Linus, Third pull request for -rc Just 3 small last minute regressions that were found in the last week. The Broadcom fix is a bit big for rc7, but since it is fixing driver crash regressions that were merged via netdev into rc1, I am sending it. The following changes since commit 55ba49cbcef

Re: [PATCH v2] vmw_pvrdma: Release netdev when vmxnet3 module is removed

2018-07-03 Thread Jason Gunthorpe
ion > has been tested by myself and the reporter with successful results. > This fix also allows the pvrdma driver to find its underlying ethernet > device in the event that vmxnet3 is loaded after pvrdma, which it was > not able to do before. > > Signed-off-by: Neil Horm

Re: [PATCH] tpm: Fix NULL pointer dereference in tpm_transmit()

2018-07-04 Thread Jason Gunthorpe
On Wed, Jul 04, 2018 at 02:33:40PM +0530, Shirish S wrote: > During system shutdown, > tpm_class_shutdown() when called with TPM_CHIP_FLAG_TPM2 > flag set, makes chip->ops NULL. > > However tpm_chip_unregister() called later in shutdown > sequence tries to access chip->ops in tpm_try_transmit() >

Re: [PATCH 2/2] IB/mad: Use IDR for agent IDs

2018-06-12 Thread Jason Gunthorpe
On Tue, Jun 12, 2018 at 07:59:42AM +0300, jackm wrote: > On Mon, 11 Jun 2018 10:19:18 -0600 > Jason Gunthorpe wrote: > > > On Mon, Jun 11, 2018 at 09:19:14AM +0300, jackm wrote: > > > On Sun, 10 Jun 2018 22:42:03 -0600 > > > Jason Gunthorpe wrote: > > >

Re: [PATCH 2/2] IB/mad: Use IDR for agent IDs

2018-06-12 Thread Jason Gunthorpe
On Fri, Jun 08, 2018 at 10:42:18AM -0700, Matthew Wilcox wrote: > From: Matthew Wilcox > > Allocate agent IDs from a global IDR instead of an atomic variable. > This eliminates the possibility of reusing an ID which is already in > use after 4 billion registrations, and we can also limit the assi

Re: [PATCH 1/2] IB/mad: Agent registration is process context only

2018-06-12 Thread Jason Gunthorpe
On Fri, Jun 08, 2018 at 10:42:17AM -0700, Matthew Wilcox wrote: > From: Matthew Wilcox > > Document this (it's implicitly true due to sleeping operations already > in use in both registration and deregistration). Use this fact to use > spin_lock_irq instead of spin_lock_irqsave. This improves p

<    1   2   3   4   5   6   7   8   9   10   >