diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2020-07-16 14:46:47 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2020-07-16 14:46:47 +0100 |
commit | 175788d4eb91a840e9505d84ff2c6bedf4380143 (patch) | |
tree | 2ac31dadcb13db6d76ac02352bd276c5ca015f94 | |
parent | ee5128bb00f90dd301991d80d1db5224ce924c84 (diff) | |
parent | df8a7568932e4c3c930fdfeb228dd72b4bb71a1f (diff) | |
download | qemu-175788d4eb91a840e9505d84ff2c6bedf4380143.zip qemu-175788d4eb91a840e9505d84ff2c6bedf4380143.tar.gz qemu-175788d4eb91a840e9505d84ff2c6bedf4380143.tar.bz2 |
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>
-rw-r--r-- | hw/tpm/tpm_spapr.c | 5 | ||||
-rw-r--r-- | tests/qtest/tpm-util.c | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/hw/tpm/tpm_spapr.c b/hw/tpm/tpm_spapr.c index cb4dfd1..8288ab0 100644 --- a/hw/tpm/tpm_spapr.c +++ b/hw/tpm/tpm_spapr.c @@ -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) diff --git a/tests/qtest/tpm-util.c b/tests/qtest/tpm-util.c index 34efae8..58a9593 100644 --- a/tests/qtest/tpm-util.c +++ b/tests/qtest/tpm-util.c @@ -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) |