From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, Stefan Berger <stefanb@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PULL v1 03/10] tpm_tis: limit size of buffer from backend
Date: Fri, 22 Dec 2017 15:16:18 -0500 [thread overview]
Message-ID: <1513973785-14427-4-git-send-email-stefanb@linux.vnet.ibm.com> (raw)
In-Reply-To: <1513973785-14427-1-git-send-email-stefanb@linux.vnet.ibm.com>
This is a preparatory patch for the subsequent ones where we
get rid of the flexibility of supporting any kind of buffer size
that the backend may support. We keep the size at 4096, which is
also the size the external emulator supports. So, limit the size
of the buffer we can support and pass it back to the backend.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
hw/tpm/tpm_tis.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
index ac5f51f..a6e2f6e 100644
--- a/hw/tpm/tpm_tis.c
+++ b/hw/tpm/tpm_tis.c
@@ -1012,7 +1012,8 @@ static void tpm_tis_reset(DeviceState *dev)
int c;
s->be_tpm_version = tpm_backend_get_tpm_version(s->be_driver);
- s->be_buffer_size = tpm_backend_get_buffer_size(s->be_driver);
+ s->be_buffer_size = MIN(tpm_backend_get_buffer_size(s->be_driver),
+ TPM_TIS_BUFFER_MAX);
tpm_backend_reset(s->be_driver);
@@ -1044,7 +1045,7 @@ static void tpm_tis_reset(DeviceState *dev)
tpm_tis_realloc_buffer(&s->loc[c].r_buffer, s->be_buffer_size);
}
- tpm_tis_do_startup_tpm(s, 0);
+ tpm_tis_do_startup_tpm(s, s->be_buffer_size);
}
static const VMStateDescription vmstate_tpm_tis = {
--
2.5.5
next prev parent reply other threads:[~2017-12-22 20:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-22 20:16 [Qemu-devel] [PULL v1 00/10] Merge tpm 2017/12/22 Stefan Berger
2017-12-22 20:16 ` [Qemu-devel] [PULL v1 01/10] tpm_emulator: Add a caching layer for the TPM Established flag Stefan Berger
2017-12-22 20:16 ` [Qemu-devel] [PULL v1 02/10] tpm_tis: convert uint32_t to size_t Stefan Berger
2017-12-22 20:16 ` Stefan Berger [this message]
2017-12-22 20:16 ` [Qemu-devel] [PULL v1 04/10] tpm_tis: remove TPMSizeBuffer usage Stefan Berger
2017-12-22 20:16 ` [Qemu-devel] [PULL v1 05/10] tpm_tis: move buffers from localities into common location Stefan Berger
2017-12-22 20:16 ` [Qemu-devel] [PULL v1 06/10] tpm_tis: merge read and write buffer into single buffer Stefan Berger
2017-12-22 20:16 ` [Qemu-devel] [PULL v1 07/10] tpm_tis: move r/w_offsets to TPMState Stefan Berger
2017-12-22 20:16 ` [Qemu-devel] [PULL v1 08/10] tpm_tis: merge r/w_offset into rw_offset Stefan Berger
2017-12-22 20:16 ` [Qemu-devel] [PULL v1 09/10] tpm: Implement tpm_sized_buffer_reset Stefan Berger
2017-12-22 20:16 ` [Qemu-devel] [PULL v1 10/10] acpi: Update TPM2 ACPI table to more recent specs Stefan Berger
2018-01-08 11:39 ` [Qemu-devel] [PULL v1 00/10] Merge tpm 2017/12/22 Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1513973785-14427-4-git-send-email-stefanb@linux.vnet.ibm.com \
--to=stefanb@linux.vnet.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).