| 1 |
From e7c976b5864e7d2649292d90ea60d5aea091a990 Mon Sep 17 00:00:00 2001 |
| 2 |
From: Jason Andryuk <[email protected]> |
| 3 |
Date: Sun, 14 Mar 2021 12:46:34 -0400 |
| 4 |
Subject: [PATCH 2/2] Increase command durations |
| 5 |
|
| 6 |
Wth Linux 5.4 xen-tpmfront and a Xen vtpm-stubdom, xen-tpmfront was |
| 7 |
failing commands with -ETIME: |
| 8 |
tpm tpm0: tpm_try_transmit: send(): error-62 |
| 9 |
|
| 10 |
The vtpm was returning the data, but it was after the duration timeout |
| 11 |
in vtpm_send. Linux may have started being more stringent about timing? |
| 12 |
|
| 13 |
The vtpm-stubdom has a little delay since it writes its disk before |
| 14 |
returning the response. |
| 15 |
|
| 16 |
Anyway, the durations are rather low. When they were 1/10/1000 before |
| 17 |
converting to microseconds, Linux showed all three durations rounded to |
| 18 |
10000. Update them with values from a physical TPM1.2. These were |
| 19 |
taken from a WEC which was software downgraded from a TPM2 to a TPM1.2. |
| 20 |
They might be excessive, but I'd rather have a command succeed than |
| 21 |
return -ETIME. |
| 22 |
|
| 23 |
An IFX physical TPM1.2 uses: |
| 24 |
1000000 |
| 25 |
1500000 |
| 26 |
150000000 |
| 27 |
|
| 28 |
Signed-off-by: Jason Andryuk <[email protected]> |
| 29 |
--- |
| 30 |
tpm/tpm_data.c | 6 +++--- |
| 31 |
1 file changed, 3 insertions(+), 3 deletions(-) |
| 32 |
|
| 33 |
diff --git a/tpm/tpm_data.c b/tpm/tpm_data.c |
| 34 |
index bebaf10..844afca 100644 |
| 35 |
--- a/tpm/tpm_data.c |
| 36 |
+++ b/tpm/tpm_data.c |
| 37 |
@@ -71,9 +71,9 @@ static void init_timeouts(void) |
| 38 |
tpmData.permanent.data.tis_timeouts[1] = 2000000; |
| 39 |
tpmData.permanent.data.tis_timeouts[2] = 750000; |
| 40 |
tpmData.permanent.data.tis_timeouts[3] = 750000; |
| 41 |
- tpmData.permanent.data.cmd_durations[0] = 1000; |
| 42 |
- tpmData.permanent.data.cmd_durations[1] = 10000; |
| 43 |
- tpmData.permanent.data.cmd_durations[2] = 1000000; |
| 44 |
+ tpmData.permanent.data.cmd_durations[0] = 3000000; |
| 45 |
+ tpmData.permanent.data.cmd_durations[1] = 3000000; |
| 46 |
+ tpmData.permanent.data.cmd_durations[2] = 600000000; |
| 47 |
} |
| 48 |
|
| 49 |
void tpm_init_data(void) |
| 50 |
-- |
| 51 |
2.30.2 |
| 52 |
|