Debian Codegraph @

stubdom/vtpm-microsecond-duration.patch

raw
1 From 5a510e0afd7c288e3f0fb3523ec749ba1366ad61 Mon Sep 17 00:00:00 2001
2 From: Jason Andryuk <[email protected]>
3 Date: Sun, 14 Mar 2021 12:42:10 -0400
4 Subject: [PATCH 1/2] Use microseconds for timeouts and durations
5
6 The timeout and duration fields should be in microseconds according to
7 the spec.
8
9 TPM_CAP_PROP_TIS_TIMEOUT:
10 A 4 element array of UINT32 values each denoting the timeout value in
11 microseconds for the following in this order:
12
13 TPM_CAP_PROP_DURATION:
14 A 3 element array of UINT32 values each denoting the duration value in
15 microseconds of the duration of the three classes of commands:
16
17 Linux will scale the timeouts up by 1000, but not the durations. Change
18 the units for both sets as appropriate.
19
20 Signed-off-by: Jason Andryuk <[email protected]>
21 ---
22 tpm/tpm_data.c | 14 +++++++-------
23 1 file changed, 7 insertions(+), 7 deletions(-)
24
25 diff --git a/tpm/tpm_data.c b/tpm/tpm_data.c
26 index a3a79ef..bebaf10 100644
27 --- a/tpm/tpm_data.c
28 +++ b/tpm/tpm_data.c
29 @@ -67,13 +67,13 @@ static void init_nv_storage(void)
30 static void init_timeouts(void)
31 {
32 /* for the timeouts we use the PC platform defaults */
33 - tpmData.permanent.data.tis_timeouts[0] = 750;
34 - tpmData.permanent.data.tis_timeouts[1] = 2000;
35 - tpmData.permanent.data.tis_timeouts[2] = 750;
36 - tpmData.permanent.data.tis_timeouts[3] = 750;
37 - tpmData.permanent.data.cmd_durations[0] = 1;
38 - tpmData.permanent.data.cmd_durations[1] = 10;
39 - tpmData.permanent.data.cmd_durations[2] = 1000;
40 + tpmData.permanent.data.tis_timeouts[0] = 750000;
41 + tpmData.permanent.data.tis_timeouts[1] = 2000000;
42 + tpmData.permanent.data.tis_timeouts[2] = 750000;
43 + tpmData.permanent.data.tis_timeouts[3] = 750000;
44 + tpmData.permanent.data.cmd_durations[0] = 1000;
45 + tpmData.permanent.data.cmd_durations[1] = 10000;
46 + tpmData.permanent.data.cmd_durations[2] = 1000000;
47 }
48
49 void tpm_init_data(void)
50 --
51 2.30.2
52