All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arun Menon <armenon@redhat.com>
To: Stefan Berger <stefanb@linux.ibm.com>
Cc: qemu-devel@nongnu.org, marcandre.lureau@gmail.com,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: Re: [PATCH v3 06/10] hw/tpm: crb: Do not clear internal buffers when backend is busy
Date: Sun, 4 Oct 2026 22:06:50 +0530	[thread overview]
Message-ID: <asKAoq5TrCop1TFx@fedora> (raw)
In-Reply-To: <20261002142516.2063735-7-stefanb@linux.ibm.com>

On Fri, Oct 02, 2026 at 10:25:12AM -0400, Stefan Berger wrote:
> While the backend (thread) is accessing the request and response buffers,
> do not clear those buffers upon a command cancellation. Also, per CRB spec
> the TPM is expected to either return a normal command response (command
> could not be cancelled) or an error response indicating TPM_RC_CANCELED.
> So the response buffer must be able to receive a response as normal.
> 
> Fixes: 29315d22b259 ("hw/tpm: Add internal buffer state for chunking")
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
> ---
>  hw/tpm/tpm_crb.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/hw/tpm/tpm_crb.c b/hw/tpm/tpm_crb.c
> index 54fa2042b5..daf451aa56 100644
> --- a/hw/tpm/tpm_crb.c
> +++ b/hw/tpm/tpm_crb.c
> @@ -219,7 +219,6 @@ static void tpm_crb_mmio_write(void *opaque, hwaddr addr,
>              if (s->regs[R_CRB_CTRL_START] & CRB_START_INVOKE) {
>                  tpm_backend_cancel_cmd(s->tpmbe);
>              }
> -            tpm_crb_clear_internal_buffers(s);
>          }
>          break;
>      case A_CRB_CTRL_START:
> -- 
> 2.55.0
> 

Reviewed-by: Arun Menon <armenon@redhat.com>



  reply	other threads:[~2026-10-04 16:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02 14:25 [PATCH v3 00/10] Fix a couple of issues in TPM related code Stefan Berger
2026-10-02 14:25 ` [PATCH v3 01/10] tpm_util: Pass TPMVersion to function writing fatal error response Stefan Berger
2026-10-04 17:19   ` Arun Menon
2026-10-02 14:25 ` [PATCH v3 02/10] tpm_emulator: Reject TPM responses whose size is too small Stefan Berger
2026-10-02 14:25 ` [PATCH v3 03/10] tpm_emulator: Reject sending commands smaller than the request header Stefan Berger
2026-10-02 14:25 ` [PATCH v3 04/10] hw/tpm: tis: Only read from response buffer if rw_offset < len Stefan Berger
2026-10-02 14:25 ` [PATCH v3 05/10] hw/tpm: tis: Use uint32_t for len to avoid truncating size of command Stefan Berger
2026-10-02 14:25 ` [PATCH v3 06/10] hw/tpm: crb: Do not clear internal buffers when backend is busy Stefan Berger
2026-10-04 16:36   ` Arun Menon [this message]
2026-10-02 14:25 ` [PATCH v3 07/10] hw/tpm: crb: Avoid potential integer underflow Stefan Berger
2026-10-02 14:25 ` [PATCH v3 08/10] hw/tpm: crb: Implement tpm_ppi_uninit and use it in tpm_crb_unrealize Stefan Berger
2026-10-04 17:32   ` Arun Menon
2026-10-02 14:25 ` [PATCH v3 09/10] hw/tpm: crb: Consider response_buffer->len of received response Stefan Berger
2026-10-02 14:25 ` [PATCH v3 10/10] tests: Add tests with commands with bad length Stefan Berger

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=asKAoq5TrCop1TFx@fedora \
    --to=armenon@redhat.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanb@linux.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.