diff mbox series

hw/tpm: TIS on sysbus: Remove unsupport ppi command line option

Message ID 20230714115325.248930-1-stefanb@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series hw/tpm: TIS on sysbus: Remove unsupport ppi command line option | expand

Commit Message

Stefan Berger July 14, 2023, 11:53 a.m. UTC
The ppi command line option for the TIS device on sysbus never worked
and caused an immediate segfault. Since it is part of the state of
a VM we cannot remove it but have to intercept ppi_enabled set to
true and display an error instead.

Reproducer with the ppi=on option passed:

qemu-system-aarch64 \
   -machine virt,gic-version=3 \
   -m 4G  \
   -nographic -no-acpi \
   -chardev socket,id=chrtpm,path=/tmp/mytpm1/swtpm-sock \
   -tpmdev emulator,id=tpm0,chardev=chrtpm \
   -device tpm-tis-device,tpmdev=tpm0,ppi=on
[...]
Segmentation fault (core dumped)

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
---
 hw/tpm/tpm_tis_sysbus.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/hw/tpm/tpm_tis_sysbus.c b/hw/tpm/tpm_tis_sysbus.c
index 45e63efd63..4319d31c88 100644
--- a/hw/tpm/tpm_tis_sysbus.c
+++ b/hw/tpm/tpm_tis_sysbus.c
@@ -124,6 +124,11 @@  static void tpm_tis_sysbus_realizefn(DeviceState *dev, Error **errp)
         error_setg(errp, "'tpmdev' property is required");
         return;
     }
+
+    if (s->ppi_enabled) {
+        error_setg(errp, "'ppi=on' is not supported by this device");
+        return;
+    }
 }
 
 static void tpm_tis_sysbus_class_init(ObjectClass *klass, void *data)