qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 09/11] tpm_tis_sysbus: fix crash when PPI is enabled


From: Stefan Berger
Subject: Re: [PATCH 09/11] tpm_tis_sysbus: fix crash when PPI is enabled
Date: Thu, 13 Jul 2023 12:49:55 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0



On 7/12/23 23:51, Joelle van Dyne wrote:
If 'ppi' property is set, then `tpm_ppi_reset` is called on reset
which SEGFAULTs because `tpmppi->buf` is not allocated.

Signed-off-by: Joelle van Dyne <j@getutm.app>
---
  hw/tpm/tpm_tis_sysbus.c | 4 ++++
  1 file changed, 4 insertions(+)

diff --git a/hw/tpm/tpm_tis_sysbus.c b/hw/tpm/tpm_tis_sysbus.c
index 45e63efd63..1014d5d993 100644
--- a/hw/tpm/tpm_tis_sysbus.c
+++ b/hw/tpm/tpm_tis_sysbus.c
@@ -124,6 +124,10 @@ static void tpm_tis_sysbus_realizefn(DeviceState *dev, 
Error **errp)
          error_setg(errp, "'tpmdev' property is required");
          return;
      }
+
+    if (s->ppi_enabled) {
+        sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->ppi.ram);
+    }
  }


The tpm-tis-device doesn't work for x86_64 but for aarch64.


We have this here in this file:

    DEFINE_PROP_BOOL("ppi", TPMStateSysBus, state.ppi_enabled, false),

I don't know whether ppi would work on aarch64. It needs firmware support like 
in edk2.
I think the best solution is to remove this DEFINE_PROP_BOOL() and if someone 
wants
to enable it they would have to add firmware support and test it before 
re-enabling it.

   Stefan

  static void tpm_tis_sysbus_class_init(ObjectClass *klass, void *data)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]