All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arun Menon <armenon@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: "Stefan Berger" <stefanb@linux.ibm.com>,
	qemu-devel@nongnu.org, "Yanan Wang" <wangyanan55@huawei.com>,
	"Ani Sinha" <anisinha@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Stefan Berger" <stefanb@linux.vnet.ibm.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Zhao Liu" <zhao1.liu@intel.com>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Fabiano Rosas" <farosas@suse.de>
Subject: Re: [PATCH v4 01/10] hw/tpm: Add TPM CRB chunking fields
Date: Mon, 20 Apr 2026 17:20:37 +0530	[thread overview]
Message-ID: <aeYTDYOQzvYXuay0@fedora> (raw)
In-Reply-To: <CAJ+F1CKq=+hRhgHeGP-27tec+ypRGL3OKd2Q70_JoPpYyAA3Sg@mail.gmail.com>

Hi Marc-André,

Thanks for the review.

On Fri, Apr 17, 2026 at 06:51:14PM +0400, Marc-André Lureau wrote:
> Hi
> 
> On Fri, Apr 17, 2026 at 6:36 PM Stefan Berger <stefanb@linux.ibm.com> wrote:
> >
> >
> >
> > On 4/17/26 6:05 AM, Marc-André Lureau wrote:
> > > Hi
> > >
> > > On Tue, Apr 14, 2026 at 12:30 PM Arun Menon <armenon@redhat.com> wrote:
> > >>
> > >> From: Arun Menon <armenon@redhat.com>
> > >>
> > >> - Add new fields to the CRB Interface Identifier and the CRB
> > >>    Control Start registers.
> > >> - CRB_CTRL_START now has 2 new settings, that can be toggled using the
> > >>    nextChunk and crbRspRetry bits.
> > >> - CapCRBChunk bit (10) was Reserved1 previously. The field is reused in
> > >>    this revision of the specification.
> > >> - Refer to section 6.4.2.2 of [1]
> > >>
> > >> [1] https://trustedcomputinggroup.org/wp-content/uploads/PC-Client-Specific-Platform-TPM-Profile-for-TPM-2p0-v1p07_Pub.pdf
> > >>
> > >> Signed-off-by: Arun Menon <armenon@redhat.com>
> > >> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
> > >> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > >> ---
> > >>   hw/tpm/tpm_crb.c      | 3 +++
> > >>   include/hw/acpi/tpm.h | 5 ++++-
> > >>   2 files changed, 7 insertions(+), 1 deletion(-)
> > >>
> > >> diff --git a/hw/tpm/tpm_crb.c b/hw/tpm/tpm_crb.c
> > >> index 8723536f93..0a1c7ecdc6 100644
> > >> --- a/hw/tpm/tpm_crb.c
> > >> +++ b/hw/tpm/tpm_crb.c
> > >> @@ -59,6 +59,7 @@ DECLARE_INSTANCE_CHECKER(CRBState, CRB,
> > >>   #define CRB_INTF_CAP_FIFO_NOT_SUPPORTED 0b0
> > >>   #define CRB_INTF_CAP_CRB_SUPPORTED 0b1
> > >>   #define CRB_INTF_IF_SELECTOR_CRB 0b1
> > >> +#define CRB_INTF_CAP_CRB_CHUNK 0b1
> > >>
> > >>   #define CRB_CTRL_CMD_SIZE (TPM_CRB_ADDR_SIZE - A_CRB_DATA_BUFFER)
> > >>
> > >> @@ -262,6 +263,8 @@ static void tpm_crb_reset(void *dev)
> > >>                        CapCRB, CRB_INTF_CAP_CRB_SUPPORTED);
> > >>       ARRAY_FIELD_DP32(s->regs, CRB_INTF_ID,
> > >>                        InterfaceSelector, CRB_INTF_IF_SELECTOR_CRB);
> > >> +    ARRAY_FIELD_DP32(s->regs, CRB_INTF_ID,
> > >> +                     CapCRBChunk, CRB_INTF_CAP_CRB_CHUNK);
> > >
> > > We should not expose that new capability to guests without an explicit
> > > "cap-chunk=on".
> >
> > You mean put this on the QEMU command line? This new capability is
> > really only needed if the user chooses PQC algorithm support (but then I
> > was also going to allow for 7kb writes to NVRAM spaces rather than 1kb
> > writes so far) and if the user chooses a swtpm profile with such support
> > but then fails to set this flag, some transmissions won't work. What
> > would be the problem if we exposed this new feature all the time and if
> > we can avoid state backwards-incompatibilities, which IMO is the most
> > important aspect, if we detect that chunking was not used by the driver
> 
> In general, we shouldn't suddenly expose device capabilities to
> guests. Starting with 11.1 machine, the cap-chunk feature can be
> enabled by default though.

You are right, we do not need to keep track of 2 properties. I will
remove migrate_buffers hw_compat property.

IIUC, you meant we need to expose cap-chunk i.e. remove "x-".
And the whole logic of exposing it based on machine type should also be
moved to earlier i.e. [PATCH v4 01/10] hw/tpm: Add TPM CRB chunking fields
instead of [PATCH v4 06/10] hw/tpm: Add support for VM migration with TPM CRB chunking.

> 
> > and only write additional state if found absolutely necessary? I would
> > prefer to untangle the user's choice of enabled algorithm from the
> > choice of such a flag. But then there's the aspect of OS drivers that
> > could use chunking even when not absolutely necessary (?).
> 

Reards,
Arun Menon



  reply	other threads:[~2026-04-20 11:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-14  8:29 [PATCH v4 00/10] hw/tpm: CRB chunking capability to handle PQC Arun Menon
2026-04-14  8:29 ` [PATCH v4 01/10] hw/tpm: Add TPM CRB chunking fields Arun Menon
2026-04-17 10:05   ` Marc-André Lureau
2026-04-17 14:34     ` Stefan Berger
2026-04-17 14:51       ` Marc-André Lureau
2026-04-20 11:50         ` Arun Menon [this message]
2026-04-14  8:29 ` [PATCH v4 02/10] hw/tpm: Refactor CRB_CTRL_START register access Arun Menon
2026-04-14  8:29 ` [PATCH v4 03/10] hw/tpm: Add internal buffer state for chunking Arun Menon
2026-04-14  8:29 ` [PATCH v4 04/10] hw/tpm: Implement TPM CRB chunking logic Arun Menon
2026-04-14  8:29 ` [PATCH v4 05/10] test/qtest: Add test for tpm crb chunking Arun Menon
2026-04-14  8:29 ` [PATCH v4 06/10] hw/tpm: Add support for VM migration with TPM CRB chunking Arun Menon
2026-04-14  8:29 ` [PATCH v4 07/10] qtests: Enable starting swtpm with a given profile Arun Menon
2026-04-14  8:29 ` [PATCH v4 08/10] tests: Use ML-DSA-87 operations to caused large TPM transfers with CRB Arun Menon
2026-04-14  8:29 ` [PATCH v4 09/10] tpm: Extend TPM TIS buffer size to 8192 bytes Arun Menon
2026-04-14  8:29 ` [PATCH v4 10/10] tests: Use ML-DSA-87 operations to caused large TPM transfers with TIS Arun Menon

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=aeYTDYOQzvYXuay0@fedora \
    --to=armenon@redhat.com \
    --cc=anisinha@redhat.com \
    --cc=farosas@suse.de \
    --cc=imammedo@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanb@linux.ibm.com \
    --cc=stefanb@linux.vnet.ibm.com \
    --cc=wangyanan55@huawei.com \
    --cc=zhao1.liu@intel.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.