Skip to contentSkip to conversation

tpm: Add missing ACPI device identification objects

PATCH Superseded Stefan Berger 2 participants 6 messages Nov 10, 2021 – Nov 27, 2021

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v3 cover tpm: Add missing ACPI device identification objects

This series of patches adds missing ACPI device identification objects _STR and _UID to TPM 1.2 and TPM 2 ACPI tables.

Stefan

v3:
- Dropped replacement of ACPI tables with empty files in 1/3.
- Reduced ignored files

Stefan Berger (3):
tests: acpi: prepare for updated TPM related tables
acpi: tpm: Add missing device identification objects
tests: acpi: Add updated TPM related tables

 hw/arm/virt-acpi-build.c           |   1 +
 hw/i386/acpi-build.c               |   8 ++++++++
 tests/data/acpi/q35/DSDT.tis.tpm12 | Bin 8894 -> 8900 bytes
 tests/data/acpi/q35/DSDT.tis.tpm2  | Bin 8894 -> 8921 bytes
 4 files changed, 9 insertions(+)
Signature · 1 line
2.31.1
#1 lore raw

PATCH v3 1/3 tests: acpi: prepare for updated TPM related tables

Replace existing TPM related tables, that are about to change, with empty files.

Cc Michael S. Tsirkin <[email protected]>
Cc Igor Mammedov <[email protected]>
Cc Ani Sinha <[email protected]>
---
 tests/qtest/bios-tables-test-allowed-diff.h | 2 ++
 1 file changed, 2 insertions(+)
tests/qtest/bios-tables-test-allowed-diff.h +2 -0
index dfb8523c8b..5d80e408d4 100644
@@ -1 +1,3 @@
 /* List of comma-separated changed AML files to ignore */
+"tests/data/acpi/q35/DSDT.tis.tpm12",
+"tests/data/acpi/q35/DSDT.tis.tpm2",
Signature · 1 line
2.31.1
#2 lore raw

PATCH v3 2/3 acpi: tpm: Add missing device identification objects

In reply to Stefan Berger

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

---
 hw/arm/virt-acpi-build.c | 1 +
 hw/i386/acpi-build.c     | 8 ++++++++
 2 files changed, 9 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 +8 -0
index a3ad6abd33..5bd2160a89 100644
@@ -1808,11 +1808,15 @@ 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")));
                 } else {
                     dev = aml_device("ISA.TPM");
                     aml_append(dev, aml_name_decl("_HID",
                                                   aml_eisaid("PNP0C31")));
                 }
+                aml_append(dev, aml_name_decl("_UID", aml_int(1)));
 
                 aml_append(dev, aml_name_decl("_STA", aml_int(0xF)));
                 crs = aml_resource_template();
@@ -1840,6 +1844,8 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
     if (TPM_IS_CRB(tpm)) {
         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")));
         crs = aml_resource_template();
         aml_append(crs, aml_memory32_fixed(TPM_CRB_ADDR_BASE,
                                            TPM_CRB_ADDR_SIZE, AML_READ_WRITE));
@@ -1847,6 +1853,8 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
 
         aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
 
+        aml_append(dev, aml_name_decl("_UID", aml_int(1)));
+
         tpm_build_ppi_acpi(tpm, dev);
 
         aml_append(sb_scope, dev);
Signature · 1 line
2.31.1
#3 lore raw

PATCH v3 3/3 tests: acpi: Add updated TPM related tables

In reply to Stefan Berger

The updated TPM related tables have the following additions:

Device (TPM)

   {
       Name (_HID, "MSFT0101" /* TPM 2.0 Security Device */)  // _HID: Hardware ID

+ Name (_STR, "TPM 2.0 Device") // _STR: Description String
+ Name (_UID, One) // _UID: Unique ID
Name (_STA, 0x0F) // _STA: Status
Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings

Cc Michael S. Tsirkin <[email protected]>
Cc Igor Mammedov <[email protected]>
Cc Ani Sinha <[email protected]>
---
 tests/data/acpi/q35/DSDT.tis.tpm12          | Bin 8894 -> 8900 bytes
 tests/data/acpi/q35/DSDT.tis.tpm2           | Bin 8894 -> 8921 bytes
 tests/qtest/bios-tables-test-allowed-diff.h |   2 --
 3 files changed, 2 deletions(-)
tests/data/acpi/q35/DSDT.tis.tpm12 binary +0 -0
index c96b5277a14ae98174408d690d6e0246bd932623..dc1c990496a8fb0fc268081a54c5af363bcd833f 100644
GIT binary patch
tests/data/acpi/q35/DSDT.tis.tpm2 binary +0 -0
index c92d4d29c79352a60974ea9f665d0b9a410a4bac..1314a5d3dad1b7b9aff782e649058873c492acb0 100644
GIT binary patch
tests/qtest/bios-tables-test-allowed-diff.h +0 -2
index 5d80e408d4..dfb8523c8b 100644
@@ -1,3 +1 @@
 /* List of comma-separated changed AML files to ignore */
-"tests/data/acpi/q35/DSDT.tis.tpm12",
-"tests/data/acpi/q35/DSDT.tis.tpm2",
Signature · 1 line
2.31.1
#4 lore raw
In reply to Stefan Berger

Is this series now acceptable for 'after 6.2'?

Quoted 20 lines · Stefan Berger

This series of patches adds missing ACPI device identification objects _STR and _UID to TPM 1.2 and TPM 2 ACPI tables.

Stefan

v3:
- Dropped replacement of ACPI tables with empty files in 1/3.
- Reduced ignored files

Stefan Berger (3):
tests: acpi: prepare for updated TPM related tables
acpi: tpm: Add missing device identification objects
tests: acpi: Add updated TPM related tables

  hw/arm/virt-acpi-build.c           |   1 +
  hw/i386/acpi-build.c               |   8 ++++++++
  tests/data/acpi/q35/DSDT.tis.tpm12 | Bin 8894 -> 8900 bytes
  tests/data/acpi/q35/DSDT.tis.tpm2  | Bin 8894 -> 8921 bytes
  4 files changed, 9 insertions(+)
#5 lore raw
Quoted 1 line · Stefan Berger

Is this series now acceptable for 'after 6.2'?

Sure. Tagged. Pls ping me aftre release to help make sure I don't lose it.

Quoted 22 lines · Stefan Berger
Quoted 20 lines

This series of patches adds missing ACPI device identification objects _STR and _UID to TPM 1.2 and TPM 2 ACPI tables.

Stefan

v3:
- Dropped replacement of ACPI tables with empty files in 1/3.
- Reduced ignored files

Stefan Berger (3):
tests: acpi: prepare for updated TPM related tables
acpi: tpm: Add missing device identification objects
tests: acpi: Add updated TPM related tables

  hw/arm/virt-acpi-build.c           |   1 +
  hw/i386/acpi-build.c               |   8 ++++++++
  tests/data/acpi/q35/DSDT.tis.tpm12 | Bin 8894 -> 8900 bytes
  tests/data/acpi/q35/DSDT.tis.tpm2  | Bin 8894 -> 8921 bytes
  4 files changed, 9 insertions(+)