[PATCH v2] tpm: Move Linux RNG connection to hwrng

2017-10-31 Thread Jason Gunthorpe
Muralidharan Signed-off-by: Jason Gunthorpe --- drivers/char/hw_random/Kconfig | 13 --- drivers/char/hw_random/Makefile | 1 - drivers/char/hw_random/tpm-rng.c | 50 drivers/char/tpm/Kconfig | 11 + drivers/char/tpm/tpm-chip.c | 41

[PATCH] kvm: Return -ENODEV from update_persistent_clock

2017-10-31 Thread Jason Gunthorpe
kvm does not support setting the RTC, so the correct result is -ENODEV. Returning -1 will cause sync_cmos_clock to keep trying to set the RTC every second. Signed-off-by: Jason Gunthorpe --- arch/x86/kernel/kvmclock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86

Re: [tpmdd-devel] [PATCH] tpm: remove chip_num parameter from in-kernel API

2017-10-24 Thread Jason Gunthorpe
On Tue, Oct 24, 2017 at 09:21:15PM +0530, PrasannaKumar Muralidharan wrote: > Please check the RFC [1]. It does use chip id. The rfc has issues and > has to be fixed but still there could be users of the API. > > 1. https://www.spinics.net/lists/linux-crypto/msg28282.html That patch isn't safe a

Re: [tpmdd-devel] [PATCH] tpm: remove chip_num parameter from in-kernel API

2017-10-24 Thread Jason Gunthorpe
On Tue, Oct 24, 2017 at 09:37:33PM +0530, PrasannaKumar Muralidharan wrote: > Hi Jason, > > On 24 October 2017 at 21:25, Jason Gunthorpe > wrote: > > On Tue, Oct 24, 2017 at 09:21:15PM +0530, PrasannaKumar Muralidharan wrote: > > > >> Please check the RFC [1].

Re: [tpmdd-devel] [PATCH] tpm: remove chip_num parameter from in-kernel API

2017-10-24 Thread Jason Gunthorpe
On Tue, Oct 24, 2017 at 10:02:00AM -0700, Dmitry Torokhov wrote: > tpm-rng is abomination that should be kicked out as soon as possible. > It wrecks havoc with the power management (TPM chip drivers may go > into suspend state, but tpm_rng does not do any power management and > happily forwards req

Re: [tpmdd-devel] [PATCH] tpm: remove chip_num parameter from in-kernel API

2017-10-24 Thread Jason Gunthorpe
On Tue, Oct 24, 2017 at 09:44:30PM +0530, PrasannaKumar Muralidharan wrote: > I am wondering why it is wrong. Isn't the chip id valid till it is > unregistered? If so the rfc is correct. Please explain, may be I am > missing something. The lifetime is a bit complicated, but the general rule in th

[PATCH] tpm: Move Linux RNG connection to hwrng

2017-10-24 Thread Jason Gunthorpe
Muralidharan Signed-off-by: Jason Gunthorpe Reviewed-by: Jason Gunthorpe --- drivers/char/hw_random/Kconfig | 13 --- drivers/char/hw_random/Makefile | 1 - drivers/char/hw_random/tpm-rng.c | 50 drivers/char/tpm/Kconfig | 13

Re: [PATCH] tpm: remove chip_num parameter from in-kernel API

2017-10-24 Thread Jason Gunthorpe
On Mon, Oct 23, 2017 at 02:38:14PM +0200, Jarkko Sakkinen wrote: > The reasoning is simple and obvious. Since every call site passes the > value TPM_ANY_NUM (0x) the parameter does not have right to exist. > Refined the documentation of the corresponding functions. I like this patch, but how a

Re: [PATCH] tpm: Move Linux RNG connection to hwrng

2017-10-24 Thread Jason Gunthorpe
On Tue, Oct 24, 2017 at 12:42:35PM -0600, Jason Gunthorpe wrote: > This is compile tested only. 0day says the kconfig has a problem when randomized, here is the fix I will roll into a v2 in a few days: diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig index a95725fa777

Re: [PATCH] tpm: Move Linux RNG connection to hwrng

2017-10-25 Thread Jason Gunthorpe
On Wed, Oct 25, 2017 at 08:15:09PM +0530, PrasannaKumar Muralidharan wrote: > > +static int tpm_add_hwrng(struct tpm_chip *chip) > > +{ > > + if (!IS_ENABLED(CONFIG_HW_RANDOM_TPM)) > > + return 0; > > Can #ifndef CONFIG_HW_RANDOM_TPM be used instead? That way an if > condition

Re: [PATCH v2] tpm: use struct tpm_chip for tpm_chip_find_get()

2017-10-25 Thread Jason Gunthorpe
that instead a struct tpm_chip > instance is given and NULL means the default chip. In addition, this > commit refines the documentation to be up to date with the > implementation. > > Suggested-by: Jason Gunthorpe (@chip_num -> > @chip) > Signed-off-by: Jarkko Sakki

Re: [PATCH] tpm: Move Linux RNG connection to hwrng

2017-10-25 Thread Jason Gunthorpe
On Wed, Oct 25, 2017 at 08:58:17PM +0200, Jarkko Sakkinen wrote: > On Wed, Oct 25, 2017 at 08:15:09PM +0530, PrasannaKumar Muralidharan wrote: > > > + if (!IS_ENABLED(CONFIG_HW_RANDOM_TPM)) > > > + return 0; > > > > Can #ifndef CONFIG_HW_RANDOM_TPM be used instead? That way an

Re: [PATCH v2] tpm: use struct tpm_chip for tpm_chip_find_get()

2017-10-25 Thread Jason Gunthorpe
> struct tpm_chip *tpm_chip_find_get(u64 id) > { > struct tpm_chup *chip; > struct tpm_chip *res = NULL; > int chip_num = 0; > int chip_prev; > > mutex_lock(&idr_lock); > > do { > chip_prev = chip_num; > > chip = idr_get_next(&dev_n

Re: [PATCH] tpm: Move Linux RNG connection to hwrng

2017-10-25 Thread Jason Gunthorpe
On Wed, Oct 25, 2017 at 10:00:30PM +0200, Jarkko Sakkinen wrote: > A minor tidbit: could the tpm_ prefix removed from those fields? Yes, in v2 I will send v2 when you land your rework patch as this will depend on it. Jason

Re: [PATCH v2] tpm: use struct tpm_chip for tpm_chip_find_get()

2017-10-25 Thread Jason Gunthorpe
On Wed, Oct 25, 2017 at 10:07:46PM +0200, Jarkko Sakkinen wrote: > The id has a nice feature that it is unique for one boot cycle you can > even try to get a chip that has been deleted. It has the most stable > properties in the long run. It isn't unique, we can re-use ids them via idr_alloc(). W

Re: [PATCH v3] tpm: use struct tpm_chip for tpm_chip_find_get()

2017-10-26 Thread Jason Gunthorpe
On Thu, Oct 26, 2017 at 09:57:12PM +0530, PrasannaKumar Muralidharan wrote: > I do not what value my rb tag provides as I have not contributed code > to it before. Is it encouraged by kernel community? Yes. People will judge the quality of your rb tag based on other reviews they have seen you mak

Re: [PATCH v2] tpm: Move Linux RNG connection to hwrng

2017-11-05 Thread Jason Gunthorpe
On Sun, Nov 05, 2017 at 01:05:06PM +0200, Jarkko Sakkinen wrote: > I asked to create a series for a reason. Now this doesn't apply because I > don't have an ancestor in my git history. It would be unusual for me to put your patch into a series unless I am also adopting it. eg what happens if ther

Re: [PATCH 3/4] tpm: seal/unseal for TPM 2.0

2015-10-13 Thread Jason Gunthorpe
On Fri, Oct 02, 2015 at 11:38:17AM +0300, Jarkko Sakkinen wrote: > Added tpm_trusted_seal() and tpm_trusted_unseal() API for sealing > trusted keys. > > This patch implements basic sealing and unsealing functionality for > TPM 2.0: We really need to stop using chip id's as a handle - the caller s

Re: [PATCH v2 0/4] Basic trusted keys support for TPM 2.0

2015-10-13 Thread Jason Gunthorpe
On Tue, Oct 13, 2015 at 11:11:21AM +0300, Jarkko Sakkinen wrote: > * I updated tpm_buf to a be heap based structure. Now there's one full > page of memory for variable sized messages. Also the stack is greatly > reduced. You may as well just use a skb then. Jason -- To unsubscribe from this

Re: [PATCH] infiniband:Fix error checking in the function ocrdma_dereg_mr

2015-09-04 Thread Jason Gunthorpe
On Fri, Sep 04, 2015 at 12:45:38PM -0400, Doug Ledford wrote: > On 09/04/2015 12:35 PM, Nicholas Krause wrote: > > This fixes error checking in the function ocrdma_dereg_mr to properly > > check if the call to ocrdma_mbx_alloc fails as if so we must exit this > > function immediately and return the

[GIT PULL] Please pull RDMA subsystem changes

2018-08-03 Thread Jason Gunthorpe
Hi Linus, Third pull request for -rc Things are still slow on the RC side, this one patch has been sitting in the git tree for a few weeks waiting for some friends. I expect this is the last RC pull for this cycle. The following changes since commit d63c46734c545ad0488761059004a65c46efdde3: R

Re: linux-next: manual merge of the rdma tree with Linus' tree

2018-08-06 Thread Jason Gunthorpe
On Mon, Aug 06, 2018 at 12:01:31PM +1000, Stephen Rothwell wrote: > Hi all, > > Today's linux-next merge of the rdma tree got a conflict in: > > drivers/infiniband/core/uverbs_main.c > > between commit: > > 1eb9364ce81d ("IB/uverbs: Fix ordering of ucontext check in > ib_uverbs_write") >

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

2018-08-06 Thread Jason Gunthorpe
On Mon, Aug 06, 2018 at 02:53:31PM +1000, Stephen Rothwell wrote: > Hi all, > > Today's linux-next merge of the tip tree got a conflict in: > > drivers/infiniband/core/rdma_core.c > > between commit: > > 9867f5c6695f ("IB/uverbs: Convert 'bool exclusive' into an enum") > > from the rdma tr

Re: [PATCH v3 RESEND 2/2] tpm: add support for nonblocking operation

2018-08-07 Thread Jason Gunthorpe
On Mon, Aug 06, 2018 at 04:05:48PM -0700, James Bottomley wrote: > > @@ -118,25 +155,48 @@ ssize_t tpm_common_write(struct file *file, > > const char __user *buf, > >    * the char dev is held open. > >    */ > >   if (tpm_try_get_ops(priv->chip)) { > > - mutex_unlock(&priv->buffer

Re: [PATCH 1/6] tpm: Introduce a kref for the tpm_chip

2018-06-20 Thread Jason Gunthorpe
On Wed, Jun 20, 2018 at 12:19:43PM -0400, Stefan Berger wrote: > Introduce a kref for the tpm_chip that we initialize when the tpm_chip has > been allocated and release before the tpm_chip is to be freed. > > Signed-off-by: Stefan Berger > drivers/char/tpm/tpm-chip.c | 24 +++

Re: [PATCH v2 1/4] tpm: Implement tpm_chip_find() and tpm_chip_put() for other subsystems

2018-06-20 Thread Jason Gunthorpe
On Wed, Jun 20, 2018 at 04:42:33PM -0400, Stefan Berger wrote: > Implement tpm_chip_find() for other subsystems to find a TPM chip and > get a reference to that chip. Once done with using the chip, the reference > is released using tpm_chip_put(). > > Signed-off-by: Stefan Berger > drivers/char/

[GIT PULL] Please pull RDMA subsystem changes

2018-06-20 Thread Jason Gunthorpe
ry leak in mlx5_ib_create_flow Jason Gunthorpe (1): IB/uverbs: Fix ordering of ucontext check in ib_uverbs_write Kalderon, Michal (1): RDMA/qedr: Fix NULL pointer dereference when running over iWARP without RDMA-CM Vijay Immanuel (1): IB/rxe: Fix missing completion for mem_reg wor

Re: [PATCH v2 1/4] tpm: Implement tpm_chip_find() and tpm_chip_put() for other subsystems

2018-06-21 Thread Jason Gunthorpe
On Thu, Jun 21, 2018 at 01:45:03PM -0400, Stefan Berger wrote: > On 06/21/2018 01:15 PM, Jarkko Sakkinen wrote: > >On Wed, Jun 20, 2018 at 04:42:33PM -0400, Stefan Berger wrote: > >>Implement tpm_chip_find() for other subsystems to find a TPM chip and > >>get a reference to that chip. Once done wit

Re: [PATCH v2 1/4] tpm: Implement tpm_chip_find() and tpm_chip_put() for other subsystems

2018-06-21 Thread Jason Gunthorpe
On Thu, Jun 21, 2018 at 02:19:44PM -0400, Stefan Berger wrote: > On 06/21/2018 01:56 PM, Jason Gunthorpe wrote: > >On Thu, Jun 21, 2018 at 01:45:03PM -0400, Stefan Berger wrote: > >>On 06/21/2018 01:15 PM, Jarkko Sakkinen wrote: > >>>On Wed, Jun 20, 2018 at 04:42:3

Re: [PATCH v2 1/4] tpm: Implement tpm_chip_find() and tpm_chip_put() for other subsystems

2018-06-21 Thread Jason Gunthorpe
On Thu, Jun 21, 2018 at 04:14:46PM -0400, Stefan Berger wrote: > On 06/21/2018 03:06 PM, Jason Gunthorpe wrote: > >On Thu, Jun 21, 2018 at 02:19:44PM -0400, Stefan Berger wrote: > >>On 06/21/2018 01:56 PM, Jason Gunthorpe wrote: > >>>On Thu, Jun 21, 2018 at 01:45:0

Re: [PATCH v2 3/4] ima: Use tpm_chip_find() and access TPM functions using it

2018-06-21 Thread Jason Gunthorpe
On Thu, Jun 21, 2018 at 04:59:55PM -0400, Stefan Berger wrote: > On 06/21/2018 04:53 PM, Mimi Zohar wrote: > >On Wed, 2018-06-20 at 16:42 -0400, Stefan Berger wrote: > >>Rather than accessing the TPM functions using a NULL pointer, which > >>causes a lookup for a suitable chip every time, get a hol

Re: [PATCH v2 3/4] ima: Use tpm_chip_find() and access TPM functions using it

2018-06-22 Thread Jason Gunthorpe
On Fri, Jun 22, 2018 at 07:40:37AM -0400, Stefan Berger wrote: > On 06/21/2018 11:25 PM, Jason Gunthorpe wrote: > >On Thu, Jun 21, 2018 at 04:59:55PM -0400, Stefan Berger wrote: > >>On 06/21/2018 04:53 PM, Mimi Zohar wrote: > >>>On Wed, 2018-06-20 at 16:42 -0400, Ste

Re: [PATCH v3 1/4] tpm: rename tpm_chip_find_get() to tpm_get_ops()

2018-06-22 Thread Jason Gunthorpe
On Fri, Jun 22, 2018 at 12:46:10PM -0400, Stefan Berger wrote: > Rename tpm_chip_find_get() to tpm_get_ops(). This now matches > the name of its counter part tpm_put_ops() better. > > Signed-off-by: Stefan Berger > drivers/char/tpm/tpm-chip.c | 4 ++-- > drivers/char/tpm/tpm-interface.c |

Re: [PATCH v3 2/4] tpm: Implement tpm_chip_find() for other subsystems to find a TPM chip

2018-06-22 Thread Jason Gunthorpe
On Fri, Jun 22, 2018 at 12:46:11PM -0400, Stefan Berger wrote: > Implement tpm_chip_find() for other subsystems to find a TPM chip and > get a reference to that chip. > > Signed-off-by: Stefan Berger > drivers/char/tpm/tpm-chip.c | 27 +++ > include/linux/tpm.h |

Re: [PATCH v3 2/4] tpm: Implement tpm_chip_find() for other subsystems to find a TPM chip

2018-06-22 Thread Jason Gunthorpe
On Fri, Jun 22, 2018 at 04:45:47PM -0400, Stefan Berger wrote: > On 06/22/2018 04:43 PM, Jason Gunthorpe wrote: > >On Fri, Jun 22, 2018 at 12:46:11PM -0400, Stefan Berger wrote: > >>Implement tpm_chip_find() for other subsystems to find a TPM chip and > >>g

Re: [PATCH rdma-next v4 0/3] overflow.h: Add left-shift helper

2018-08-08 Thread Jason Gunthorpe
signed overflows). > - fix documentation typo on argument name. > v2: > - swap out selftests with framework from Rasmus, add lots more tests. > - drop double-assignment in helper. > > > Jason Gunthorpe (1): > overflow.h: Add arithmetic shift helper > > Kees Cook (

Re: [PATCH] IB/ucm: fix UCM link error

2018-08-21 Thread Jason Gunthorpe
On Tue, Aug 21, 2018 at 04:20:44PM +0200, Arnd Bergmann wrote: > Building UCM with CONFIG_INFINIBAND_USER_ACCESS=m results in a > set of link errors including: > > drivers/infiniband/core/ucm.o: In function `ib_ucm_event_handler': > ucm.c:(.text+0x6dc): undefined reference to `ib_copy_path_rec_to_

[GIT PULL] Please pull RDMA subsystem changes

2018-08-22 Thread Jason Gunthorpe
a randconfig failure Arnd Bergmann (1): IB/ucm: fix UCM link error Jason Gunthorpe (1): RDMA/smc: Replace ib_query_gid with rdma_get_gid_attr Michael J. Ruhl (1): IB/hfi1: Invalid NUMA node information can cause a divide by zero driver

Re: [RDMA bug] KASAN: use-after-free Read in __list_del_entry_valid (4)

2018-08-23 Thread Jason Gunthorpe
On Wed, Aug 22, 2018 at 11:16:31PM -0700, Eric Biggers wrote: > Hello RDMA / InfiniBand maintainers, > > This is an RDMA bug and it still occurs on Linus' tree as of today > (commit 815f0ddb346c1960). > > I've also simplified the reproducer for it; see below after the original > report. > Appare

Re: [RDMA bug] KASAN: use-after-free Read in __list_del_entry_valid (4)

2018-08-23 Thread Jason Gunthorpe
On Thu, Aug 23, 2018 at 04:39:29PM +, Parav Pandit wrote: > > > > From: Jason Gunthorpe > > Sent: Thursday, August 23, 2018 9:55 AM > > To: Eric Biggers > > Cc: Doug Ledford ; linux-r...@vger.kernel.org; > > dasaratharaman.chandramo...@intel.com

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

2018-07-25 Thread Jason Gunthorpe
On Thu, Jul 26, 2018 at 10:55:53AM +1000, Stephen Rothwell wrote: > Hi all, > > After merging the rdma tree, today's linux-next build (powerpc > ppc64_defconfig) produced this warning: > > net/sunrpc/xprtrdma/svc_rdma_rw.c: In function 'svc_rdma_post_chunk_ctxt': > net/sunrpc/xprtrdma/svc_rdma_rw

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

2018-07-26 Thread Jason Gunthorpe
On Thu, Jul 26, 2018 at 05:10:13AM +, Bart Van Assche wrote: > On Wed, 2018-07-25 at 21:05 -0600, Jason Gunthorpe wrote: > > On Thu, Jul 26, 2018 at 10:55:53AM +1000, Stephen Rothwell wrote: > > > Hi all, > > > > > > After merging the rdma tre

Re: [PATCH v2] IB/mlx5: avoid excessive warning msgs when creating VFs on 2nd port

2018-07-26 Thread Jason Gunthorpe
On Mon, Jul 23, 2018 at 02:15:08PM -0700, Qing Huang wrote: > When a CX5 device is configured in dual-port RoCE mode, after creating > many VFs against port 1, creating the same number of VFs against port 2 > will flood kernel/syslog with something like > "mlx5_*:mlx5_ib_bind_slave_port:4266:(pid 5

Re: [PATCH] MAINTAINERS: Add .clang-format entry

2018-07-30 Thread Jason Gunthorpe
On Mon, Jul 30, 2018 at 06:24:31PM +0200, Miguel Ojeda wrote: > As discussed in https://lkml.org/lkml/2018/6/25/877 > > Signed-off-by: Miguel Ojeda > --- > MAINTAINERS | 5 + > 1 file changed, 5 insertions(+) Thanks! Did you setup a tree? Can you take the patch I sent as well? Do you want m

Re: [PATCH v2 2/3] test_overflow: Add shift overflow tests

2018-07-31 Thread Jason Gunthorpe
On Tue, Jul 31, 2018 at 05:00:38PM -0700, Kees Cook wrote: > + /* Overflow: high bit falls off. */ > + /* 10010110 */ > + err |= TEST_ONE_SHIFT(150, 1, u8, 0, true); > + /* 1000100010010110 */ > + err |= TEST_ONE_SHIFT(34966, 1, u16, 0, true); > + /* 1100100010001000

Re: [PATCH v2 1/3] overflow.h: Add arithmetic shift helper

2018-07-31 Thread Jason Gunthorpe
On Tue, Jul 31, 2018 at 05:00:37PM -0700, Kees Cook wrote: > From: Jason Gunthorpe > > Add shift_overflow() helper to assist driver authors in ensuring that > shift operations don't cause overflows or other odd conditions. > > Signed-off-by: Jason Gunthorpe > Sign

Re: [PATCH v2 1/3] overflow.h: Add arithmetic shift helper

2018-08-01 Thread Jason Gunthorpe
On Wed, Aug 01, 2018 at 11:07:24AM +0300, Dan Carpenter wrote: > On Wed, Aug 01, 2018 at 10:57:44AM +0300, Dan Carpenter wrote: > > The idea is nice, but I don't like the API. The "_overflow" feels too > > specific because maybe we could check for other things in the future. > > Normally boolean m

Re: [PATCH] IPoIB: use kvzalloc to allocate an array of bucket pointers

2018-07-23 Thread Jason Gunthorpe
On Mon, Jul 09, 2018 at 04:51:03PM +0300, Jan Dakinevich wrote: > This table by default takes 32KiB which is 3rd memory order. Meanwhile, > this memory is not aimed for DMA operation and could be safely allocated > by vmalloc. > > Signed-off-by: Jan Dakinevich > Reviewed-by: Håkon Bugge > --- >

Re: [PATCH] tpm: add support for partial reads

2018-07-23 Thread Jason Gunthorpe
On Thu, Jul 19, 2018 at 08:52:32AM -0700, Tadeusz Struk wrote: > Currently to read a response from the TPM device an application needs > provide "big enough" buffer for the whole response and read it in one go. > The application doesn't know how big the response it beforehand so it > always needs t

Re: [PATCH] tpm: add support for partial reads

2018-07-23 Thread Jason Gunthorpe
On Mon, Jul 23, 2018 at 02:38:08PM -0700, Tadeusz Struk wrote: > On 07/23/2018 02:13 PM, James Bottomley wrote: > > The current patch does, you even provided a use case in your last email > > (it's do command to get sizing followed by do command with correctly > > sized buffer). > > The example

Re: [PATCH] tpm: add support for partial reads

2018-07-23 Thread Jason Gunthorpe
On Mon, Jul 23, 2018 at 03:00:20PM -0700, Tadeusz Struk wrote: > On 07/23/2018 02:56 PM, Jason Gunthorpe wrote: > > The proposed patch doesn't clear the data_pending if the entire buffer > > is not consumed, so of course it is ABI breaking, that really isn't OK. >

Re: [PATCH] tpm: add support for partial reads

2018-07-23 Thread Jason Gunthorpe
On Mon, Jul 23, 2018 at 04:42:38PM -0700, Tadeusz Struk wrote: > On 07/23/2018 03:08 PM, Jason Gunthorpe wrote: > > On Mon, Jul 23, 2018 at 03:00:20PM -0700, Tadeusz Struk wrote: > >> On 07/23/2018 02:56 PM, Jason Gunthorpe wrote: > >>> The proposed patch doesn&#

Re: [PATCH] drivers: infiniband: core: Remove extra parentheses

2018-07-25 Thread Jason Gunthorpe
On Wed, Jul 25, 2018 at 08:43:56PM +0200, Varsha Rao wrote: > Remove unnecessary parentheses to fix the clang warning of extraneous > parentheses. > > Signed-off-by: Varsha Rao > --- > drivers/infiniband/core/cma.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied to for-next, tha

[GIT PULL] Please pull RDMA subsystem changes

2018-07-13 Thread Jason Gunthorpe
Hi Linus, Second pull request for -rc Things have been quite slow, only 6 RC patches have been sent to the list. Lots of stuff in for-next already though. The following changes since commit 6f0d349d922ba44e4348a17a78ea51b7135965b1: Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Re: [PATCH 2/3] tpm: separate cmd_ready/go_idle from runtime_pm

2018-01-23 Thread Jason Gunthorpe
On Tue, Jan 23, 2018 at 03:08:41PM +0200, Jarkko Sakkinen wrote: > On Tue, Jan 23, 2018 at 01:27:30PM +0200, Tomas Winkler wrote: > > We cannot use go_idle cmd_ready commands via runtime_pm handles > > as with the introduction of localities this is no longer an optional > > feature, while runtime p

Re: [PATCH] IB/mthca: Fix how mthca_map_user_db() calls gup

2018-01-25 Thread Jason Gunthorpe
On Thu, Jan 25, 2018 at 11:34:23AM -0500, Doug Ledford wrote: > > - Should I be wrong about no callers already holding mmap_sem, > > I still think calling gup without the mutex makes sense for > > improved paralellism. Now, if callers can hold the mmap_sem, > > it's wrong to do copy_from_user

Re: [PATCH] IB/mthca: Fix how mthca_map_user_db() calls gup

2018-01-25 Thread Jason Gunthorpe
On Thu, Jan 25, 2018 at 01:06:24PM -0500, Doug Ledford wrote: > On Thu, 2018-01-25 at 10:50 -0700, Jason Gunthorpe wrote: > > On Thu, Jan 25, 2018 at 11:34:23AM -0500, Doug Ledford wrote: > > > > - Should I be wrong about no callers already holding mmap_sem, > > >

Re: [PATCH] net/mlx4_en: ensure rx_desc updating reaches HW before prod db updating

2018-01-12 Thread Jason Gunthorpe
On Fri, Jan 12, 2018 at 11:42:22AM +0800, Jianchao Wang wrote: > Customer reported memory corruption issue on previous mlx4_en driver > version where the order-3 pages and multiple page reference counting > were still used. > > Finally, find out one of the root causes is that the HW may see stale

Re: [PATCH] Documentation/ABI: update infiniband sysfs interfaces

2018-02-01 Thread Jason Gunthorpe
On Thu, Feb 01, 2018 at 07:02:33PM +0530, Aishwarya Pant wrote: > Add documentation for core and hardware specific infiniband interfaces. > The descriptions have been collected from git commit logs, reading > through code and data sheets. Some drivers have incomplete doc and are > annotated with th

Re: [PATCH 0/2] RDMA/bnxt_re: Adjustments for bnxt_qplib_alloc_dpi_tbl()

2018-02-01 Thread Jason Gunthorpe
On Sat, Jan 27, 2018 at 09:15:09PM +0100, SF Markus Elfring wrote: > From: Markus Elfring > Date: Sat, 27 Jan 2018 21:10:12 +0100 > > Two update suggestions were taken into account > from static source code analysis. > > Markus Elfring (2): > Delete two error messages for a failed memory alloc

Re: [PATCH] net/mlx4_en: ensure rx_desc updating reaches HW before prod db updating

2018-01-21 Thread Jason Gunthorpe
> Hmm, this is actually consistent with the example below [1]. > > AIU from the example, it seems that the dma_wmb/dma_rmb barriers are good > for synchronizing cpu/device accesses to the "Streaming DMA mapped" buffers > (the descriptors, went through the dma_map_page() API), but not for the > doo

Re: [PATCH] net/mlx4_en: ensure rx_desc updating reaches HW before prod db updating

2018-01-22 Thread Jason Gunthorpe
On Mon, Jan 22, 2018 at 10:40:53AM +0800, jianchao.wang wrote: > Hi Eric > > On 01/22/2018 12:43 AM, Eric Dumazet wrote: > > On Sun, 2018-01-21 at 18:24 +0200, Tariq Toukan wrote: > >> > >> On 21/01/2018 11:31 AM, Tariq Toukan wrote: > >>> > >>> > >>> On 19/01/2018 5:49 PM, Eric Dumazet wrote: > >

Re: [PATCH 06/12] IB/core: Add optional PCI P2P flag to rdma_rw_ctx_[init|destroy]()

2018-01-04 Thread Jason Gunthorpe
On Thu, Jan 04, 2018 at 12:01:31PM -0700, Logan Gunthorpe wrote: > > @@ -269,18 +270,24 @@ static int rdma_rw_init_single_wr(struct rdma_rw_ctx > *ctx, struct ib_qp *qp, > * @remote_addr:remote address to read/write (relative to @rkey) > * @rkey:remote key to operate on > * @dir: %

Re: [PATCH 06/12] IB/core: Add optional PCI P2P flag to rdma_rw_ctx_[init|destroy]()

2018-01-04 Thread Jason Gunthorpe
On Thu, Jan 04, 2018 at 12:52:24PM -0700, Logan Gunthorpe wrote: > >I'd be much happier if dma_map_sg can tell the memory is P2P or not > >from the scatterlist or dir arguments and not require the callers to > >have this. > > We tried things like this in an earlier iteration[1] which assumed the S

Re: [PATCH 02/12] pci-p2p: Add sysfs group to display p2pmem stats

2018-01-04 Thread Jason Gunthorpe
On Thu, Jan 04, 2018 at 03:50:40PM -0600, Bjorn Helgaas wrote: > > This is similar to /sys/bus/pci/drivers_autoprobe, but > > affects only the VFs associated with a specific PF. > > + > > +What: /sys/bus/pci/devices/.../p2pmem/available > > I wonder if "p2pdma"

Re: [PATCH 06/12] IB/core: Add optional PCI P2P flag to rdma_rw_ctx_[init|destroy]()

2018-01-04 Thread Jason Gunthorpe
On Thu, Jan 04, 2018 at 04:44:00PM -0700, Logan Gunthorpe wrote: > On 04/01/18 03:13 PM, Jason Gunthorpe wrote: > >On Thu, Jan 04, 2018 at 12:52:24PM -0700, Logan Gunthorpe wrote: > >>We tried things like this in an earlier iteration[1] which assumed the SG > >>was

Re: [PATCH 1/2 v2] tpm: cmd_ready command can be issued only after granting locality

2018-01-28 Thread Jason Gunthorpe
On Sun, Jan 28, 2018 at 09:51:00AM +0200, Tomas Winkler wrote: > diff --git a/include/linux/tpm.h b/include/linux/tpm.h > index bcdd3790e94d..06639fb6ab85 100644 > +++ b/include/linux/tpm.h > @@ -44,7 +44,7 @@ struct tpm_class_ops { > bool (*update_timeouts)(struct tpm_chip *chip, >

Re: [PATCH] IB/cxgb3: remove cxio_dbg.c

2018-01-28 Thread Jason Gunthorpe
On Sun, Jan 28, 2018 at 08:24:22AM -0800, Joe Perches wrote: > On Sun, 2018-01-28 at 15:11 +, Corentin Labbe wrote: > > cxio_dbg.c is uncompiled since commit 2b540355cd2f ("RDMA/cxgb3: cleanups") > > 10 years after, we could remove it. > > OK, now you could remove the prototypes and probably >

Re: [PATCH 0/3] IB-iSER: Adjustments for three function implementations

2018-01-28 Thread Jason Gunthorpe
On Sun, Jan 28, 2018 at 04:41:16PM +0200, Max Gurtovoy wrote: > > > On 1/27/2018 8:17 PM, SF Markus Elfring wrote: > >From: Markus Elfring > >Date: Sat, 27 Jan 2018 19:02:34 +0100 > > > >Three update suggestions were taken into account > >from static source code analysis. > > > >Markus Elfring (

Re: [PATCH] IB/mthca: remove mthca_user.h

2018-01-28 Thread Jason Gunthorpe
On Sun, Jan 28, 2018 at 12:39:43PM +, Corentin Labbe wrote: > mthca_user.h is unused since commit 486f60954c71 ("IB/mthca: Move user vendor > structures") > Remove it from tree. > > Signed-off-by: Corentin Labbe > Reviewed-by: Leon Romanovsky > drivers/infiniband/hw/mthca/mthca_user.h | 11

Re: [PATCH] IB/qib: remove qib_keys.c

2018-01-28 Thread Jason Gunthorpe
On Sun, Jan 28, 2018 at 03:08:55PM +, Corentin Labbe wrote: > qib_keys.c was left uncompilable in commit 7c2e11fe2dbe ("IB/qib: Remove qp > and mr functionality from qib") > Since nothing need it, remove it from tree. > > Signed-off-by: Corentin Labbe > drivers/infiniband/hw/qib/qib_keys.c

Re: [PATCH 1/2 v2] tpm: cmd_ready command can be issued only after granting locality

2018-01-29 Thread Jason Gunthorpe
On Sun, Jan 28, 2018 at 09:17:53PM +, Winkler, Tomas wrote: > > I think if a driver can fail reliquish then it needs some kind of strategy > > to > > recover. > Maybe some driver can and some not, but if it doesn't succeed it > should return an error. But you can't just leave the driver in

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

2018-01-16 Thread Jason Gunthorpe
On Wed, Jan 17, 2018 at 12:55:37PM +1100, Stephen Rothwell wrote: > Hi all, > > On Wed, 17 Jan 2018 12:51:45 +1100 Stephen Rothwell > wrote: > > > > diff --cc drivers/infiniband/hw/mlx5/qp.c > > index cffe5966aef9,ae36db3d0deb.. > > +++ b/drivers/infiniband/hw/mlx5/qp.c > > @@@ -4361

Re: [PATCH 06/12] IB/core: Add optional PCI P2P flag to rdma_rw_ctx_[init|destroy]()

2018-01-08 Thread Jason Gunthorpe
On Mon, Jan 08, 2018 at 03:59:01PM +0100, Christoph Hellwig wrote: > On Thu, Jan 04, 2018 at 09:50:31PM -0700, Jason Gunthorpe wrote: > > Well that argument applies equally to the RDMA RW API wrappers around > > the DMA API. I think it is fine if sgl are defined to only have P2P

Re: [PATCH 06/12] IB/core: Add optional PCI P2P flag to rdma_rw_ctx_[init|destroy]()

2018-01-08 Thread Jason Gunthorpe
On Mon, Jan 08, 2018 at 11:17:38AM -0700, Logan Gunthorpe wrote: > >>If at all it should be in the dma_map* wrappers, but for that we'd need > >>a good identifier. And it still would not solve the whole fake dma > >>ops issue. > > > >Very long term the IOMMUs under the ops will need to care abou

Re: [PATCH 06/12] IB/core: Add optional PCI P2P flag to rdma_rw_ctx_[init|destroy]()

2018-01-08 Thread Jason Gunthorpe
On Mon, Jan 08, 2018 at 07:34:34PM +0100, Christoph Hellwig wrote: > > > > And on that topic, does this scheme work with HFI? > > > > > > No, and I guess we need an opt-out. HFI generally seems to be > > > extremely weird. > > > > This series needs some kind of fix so HFI, QIB, rxe, etc don't ge

Re: [PATCH 06/12] IB/core: Add optional PCI P2P flag to rdma_rw_ctx_[init|destroy]()

2018-01-08 Thread Jason Gunthorpe
On Mon, Jan 8, 2018 at 11:57 AM, Christoph Hellwig wrote: >> (c) setup/manage any security permissions on mappings >> Which P2P may at some point be concerned with. > > Maybe once root complexes with iommus actually support P2P. But until > then we have a lot more more important problems to solv

Re: [PATCH 06/12] IB/core: Add optional PCI P2P flag to rdma_rw_ctx_[init|destroy]()

2018-01-09 Thread Jason Gunthorpe
On Tue, Jan 09, 2018 at 05:46:40PM +0100, Christoph Hellwig wrote: > On Mon, Jan 08, 2018 at 12:49:50PM -0700, Jason Gunthorpe wrote: > > Pretty sure P2P capable IOMMU hardware exists. > > > > With SOC's we also have the scenario that an DMA originated from an > >

Re: Documentation: infiniband: move sysfs interface to ABI

2018-01-09 Thread Jason Gunthorpe
On Mon, Jan 08, 2018 at 02:23:42PM +0530, Aishwarya Pant wrote: > Hi > > In Documentation/infiniband/sysfs.txt, there is a description of the > infiniband > sysfs interface and there also exists > Documentation/ABI/testing/sysfs-class-infiniband which is out of date. > > Would it be useful to mo

Re: [PATCH] net/mlx4_en: ensure rx_desc updating reaches HW before prod db updating

2018-01-13 Thread Jason Gunthorpe
On Fri, Jan 12, 2018 at 01:01:56PM -0800, Saeed Mahameed wrote: > Simply putting a memory barrier on the top or the bottom of a functions, > means nothing unless you are looking at the whole picture, of all the > callers of that function to understand why is it there. When I review code I want t

Re: [PATCH] IB/cma: use strlcpy() instead of strncpy()

2018-01-15 Thread Jason Gunthorpe
On Fri, Jan 12, 2018 at 03:56:05PM +0800, Xiongfeng Wang wrote: > From: Xiongfeng Wang > > gcc-8 reports > > drivers/infiniband/core/cma_configfs.c: In function 'make_cma_dev': > ./include/linux/string.h:245:9: warning: '__builtin_strncpy' specified > bound 64 equals destination size [-Wstringop

Re: [PATCH] tpm: allow TCPA log area to be empty

2018-03-12 Thread Jason Gunthorpe
On Sat, Mar 10, 2018 at 06:16:37PM +0200, Jarkko Sakkinen wrote: > TCPA log are can be empty when the TPM is disabled. This commit changes the > behavior of tpm_read_log_acpi() to return successfully in this case. The commit should explain why we'd want this.. eg Why does it matter to create the

Re: [PATCH] security: Fix IMA Kconfig for dependencies on ARM64

2018-03-12 Thread Jason Gunthorpe
On Mon, Mar 12, 2018 at 05:53:18PM -0400, Mimi Zohar wrote: > Using Kconfig to force the TPM to be builtin is not required, but > helpful.  Users interested in IMA-measurement could configure the TPM > as builtin themselves.  Without the TPM builtin, IMA goes into TPM- > bypass mode. This issues,

Re: [PATCH] security: Fix IMA Kconfig for dependencies on ARM64

2018-03-12 Thread Jason Gunthorpe
On Mon, Mar 12, 2018 at 06:58:45PM -0400, Mimi Zohar wrote: > On Mon, 2018-03-12 at 15:59 -0600, Jason Gunthorpe wrote: > > On Mon, Mar 12, 2018 at 05:53:18PM -0400, Mimi Zohar wrote: > > > > > Using Kconfig to force the TPM to be builtin is not required, but > > &

Re: [PATCH v2 07/10] nvme-pci: Use PCI p2pmem subsystem to manage the CMB

2018-03-05 Thread Jason Gunthorpe
On Mon, Mar 05, 2018 at 09:57:27PM +0200, Sagi Grimberg wrote: > Keith, while we're on this, regardless of cmb, is SQE memcopy and DB update > ordering always guaranteed? > > If you look at mlx4 (rdma device driver) that works exactly the same as > nvme you will find: > -- > qp->s

Re: [PATCH v2 07/10] nvme-pci: Use PCI p2pmem subsystem to manage the CMB

2018-03-05 Thread Jason Gunthorpe
On Mon, Mar 05, 2018 at 01:42:12PM -0700, Keith Busch wrote: > On Mon, Mar 05, 2018 at 01:10:53PM -0700, Jason Gunthorpe wrote: > > So when reading the above mlx code, we see the first wmb() being used > > to ensure that CPU stores to cachable memory are visible to the DMA >

Re: [PATCH 1/6] tpm: sort objects in the Makefile

2018-03-05 Thread Jason Gunthorpe
On Mon, Mar 05, 2018 at 10:20:12PM +0200, Tomas Winkler wrote: > Make the tpm Makefile a bit more in order by putting > objects in one column and group together tpm2 modules > > Prefer tpm-objs += instead of tpm-y += notation. > > Signed-off-by: Tomas Winkler > drivers/char/tpm/Makefile | 14 ++

Re: [PATCH 1/6] tpm: sort objects in the Makefile

2018-03-05 Thread Jason Gunthorpe
On Mon, Mar 05, 2018 at 09:21:37PM +, Winkler, Tomas wrote: > > On Mon, Mar 05, 2018 at 10:20:12PM +0200, Tomas Winkler wrote: > > > Make the tpm Makefile a bit more in order by putting objects in one > > > column and group together tpm2 modules > > > > > > Prefer tpm-objs += instead of tpm-y +

Re: [PATCH 3/3] tpm_crb: use __le64 annotated variable for response buffer address

2018-03-06 Thread Jason Gunthorpe
On Tue, Mar 06, 2018 at 10:28:21AM +0200, Jarkko Sakkinen wrote: > On Mon, Mar 05, 2018 at 03:03:20PM +0200, Jarkko Sakkinen wrote: > > On Sun, Mar 04, 2018 at 02:12:05PM +0200, Tomas Winkler wrote: > > > This suppresses sparse warning > > > drivers/char/tpm/tpm_crb.c:558:18: warning: cast to restr

Re: [PATCH v3 3/5] tpm: migrate tpm2_probe() to use struct tpm_buf

2018-03-06 Thread Jason Gunthorpe
On Tue, Mar 06, 2018 at 01:37:31PM +0200, Jarkko Sakkinen wrote: > On Mon, 2018-03-05 at 18:56 +0200, Jarkko Sakkinen wrote: > > In order to make struct tpm_buf the first class object for constructing TPM > > commands, migrate tpm2_probe() to use it. > > > > Signed-off-by: Jarkko Sakkinen > > Ja

Re: [PATCH 1/3 RESEND] tpm: add longer timeouts for creation commands.

2018-03-06 Thread Jason Gunthorpe
On Tue, Mar 06, 2018 at 01:36:36PM -0500, Mimi Zohar wrote: > On Tue, 2018-03-06 at 08:32 -0800, James Bottomley wrote: > > On Tue, 2018-03-06 at 08:06 +, Winkler, Tomas wrote: > > > > > > > > > > > > On Mon, Mar 05, 2018 at 01:09:09PM +, Winkler, Tomas wrote: > > > > > > > > > > Why you

Re: [PATCH] infiniband: remove redundant assignment to pointer 'rdi'

2018-03-06 Thread Jason Gunthorpe
On Thu, Mar 01, 2018 at 04:23:54PM +, Colin Ian King wrote: > From: Colin Ian King > > The pointer rdi is being initialized with a value that is never read > and re-assigned immediately after, hence the initialization is redundant > and can be removed. > > Cleans up clang warning: > drivers/

Re: [PATCH v2] infiniband: hw: Drop unnecessary continue

2018-03-06 Thread Jason Gunthorpe
On Sat, Mar 03, 2018 at 09:54:57PM +0530, Arushi wrote: > Continue at the bottom of a loop are removed. > Issue found using drop_continue.cocci Coccinelle script. > > Signed-off-by: Arushi Singhal > Changes in v2: > - Braces is dropped from if with single statement. > > drivers/infiniband/hw/qi

Re: [PATCH] RDMA/bnxt_re/qplib_sp: Use true and false for boolean values

2018-03-06 Thread Jason Gunthorpe
On Mon, Mar 05, 2018 at 05:36:47PM -0600, Gustavo A. R. Silva wrote: > Assign true or false to boolean variables instead of an integer value. > > This issue was detected with the help of Coccinelle. > > Signed-off-by: Gustavo A. R. Silva > Acked-by: Selvin Xavier > --- > drivers/infiniband/hw/

Re: [PATCH 1/2] infiniband: qplib_fp: fix pointer cast

2018-03-06 Thread Jason Gunthorpe
On Wed, Mar 07, 2018 at 12:25:14AM +0100, Arnd Bergmann wrote: > On Wed, Feb 28, 2018 at 10:15 PM, Jason Gunthorpe wrote: > > On Tue, Feb 20, 2018 at 09:56:26PM +0100, Arnd Bergmann wrote: > >> Building for a 32-bit target results in a couple of warnings from casting > >

Re: [PATCH] security: Fix IMA Kconfig for dependencies on ARM64

2018-03-07 Thread Jason Gunthorpe
On Tue, Mar 06, 2018 at 11:26:26PM -0600, Jiandi An wrote: > TPM_CRB driver is the TPM support for ARM64. If it > is built as module, TPM chip is registered after IMA > init. tpm_pcr_read() in IMA driver would fail and > display the following message even though eventually > there is TPM chip on

[PATCH] kbuild: rpm-pkg: Support GNU tar >= 1.29

2018-03-23 Thread Jason Gunthorpe
in a huge package. Simple argument re-ordering fixes the problem. Signed-off-by: Jason Gunthorpe --- scripts/package/mkspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) At the very least this effects FC27. diff --git a/scripts/package/mkspec b/scripts/package/mkspec index

Re: [PATCH v3 01/11] PCI/P2PDMA: Support peer-to-peer memory

2018-03-26 Thread Jason Gunthorpe
On Mon, Mar 26, 2018 at 12:11:38PM +0100, Jonathan Cameron wrote: > On Tue, 13 Mar 2018 10:43:55 -0600 > Logan Gunthorpe wrote: > > > On 12/03/18 09:28 PM, Sinan Kaya wrote: > > > On 3/12/2018 3:35 PM, Logan Gunthorpe wrote: > > > Regarding the switch business, It is amazing how much trouble you

Re: [PATCH v3 01/11] PCI/P2PDMA: Support peer-to-peer memory

2018-03-26 Thread Jason Gunthorpe
On Mon, Mar 26, 2018 at 11:30:38AM -0600, Logan Gunthorpe wrote: > > > On 26/03/18 10:41 AM, Jason Gunthorpe wrote: > > On Mon, Mar 26, 2018 at 12:11:38PM +0100, Jonathan Cameron wrote: > >> On Tue, 13 Mar 2018 10:43:55 -0600 > >> Logan Gunthorpe wrote: >

[GIT PULL] Please pull RDMA subsystem changes

2018-04-06 Thread Jason Gunthorpe
onstify while there. IB/rxe: Remove unused variable (char *rxe_qp_state_name[]) Honggang Li (2): IB/core: Set speed string to SDR for invalid active rates IB/mlx5: Set the default active rate and width to QDR and 4X Ilya Lesokhin (1): IB/mlx5: Maintain a single emergency page

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