* [PATCH] acpi: tpm: Add missing device identification objects
@ 2021-11-09 0:46 Stefan Berger
2021-11-09 9:12 ` Philippe Mathieu-Daudé
2021-11-10 9:24 ` Eric Auger
0 siblings, 2 replies; 7+ messages in thread
From: Stefan Berger @ 2021-11-09 0:46 UTC (permalink / raw)
To: qemu-devel, qemu-trivial
Cc: Michael S . Tsirkin, Shannon Zhao, Igor Mammedov, Ani Sinha,
marcandre.lureau, Stefan Berger
From: Stefan Berger <stefanb@linux.ibm.com>
Add missing device identification objects _STR and _UID. They will appear
as files 'description' and 'uid' under Linux sysfs.
Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Ani Sinha <ani@anisinha.ca>
Fixes: #708
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
---
hw/arm/virt-acpi-build.c | 1 +
hw/i386/acpi-build.c | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index 674f902652..09456424aa 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -228,6 +228,7 @@ static void acpi_dsdt_add_tpm(Aml *scope, VirtMachineState *vms)
Aml *dev = aml_device("TPM0");
aml_append(dev, aml_name_decl("_HID", aml_string("MSFT0101")));
+ aml_append(dev, aml_name_decl("_STR", aml_string("TPM 2.0 Device")));
aml_append(dev, aml_name_decl("_UID", aml_int(0)));
Aml *crs = aml_resource_template();
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index a3ad6abd33..d6d3541407 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1808,6 +1808,10 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
dev = aml_device("TPM");
aml_append(dev, aml_name_decl("_HID",
aml_string("MSFT0101")));
+ aml_append(dev,
+ aml_name_decl("_STR",
+ aml_string("TPM 2.0 Device")));
+ aml_append(dev, aml_name_decl("_UID", aml_int(0)));
} else {
dev = aml_device("ISA.TPM");
aml_append(dev, aml_name_decl("_HID",
--
2.31.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] acpi: tpm: Add missing device identification objects
2021-11-09 0:46 [PATCH] acpi: tpm: Add missing device identification objects Stefan Berger
@ 2021-11-09 9:12 ` Philippe Mathieu-Daudé
2021-11-10 9:24 ` Eric Auger
1 sibling, 0 replies; 7+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-11-09 9:12 UTC (permalink / raw)
To: Stefan Berger, qemu-devel, qemu-trivial
Cc: Michael S . Tsirkin, Shannon Zhao, marcandre.lureau, Ani Sinha,
Igor Mammedov, Stefan Berger
On 11/9/21 01:46, Stefan Berger wrote:
> From: Stefan Berger <stefanb@linux.ibm.com>
>
> Add missing device identification objects _STR and _UID. They will appear
> as files 'description' and 'uid' under Linux sysfs.
>
> Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Ani Sinha <ani@anisinha.ca>
> Fixes: #708
https://gitlab.com/qemu-project/qemu/-/issues/708
> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
> ---
> hw/arm/virt-acpi-build.c | 1 +
> hw/i386/acpi-build.c | 4 ++++
> 2 files changed, 5 insertions(+)
>
> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> index 674f902652..09456424aa 100644
> --- a/hw/arm/virt-acpi-build.c
> +++ b/hw/arm/virt-acpi-build.c
> @@ -228,6 +228,7 @@ static void acpi_dsdt_add_tpm(Aml *scope, VirtMachineState *vms)
>
> Aml *dev = aml_device("TPM0");
> aml_append(dev, aml_name_decl("_HID", aml_string("MSFT0101")));
> + aml_append(dev, aml_name_decl("_STR", aml_string("TPM 2.0 Device")));
> aml_append(dev, aml_name_decl("_UID", aml_int(0)));
>
> Aml *crs = aml_resource_template();
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index a3ad6abd33..d6d3541407 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -1808,6 +1808,10 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
> dev = aml_device("TPM");
> aml_append(dev, aml_name_decl("_HID",
> aml_string("MSFT0101")));
> + aml_append(dev,
> + aml_name_decl("_STR",
> + aml_string("TPM 2.0 Device")));
> + aml_append(dev, aml_name_decl("_UID", aml_int(0)));
> } else {
> dev = aml_device("ISA.TPM");
> aml_append(dev, aml_name_decl("_HID",
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] acpi: tpm: Add missing device identification objects
2021-11-09 0:46 [PATCH] acpi: tpm: Add missing device identification objects Stefan Berger
2021-11-09 9:12 ` Philippe Mathieu-Daudé
@ 2021-11-10 9:24 ` Eric Auger
1 sibling, 0 replies; 7+ messages in thread
From: Eric Auger @ 2021-11-10 9:24 UTC (permalink / raw)
To: Stefan Berger, qemu-devel, qemu-trivial
Cc: Michael S . Tsirkin, Shannon Zhao, marcandre.lureau, Ani Sinha,
Igor Mammedov, Stefan Berger
Hi Stefan,
On 11/9/21 1:46 AM, Stefan Berger wrote:
> From: Stefan Berger <stefanb@linux.ibm.com>
>
> Add missing device identification objects _STR and _UID. They will appear
> as files 'description' and 'uid' under Linux sysfs.
>
> Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Ani Sinha <ani@anisinha.ca>
> Fixes: #708
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Thanks
Eric
> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
> ---
> hw/arm/virt-acpi-build.c | 1 +
> hw/i386/acpi-build.c | 4 ++++
> 2 files changed, 5 insertions(+)
>
> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> index 674f902652..09456424aa 100644
> --- a/hw/arm/virt-acpi-build.c
> +++ b/hw/arm/virt-acpi-build.c
> @@ -228,6 +228,7 @@ static void acpi_dsdt_add_tpm(Aml *scope, VirtMachineState *vms)
>
> Aml *dev = aml_device("TPM0");
> aml_append(dev, aml_name_decl("_HID", aml_string("MSFT0101")));
> + aml_append(dev, aml_name_decl("_STR", aml_string("TPM 2.0 Device")));
> aml_append(dev, aml_name_decl("_UID", aml_int(0)));
>
> Aml *crs = aml_resource_template();
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index a3ad6abd33..d6d3541407 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -1808,6 +1808,10 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
> dev = aml_device("TPM");
> aml_append(dev, aml_name_decl("_HID",
> aml_string("MSFT0101")));
> + aml_append(dev,
> + aml_name_decl("_STR",
> + aml_string("TPM 2.0 Device")));
> + aml_append(dev, aml_name_decl("_UID", aml_int(0)));
> } else {
> dev = aml_device("ISA.TPM");
> aml_append(dev, aml_name_decl("_HID",
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] acpi: tpm: Add missing device identification objects
2021-11-09 7:30 ` Marc-André Lureau
@ 2021-11-09 11:50 ` Stefan Berger
0 siblings, 0 replies; 7+ messages in thread
From: Stefan Berger @ 2021-11-09 11:50 UTC (permalink / raw)
To: Marc-André Lureau, Stefan Berger
Cc: Michael S . Tsirkin, qemu-trivial, qemu-devel, Shannon Zhao,
Ani Sinha, Igor Mammedov
On 11/9/21 02:30, Marc-André Lureau wrote:
> Hi
>
> On Tue, Nov 9, 2021 at 11:25 AM Marc-André Lureau
> <marcandre.lureau@redhat.com> wrote:
>> On Tue, Nov 9, 2021 at 4:37 AM Stefan Berger <stefanb@linux.vnet.ibm.com> wrote:
>>> Add missing device identification objects _STR and _UID. They will appear
>>> as files 'description' and 'uid' under Linux sysfs.
>>>
>>> Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
>>> Cc: Michael S. Tsirkin <mst@redhat.com>
>>> Cc: Igor Mammedov <imammedo@redhat.com>
>>> Cc: Ani Sinha <ani@anisinha.ca>
>>> Fixes: #708
>>> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
>> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>>
>> (on my host, for some reason the UID is 1, does this matter?)
Let's make it '1'. My TPM 1.2 machine shows also '1'.
specs:
"6.1.12 _UID (Unique ID)
This object provides OSPM with a logical device ID that does not change
across reboots. This object is
optional, but is required when the device has no other way to report a
persistent unique device ID. The
_UID must be unique across all devices with either a common _HID or
_CID. [...]"
> And shouldn't this be done also for TIS device?
Fixed. It was missing for the CRB device.
Thanks.
Stefan
>
>>> ---
>>> hw/arm/virt-acpi-build.c | 1 +
>>> hw/i386/acpi-build.c | 4 ++++
>>> 2 files changed, 5 insertions(+)
>>>
>>> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
>>> index 674f902652..09456424aa 100644
>>> --- a/hw/arm/virt-acpi-build.c
>>> +++ b/hw/arm/virt-acpi-build.c
>>> @@ -228,6 +228,7 @@ static void acpi_dsdt_add_tpm(Aml *scope, VirtMachineState *vms)
>>>
>>> Aml *dev = aml_device("TPM0");
>>> aml_append(dev, aml_name_decl("_HID", aml_string("MSFT0101")));
>>> + aml_append(dev, aml_name_decl("_STR", aml_string("TPM 2.0 Device")));
>>> aml_append(dev, aml_name_decl("_UID", aml_int(0)));
>>>
>>> Aml *crs = aml_resource_template();
>>> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
>>> index a3ad6abd33..d6d3541407 100644
>>> --- a/hw/i386/acpi-build.c
>>> +++ b/hw/i386/acpi-build.c
>>> @@ -1808,6 +1808,10 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
>>> dev = aml_device("TPM");
>>> aml_append(dev, aml_name_decl("_HID",
>>> aml_string("MSFT0101")));
>>> + aml_append(dev,
>>> + aml_name_decl("_STR",
>>> + aml_string("TPM 2.0 Device")));
>>> + aml_append(dev, aml_name_decl("_UID", aml_int(0)));
>>> } else {
>>> dev = aml_device("ISA.TPM");
>>> aml_append(dev, aml_name_decl("_HID",
>>> --
>>> 2.31.1
>>>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] acpi: tpm: Add missing device identification objects
2021-11-09 7:25 ` Marc-André Lureau
@ 2021-11-09 7:30 ` Marc-André Lureau
2021-11-09 11:50 ` Stefan Berger
0 siblings, 1 reply; 7+ messages in thread
From: Marc-André Lureau @ 2021-11-09 7:30 UTC (permalink / raw)
To: Stefan Berger
Cc: Michael S . Tsirkin, qemu-trivial, qemu-devel, Shannon Zhao,
Ani Sinha, Igor Mammedov, Stefan Berger
Hi
On Tue, Nov 9, 2021 at 11:25 AM Marc-André Lureau
<marcandre.lureau@redhat.com> wrote:
>
> On Tue, Nov 9, 2021 at 4:37 AM Stefan Berger <stefanb@linux.vnet.ibm.com> wrote:
> >
> > Add missing device identification objects _STR and _UID. They will appear
> > as files 'description' and 'uid' under Linux sysfs.
> >
> > Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
> > Cc: Michael S. Tsirkin <mst@redhat.com>
> > Cc: Igor Mammedov <imammedo@redhat.com>
> > Cc: Ani Sinha <ani@anisinha.ca>
> > Fixes: #708
> > Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
>
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> (on my host, for some reason the UID is 1, does this matter?)
And shouldn't this be done also for TIS device?
>
> > ---
> > hw/arm/virt-acpi-build.c | 1 +
> > hw/i386/acpi-build.c | 4 ++++
> > 2 files changed, 5 insertions(+)
> >
> > diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> > index 674f902652..09456424aa 100644
> > --- a/hw/arm/virt-acpi-build.c
> > +++ b/hw/arm/virt-acpi-build.c
> > @@ -228,6 +228,7 @@ static void acpi_dsdt_add_tpm(Aml *scope, VirtMachineState *vms)
> >
> > Aml *dev = aml_device("TPM0");
> > aml_append(dev, aml_name_decl("_HID", aml_string("MSFT0101")));
> > + aml_append(dev, aml_name_decl("_STR", aml_string("TPM 2.0 Device")));
> > aml_append(dev, aml_name_decl("_UID", aml_int(0)));
> >
> > Aml *crs = aml_resource_template();
> > diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> > index a3ad6abd33..d6d3541407 100644
> > --- a/hw/i386/acpi-build.c
> > +++ b/hw/i386/acpi-build.c
> > @@ -1808,6 +1808,10 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
> > dev = aml_device("TPM");
> > aml_append(dev, aml_name_decl("_HID",
> > aml_string("MSFT0101")));
> > + aml_append(dev,
> > + aml_name_decl("_STR",
> > + aml_string("TPM 2.0 Device")));
> > + aml_append(dev, aml_name_decl("_UID", aml_int(0)));
> > } else {
> > dev = aml_device("ISA.TPM");
> > aml_append(dev, aml_name_decl("_HID",
> > --
> > 2.31.1
> >
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] acpi: tpm: Add missing device identification objects
2021-11-09 0:37 Stefan Berger
@ 2021-11-09 7:25 ` Marc-André Lureau
2021-11-09 7:30 ` Marc-André Lureau
0 siblings, 1 reply; 7+ messages in thread
From: Marc-André Lureau @ 2021-11-09 7:25 UTC (permalink / raw)
To: Stefan Berger
Cc: Michael S . Tsirkin, qemu-trivial, qemu-devel, Shannon Zhao,
Ani Sinha, Igor Mammedov, Stefan Berger
On Tue, Nov 9, 2021 at 4:37 AM Stefan Berger <stefanb@linux.vnet.ibm.com> wrote:
>
> Add missing device identification objects _STR and _UID. They will appear
> as files 'description' and 'uid' under Linux sysfs.
>
> Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Ani Sinha <ani@anisinha.ca>
> Fixes: #708
> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
(on my host, for some reason the UID is 1, does this matter?)
> ---
> hw/arm/virt-acpi-build.c | 1 +
> hw/i386/acpi-build.c | 4 ++++
> 2 files changed, 5 insertions(+)
>
> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> index 674f902652..09456424aa 100644
> --- a/hw/arm/virt-acpi-build.c
> +++ b/hw/arm/virt-acpi-build.c
> @@ -228,6 +228,7 @@ static void acpi_dsdt_add_tpm(Aml *scope, VirtMachineState *vms)
>
> Aml *dev = aml_device("TPM0");
> aml_append(dev, aml_name_decl("_HID", aml_string("MSFT0101")));
> + aml_append(dev, aml_name_decl("_STR", aml_string("TPM 2.0 Device")));
> aml_append(dev, aml_name_decl("_UID", aml_int(0)));
>
> Aml *crs = aml_resource_template();
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index a3ad6abd33..d6d3541407 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -1808,6 +1808,10 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
> dev = aml_device("TPM");
> aml_append(dev, aml_name_decl("_HID",
> aml_string("MSFT0101")));
> + aml_append(dev,
> + aml_name_decl("_STR",
> + aml_string("TPM 2.0 Device")));
> + aml_append(dev, aml_name_decl("_UID", aml_int(0)));
> } else {
> dev = aml_device("ISA.TPM");
> aml_append(dev, aml_name_decl("_HID",
> --
> 2.31.1
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] acpi: tpm: Add missing device identification objects
@ 2021-11-09 0:37 Stefan Berger
2021-11-09 7:25 ` Marc-André Lureau
0 siblings, 1 reply; 7+ messages in thread
From: Stefan Berger @ 2021-11-09 0:37 UTC (permalink / raw)
To: qemu-devel, qemu-trivial
Cc: Michael S . Tsirkin, Stefan Berger, Shannon Zhao, Igor Mammedov,
Ani Sinha, marcandre.lureau, Stefan Berger
Add missing device identification objects _STR and _UID. They will appear
as files 'description' and 'uid' under Linux sysfs.
Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Ani Sinha <ani@anisinha.ca>
Fixes: #708
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
---
hw/arm/virt-acpi-build.c | 1 +
hw/i386/acpi-build.c | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index 674f902652..09456424aa 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -228,6 +228,7 @@ static void acpi_dsdt_add_tpm(Aml *scope, VirtMachineState *vms)
Aml *dev = aml_device("TPM0");
aml_append(dev, aml_name_decl("_HID", aml_string("MSFT0101")));
+ aml_append(dev, aml_name_decl("_STR", aml_string("TPM 2.0 Device")));
aml_append(dev, aml_name_decl("_UID", aml_int(0)));
Aml *crs = aml_resource_template();
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index a3ad6abd33..d6d3541407 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1808,6 +1808,10 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
dev = aml_device("TPM");
aml_append(dev, aml_name_decl("_HID",
aml_string("MSFT0101")));
+ aml_append(dev,
+ aml_name_decl("_STR",
+ aml_string("TPM 2.0 Device")));
+ aml_append(dev, aml_name_decl("_UID", aml_int(0)));
} else {
dev = aml_device("ISA.TPM");
aml_append(dev, aml_name_decl("_HID",
--
2.31.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2021-11-10 9:25 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-09 0:46 [PATCH] acpi: tpm: Add missing device identification objects Stefan Berger
2021-11-09 9:12 ` Philippe Mathieu-Daudé
2021-11-10 9:24 ` Eric Auger
-- strict thread matches above, loose matches on Subject: below --
2021-11-09 0:37 Stefan Berger
2021-11-09 7:25 ` Marc-André Lureau
2021-11-09 7:30 ` Marc-André Lureau
2021-11-09 11:50 ` Stefan Berger
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.