2022-05-10 13:35:49

by Johannes Holland

[permalink] [raw]
Subject: [PATCH] tpm: increase timeout for kselftests

Due to CreatePrimary commands which need to create RSA keys of
increasing size, the timeout value need to be raised, as well.
Default is 300s.

Signed-off-by: Johannes Holland <[email protected]>
---
A timeout of anything below 600s still lead to occasional timeouts for
me. Therefore, I propose 600s as a new value.

tools/testing/selftests/tpm2/settings | 2 ++
1 file changed, 2 insertions(+)
create mode 100644 tools/testing/selftests/tpm2/settings

diff --git a/tools/testing/selftests/tpm2/settings b/tools/testing/selftests/tpm2/settings
new file mode 100644
index 000000000000..919bc3803f03
--- /dev/null
+++ b/tools/testing/selftests/tpm2/settings
@@ -0,0 +1,2 @@
+timeout=600
+
--
2.34.1



2022-05-10 22:03:06

by Paul Menzel

[permalink] [raw]
Subject: Re: [PATCH] tpm: increase timeout for kselftests

Dear Johannes,


Thank you for your patch.

Am 10.05.22 um 13:16 schrieb Johannes Holland:


Should you resend, maybe be more specific in the commit message summary.
Maybe:

Double timeout for kselftests to 10 min

> Due to CreatePrimary commands which need to create RSA keys of
> increasing size, the timeout value need to be raised, as well.

need*s*?

> Default is 300s.

Mention 600 ms somewhere?

> Signed-off-by: Johannes Holland <[email protected]>
> ---
> A timeout of anything below 600s still lead to occasional timeouts for
> me. Therefore, I propose 600s as a new value.

I’d say, this should go into the commit message. Maybe even say, what
devices you are testing with.


Kind regards,

Paul


> tools/testing/selftests/tpm2/settings | 2 ++
> 1 file changed, 2 insertions(+)
> create mode 100644 tools/testing/selftests/tpm2/settings
>
> diff --git a/tools/testing/selftests/tpm2/settings b/tools/testing/selftests/tpm2/settings
> new file mode 100644
> index 000000000000..919bc3803f03
> --- /dev/null
> +++ b/tools/testing/selftests/tpm2/settings
> @@ -0,0 +1,2 @@
> +timeout=600
> +

2022-05-11 20:14:04

by Jarkko Sakkinen

[permalink] [raw]
Subject: Re: [PATCH] tpm: increase timeout for kselftests

On Tue, May 10, 2022 at 01:16:08PM +0200, Johannes Holland wrote:
> Due to CreatePrimary commands which need to create RSA keys of
> increasing size, the timeout value need to be raised, as well.
> Default is 300s.
>
> Signed-off-by: Johannes Holland <[email protected]>
> ---
> A timeout of anything below 600s still lead to occasional timeouts for
> me. Therefore, I propose 600s as a new value.
>
> tools/testing/selftests/tpm2/settings | 2 ++
> 1 file changed, 2 insertions(+)
> create mode 100644 tools/testing/selftests/tpm2/settings
>
> diff --git a/tools/testing/selftests/tpm2/settings b/tools/testing/selftests/tpm2/settings
> new file mode 100644
> index 000000000000..919bc3803f03
> --- /dev/null
> +++ b/tools/testing/selftests/tpm2/settings
> @@ -0,0 +1,2 @@
> +timeout=600
> +
> --
> 2.34.1
>

Could cope but I did not get why it needs to be raised.

BR, Jarkko

2022-05-23 05:45:43

by Stefan Mahnke-Hartmann

[permalink] [raw]
Subject: Re: [PATCH] tpm: increase timeout for kselftests



On 11.05.22 17:14, Jarkko Sakkinen wrote:
> On Tue, May 10, 2022 at 01:16:08PM +0200, Johannes Holland wrote:
>> Due to CreatePrimary commands which need to create RSA keys of
>> increasing size, the timeout value need to be raised, as well.
>> Default is 300s.
>>
>> Signed-off-by: Johannes Holland <[email protected]>
>> ---
>> A timeout of anything below 600s still lead to occasional timeouts for
>> me. Therefore, I propose 600s as a new value.
>>
>> tools/testing/selftests/tpm2/settings | 2 ++
>> 1 file changed, 2 insertions(+)
>> create mode 100644 tools/testing/selftests/tpm2/settings
>>
>> diff --git a/tools/testing/selftests/tpm2/settings b/tools/testing/selftests/tpm2/settings
>> new file mode 100644
>> index 000000000000..919bc3803f03
>> --- /dev/null
>> +++ b/tools/testing/selftests/tpm2/settings
>> @@ -0,0 +1,2 @@
>> +timeout=600
>> +
>> --
>> 2.34.1
>>
> Could cope but I did not get why it needs to be raised.

The TPM2 SpaceTest testsuite currently creates 8 primary RSA 2k keys + 1 for
setup. Generating a RSA2k key can take up to ~1-2 minutes on some of our TPMs.
=> 2x9 = 18 minutes. In the kernel we even define a duration timeout for rsa2k
keygen of 5 min per key! (TPM2_DURATION_LONG_LONG = 300000) => up to 45 minutes
would be "acceptable".

However since the average key generation time is much faster, a value of ~10
minutes should be fine enough.

The reason why you did not experience this yet on your test system is either
because PTT TPMs are faster in that respect and/or some TPMs implement pre-gen
mechanisms for key generation, (or just plain luck)

BR, Stefan

> BR, Jarkko


2022-05-23 21:14:47

by Jarkko Sakkinen

[permalink] [raw]
Subject: Re: [PATCH] tpm: increase timeout for kselftests

On Fri, May 20, 2022 at 03:28:42PM +0200, Stefan Mahnke-Hartmann wrote:
>
>
> On 11.05.22 17:14, Jarkko Sakkinen wrote:
> > On Tue, May 10, 2022 at 01:16:08PM +0200, Johannes Holland wrote:
> >> Due to CreatePrimary commands which need to create RSA keys of
> >> increasing size, the timeout value need to be raised, as well.
> >> Default is 300s.
> >>
> >> Signed-off-by: Johannes Holland <[email protected]>
> >> ---
> >> A timeout of anything below 600s still lead to occasional timeouts for
> >> me. Therefore, I propose 600s as a new value.
> >>
> >> tools/testing/selftests/tpm2/settings | 2 ++
> >> 1 file changed, 2 insertions(+)
> >> create mode 100644 tools/testing/selftests/tpm2/settings
> >>
> >> diff --git a/tools/testing/selftests/tpm2/settings b/tools/testing/selftests/tpm2/settings
> >> new file mode 100644
> >> index 000000000000..919bc3803f03
> >> --- /dev/null
> >> +++ b/tools/testing/selftests/tpm2/settings
> >> @@ -0,0 +1,2 @@
> >> +timeout=600
> >> +
> >> --
> >> 2.34.1
> >>
> > Could cope but I did not get why it needs to be raised.
>
> The TPM2 SpaceTest testsuite currently creates 8 primary RSA 2k keys + 1 for
> setup. Generating a RSA2k key can take up to ~1-2 minutes on some of our TPMs.
> => 2x9 = 18 minutes. In the kernel we even define a duration timeout for rsa2k
> keygen of 5 min per key! (TPM2_DURATION_LONG_LONG = 300000) => up to 45 minutes
> would be "acceptable".
>
> However since the average key generation time is much faster, a value of ~10
> minutes should be fine enough.
>
> The reason why you did not experience this yet on your test system is either
> because PTT TPMs are faster in that respect and/or some TPMs implement pre-gen
> mechanisms for key generation, (or just plain luck)
>
> BR, Stefan
>
> > BR, Jarkko

I think this is ok.


Acked-by: Jarkko Sakkinen <[email protected]>

BR, Jarkko

2022-06-20 15:32:20

by Stefan Mahnke-Hartmann

[permalink] [raw]
Subject: Re: [PATCH] tpm: increase timeout for kselftests



On 23.05.22 21:59, Jarkko Sakkinen wrote:
> On Fri, May 20, 2022 at 03:28:42PM +0200, Stefan Mahnke-Hartmann wrote:
>>
>> On 11.05.22 17:14, Jarkko Sakkinen wrote:
>>> On Tue, May 10, 2022 at 01:16:08PM +0200, Johannes Holland wrote:
>>>> Due to CreatePrimary commands which need to create RSA keys of
>>>> increasing size, the timeout value need to be raised, as well.
>>>> Default is 300s.
>>>>
>>>> Signed-off-by: Johannes Holland <[email protected]>
>>>> ---
>>>> A timeout of anything below 600s still lead to occasional timeouts for
>>>> me. Therefore, I propose 600s as a new value.
>>>>
>>>> tools/testing/selftests/tpm2/settings | 2 ++
>>>> 1 file changed, 2 insertions(+)
>>>> create mode 100644 tools/testing/selftests/tpm2/settings
>>>>
>>>> diff --git a/tools/testing/selftests/tpm2/settings b/tools/testing/selftests/tpm2/settings
>>>> new file mode 100644
>>>> index 000000000000..919bc3803f03
>>>> --- /dev/null
>>>> +++ b/tools/testing/selftests/tpm2/settings
>>>> @@ -0,0 +1,2 @@
>>>> +timeout=600
>>>> +
>>>> --
>>>> 2.34.1
>>>>
>>> Could cope but I did not get why it needs to be raised.
>> The TPM2 SpaceTest testsuite currently creates 8 primary RSA 2k keys + 1 for
>> setup. Generating a RSA2k key can take up to ~1-2 minutes on some of our TPMs.
>> => 2x9 = 18 minutes. In the kernel we even define a duration timeout for rsa2k
>> keygen of 5 min per key! (TPM2_DURATION_LONG_LONG = 300000) => up to 45 minutes
>> would be "acceptable".
>>
>> However since the average key generation time is much faster, a value of ~10
>> minutes should be fine enough.
>>
>> The reason why you did not experience this yet on your test system is either
>> because PTT TPMs are faster in that respect and/or some TPMs implement pre-gen
>> mechanisms for key generation, (or just plain luck)
>>
>> BR, Stefan
>>
>>> BR, Jarkko
> I think this is ok.
>
>
> Acked-by: Jarkko Sakkinen <[email protected]>
>
> BR, Jarkko
>
Hi Jarkko,
 
Just curious. I can't see this patch was added to linux-next. Was I
expected to do something more to it?
 
Kind regards
Stefan

2022-06-26 06:42:50

by Jarkko Sakkinen

[permalink] [raw]
Subject: Re: [PATCH] tpm: increase timeout for kselftests

On Mon, Jun 20, 2022 at 04:45:45PM +0200, Stefan Mahnke-Hartmann wrote:
>
>
> On 23.05.22 21:59, Jarkko Sakkinen wrote:
> > On Fri, May 20, 2022 at 03:28:42PM +0200, Stefan Mahnke-Hartmann wrote:
> >>
> >> On 11.05.22 17:14, Jarkko Sakkinen wrote:
> >>> On Tue, May 10, 2022 at 01:16:08PM +0200, Johannes Holland wrote:
> >>>> Due to CreatePrimary commands which need to create RSA keys of
> >>>> increasing size, the timeout value need to be raised, as well.
> >>>> Default is 300s.
> >>>>
> >>>> Signed-off-by: Johannes Holland <[email protected]>
> >>>> ---
> >>>> A timeout of anything below 600s still lead to occasional timeouts for
> >>>> me. Therefore, I propose 600s as a new value.
> >>>>
> >>>> tools/testing/selftests/tpm2/settings | 2 ++
> >>>> 1 file changed, 2 insertions(+)
> >>>> create mode 100644 tools/testing/selftests/tpm2/settings
> >>>>
> >>>> diff --git a/tools/testing/selftests/tpm2/settings b/tools/testing/selftests/tpm2/settings
> >>>> new file mode 100644
> >>>> index 000000000000..919bc3803f03
> >>>> --- /dev/null
> >>>> +++ b/tools/testing/selftests/tpm2/settings
> >>>> @@ -0,0 +1,2 @@
> >>>> +timeout=600
> >>>> +
> >>>> --
> >>>> 2.34.1
> >>>>
> >>> Could cope but I did not get why it needs to be raised.
> >> The TPM2 SpaceTest testsuite currently creates 8 primary RSA 2k keys + 1 for
> >> setup. Generating a RSA2k key can take up to ~1-2 minutes on some of our TPMs.
> >> => 2x9 = 18 minutes. In the kernel we even define a duration timeout for rsa2k
> >> keygen of 5 min per key! (TPM2_DURATION_LONG_LONG = 300000) => up to 45 minutes
> >> would be "acceptable".
> >>
> >> However since the average key generation time is much faster, a value of ~10
> >> minutes should be fine enough.
> >>
> >> The reason why you did not experience this yet on your test system is either
> >> because PTT TPMs are faster in that respect and/or some TPMs implement pre-gen
> >> mechanisms for key generation, (or just plain luck)
> >>
> >> BR, Stefan
> >>
> >>> BR, Jarkko
> > I think this is ok.
> >
> >
> > Acked-by: Jarkko Sakkinen <[email protected]>
> >
> > BR, Jarkko
> >
> Hi Jarkko,
> ?
> Just curious. I can't see this patch was added to linux-next. Was I
> expected to do something more to it?
> ?
> Kind regards
> Stefan

Couple of things:

- Send to selftests maintainer:
- "selftests/tpm2" instead of "tpm:"

BR, Jarkko