* [PATCH] hw/tpm: TIS on sysbus: Remove unsupport ppi command line option
@ 2023-07-13 17:19 Stefan Berger
2023-07-13 17:38 ` Eric Auger
2023-07-14 6:07 ` Joelle van Dyne
0 siblings, 2 replies; 8+ messages in thread
From: Stefan Berger @ 2023-07-13 17:19 UTC (permalink / raw)
To: qemu-devel; +Cc: marcandre.lureau, eric.auger, ard.biesheuvel, j, Stefan Berger
The ppi command line option for the TIS device on sysbus never worked
and caused an immediate segfault. Remove support for it since it also
needs support in the firmware and needs testing inside the VM.
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 | 1 -
1 file changed, 1 deletion(-)
diff --git a/hw/tpm/tpm_tis_sysbus.c b/hw/tpm/tpm_tis_sysbus.c
index 45e63efd63..6724b3d4f6 100644
--- a/hw/tpm/tpm_tis_sysbus.c
+++ b/hw/tpm/tpm_tis_sysbus.c
@@ -93,7 +93,6 @@ static void tpm_tis_sysbus_reset(DeviceState *dev)
static Property tpm_tis_sysbus_properties[] = {
DEFINE_PROP_UINT32("irq", TPMStateSysBus, state.irq_num, TPM_TIS_IRQ),
DEFINE_PROP_TPMBE("tpmdev", TPMStateSysBus, state.be_driver),
- DEFINE_PROP_BOOL("ppi", TPMStateSysBus, state.ppi_enabled, false),
DEFINE_PROP_END_OF_LIST(),
};
--
2.41.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] hw/tpm: TIS on sysbus: Remove unsupport ppi command line option
2023-07-13 17:19 [PATCH] hw/tpm: TIS on sysbus: Remove unsupport ppi command line option Stefan Berger
@ 2023-07-13 17:38 ` Eric Auger
2023-07-14 6:07 ` Joelle van Dyne
1 sibling, 0 replies; 8+ messages in thread
From: Eric Auger @ 2023-07-13 17:38 UTC (permalink / raw)
To: Stefan Berger, qemu-devel; +Cc: marcandre.lureau, ard.biesheuvel, j
Hi Stefan,
On 7/13/23 19:19, Stefan Berger wrote:
> The ppi command line option for the TIS device on sysbus never worked
> and caused an immediate segfault. Remove support for it since it also
> needs support in the firmware and needs testing inside the VM.
>
> 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>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Thanks!
Eric
> ---
> hw/tpm/tpm_tis_sysbus.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/hw/tpm/tpm_tis_sysbus.c b/hw/tpm/tpm_tis_sysbus.c
> index 45e63efd63..6724b3d4f6 100644
> --- a/hw/tpm/tpm_tis_sysbus.c
> +++ b/hw/tpm/tpm_tis_sysbus.c
> @@ -93,7 +93,6 @@ static void tpm_tis_sysbus_reset(DeviceState *dev)
> static Property tpm_tis_sysbus_properties[] = {
> DEFINE_PROP_UINT32("irq", TPMStateSysBus, state.irq_num, TPM_TIS_IRQ),
> DEFINE_PROP_TPMBE("tpmdev", TPMStateSysBus, state.be_driver),
> - DEFINE_PROP_BOOL("ppi", TPMStateSysBus, state.ppi_enabled, false),
> DEFINE_PROP_END_OF_LIST(),
> };
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] hw/tpm: TIS on sysbus: Remove unsupport ppi command line option
2023-07-13 17:19 [PATCH] hw/tpm: TIS on sysbus: Remove unsupport ppi command line option Stefan Berger
2023-07-13 17:38 ` Eric Auger
@ 2023-07-14 6:07 ` Joelle van Dyne
2023-07-14 6:12 ` Joelle van Dyne
2023-07-14 11:51 ` Stefan Berger
1 sibling, 2 replies; 8+ messages in thread
From: Joelle van Dyne @ 2023-07-14 6:07 UTC (permalink / raw)
To: Stefan Berger; +Cc: qemu-devel, marcandre.lureau, eric.auger, ard.biesheuvel, j
On Thu, Jul 13, 2023 at 10:20 AM Stefan Berger <stefanb@linux.ibm.com> wrote:
>
> The ppi command line option for the TIS device on sysbus never worked
> and caused an immediate segfault. Remove support for it since it also
> needs support in the firmware and needs testing inside the VM.
>
> 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>
Do you need to add a VMSTATE_UNUSED_TEST in case a future QEMU version
introduces a new field in the same position which will cause an issue
when restoring from an older version?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] hw/tpm: TIS on sysbus: Remove unsupport ppi command line option
2023-07-14 6:07 ` Joelle van Dyne
@ 2023-07-14 6:12 ` Joelle van Dyne
2023-07-14 11:51 ` Stefan Berger
1 sibling, 0 replies; 8+ messages in thread
From: Joelle van Dyne @ 2023-07-14 6:12 UTC (permalink / raw)
To: Joelle van Dyne
Cc: Stefan Berger, qemu-devel, marcandre.lureau, eric.auger,
ard.biesheuvel
On Thu, Jul 13, 2023 at 11:07 PM Joelle van Dyne <j@getutm.app> wrote:
>
> On Thu, Jul 13, 2023 at 10:20 AM Stefan Berger <stefanb@linux.ibm.com> wrote:
> >
> > The ppi command line option for the TIS device on sysbus never worked
> > and caused an immediate segfault. Remove support for it since it also
> > needs support in the firmware and needs testing inside the VM.
> >
> > 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>
>
> Do you need to add a VMSTATE_UNUSED_TEST in case a future QEMU version
> introduces a new field in the same position which will cause an issue
> when restoring from an older version?
Actually, ignore that last message. I misread the patch thinking it's
on the VMState.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] hw/tpm: TIS on sysbus: Remove unsupport ppi command line option
2023-07-14 6:07 ` Joelle van Dyne
2023-07-14 6:12 ` Joelle van Dyne
@ 2023-07-14 11:51 ` Stefan Berger
2023-07-14 13:51 ` Eric Auger
1 sibling, 1 reply; 8+ messages in thread
From: Stefan Berger @ 2023-07-14 11:51 UTC (permalink / raw)
To: Joelle van Dyne; +Cc: qemu-devel, marcandre.lureau, eric.auger, ard.biesheuvel
On 7/14/23 02:07, Joelle van Dyne wrote:
> On Thu, Jul 13, 2023 at 10:20 AM Stefan Berger <stefanb@linux.ibm.com> wrote:
>>
>> The ppi command line option for the TIS device on sysbus never worked
>> and caused an immediate segfault. Remove support for it since it also
>> needs support in the firmware and needs testing inside the VM.
>>
>> 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>
>
> Do you need to add a VMSTATE_UNUSED_TEST in case a future QEMU version
> introduces a new field in the same position which will cause an issue
> when restoring from an older version?
Hm, you got a point there. We will have to error-out in case someone sets ppi=on instead since the expectation that PPI would work is simply not there. v2 coming soon.
Stefan
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] hw/tpm: TIS on sysbus: Remove unsupport ppi command line option
@ 2023-07-14 11:53 Stefan Berger
0 siblings, 0 replies; 8+ messages in thread
From: Stefan Berger @ 2023-07-14 11:53 UTC (permalink / raw)
To: qemu-devel; +Cc: marcandre.lureau, eric.auger, ard.biesheuvel, j, Stefan Berger
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 --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)
--
2.41.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] hw/tpm: TIS on sysbus: Remove unsupport ppi command line option
2023-07-14 11:51 ` Stefan Berger
@ 2023-07-14 13:51 ` Eric Auger
2023-07-14 14:19 ` Stefan Berger
0 siblings, 1 reply; 8+ messages in thread
From: Eric Auger @ 2023-07-14 13:51 UTC (permalink / raw)
To: Stefan Berger, Joelle van Dyne
Cc: qemu-devel, marcandre.lureau, ard.biesheuvel
Hi Stefan,
On 7/14/23 13:51, Stefan Berger wrote:
>
>
> On 7/14/23 02:07, Joelle van Dyne wrote:
>> On Thu, Jul 13, 2023 at 10:20 AM Stefan Berger
>> <stefanb@linux.ibm.com> wrote:
>>>
>>> The ppi command line option for the TIS device on sysbus never worked
>>> and caused an immediate segfault. Remove support for it since it also
>>> needs support in the firmware and needs testing inside the VM.
>>>
>>> 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>
>>
>> Do you need to add a VMSTATE_UNUSED_TEST in case a future QEMU version
>> introduces a new field in the same position which will cause an issue
>> when restoring from an older version?
>
> Hm, you got a point there. We will have to error-out in case someone
> sets ppi=on instead since the expectation that PPI would work is
> simply not there. v2 coming soon.
as Joelle pointed it out ppi_enabled is not part of
vmstate_tpm_tis_sysbus fields. And since it has never worked I suspect
we cannot have any existing VM enabling it. So I don't get the issue
with this 1st version?
Thanks
Eric
>
> Stefan
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] hw/tpm: TIS on sysbus: Remove unsupport ppi command line option
2023-07-14 13:51 ` Eric Auger
@ 2023-07-14 14:19 ` Stefan Berger
0 siblings, 0 replies; 8+ messages in thread
From: Stefan Berger @ 2023-07-14 14:19 UTC (permalink / raw)
To: eric.auger, Joelle van Dyne; +Cc: qemu-devel, marcandre.lureau, ard.biesheuvel
On 7/14/23 09:51, Eric Auger wrote:
> Hi Stefan,
> On 7/14/23 13:51, Stefan Berger wrote:
>>
>>
>> On 7/14/23 02:07, Joelle van Dyne wrote:
>>> On Thu, Jul 13, 2023 at 10:20 AM Stefan Berger
>>> <stefanb@linux.ibm.com> wrote:
>>>>
>>>> The ppi command line option for the TIS device on sysbus never worked
>>>> and caused an immediate segfault. Remove support for it since it also
>>>> needs support in the firmware and needs testing inside the VM.
>>>>
>>>> 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>
>>>
>>> Do you need to add a VMSTATE_UNUSED_TEST in case a future QEMU version
>>> introduces a new field in the same position which will cause an issue
>>> when restoring from an older version?
>>
>> Hm, you got a point there. We will have to error-out in case someone
>> sets ppi=on instead since the expectation that PPI would work is
>> simply not there. v2 coming soon.
> as Joelle pointed it out ppi_enabled is not part of
> vmstate_tpm_tis_sysbus fields. And since it has never worked I suspect
> we cannot have any existing VM enabling it. So I don't get the issue
> with this 1st version?
You are right. I repeated my test with restoring state of a VM taken before the removal of this field and it restored it. So that other patch is good and I am withdrawing this patch here.
Stefan
>
> Thanks
>
> Eric
>>
>> Stefan
>>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-07-14 14:20 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-13 17:19 [PATCH] hw/tpm: TIS on sysbus: Remove unsupport ppi command line option Stefan Berger
2023-07-13 17:38 ` Eric Auger
2023-07-14 6:07 ` Joelle van Dyne
2023-07-14 6:12 ` Joelle van Dyne
2023-07-14 11:51 ` Stefan Berger
2023-07-14 13:51 ` Eric Auger
2023-07-14 14:19 ` Stefan Berger
-- strict thread matches above, loose matches on Subject: below --
2023-07-14 11:53 Stefan Berger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).