Skip to contentSkip to conversation

acpi: tpm: Add missing device identification objects

PATCH In review Stefan Berger 3 participants 4 messages Nov 9, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 acpi: tpm: Add missing device identification objects

Add missing device identification objects _STR and _UID. They will appear as files 'description' and 'uid' under Linux sysfs.

Cc Shannon Zhao <[email protected]>
Cc Michael S. Tsirkin <[email protected]>
Cc Igor Mammedov <[email protected]>
Cc Ani Sinha <[email protected]>
Fixes #708
---
 hw/arm/virt-acpi-build.c | 1 +
 hw/i386/acpi-build.c     | 4 ++++
 2 files changed, 5 insertions(+)
hw/arm/virt-acpi-build.c +1 -0
index 674f902652..09456424aa 100644
@@ -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();
hw/i386/acpi-build.c +4 -0
index a3ad6abd33..d6d3541407 100644
@@ -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",
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Stefan Berger

Add missing device identification objects _STR and _UID. They will appear as files 'description' and 'uid' under Linux sysfs.

Cc Shannon Zhao <[email protected]>
Cc Michael S. Tsirkin <[email protected]>
Cc Igor Mammedov <[email protected]>
Cc Ani Sinha <[email protected]>
Fixes #708

(on my host, for some reason the UID is 1, does this matter?)

Quoted 35 lines
---
 hw/arm/virt-acpi-build.c | 1 +
 hw/i386/acpi-build.c     | 4 ++++
 2 files changed, 5 insertions(+)
hw/arm/virt-acpi-build.c +1 -0
index 674f902652..09456424aa 100644
@@ -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();
hw/i386/acpi-build.c +4 -1
index a3ad6abd33..d6d3541407 100644
@@ -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

#2 lore raw

Hi

Quoted 13 lines · Marc-André Lureau
Quoted 10 lines · Stefan Berger

Add missing device identification objects _STR and _UID. They will appear as files 'description' and 'uid' under Linux sysfs.

Cc Shannon Zhao <[email protected]>
Cc Michael S. Tsirkin <[email protected]>
Cc Igor Mammedov <[email protected]>
Cc Ani Sinha <[email protected]>
Fixes #708
Quoted 3 lines

(on my host, for some reason the UID is 1, does this matter?)

And shouldn't this be done also for TIS device?

Quoted 36 lines
Quoted 36 lines
---
 hw/arm/virt-acpi-build.c | 1 +
 hw/i386/acpi-build.c     | 4 ++++
 2 files changed, 5 insertions(+)
hw/arm/virt-acpi-build.c +1 -0
index 674f902652..09456424aa 100644
@@ -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();
hw/i386/acpi-build.c +4 -1
index a3ad6abd33..d6d3541407 100644
@@ -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

#3 lore raw
Quoted 17 lines · Marc-André Lureau

Hi

Quoted 13 lines · Marc-André Lureau
Quoted 9 lines · Stefan Berger

Add missing device identification objects _STR and _UID. They will appear as files 'description' and 'uid' under Linux sysfs.

Cc Shannon Zhao <[email protected]>
Cc Michael S. Tsirkin <[email protected]>
Cc Igor Mammedov <[email protected]>
Cc Ani Sinha <[email protected]>
Fixes #708

(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. [...]"

Quoted 1 line

And shouldn't this be done also for TIS device?

Fixed. It was missing for the CRB device.

Thanks.

  Stefan

Quoted 36 lines
Quoted 36 lines
Quoted 36 lines
---
  hw/arm/virt-acpi-build.c | 1 +
  hw/i386/acpi-build.c     | 4 ++++
  2 files changed, 5 insertions(+)
hw/arm/virt-acpi-build.c +1 -0
index 674f902652..09456424aa 100644
@@ -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();
hw/i386/acpi-build.c +4 -1
index a3ad6abd33..d6d3541407 100644
@@ -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