All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [tpm2] [tpm2-driver] Error at boot : A TPM error (256) occurred continue selftest
@ 2019-08-23 17:21 Roberts, William C
  0 siblings, 0 replies; 4+ messages in thread
From: Roberts, William C @ 2019-08-23 17:21 UTC (permalink / raw)
  To: tpm2

[-- Attachment #1: Type: text/plain, Size: 1878 bytes --]

You should be able to ignore that. But I am unsure of what is leading you to that state. Is someone
Sending a selftest command before a startup command? The startup command, when not in field upgrade
Mode, should be startup. So when the tpm initializes, it expects one of the first commands as described
In the spec:
https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-1-Architecture-01.38.pdf

The first command sent to the tpm should be a startup command..... you can see that in Figure 5 on page 57
Of the spec above and described in detail in section 12.2.2

Bill

> -----Original Message-----
> From: tpm2 [mailto:tpm2-bounces(a)lists.01.org] On Behalf Of Gael GUEGAN
> Sent: Thursday, August 8, 2019 3:35 AM
> To: tpm2(a)lists.01.org; javierm(a)redhat.com
> Subject: [tpm2] [tpm2-driver] Error at boot : A TPM error (256) occurred continue
> selftest
> 
> Hello all,
> 
> 
> 
> I am working with the linux kernel version 4.9 on an embedded target.
> 
> And I am having the following error message from the TPM driver at boot :
> 
> 
> 
> > $  dmesg | grep TPM
> 
> [    2.946137] tpm_tis_spi spi32766.0: 2.0 TPM (device-id 0x0, rev-id 78)
> 
> [    2.975824] tpm tpm0: A TPM error (256) occurred continue selftest
> 
> 
> 
> So I have seen that this error 256 correspond to TPM2_RC_INITIALIZE = 0x0100,
> and that it is thrown  from this function
> <https://github.com/torvalds/linux/blob/v4.9/drivers/char/tpm/tpm-
> interface.c#L422>  (be32_to_cpu() when executing a tpm_transmit_cmd()).
> 
> 
> 
> However can someone explain why I am having this error ? Is it possible that it is
> because I am trying to access to the TPM during its initialization phase / selftest
> phase ?
> 
> Can I ignore this error without worry ?
> 
> 
> 
> 
> 
> Thank for your help,
> 
> 
> 
> 
> 
> Gael GUEGAN


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [tpm2] [tpm2-driver] Error at boot : A TPM error (256) occurred continue selftest
@ 2019-08-26 15:39 Roberts, William C
  0 siblings, 0 replies; 4+ messages in thread
From: Roberts, William C @ 2019-08-26 15:39 UTC (permalink / raw)
  To: tpm2

[-- Attachment #1: Type: text/plain, Size: 4002 bytes --]



> -----Original Message-----
> From: Tricca, Philip B
> Sent: Monday, August 26, 2019 10:31 AM
> To: Roberts, William C <william.c.roberts(a)intel.com>; Gael GUEGAN
> <Gael.Guegan(a)non.se.com>; tpm2(a)lists.01.org; javierm(a)redhat.com
> Subject: RE: [tpm2] [tpm2-driver] Error at boot : A TPM error (256) occurred
> continue selftest
> 
> A bit more data on the "why": if the TPM receives a startup command when it is
> not required (TPM has *already* completed startup) then it will return
> TPM_RC_INITIALIZE (you can test this using the tpm2_startup command from
> tpm2-tools). By the time the kernel takes over the platform firmware should

Ahh yes Section 9.3 of the commands doc is actually more clear than the Architecture doc:
" Additional TPM2_Startup() commands are not allowed after it has completed successfully. If a TPM requires
TPM2_Startup() and another command is received, or if the TPM receives TPM2_Startup() when it is not
required, the TPM shall return TPM_RC_INITIALIZE."

> have already initialized the TPM. The kernel sends a startup command regardless
> since we have no guarantee that the firmware did what it was supposed to do. So
> in the common case the kernel will receive this RC in response to the Startup
> command.
> 
> Reporting this as an error is inaccurate but harmless. I'm not seeing this on my
> 4.19 kernel so this may have already been addressed upstream. Might be worth
> an email to the drivers maintainers if you can repro on a newer kernel.
> 
> Philip
> 
> -----Original Message-----
> From: tpm2 [mailto:tpm2-bounces(a)lists.01.org] On Behalf Of Roberts, William C
> Sent: 23 August, 2019 10:22
> To: Gael GUEGAN <Gael.Guegan(a)non.se.com>; tpm2(a)lists.01.org;
> javierm(a)redhat.com
> Subject: Re: [tpm2] [tpm2-driver] Error at boot : A TPM error (256) occurred
> continue selftest
> 
> You should be able to ignore that. But I am unsure of what is leading you to that
> state. Is someone Sending a selftest command before a startup command? The
> startup command, when not in field upgrade Mode, should be startup. So when
> the tpm initializes, it expects one of the first commands as described In the spec:
> https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-1-
> Architecture-01.38.pdf
> 
> The first command sent to the tpm should be a startup command..... you can see
> that in Figure 5 on page 57 Of the spec above and described in detail in section
> 12.2.2
> 
> Bill
> 
> > -----Original Message-----
> > From: tpm2 [mailto:tpm2-bounces(a)lists.01.org] On Behalf Of Gael GUEGAN
> > Sent: Thursday, August 8, 2019 3:35 AM
> > To: tpm2(a)lists.01.org; javierm(a)redhat.com
> > Subject: [tpm2] [tpm2-driver] Error at boot : A TPM error (256)
> > occurred continue selftest
> >
> > Hello all,
> >
> >
> >
> > I am working with the linux kernel version 4.9 on an embedded target.
> >
> > And I am having the following error message from the TPM driver at boot :
> >
> >
> >
> > > $  dmesg | grep TPM
> >
> > [    2.946137] tpm_tis_spi spi32766.0: 2.0 TPM (device-id 0x0, rev-id 78)
> >
> > [    2.975824] tpm tpm0: A TPM error (256) occurred continue selftest
> >
> >
> >
> > So I have seen that this error 256 correspond to TPM2_RC_INITIALIZE =
> > 0x0100, and that it is thrown  from this function
> > <https://github.com/torvalds/linux/blob/v4.9/drivers/char/tpm/tpm-
> > interface.c#L422>  (be32_to_cpu() when executing a tpm_transmit_cmd()).
> >
> >
> >
> > However can someone explain why I am having this error ? Is it
> > possible that it is because I am trying to access to the TPM during
> > its initialization phase / selftest phase ?
> >
> > Can I ignore this error without worry ?
> >
> >
> >
> >
> >
> > Thank for your help,
> >
> >
> >
> >
> >
> > Gael GUEGAN
> 
> _______________________________________________
> tpm2 mailing list
> tpm2(a)lists.01.org
> https://lists.01.org/mailman/listinfo/tpm2

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [tpm2] [tpm2-driver] Error at boot : A TPM error (256) occurred continue selftest
@ 2019-08-26 15:30 Tricca, Philip B
  0 siblings, 0 replies; 4+ messages in thread
From: Tricca, Philip B @ 2019-08-26 15:30 UTC (permalink / raw)
  To: tpm2

[-- Attachment #1: Type: text/plain, Size: 3126 bytes --]

A bit more data on the "why": if the TPM receives a startup command when it is not required (TPM has *already* completed startup) then it will return TPM_RC_INITIALIZE (you can test this using the tpm2_startup command from tpm2-tools). By the time the kernel takes over the platform firmware should have already initialized the TPM. The kernel sends a startup command regardless since we have no guarantee that the firmware did what it was supposed to do. So in the common case the kernel will receive this RC in response to the Startup command.

Reporting this as an error is inaccurate but harmless. I'm not seeing this on my 4.19 kernel so this may have already been addressed upstream. Might be worth an email to the drivers maintainers if you can repro on a newer kernel.

Philip

-----Original Message-----
From: tpm2 [mailto:tpm2-bounces(a)lists.01.org] On Behalf Of Roberts, William C
Sent: 23 August, 2019 10:22
To: Gael GUEGAN <Gael.Guegan(a)non.se.com>; tpm2(a)lists.01.org; javierm(a)redhat.com
Subject: Re: [tpm2] [tpm2-driver] Error at boot : A TPM error (256) occurred continue selftest

You should be able to ignore that. But I am unsure of what is leading you to that state. Is someone Sending a selftest command before a startup command? The startup command, when not in field upgrade Mode, should be startup. So when the tpm initializes, it expects one of the first commands as described In the spec:
https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-1-Architecture-01.38.pdf

The first command sent to the tpm should be a startup command..... you can see that in Figure 5 on page 57 Of the spec above and described in detail in section 12.2.2

Bill

> -----Original Message-----
> From: tpm2 [mailto:tpm2-bounces(a)lists.01.org] On Behalf Of Gael GUEGAN
> Sent: Thursday, August 8, 2019 3:35 AM
> To: tpm2(a)lists.01.org; javierm(a)redhat.com
> Subject: [tpm2] [tpm2-driver] Error at boot : A TPM error (256) 
> occurred continue selftest
> 
> Hello all,
> 
> 
> 
> I am working with the linux kernel version 4.9 on an embedded target.
> 
> And I am having the following error message from the TPM driver at boot :
> 
> 
> 
> > $  dmesg | grep TPM
> 
> [    2.946137] tpm_tis_spi spi32766.0: 2.0 TPM (device-id 0x0, rev-id 78)
> 
> [    2.975824] tpm tpm0: A TPM error (256) occurred continue selftest
> 
> 
> 
> So I have seen that this error 256 correspond to TPM2_RC_INITIALIZE = 
> 0x0100, and that it is thrown  from this function
> <https://github.com/torvalds/linux/blob/v4.9/drivers/char/tpm/tpm-
> interface.c#L422>  (be32_to_cpu() when executing a tpm_transmit_cmd()).
> 
> 
> 
> However can someone explain why I am having this error ? Is it 
> possible that it is because I am trying to access to the TPM during 
> its initialization phase / selftest phase ?
> 
> Can I ignore this error without worry ?
> 
> 
> 
> 
> 
> Thank for your help,
> 
> 
> 
> 
> 
> Gael GUEGAN

_______________________________________________
tpm2 mailing list
tpm2(a)lists.01.org
https://lists.01.org/mailman/listinfo/tpm2

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [tpm2] [tpm2-driver] Error at boot : A TPM error (256) occurred continue selftest
@ 2019-08-08  8:34 Gael GUEGAN
  0 siblings, 0 replies; 4+ messages in thread
From: Gael GUEGAN @ 2019-08-08  8:34 UTC (permalink / raw)
  To: tpm2

[-- Attachment #1: Type: text/plain, Size: 853 bytes --]

Hello all,

I am working with the linux kernel version 4.9 on an embedded target.
And I am having the following error message from the TPM driver at boot :

> $  dmesg | grep TPM
[    2.946137] tpm_tis_spi spi32766.0: 2.0 TPM (device-id 0x0, rev-id 78)
[    2.975824] tpm tpm0: A TPM error (256) occurred continue selftest

So I have seen that this error 256 correspond to TPM2_RC_INITIALIZE = 0x0100,  and that it is thrown  from this function<https://github.com/torvalds/linux/blob/v4.9/drivers/char/tpm/tpm-interface.c#L422> (be32_to_cpu() when executing a tpm_transmit_cmd()).

However can someone explain why I am having this error ? Is it possible that it is because I am trying to access to the TPM during its initialization phase / selftest phase ?
Can I ignore this error without worry ?


Thank for your help,


Gael GUEGAN

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 4098 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-26 15:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-23 17:21 [tpm2] [tpm2-driver] Error at boot : A TPM error (256) occurred continue selftest Roberts, William C
  -- strict thread matches above, loose matches on Subject: below --
2019-08-26 15:39 Roberts, William C
2019-08-26 15:30 Tricca, Philip B
2019-08-08  8:34 Gael GUEGAN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.