From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, "Thomas Huth" <thuth@redhat.com>,
"Stefan Berger" <stefanb@linux.vnet.ibm.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Ani Sinha" <anisinha@redhat.com>,
"Igor Mammedov" <imammedo@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH v3 3/5] hw/tpm: Remove CRBState::ppi_enabled field
Date: Tue, 17 Mar 2026 13:02:39 +0100 [thread overview]
Message-ID: <20260317120241.16320-4-philmd@linaro.org> (raw)
In-Reply-To: <20260317120241.16320-1-philmd@linaro.org>
The CRBState::ppi_enabled boolean was only set in the
hw_compat_3_1[] array, via the 'ppi=false' property.
We removed all machines using that array, and the array
itself in commit a861ffef237 ("hw/core/machine: Remove
the hw_compat_3_1[] array"). We can safely remove the
now unused property. Since CRB devices always use PPI,
simplify removing the CRBState::ppi_enabled field.
Set the generic TPMIfClass::ppi_enabled so ACPI subsystem
can keep checking its availability.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/tpm/tpm_crb.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/hw/tpm/tpm_crb.c b/hw/tpm/tpm_crb.c
index 8723536f931..02701ab9480 100644
--- a/hw/tpm/tpm_crb.c
+++ b/hw/tpm/tpm_crb.c
@@ -43,7 +43,6 @@ struct CRBState {
size_t be_buffer_size;
- bool ppi_enabled;
TPMPPI ppi;
};
typedef struct CRBState CRBState;
@@ -228,16 +227,13 @@ static const VMStateDescription vmstate_tpm_crb = {
static const Property tpm_crb_properties[] = {
DEFINE_PROP_TPMBE("tpmdev", CRBState, tpmbe),
- DEFINE_PROP_BOOL("ppi", CRBState, ppi_enabled, true),
};
static void tpm_crb_reset(void *dev)
{
CRBState *s = CRB(dev);
- if (s->ppi_enabled) {
- tpm_ppi_reset(&s->ppi);
- }
+ tpm_ppi_reset(&s->ppi);
tpm_backend_reset(s->tpmbe);
memset(s->regs, 0, sizeof(s->regs));
@@ -303,10 +299,8 @@ static void tpm_crb_realize(DeviceState *dev, Error **errp)
memory_region_add_subregion(get_system_memory(),
TPM_CRB_ADDR_BASE + sizeof(s->regs), &s->cmdmem);
- if (s->ppi_enabled) {
- tpm_ppi_init(&s->ppi, get_system_memory(),
- TPM_PPI_ADDR_BASE, OBJECT(s));
- }
+ tpm_ppi_init(&s->ppi, get_system_memory(),
+ TPM_PPI_ADDR_BASE, OBJECT(s));
if (xen_enabled()) {
tpm_crb_reset(dev);
@@ -325,6 +319,7 @@ static void tpm_crb_class_init(ObjectClass *klass, const void *data)
dc->vmsd = &vmstate_tpm_crb;
dc->user_creatable = true;
tc->model = TPM_MODEL_TPM_CRB;
+ tc->ppi_enabled = true;
tc->get_version = tpm_crb_get_version;
tc->request_completed = tpm_crb_request_completed;
--
2.53.0
next prev parent reply other threads:[~2026-03-17 12:04 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-17 12:02 [PATCH v3 0/5] hw/tpm: Remove instance @ppi_enabled field Philippe Mathieu-Daudé
2026-03-17 12:02 ` [PATCH v3 1/5] hw/tpm: Factor tpm_ppi_enabled() out Philippe Mathieu-Daudé
2026-03-17 13:18 ` Stefan Berger
2026-03-17 12:02 ` [PATCH v3 2/5] hw/tpm: Add TPMIfClass::ppi_enabled field Philippe Mathieu-Daudé
2026-03-17 13:17 ` Stefan Berger
2026-03-17 15:15 ` Philippe Mathieu-Daudé
2026-03-17 12:02 ` Philippe Mathieu-Daudé [this message]
2026-03-17 13:19 ` [PATCH v3 3/5] hw/tpm: Remove CRBState::ppi_enabled field Stefan Berger
2026-03-17 15:16 ` Philippe Mathieu-Daudé
2026-03-17 16:58 ` Stefan Berger
2026-03-17 12:02 ` [PATCH v3 4/5] hw/tpm: Propagate @ppi_enabled to tpm_tis_reset() and remove in TPMState Philippe Mathieu-Daudé
2026-03-17 13:21 ` Stefan Berger
2026-03-17 12:02 ` [PATCH v3 5/5] hw/tpm: Simplify tpm_ppi_enabled() Philippe Mathieu-Daudé
2026-03-17 13:21 ` Stefan Berger
2026-03-23 9:56 ` [PATCH v3 0/5] hw/tpm: Remove instance @ppi_enabled field Philippe Mathieu-Daudé
2026-03-27 15:18 ` Stefan Berger
2026-03-27 15:21 ` Stefan Berger
2026-03-27 18:17 ` Stefan Berger
2026-03-27 23:37 ` Philippe Mathieu-Daudé
2026-04-20 20:31 ` Philippe Mathieu-Daudé
2026-04-21 21:44 ` Stefan Berger
2026-04-21 22:15 ` Philippe Mathieu-Daudé
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=20260317120241.16320-4-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=anisinha@redhat.com \
--cc=imammedo@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=stefanb@linux.vnet.ibm.com \
--cc=thuth@redhat.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.