Merge tpm 2020/07/15 v1

-----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEuBi5yt+QicLVzsZrda1lgCoLQhEFAl8PVgUACgkQda1lgCoL
 QhHkeQgA2QkM4jJQ5QHG0rIin8PpbH/CZ3gn9gMwcrDLYxzrxguWaWLicvwF1VmN
 hcqfHvyF5fs36v3ebCD9Gopc1NZyPce1iqaVwE/r1yTyFeBZyIMJ54IRhWyvqTbp
 ndzq9jwZ4c+mIm4OueGHISP1EVJnfw6nq56zbJlZXVP9LrV+CTsr49ScaNwVXXxf
 TeqLwWHwweJhqjSDRY4Tiqd+kLcEc/sl/2tRB3QE9lzM8ziCGdKg9oJMrimS/xdA
 9+t5geDj3W3AF+e+fJ17InrEVcr+zU6XJYmKGMJ2yZvzIPof69UShVbd6XTO7Xpz
 bKN8DEcfEaRwMFjuYpFCllTeXGsD4g==
 =D8HF
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2020-07-15-1' into staging

Merge tpm 2020/07/15 v1

# gpg: Signature made Wed 15 Jul 2020 20:16:21 BST
# gpg:                using RSA key B818B9CADF9089C2D5CEC66B75AD65802A0B4211
# gpg: Good signature from "Stefan Berger <stefanb@linux.vnet.ibm.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: B818 B9CA DF90 89C2 D5CE  C66B 75AD 6580 2A0B 4211

* remotes/stefanberger/tags/pull-tpm-2020-07-15-1:
  tests: tpm: Skip over pcrUpdateCounter byte in result comparison
  tpm: tpm_spapr: Exit on TPM backend failures

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2020-07-16 14:46:47 +01:00
commit 175788d4eb
2 changed files with 9 additions and 2 deletions

View File

@ -306,7 +306,10 @@ static void tpm_spapr_reset(SpaprVioDevice *dev)
TPM_SPAPR_BUFFER_MAX);
tpm_backend_reset(s->be_driver);
tpm_spapr_do_startup_tpm(s, s->be_buffer_size);
if (tpm_spapr_do_startup_tpm(s, s->be_buffer_size) < 0) {
exit(1);
}
}
static enum TPMVersion tpm_spapr_get_version(TPMIf *ti)

View File

@ -139,7 +139,11 @@ void tpm_util_pcrread(QTestState *s, tx_func *tx,
tx(s, tpm_pcrread, sizeof(tpm_pcrread), buffer, sizeof(buffer));
g_assert_cmpmem(buffer, exp_resp_size, exp_resp, exp_resp_size);
/* skip pcrUpdateCounter (14th byte) in comparison */
g_assert(exp_resp_size >= 15);
g_assert_cmpmem(buffer, 13, exp_resp, 13);
g_assert_cmpmem(&buffer[14], exp_resp_size - 14,
&exp_resp[14], exp_resp_size - 14);
}
bool tpm_util_swtpm_has_tpm2(void)