Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1578598

Re: [PATCH 6/6] tpm2: add session handle context saving and restoring to the space code

From James Bottomley <James.Bottomley@HansenPartnership.com>
Newsgroups linux.kernel
Subject Re: [PATCH 6/6] tpm2: add session handle context saving and restoring to the space code
Date 2017-02-10 17:30 +0100
Message-ID <t9mf7-5Nv-13@gated-at.bofh.it> (permalink)
References <t8ys1-84Y-7@gated-at.bofh.it> <t8ys2-84Y-33@gated-at.bofh.it> <t9iEy-3nS-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, 2017-02-10 at 14:32 +0200, Jarkko Sakkinen wrote:
> On Wed, Feb 08, 2017 at 01:07:08PM +0200, Jarkko Sakkinen wrote:
> > From: James Bottomley <James.Bottomley@HansenPartnership.com>
[...] 
> > +static int tpm2_session_add(struct tpm_chip *chip, u32 handle)
> > +{
> > +	struct tpm_space *space = &chip->work_space;
> > +	int i;
> > +
> > +	for (i = 0; i < ARRAY_SIZE(space->session_tbl); i++)
> > +		if (space->session_tbl[i] == 0)
> > +			break;
> > +	if (i == ARRAY_SIZE(space->session_tbl)) {
> > +		dev_err(&chip->dev, "out of session slots\n");
> 
> This really should be dev_dbg.

This was my reply to the comment the last time:

    I can do that, but I think this should be higher than debug.  If
    this trips, something an application was doing will fail with a non
    TPM error and someone may wish to investigate why.  Having a kernel
    message would help with that (but they won't see it if it's debug).

    I'm also leaning towards the idea that we should actually have one
    more _tbl slot than we know the TPM does, so that if someone goes
    over it's the TPM that gives them a real TPM out of memory error
    rather than the space code returning -ENOMEM.

    If you agree, I think it should be four for both sessions_tbl and
    context_tbl.

So I really don't think it should be debug.  Could we compromise on
dev_info?

James

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 6/6] tpm2: add session handle context saving and restoring to the space code Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-02-08 12:20 +0100
  Re: [PATCH 6/6] tpm2: add session handle context saving and  restoring to the space code Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-02-10 10:30 +0100
    Re: [PATCH 6/6] tpm2: add session handle context saving and  restoring to the space code James Bottomley <James.Bottomley@HansenPartnership.com> - 2017-02-10 17:30 +0100
      Re: [PATCH 6/6] tpm2: add session handle context saving and  restoring to the space code' Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-02-10 20:10 +0100
  Re: [PATCH 6/6] tpm2: add session handle context saving and  restoring to the space code Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-02-10 13:40 +0100
    Re: [PATCH 6/6] tpm2: add session handle context saving and  restoring to the space code James Bottomley <James.Bottomley@HansenPartnership.com> - 2017-02-10 17:30 +0100
      Re: [PATCH 6/6] tpm2: add session handle context saving and  restoring to the space code Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-02-10 20:20 +0100
        Re: [tpmdd-devel] [PATCH 6/6] tpm2: add session handle context  saving and restoring to the space code James Bottomley <James.Bottomley@HansenPartnership.com> - 2017-02-10 20:20 +0100
          Re: [tpmdd-devel] [PATCH 6/6] tpm2: add session handle context  saving and restoring to the space code Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-02-10 23:50 +0100

csiph-web