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, "Zhao Liu" <zhao1.liu@intel.com>,
	"Stefan Berger" <stefanb@linux.vnet.ibm.com>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Fabiano Rosas" <farosas@suse.de>,
	"Igor Mammedov" <imammedo@redhat.com>,
	marcandre.lureau@redhat.com,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Yanan Wang" <wangyanan55@huawei.com>,
	"Ani Sinha" <anisinha@redhat.com>
Subject: Re: [PATCH v5 06/10] hw/tpm: Add support for VM migration with TPM CRB chunking
Date: Thu, 30 Apr 2026 01:19:11 +0530	[thread overview]
Message-ID: <afJgt-8vQBCKzCbN@fedora> (raw)
In-Reply-To: <4474547c-0d94-4585-8970-83950d3c75c3@linux.ibm.com>

Hi,

On Wed, Apr 29, 2026 at 11:36:39AM -0400, Stefan Berger wrote:
> 
> 
> On 4/22/26 6:30 AM, Arun Menon wrote:
> > From: Arun Menon <armenon@redhat.com>
> > 
> > - Add subsection in VMState for TPM CRB with the newly introduced
> >    command and response buffer GByteArrays, along with a needed callback,
> >    so that newer QEMU only sends the buffers if it is necessary.
> > - Implement a migration blocker to prevent migration of the VM if the
> >    user manually enables chunking capability, cap-chunk, but the machine
> >    type does not support it, using a new hw_compat property called
> >    allow_chunk_migration.
> > - Add a post_load_errp hook so that during a migration, the buffers are
> >    validated before destination VM is started.
> > 
> > Signed-off-by: Arun Menon <armenon@redhat.com>
> > ---
> >   hw/core/machine.c |  1 +
> >   hw/tpm/tpm_crb.c  | 71 +++++++++++++++++++++++++++++++++++++++++++++++
> >   2 files changed, 72 insertions(+)
> > 
> > @@ -422,6 +478,7 @@ static void tpm_crb_reset(void *dev)
> >   static void tpm_crb_realize(DeviceState *dev, Error **errp)
> >   {
> >       CRBState *s = CRB(dev);
> > +    int ret;
> >       if (!tpm_find()) {
> >           error_setg(errp, "at most one TPM device is permitted");
> > @@ -431,6 +488,15 @@ static void tpm_crb_realize(DeviceState *dev, Error **errp)
> >           error_setg(errp, "'tpmdev' property is required");
> >           return;
> >       }
> > +    if (s->cap_chunk && !s->allow_chunk_migration) {
> > +        error_setg(&s->migration_blocker,
> > +                   "The tpm-crb device does not support chunk migration with "
> > +                   "machine version less than 11.1");
> > +        ret = migrate_add_blocker_normal(&s->migration_blocker, errp);
> > +        if (ret < 0) {
> > +            return;
> 
> Should this do an error_report() and exit(1)?

The tpm_crb_realize() function has always propagated errors in errp
back to the caller and returned in case of an error.
To be honest I followed the suit. A quick glance at the codebase shows
that the realize function in other devices also avoid calling exit().



Regards,
Arun Menon
> 
> 



  reply	other threads:[~2026-04-29 19:50 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-22 10:30 [PATCH v5 00/10] hw/tpm: CRB chunking capability to handle PQC Arun Menon
2026-04-22 10:30 ` [PATCH v5 01/10] hw/tpm: Add TPM CRB chunking fields Arun Menon
2026-04-22 10:30 ` [PATCH v5 02/10] hw/tpm: Refactor CRB_CTRL_START register access Arun Menon
2026-04-22 10:30 ` [PATCH v5 03/10] hw/tpm: Add internal buffer state for chunking Arun Menon
2026-04-22 12:55   ` Stefan Berger
2026-04-29 14:16   ` Stefan Berger
2026-04-22 10:30 ` [PATCH v5 04/10] hw/tpm: Implement TPM CRB chunking logic Arun Menon
2026-04-22 10:30 ` [PATCH v5 05/10] test/qtest: Add test for tpm crb chunking Arun Menon
2026-04-29 14:26   ` Stefan Berger
2026-04-22 10:30 ` [PATCH v5 06/10] hw/tpm: Add support for VM migration with TPM CRB chunking Arun Menon
2026-04-29 15:36   ` Stefan Berger
2026-04-29 19:49     ` Arun Menon [this message]
2026-04-29 23:14   ` Stefan Berger
2026-04-30  5:11     ` Arun Menon
2026-04-30 11:46       ` Stefan Berger
2026-05-04  7:12         ` Arun Menon
2026-05-04 14:33           ` Stefan Berger
2026-05-04 17:42             ` Arun Menon
2026-04-30 19:49   ` Stefan Berger
2026-05-04 17:43     ` Arun Menon
2026-04-22 10:30 ` [PATCH v5 07/10] qtests: Enable starting swtpm with a given profile Arun Menon
2026-04-22 10:30 ` [PATCH v5 08/10] tests: Use ML-DSA-87 operations to caused large TPM transfers with CRB Arun Menon
2026-04-22 10:30 ` [PATCH v5 09/10] tpm: Extend TPM TIS buffer size to 8192 bytes Arun Menon
2026-04-22 10:30 ` [PATCH v5 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=afJgt-8vQBCKzCbN@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.