Re: [PATCH v9 0/5] tpm: Command duration logging and chip-specific override

2016-07-13 Thread Jason Gunthorpe
On Wed, Jul 13, 2016 at 09:44:05AM -0700, Ed Swierk wrote: > On Wed, Jul 13, 2016 at 9:19 AM, Ed Swierk wrote: > > v9: Include command duration in existing error messages rather than > > logging an extra debug message. Rebase onto Jarkko's tree. > > Incidentally, with

Re: [PATCH 2/2] tpm: add driver for cr50 on SPI

2016-07-21 Thread Jason Gunthorpe
On Thu, Jul 21, 2016 at 11:10:47AM -0700, Andrey Pronin wrote: > On Wed, Jul 20, 2016 at 11:03:36AM -0600, Jason Gunthorpe wrote: > > On Tue, Jul 19, 2016 at 05:24:11PM -0700, Andrey Pronin wrote: > > > > > The only two things that bother me with such approach are > &g

Re: [PATCH v3 2/2] tpm: add driver for cr50 on SPI

2016-07-28 Thread Jason Gunthorpe
On Thu, Jul 28, 2016 at 04:01:41PM -0700, Dmitry Torokhov wrote: > > + u8 tx_buf[MAX_SPI_FRAMESIZE]; > > + u8 rx_buf[MAX_SPI_FRAMESIZE]; > > Both of these need to be annotated as "cacheline_aligned" since we > eye them for use in DMA transfers. Huh. That sure looks true to me.. We make

Re: [PATCH v9 0/5] tpm: Command duration logging and chip-specific override

2016-07-13 Thread Jason Gunthorpe
On Wed, Jul 13, 2016 at 01:00:28PM -0700, Ed Swierk wrote: > On Wed, Jul 13, 2016 at 10:36 AM, Jason Gunthorpe > <jguntho...@obsidianresearch.com> wrote: > > I think your bios is broken? > > The BIOS is broken in many ways. I already have to pass > memmap=256M$0x80

Re: [PATCH v2 1/2] tpm: devicetree: document properties for cr50

2016-07-20 Thread Jason Gunthorpe
On Wed, Jul 20, 2016 at 12:49:12PM -0700, Andrey Pronin wrote: > Sorry, I just updated this patch description in v2 to indicate why they are > not > hard-coded, but didn't answer explicitly. As the firmware changes, a different > revision of it can have a different time before it sleeps in its

Re: [PATCH] tpm: fix a race condition tpm2_unseal_trusted()

2016-07-20 Thread Jason Gunthorpe
On Wed, Jul 20, 2016 at 11:53:14PM +0300, Jarkko Sakkinen wrote: > The only use cases I see at the moment for it work this way: > > 1. Call tpm_try_get_ops. > 2. Send a TPM command. > 3. Call tpm_put_ops. Right, but that is just a reflection of what the in kernel users are doing today, not

Re: [PATCH] tpm: fix a race condition tpm2_unseal_trusted()

2016-07-21 Thread Jason Gunthorpe
On Thu, Jul 21, 2016 at 12:02:45PM +0300, Jarkko Sakkinen wrote: > On Wed, Jul 20, 2016 at 03:13:32PM -0600, Jason Gunthorpe wrote: > > On Wed, Jul 20, 2016 at 11:53:14PM +0300, Jarkko Sakkinen wrote: > > > > > The only use cases I see at the moment for it work this w

Re: [PATCH] tpm_tis_core: convert max timeouts from msec to jiffies

2016-07-18 Thread Jason Gunthorpe
On Mon, Jul 18, 2016 at 09:45:32PM +0300, Jarkko Sakkinen wrote: > On Thu, Jul 14, 2016 at 05:29:40PM -0700, Andrey Pronin wrote: > > tpm_tis_core was missing conversion from msec when assigning > > max timeouts from constants. > > > > Signed-off-by: Andrey Pronin > >

Re: [PATCH v3 3/5] tpm: return error code from tpm_gen_interrupt()

2016-07-19 Thread Jason Gunthorpe
On Tue, Jul 19, 2016 at 04:32:47PM +0300, Jarkko Sakkinen wrote: > Return error code from tpm_gen_interrupt() and fail tpm_tis family of > drivers on a system error. It doesn't make sense to continue if we > cannot even reach the TPM. > > Signed-off-by: Jarkko Sakkinen

Re: [PATCH v3 0/5] Use tpm_transmit_cmd() consistently across kernel call sites

2016-07-19 Thread Jason Gunthorpe
from all function declarations in > tpm.h as suggested by Jason Gunthorpe. Other than my comment: Reviewed-by: Jason Gunthorpe <jguntho...@obsidianresearch.com> Jason

Re: [PATCH v3 3/5] tpm: return error code from tpm_gen_interrupt()

2016-07-19 Thread Jason Gunthorpe
0:00 2001 From: Jason Gunthorpe <jguntho...@obsidianresearch.com> Date: Tue, 19 Jul 2016 14:38:55 -0600 Subject: [PATCH] tpm/st33zp24: Remove useless tpm_gen_interrupt This function should only be called as part of an IRQ probing protocol and st33 does not have any code to detect that t

Re: [PATCH v4 3/5] tpm: replace tpm_gen_interrupt() with tpm_tis_gen_interrupt()

2016-07-20 Thread Jason Gunthorpe
failed. All the patches look good to me now.. Reviewed-by: Jason Gunthorpe <jguntho...@obsidianresearch.com> Jason

Re: [PATCH v2] tpm: add sysfs attributes for tpm2

2016-07-20 Thread Jason Gunthorpe
On Tue, Jul 19, 2016 at 07:51:52PM -0700, Andrey Pronin wrote: > Add sysfs attributes in TPM2.0 case for: > - TPM_PT_PERMANENT flags > - TPM_PT_STARTUP_CLEAR flags > - lockout-related properties I'm not completely sure we need to have these sysfs attributes. Do you have a reason to expose

Re: [PATCH 2/2] tpm: add driver for cr50 on SPI

2016-07-20 Thread Jason Gunthorpe
On Tue, Jul 19, 2016 at 05:24:11PM -0700, Andrey Pronin wrote: > The only two things that bother me with such approach are > (1) whatever names I pick for the new set of functions, they > will be similar to and thus might be confused with the > original tpm_tis_read/writeXX;

Re: [PATCH] tpm: fix a race condition tpm2_unseal_trusted()

2016-07-20 Thread Jason Gunthorpe
On Wed, Jul 20, 2016 at 03:16:32AM +0300, Jarkko Sakkinen wrote: > Unseal and load operations should be done as an atomic unit. This > commit fixes the issue by moving TPM mutex handling to tpm_try_get_ops() > and tpm_put_ops(), which is probably more logical place for it anyway. No.. 'get_ops'

Re: [PATCH 1/2] tpm: add sysfs attributes for tpm2

2016-07-15 Thread Jason Gunthorpe
On Fri, Jul 15, 2016 at 09:56:58AM -0700, Andrey Pronin wrote: > On Thu, Jul 14, 2016 at 09:34:39PM -0600, Jason Gunthorpe wrote: > > On Thu, Jul 14, 2016 at 08:32:01PM -0700, Andrey Pronin wrote: > > > > > tpm2 shares some of the attributes with tpm1 (e.g. timeouts). D

Re: [PATCH 2/2] tpm: fix byte-order for the value read by tpm2_get_tpm_pt

2016-07-15 Thread Jason Gunthorpe
On Fri, Jul 15, 2016 at 12:31:43PM -0700, Andrey Pronin wrote: > I even tried changing the code there to > __be32 vv = cmd.params.get_tpm_pt_out.value; > u32 ret = vv; > to make it clear what's going on. Still, no complaints from sparse. Hum, I'm not an expert at sparse, but I expect

[PATCH v4 0/2] Nuvoton TPM2 support

2016-07-12 Thread Jason Gunthorpe
This should be ready to go now. v4: - Fix build error noticed by Fengguang Wu when DT is enabled. - IRQ patch split out Jason Gunthorpe (2): tpm: Factor out common startup code tpm: Add TPM 2.0 support to the Nuvoton i2c driver (NPCT6xx family) .../devicetree/bindings/i2c/trivial

[PATCH v4 2/2] tpm: Add TPM 2.0 support to the Nuvoton i2c driver (NPCT6xx family)

2016-07-12 Thread Jason Gunthorpe
The command flow is exactly the same, the core simply needs to be told to enable TPM2 mode when the compatible string indicates a TPM2. Signed-off-by: Andrew Azmansky <andrew.zaman...@nuvoton.com> Tested-by: Andrew Zamansky <andrew.zaman...@nuvoton.com> Signed-off-by: Jason Guntho

[PATCH v4 1/2] tpm: Factor out common startup code

2016-07-12 Thread Jason Gunthorpe
to be tested with it enabled. Signed-off-by: Jason Gunthorpe <jguntho...@obsidianresearch.com> Tested-by: Andrew Zamansky <andrew.zaman...@nuvoton.com> Reviewed-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> --- drivers/char/tpm/st33zp24/st33zp24.c | 4 +--- drivers/c

Re: [PATCH] tpm_tis_core: convert max timeouts from msec to jiffies

2016-07-14 Thread Jason Gunthorpe
On Thu, Jul 14, 2016 at 05:29:40PM -0700, Andrey Pronin wrote: > tpm_tis_core was missing conversion from msec when assigning > max timeouts from constants. Yep. Reviewed-by: Jason Gunthorpe <jguntho...@obsidianresearch.com> Jason

Re: [PATCH 1/2] tpm_tis_core: add optional max xfer size check

2016-07-14 Thread Jason Gunthorpe
On Thu, Jul 14, 2016 at 06:39:04PM -0700, Andrey Pronin wrote: > +static inline u16 tpm_tis_max_xfer_size(struct tpm_tis_data *data) > +{ > + return data->phy_ops->max_xfer_size; > +} > + > +static inline bool tpm_tis_burstcnt_is_valid(struct tpm_tis_data *data, > +

Re: [PATCH 1/2] tpm: add sysfs attributes for tpm2

2016-07-14 Thread Jason Gunthorpe
On Thu, Jul 14, 2016 at 06:51:35PM -0700, Andrey Pronin wrote: > - sysfs_remove_link(>dev.parent->kobj, "ppi"); > - > - for (i = chip->groups[0]->attrs; *i != NULL; ++i) > - sysfs_remove_link(>dev.parent->kobj, (*i)->name); > + for (ngrp = 0; ngrp < chip->groups_cnt;

Re: [PATCH 0/2] tpm: add driver for cr50 on SPI

2016-07-14 Thread Jason Gunthorpe
On Thu, Jul 14, 2016 at 07:50:26PM -0700, Andrey Pronin wrote: > Yes, it has a TCG-compliant interface, however, there are several things > specific to this device: > - need to ensure a certain delay between spi transactions, or else >the chip can miss several first bytes. > - if there is no

Re: [PATCH 2/2] tpm: fix byte-order for the value read by tpm2_get_tpm_pt

2016-07-14 Thread Jason Gunthorpe
On Thu, Jul 14, 2016 at 08:17:01PM -0700, Andrey Pronin wrote: > conversion. The only place tpm2_get_tpm_pt() was used before was in > tpm2_gen_interrupt, which discarded the result. So, nobody noticed, > I guess. If you have a moment can you run sparse on this file before/after this change and

Re: [PATCH 2/2] tpm: support driver-specific sysfs attrs in tpm_tis_core

2016-07-14 Thread Jason Gunthorpe
On Thu, Jul 14, 2016 at 06:51:36PM -0700, Andrey Pronin wrote: > - WARN_ON(chip->groups_cnt != 0); Nope. > - const struct attribute_group *groups[3]; > + /* up to 4 attribute groups: > + * - driver-specific > + * - common TPM1.2 and TPM2.0 > + * - TPM1.2/2.0-specific >

Re: [PATCH 2/2] tpm: add driver for cr50 on SPI

2016-07-14 Thread Jason Gunthorpe
On Thu, Jul 14, 2016 at 07:20:18PM -0700, Andrey Pronin wrote: > +static int cr50_spi_read16(struct tpm_tis_data *data, u32 addr, u16 *result) > +{ > + int rc; > + > + rc = data->phy_ops->read_bytes(data, addr, sizeof(u16), (u8 *)result); > + if (!rc) > + *result =

Re: [PATCH 1/2] tpm: add sysfs attributes for tpm2

2016-07-14 Thread Jason Gunthorpe
On Thu, Jul 14, 2016 at 08:32:01PM -0700, Andrey Pronin wrote: > tpm2 shares some of the attributes with tpm1 (e.g. timeouts). Do I still > just add those separately for tpm2 to groups[1] and keep groups[0] empty? I think so. Since the file never exists for tpm2, nothing coded for tpm2 will ever

Re: [PATCH 2/2] tpm: fix byte-order for the value read by tpm2_get_tpm_pt

2016-07-14 Thread Jason Gunthorpe
rey, did sparse complain here or is there something more serious wrong as well?? Reviewed-by: Jason Gunthorpe <jguntho...@obsidianresearch.com> Jason

Re: [PATCH 1/2] tpm: define constants for tpm2 properties

2016-07-14 Thread Jason Gunthorpe
On Thu, Jul 14, 2016 at 06:07:17PM -0700, Andrey Pronin wrote: > Change-Id: I47cb1793736781fbea93e5bf80b783e0ac9e8628 These commit messages are no good, generally for all your patches. Drop the internal change-id and provide a suitable description. Do not add dead code to the kernel, so this

Re: Resurrecting due to huge ipoib perf regression - [BUG] skb corruption and kernel panic at forwarding with fragmentation

2016-07-08 Thread Jason Gunthorpe
On Fri, Jul 08, 2016 at 07:18:11AM -0700, Roland Dreier wrote: > On Thu, Jul 7, 2016 at 4:14 PM, Jason Gunthorpe > <jguntho...@obsidianresearch.com> wrote: > > We have neighbour_priv, and ndo_neigh_construct/destruct now .. > > > > A first blush that would seem t

Re: Resurrecting due to huge ipoib perf regression - [BUG] skb corruption and kernel panic at forwarding with fragmentation

2016-07-07 Thread Jason Gunthorpe
On Thu, Jul 07, 2016 at 03:01:40PM -0700, Roland Dreier wrote: > The reason we moved to the cb storage is that in the past, trying to > hide some data in the actual skb buffer that we don't actually send We have neighbour_priv, and ndo_neigh_construct/destruct now .. A first blush that would

Re: [PATCH] tpm: fix a race condition tpm2_unseal_trusted()

2016-08-09 Thread Jason Gunthorpe
On Tue, Aug 09, 2016 at 01:36:29PM +0300, Jarkko Sakkinen wrote: > Functionally my patch should not break anything. I understand the need > for clean up of locking but why doing this now to make the driver > non-racy would make clean up later on any harder? Then rename the functions so they

Re: [PATCH] powerpc: Do not make the entire heap executable

2016-08-02 Thread Jason Gunthorpe
On Mon, Aug 01, 2016 at 11:07:21PM +0200, Denys Vlasenko wrote: > On 32-bit powerps the ELF PLT sections of binaries (built with --bss-plt, > or with a toolchain which defaults to it) look like this: Hi Denys, Thanks for resurrecting this, I am still interested here, we have been using this

Re: [PATCH] tpm: fix cacheline alignment for DMA-able buffers

2016-07-29 Thread Jason Gunthorpe
On Thu, Jul 28, 2016 at 07:59:13PM -0700, Andrey Pronin wrote: > Annotate buffers used in spi transactions as cacheline_aligned > to use in DMA transfers. > > Signed-off-by: Andrey Pronin > drivers/char/tpm/st33zp24/spi.c | 4 ++-- > drivers/char/tpm/tpm_tis_spi.c | 4

Re: [PATCH v4 1/2] tpm: devicetree: document properties for cr50

2016-07-29 Thread Jason Gunthorpe
On Thu, Jul 28, 2016 at 06:55:13PM -0700, Andrey Pronin wrote: > Add TPM2.0 PTP FIFO compatible SPI interface for chips with Cr50 > firmware. Since this is now a trivial device, does it still need a dedicated file? Jason

Re: [tpmdd-devel] [PATCH] tpm: fix cacheline alignment for DMA-able buffers

2016-08-09 Thread Jason Gunthorpe
On Tue, Aug 09, 2016 at 08:18:00AM -0700, Dmitry Torokhov wrote: >Well, the main reason was simplicity and invasiveness of the >change. Well, it isn't simple, because the proposed patches have had subtle problems with DMA. Simple is to use a guaranteed dma-able allocation for DMA memory

Re: [PATCH -next] tpm_tis: fix the error handling of init_tis()

2017-02-07 Thread Jason Gunthorpe
e6be ("tpm_tis: Clean up the force=1 module parameter") > Signed-off-by: Wei Yongjun <weiyongj...@huawei.com> > drivers/char/tpm/tpm_tis.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Yep. Thanks Reviewed-by: Jason Gunthorpe <jguntho...@obsidianresearch.com> Jason

Re: [PATCH 2/6] tpm: export tpm2_flush_context_cmd

2017-02-08 Thread Jason Gunthorpe
> /** > + * tpm2_flush_context_cmd() - execute a TPM2_FlushContext command > + * @chip: TPM chip to use > + * @payload: the key data in clear and encrypted form > + * @options: authentication values and other options > + * > + * Return: same as with tpm_transmit_cmd > + */ > +void

Re: [PATCH RFC 2/2] IB/hfi1: Fix port ordering issue in a multiport device

2017-02-06 Thread Jason Gunthorpe
On Mon, Feb 06, 2017 at 11:15:33AM -0800, Tadeusz Struk wrote: > Some hardware has multiple HFIs within the same ASIC, each one on a > sepatate bus number. In some devices the numbers labeled on the > faceplate of the device don't match the PCI bus order, and the result > is that the devices

[PATCH v4 fpga 1/4] fpga zynq: Check for errors after completing DMA

2017-02-01 Thread Jason Gunthorpe
which were using the wrong bits, simplify all of this stuff. Signed-off-by: Jason Gunthorpe <jguntho...@obsidianresearch.com> Reviewed-by: Moritz Fischer <moritz.fisc...@ettus.com> Acked-by: Alan Tull <at...@opensource.altera.com> --- drivers/fpg

[PATCH v4 fpga 4/4] fpga zynq: Use the scatterlist interface

2017-02-01 Thread Jason Gunthorpe
. Signed-off-by: Jason Gunthorpe <jguntho...@obsidianresearch.com> Acked-by: Moritz Fischer <moritz.fisc...@ettus.com> --- drivers/fpga/zynq-fpga.c | 174 --- 1 file changed, 135 insertions(+), 39 deletions(-) diff --git a/drivers/fpga/z

[PATCH v4 fpga 3/4] fpga: Add scatterlist based programming

2017-02-01 Thread Jason Gunthorpe
can call to directly provide page lists. The full matrix of compatibility is provided, either the linear or sg interface can be used by the user with a driver supporting either interface. A notable change for drivers is that the .write op can now be called multiple times. Signed-off-by: Jason

[PATCH v4 fpga 0/4] Gather DMA for Zynq FPGA programming

2017-02-01 Thread Jason Gunthorpe
Hi Greg/Alan, This should be ready to land in 4.11, it is now fully acked. The purpose of this series is to implement Gather DMA for Zynq FPGA programming. Previously the driver would allocate a large contiguous DMA buffer and copy the bitfile into it. Jason Gunthorpe (4): fpga zynq: Check

[PATCH v4 fpga 2/4] fpga zynq: Check the bitstream for validity

2017-02-01 Thread Jason Gunthorpe
they are using a malformed bistream and programming failure isn't for any of the myriad of other reasons. Signed-off-by: Jason Gunthorpe <jguntho...@obsidianresearch.com> Acked-by: Moritz Fischer <moritz.fisc...@ettus.com> Acked-by: Alan Tull <at...@opensource.altera.com> ---

Re: [PATCH RFC v4 4/5] tpm: split out tpm-dev.c into tpm-dev.c and tpm-common-dev.c

2017-01-23 Thread Jason Gunthorpe
On Mon, Jan 23, 2017 at 01:44:32AM +0200, Jarkko Sakkinen wrote: > From: James Bottomley > > Signed-off-by: James Bottomley > I really think we should not use the ugly read/write interface for any new things. Still

Re: [PATCH] tpm/tpm_i2c_infineon: ensure no ongoing commands on shutdown

2017-01-23 Thread Jason Gunthorpe
On Mon, Jan 23, 2017 at 12:02:46PM -0800, Andrey Pronin wrote: > > But if there is no actual need to do this right now then don't worry > > about overdesigning things.. > > OK, I can live with chip->id specific logic in probe/shutdown, if that's > the current approach. It is where we are

Re: [tpmdd-devel] [PATCH RFC v4 4/5] tpm: split out tpm-dev.c into tpm-dev.c and tpm-common-dev.c

2017-01-23 Thread Jason Gunthorpe
On Mon, Jan 23, 2017 at 02:57:11PM -0800, James Bottomley wrote: > On Mon, 2017-01-23 at 15:49 -0700, Jason Gunthorpe wrote: > > On Mon, Jan 23, 2017 at 02:28:23PM -0800, James Bottomley wrote: > > > On Mon, 2017-01-23 at 09:47 -0700, Jason Gunthorpe wrote: > > > >

Re: [tpmdd-devel] [PATCH RFC v4 4/5] tpm: split out tpm-dev.c into tpm-dev.c and tpm-common-dev.c

2017-01-23 Thread Jason Gunthorpe
On Mon, Jan 23, 2017 at 03:20:12PM -0800, James Bottomley wrote: > > So you are saying there is so much already deployed TPM2 software > > that has this TPM_DEVICE env var convention that we need to support > > it with compat? > > > > I'm really surprised by that.. But OK. > > > > Can you at

Re: [tpmdd-devel] [PATCH RFC v4 4/5] tpm: split out tpm-dev.c into tpm-dev.c and tpm-common-dev.c

2017-01-23 Thread Jason Gunthorpe
On Mon, Jan 23, 2017 at 03:45:58PM -0800, James Bottomley wrote: > Why don't you start by doubling the timeout? If nothing notices, > chances are nothing relies on this aspect of the interface and it can > be easily removed. Okay, fair enough, with a print I think it solves my concern. I sent a

[PATCH] tpm: Begin the process to deprecate user_read_timer

2017-01-23 Thread Jason Gunthorpe
be relying on this, double the timeout and print a warning. We can remove the code in a few years, but this should be enough to prevent new users. Suggested-by: James Bottomley <james.bottom...@hansenpartnership.com> Signed-off-by: Jason Gunthorpe <jguntho...@obsidianresearch.com> ---

Re: [PATCH RFC] tpm: define a command filter

2017-01-23 Thread Jason Gunthorpe
On Tue, Jan 24, 2017 at 02:02:52AM +0200, Jarkko Sakkinen wrote: > This commit adds a command filter for whitelisting a set of commands in > a TPM space. When a TPM space is created through /dev/tpms0, no > commands are allowed. The user of the TPM space must explicitly define > the list of

Re: [PATCH] tpm/tpm_i2c_infineon: ensure no ongoing commands on shutdown

2017-01-23 Thread Jason Gunthorpe
On Mon, Jan 23, 2017 at 02:19:29PM -0800, Andrey Pronin wrote: > Simplifying to class vs driver handlers, it checks class suspend > first. And if it exists, calls it. Otherwise, it calls driver > suspend. So, it's "either-or", not "first one, then another". > Unless I'm missing something obvious,

Re: [tpmdd-devel] [PATCH RFC v4 4/5] tpm: split out tpm-dev.c into tpm-dev.c and tpm-common-dev.c

2017-01-23 Thread Jason Gunthorpe
On Mon, Jan 23, 2017 at 02:28:23PM -0800, James Bottomley wrote: > On Mon, 2017-01-23 at 09:47 -0700, Jason Gunthorpe wrote: > > On Mon, Jan 23, 2017 at 01:44:32AM +0200, Jarkko Sakkinen wrote: > > > From: James Bottomley <james.bottom...@hansenpartnership.com> > >

Re: [PATCH RFC] tpm: define a command filter

2017-01-24 Thread Jason Gunthorpe
On Tue, Jan 24, 2017 at 04:36:00PM +0200, Jarkko Sakkinen wrote: > On Mon, Jan 23, 2017 at 05:19:18PM -0700, Jason Gunthorpe wrote: > > On Tue, Jan 24, 2017 at 02:02:52AM +0200, Jarkko Sakkinen wrote: > > > This commit adds a command filter for whitelisting a set of commands in

Re: [PATCH RFC] tpm: define a command filter

2017-01-26 Thread Jason Gunthorpe
On Thu, Jan 26, 2017 at 01:14:03PM +0200, Jarkko Sakkinen wrote: > On Wed, Jan 25, 2017 at 03:11:36PM -0700, Jason Gunthorpe wrote: > > On Wed, Jan 25, 2017 at 10:21:37PM +0200, Jarkko Sakkinen wrote: > > > > > There should be anyway someway to limit what commands

Re: [PATCH] PCI: mvebu: Handle changes to the bridge windows while enabled

2017-01-30 Thread Jason Gunthorpe
On Mon, Jan 30, 2017 at 09:41:36AM -0600, Bjorn Helgaas wrote: > On Mon, Dec 12, 2016 at 11:30:20AM -0700, Jason Gunthorpe wrote: > > The PCI core will write to the bridge window config multiple times > > while they are enabled. This can lead to mbus failures like: > > > &

Re: [PATCH v3 fpga 3/4] fpga: Add scatterlist based programming

2017-01-27 Thread Jason Gunthorpe
On Mon, Jan 09, 2017 at 04:13:38PM -0600, Alan Tull wrote: > On Mon, Jan 9, 2017 at 10:12 AM, Jason Gunthorpe > <jguntho...@obsidianresearch.com> wrote: > > On Mon, Jan 09, 2017 at 10:04:36AM -0600, Alan Tull wrote: > > > >> > diff --git a/drivers/fpga/

Re: [tpmdd-devel] [RFC] tpm2-space: add handling for global session exhaustion

2017-01-27 Thread Jason Gunthorpe
On Fri, Jan 27, 2017 at 02:04:59PM -0800, James Bottomley wrote: > if I look at the code I've written, I don't know what the session > number is, I just save sessionHandle in a variable for later use (lets > say to v1). If I got the same session number returned at a later time > and placed it in

Re: [PATCH] tpm: remove tpm_read_index and tpm_write_index from tpm.h

2017-01-25 Thread Jason Gunthorpe
On Wed, Jan 25, 2017 at 04:48:58PM +0200, Jarkko Sakkinen wrote: > These are non-generic functions and do not belong to tpm.h. > > Signed-off-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> Reviewed-by: Jason Gunthorpe <jguntho...@obsidianresearch.com> Jason

Re: [PATCH RFC] tpm: define a command filter

2017-01-25 Thread Jason Gunthorpe
On Wed, Jan 25, 2017 at 10:21:37PM +0200, Jarkko Sakkinen wrote: > There should be anyway someway to limit what commands can be sent but > I understand your point. What is the filter for? James and I talked about a filter to create a safer cdev for use by users. However tpms0 cannot be that

Re: [PATCH] tpm: fix RC value check in tpm2_seal_trusted

2017-01-25 Thread Jason Gunthorpe
On Wed, Jan 25, 2017 at 11:03:48PM +0200, Jarkko Sakkinen wrote: > Fixes: 5ca4c20cfd37 ("keys, trusted: select hash algorithm for TPM2 chips") > Signed-off-by: Jarkko Sakkinen I think you need a commit message for this.. Is this following the spec? Jason

Re: [PATCH] tpm: fix RC value check in tpm2_seal_trusted

2017-01-26 Thread Jason Gunthorpe
On Thu, Jan 26, 2017 at 01:27:14PM +0200, Jarkko Sakkinen wrote: > "The error code handling is bogus as any error code that has the bits > set that TPM_RC_HASH could pass. Implemented tpm2_rc_value() helper to > parse the error value from FMT0 and FMT1 error codes to use to check the > error so

Re: [PATCH] tpm: fix RC value check in tpm2_seal_trusted

2017-01-27 Thread Jason Gunthorpe
On Fri, Jan 27, 2017 at 08:43:27AM +0200, Jarkko Sakkinen wrote: > On Thu, Jan 26, 2017 at 11:32:52AM -0700, Jason Gunthorpe wrote: > > On Thu, Jan 26, 2017 at 01:27:14PM +0200, Jarkko Sakkinen wrote: > > > > > "The error code handling is bogus as any error cod

Re: ibmvtpm byteswapping inconsistency

2017-01-26 Thread Jason Gunthorpe
On Thu, Jan 26, 2017 at 09:22:48PM +0100, Michal Such??nek wrote: > This is repeated a few times in the driver so I added memset to quiet > gcc and make behavior deterministic in case the unused fields get some > meaning in the future. Yep, reserved certainly needs to be zeroed.. Can you send a

Re: [RFC 7/8] fpga-region: add sysfs interface

2017-02-21 Thread Jason Gunthorpe
On Tue, Feb 21, 2017 at 07:49:19PM -0800, Moritz Fischer wrote: > fdt does this out of the box, too. So far I've seen nothing fdt > couldn't do (or doesn't do let's rather say). tlv/fdt/http headers are all essentially exactly the same thing. Key/value pairs with various encoding schemes. I

Re: [RFC 7/8] fpga-region: add sysfs interface

2017-02-22 Thread Jason Gunthorpe
On Wed, Feb 22, 2017 at 09:50:54AM -0800, Moritz Fischer wrote: > > For instance, we could mark Encrypted as required, and a zynq driver > > that does not support the Encrypted tag would not load the bitfile > > rather than try to load it wrongly. > > Funny you'd mention that. Thanks to your

Re: [PATCH] device-dax: fix cdev leak

2017-02-23 Thread Jason Gunthorpe
gan Gunthorpe <log...@deltatee.com> > Reported-by: Jason Gunthorpe <jguntho...@obsidianresearch.com> > Signed-off-by: Dan Williams <dan.j.willi...@intel.com> > drivers/dax/dax.c |1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/dax/dax.c

Re: [tpmdd-devel] [PATCH v2 6/7] tpm: expose spaces via a device link /dev/tpms

2017-02-24 Thread Jason Gunthorpe
On Fri, Feb 24, 2017 at 06:43:27PM -0500, James Bottomley wrote: > > It just seems confusing to call something a namespace that isn't also > > a CLONE_NEW* option.. > > Well, there's namespace behaviour and then there's how you enter them. > We have namespace behaviour with the /dev/tpms but

Re: [PATCH v2 6/7] tpm: expose spaces via a device link /dev/tpms

2017-02-24 Thread Jason Gunthorpe
On Fri, Feb 24, 2017 at 07:39:22PM +0200, Jarkko Sakkinen wrote: > > I think therefore that tpmns for TPM Namespace would be very > > appropriate. > > Makes sense. We can go with tpmns. When we have talked about TPM namespaces in the past it has been around the idea of restricting which TPMs

Re: [RFC] Add a parser in fpga_region to decode the tlv meta data suggested by Sundar

2017-02-24 Thread Jason Gunthorpe
On Fri, Feb 24, 2017 at 09:41:12PM +, Nadathur, Sundar wrote: > I have talked about the need for structs and arrays, potentially > nested, without really explaining why we may need them > eventually. I'll get to that in a moment. But, can we agree that, if > nested structs, arrays and general

Re: [PATCH v2 6/7] tpm: expose spaces via a device link /dev/tpms

2017-02-24 Thread Jason Gunthorpe
On Fri, Feb 24, 2017 at 03:29:15PM -0500, James Bottomley wrote: > On Fri, 2017-02-24 at 11:11 -0700, Jason Gunthorpe wrote: > > On Fri, Feb 24, 2017 at 07:39:22PM +0200, Jarkko Sakkinen wrote: > > > > > > I think therefore that tpmns for TPM Namespace would

Re: [tpmdd-devel] [PATCH v2 6/7] tpm: expose spaces via a device link /dev/tpms

2017-02-24 Thread Jason Gunthorpe
On Fri, Feb 24, 2017 at 06:01:00PM -0500, James Bottomley wrote: > Well, as a glib answer, I'd say the TPM is a device, so the thing which > restricts device access to containers is the device cgroup ... that's > what we should be plugging into. I'd have to look, but I suspect the > device

Re: [PATCH] switchtec: cleanup cdev init

2017-02-21 Thread Jason Gunthorpe
On Sun, Feb 19, 2017 at 09:22:35PM -0700, Logan Gunthorpe wrote: > Really, in any situation where there's a cdev and a device in the same > structure, the life cycles of the two become linked but their reference > counts are not and that is the problem here. Yes, the cdev must hold a kref on the

Re: [RFC 7/8] fpga-region: add sysfs interface

2017-02-22 Thread Jason Gunthorpe
On Tue, Feb 21, 2017 at 10:05:42PM -0800, Moritz Fischer wrote: > That being said older drivers / fpga-mgr will not deal with newer features. > TLV / KV or whatever doesn't change this fact, or am I missing something? Often a scheme will have an OPTIONAL and REQUIRED flag for each value. If a

Re: [tpmdd-devel] [RFC] tpm2-space: add handling for global session exhaustion

2017-02-09 Thread Jason Gunthorpe
On Thu, Feb 09, 2017 at 11:29:51AM -0800, James Bottomley wrote: > On Thu, 2017-02-09 at 12:04 -0700, Jason Gunthorpe wrote: > > On Thu, Feb 09, 2017 at 05:19:22PM +0200, Jarkko Sakkinen wrote: > > > The current patch set does not define policy. The simple policy > > > a

Re: [RFC 7/8] fpga-region: add sysfs interface

2017-02-16 Thread Jason Gunthorpe
On Thu, Feb 16, 2017 at 11:47:08AM -0600, Alan Tull wrote: > > Just to clarify: I was proposing using the binary format of dts, > > not actually requiring devicetree for it to work. There's plenty > > of people running u-boot on x86 using FIT images to boot. > > The FPGA images should not be

Re: [RFC 7/8] fpga-region: add sysfs interface

2017-02-15 Thread Jason Gunthorpe
On Wed, Feb 15, 2017 at 12:07:15PM -0800, matthew.gerl...@linux.intel.com wrote: > The format of the meta data associated with a fpga bitstream is certainly a > subject on its own. HTTP style plain text is definately easy to understand > and more importantly it is extendable. On the other hand,

Re: [PATCH] tpm: declare tpm2_get_pcr_allocation() as static

2017-02-15 Thread Jason Gunthorpe
On Wed, Feb 15, 2017 at 08:02:28PM +0200, Jarkko Sakkinen wrote: > There's no need to export tpm2_get_pcr_alloation() because it is only > a helper function for tpm2_auto_startup(). For the same reason it does > not make much sense to maintain documentation for it. Please stop moving these

Re: [RFC 7/8] fpga-region: add sysfs interface

2017-02-15 Thread Jason Gunthorpe
On Wed, Feb 15, 2017 at 11:46:01AM -0600, Alan Tull wrote: > I agree. I've heard some discussions about adding a header. We would > want it to not be manufacturer or fpga device specific. That would be > nice and would eliminate some of this struct. We would need a tool to > add the header,

Re: [RFC 7/8] fpga-region: add sysfs interface

2017-02-15 Thread Jason Gunthorpe
On Wed, Feb 15, 2017 at 10:14:20AM -0600, Alan Tull wrote: > Add a sysfs interface to control programming FPGA. > > Each fpga-region will get the following files which set values > in the fpga_image_info struct for that region. More files will > need to be added as fpga_image_info expands. > >

Re: [RFC 7/8] fpga-region: add sysfs interface

2017-02-15 Thread Jason Gunthorpe
On Wed, Feb 15, 2017 at 12:54:27PM -0800, Moritz Fischer wrote: > Well I don't know ;-) With something fdt based we already have > parsers there, Not sure.. How does incbin work in DTB? We have the FPGA in a s/g list so we cannot pass the entire file to libfdt - is that consistent with incbin?

Re: [RFC 7/8] fpga-region: add sysfs interface

2017-02-15 Thread Jason Gunthorpe
On Wed, Feb 15, 2017 at 04:49:58PM -0600, Alan Tull wrote: > So this script takes the bitfile and its build logs as input, parses > the build logs for image information, does some manipulations on bit > order as needed, and adds the header. So it's really doing (at least) > two things: adding

Re: [RFC 7/8] fpga-region: add sysfs interface

2017-02-15 Thread Jason Gunthorpe
On Wed, Feb 15, 2017 at 12:23:28PM -0600, Alan Tull wrote: > > This is usually the sort of stuff I'd punt to userspace, but since the > > kernel is doing request_firmware it is hard to see how that is an > > option in this case... > > I like how extensible (and readable!) this is. It wouldn't

Re: [tpmdd-devel] [RFC] tpm2-space: add handling for global session exhaustion

2017-02-09 Thread Jason Gunthorpe
On Thu, Feb 09, 2017 at 05:19:22PM +0200, Jarkko Sakkinen wrote: > > userspace instance with subsequent relinquishment of privilege. At > > that point one has the freedom to implement all sorts of policy. > > If you look at the patch set that I sent yesterday it exactly has a > feature that

Re: [PATCH] tpm/tpm_i2c_infineon: ensure no ongoing commands on shutdown

2017-01-17 Thread Jason Gunthorpe
On Tue, Jan 17, 2017 at 09:58:27AM -0800, Andrey Pronin wrote: > > Yes, sorry, I should have mentioned that.. Maybe that is too much to > > fix.. > > If we fix sysfs to go through tpm_try_get_ops, then all we can do for > shutdown is indeed something like Maybe yes, I also had at one point a

Re: [PATCH v2 00/26] IB: Optimize DMA mapping

2017-01-17 Thread Jason Gunthorpe
On Tue, Jan 17, 2017 at 10:00:00PM +, Bart Van Assche wrote: > + /* > + * qib and hfi1 use two sets of DMA operations: > + * - The DMA operations of the PCIe device for SDMA. > + * - dma_virt_ops for users of the qib and hfi1 drivers. > + * The only purpose of

Re: [PATCH] tpm/tpm_i2c_infineon: ensure no ongoing commands on shutdown

2017-01-17 Thread Jason Gunthorpe
On Tue, Jan 17, 2017 at 12:13:36PM -0800, Andrey Pronin wrote: > > Is there some way we can have the TPM core do this without requiring > > the driver to add a shutdown the struct driver? > > > > Maybe we could put something in chip->dev->driver? Not sure.. > > I can play more with it. We can

Re: [PATCH] tpm/tpm_i2c_infineon: ensure no ongoing commands on shutdown

2017-01-17 Thread Jason Gunthorpe
On Tue, Jan 17, 2017 at 03:00:53PM -0800, Andrey Pronin wrote: > Here I was talking not about tpm_tis_spi or tpm_tis. Those can > continue relying on the core, or register the default handler using > .shutdown = tpm_shutdown. I'm talking about the driver like > tpm_i2c_infineon, which although

Re: [PATCH v2 00/26] IB: Optimize DMA mapping

2017-01-17 Thread Jason Gunthorpe
On Tue, Jan 17, 2017 at 10:33:16PM +, Bart Van Assche wrote: > again and also the dma_device pointer from struct ib_device. Since the > dev.dma_ops pointer in struct ib_device is not yet used dev.dma_ops can be > used > instead of the dma_device pointer. okay great Jason

Re: [PATCH] tpm/tpm_i2c_infineon: ensure no ongoing commands on shutdown

2017-01-16 Thread Jason Gunthorpe
On Fri, Jan 13, 2017 at 04:42:30PM -0800, Andrey Pronin wrote: > On Fri, Jan 13, 2017 at 05:28:57PM -0700, Jason Gunthorpe wrote: > > On Fri, Jan 13, 2017 at 04:09:54PM -0800, Andrey Pronin wrote: > > > Resetting TPM while processing a command may lead to issues > > &g

Re: [PATCH RFC v3 5/5] tpm2: expose resource manager via a device link /dev/tpms

2017-01-16 Thread Jason Gunthorpe
On Mon, Jan 16, 2017 at 03:12:11PM +0200, Jarkko Sakkinen wrote: > @@ -199,7 +227,9 @@ struct tpm_chip *tpm_chip_alloc(struct device *pdev, > return chip; > > out: > + put_device(>devrm); > put_device(>dev); > + put_device(>devrm); > return ERR_PTR(rc); > }

Re: [tpmdd-devel] [PATCH RFC v2 5/5] tpm2: expose resource manager via a device link /dev/tpms

2017-01-16 Thread Jason Gunthorpe
On Fri, Jan 13, 2017 at 05:10:30PM -0800, James Bottomley wrote: > > No, it is correct as is. The cdev fops rely only on the tpm module. > > When tpm_chip_unregister returns to the driver the chips->ops is set > > to NULL with proper locking - the driver code becomes uncallable at > > that point.

Re: [PATCH v4] powerpc: Do not make the entire heap executable

2016-08-22 Thread Jason Gunthorpe
On Mon, Aug 22, 2016 at 08:37:05PM +0200, Denys Vlasenko wrote: > >Is this going to break any application ? I am asking because you > >mentioned the patch is lightly tested. > > I booted powerpc64 machine with RHEL7 installation, > it did not catch fire. When I authored the original patch my

Re: [PATCH v5 0/4] New Microsemi PCI Switch Management Driver

2017-03-01 Thread Jason Gunthorpe
On Wed, Mar 01, 2017 at 03:49:04PM -0700, Logan Gunthorpe wrote: > Seems to me like an elegant solution would be to implement a 'cdev_kill' > function which could kill all the processes using a cdev. Thus, during > an unbind, a driver could call it and be sure that there are no users > left and

Re: [tpmdd-devel] [PATCH] tpm: do not suspend/resume if power stays on

2017-03-01 Thread Jason Gunthorpe
On Wed, Mar 01, 2017 at 02:39:09PM -0800, Sonny Rao wrote: > > We recently added global suspend/resume callbacks to the TPM > > core. Those call backs do not power off the TPM, they just prepare its > > internal state to loose power to the chip. Skipping that process on > > hardware that does not

Re: [PATCH v5 0/4] New Microsemi PCI Switch Management Driver

2017-03-01 Thread Jason Gunthorpe
On Wed, Mar 01, 2017 at 05:23:38PM -0700, Logan Gunthorpe wrote: > > That could help, but this would mean cdev would have to insert a shim > > to grab locks around the various file ops. > > Hmm, I was hoping something more along the lines of actually killing the > processes instead of just

Re: [tpmdd-devel] [PATCH v2 6/7] tpm: expose spaces via a device link /dev/tpms

2017-02-27 Thread Jason Gunthorpe
On Sat, Feb 25, 2017 at 12:04:49PM -0500, James Bottomley wrote: > > device cgroup blocks access to the cdevs of tpm0 but not to the > > sysfs files. > > What the device cgroup currently does for us and what it could do are > two different things. It seems if it exported >

Re: [PATCH v2 6/7] tpm: expose spaces via a device link /dev/tpms

2017-02-27 Thread Jason Gunthorpe
On Sun, Feb 26, 2017 at 01:44:40PM +0200, Jarkko Sakkinen wrote: > There's now tabrm-v3 branch. I had to tweak error handling in your > device adding patch because of b4e9d7561a70. I hope I didn't break > anything. Just looked, the flow seemed like it works to me. Just confusing that

Re: [PATCH] tpm: invalid self test error message

2016-09-02 Thread Jason Gunthorpe
n startup code") Reviewed-by: Jason Gunthorpe <jguntho...@obsidianresearch.com> Reported-by: Petr Vandrovec <p...@vmware.com> Jason

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