Skip to contentSkip to conversation

tpm: Add missing ACPI device identification objects

PATCH Superseded Stefan Berger 4 participants 14 messages Dec 23, 2021 – Jan 4, 2022

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v4 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

v4:
- Rebased on current master: regenerated binaries in patch 3

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 v4 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]>

Message-id: [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
Acked-by on v4 1/3
#2 lore raw

Re: [PATCH v4 1/3] tests: acpi: prepare for updated TPM related tables

Quoted 7 lines · Stefan Berger

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]>
Quoted 17 lines

Message-id: [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 -1
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",
--

2.31.1

#3 lore raw

PATCH v4 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.

Message-id: [email protected]

---
 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 d0f4867fdf..f2514ce77c 100644
@@ -229,6 +229,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 8383b83ee3..2fb70847cb 100644
@@ -1812,11 +1812,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();
@@ -1844,6 +1848,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));
@@ -1851,6 +1857,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
Reviewed-by on v4 2/3
#4 lore raw

Re: [PATCH v4 2/3] acpi: tpm: Add missing device identification objects

Quoted 9 lines · Stefan Berger

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

Quoted 39 lines

Message-id: [email protected]

---
 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 d0f4867fdf..f2514ce77c 100644
@@ -229,6 +229,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 8383b83ee3..2fb70847cb 100644
@@ -1812,11 +1812,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();

hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1852

Quoted 5 lines
hw/i386/acpi-build.c +2 -0
@@ -1844,6 +1848,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")));

Should we put a check here to make sure it is a 2.0 version like the code hunk above for TIS_ISA? I looked around and it seems CRB is only available for TPM
2.0 in which case it is probably ok but still making sure.

https://qemu.readthedocs.io/en/latest/specs/tpm.html

Quoted 16 lines
hw/i386/acpi-build.c +2 -1
         crs = aml_resource_template();
         aml_append(crs, aml_memory32_fixed(TPM_CRB_ADDR_BASE,
                                            TPM_CRB_ADDR_SIZE, AML_READ_WRITE));
@@ -1851,6 +1857,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);
--

2.31.1

Reviewed-by on v4 2/3
#5 lore raw

Re: [PATCH v4 2/3] acpi: tpm: Add missing device identification objects

In reply to Stefan Berger
Quoted 20 lines · Stefan Berger

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

Message-id: [email protected]

---
  hw/arm/virt-acpi-build.c | 1 +
  hw/i386/acpi-build.c     | 8 ++++++++
  2 files changed, 9 insertions(+)
hw/arm/virt-acpi-build.c +0 -0
index d0f4867fdf..f2514ce77c 100644

hw/arm/virt-acpi-build.c static void acpi_dsdt_add_tpm(Aml *scope, VirtMachineState *vms) · line 234

Quoted 6 lines
hw/arm/virt-acpi-build.c +1 -0
@@ -229,6 +229,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)));
 

For ARM part

Quoted 39 lines
hw/arm/virt-acpi-build.c +0 -0
      Aml *crs = aml_resource_template();
hw/i386/acpi-build.c +8 -0
index 8383b83ee3..2fb70847cb 100644
@@ -1812,11 +1812,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();
@@ -1844,6 +1848,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));
@@ -1851,6 +1857,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);
#6 lore raw

Re: [PATCH v4 2/3] acpi: tpm: Add missing device identification objects

In reply to Stefan Berger
Quoted 1 line · On Wed, 22 Dec 2021 21:23:09 -0500 Stefan Berger <[email protected]> wrote:

Add missing device identification objects _STR and _UID. They will appear

why, does it break anything or it's just cosmetic?

Quoted 33 lines

as files 'description' and 'uid' under Linux sysfs.

Message-id: [email protected]

---
 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 d0f4867fdf..f2514ce77c 100644
@@ -229,6 +229,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 +0 -0
index 8383b83ee3..2fb70847cb 100644
@@ -1812,11 +1812,15 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
                     dev = aml_device("TPM");
                     aml_append(dev, aml_name_decl("_HID",

hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1823

Quoted 10 lines
hw/i386/acpi-build.c +4 -0
                                                   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)));

why it's 1, and not 0 as in virt-arm?

Quoted 13 lines
hw/i386/acpi-build.c +2 -0
                 aml_append(dev, aml_name_decl("_STA", aml_int(0xF)));
                 crs = aml_resource_template();
@@ -1844,6 +1848,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));

hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1859

Quoted 3 lines
hw/i386/acpi-build.c +0 -0
@@ -1851,6 +1857,8 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
 
         aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
 

no necessary ^^^ empty line

Quoted 5 lines
hw/i386/acpi-build.c +2 -0
+        aml_append(dev, aml_name_decl("_UID", aml_int(1)));
+
         tpm_build_ppi_acpi(tpm, dev);
 
         aml_append(sb_scope, dev);
#7 lore raw

Re: [PATCH v4 2/3] acpi: tpm: Add missing device identification objects

Quoted 5 lines · Igor Mammedov
Quoted 1 line · On Wed, 22 Dec 2021 21:23:09 -0500 Stefan Berger <[email protected]> wrote:

Add missing device identification objects _STR and _UID. They will appear

why, does it break anything or it's just cosmetic?

I don't know about whether any software needs these entries but it's driven by this:

https://gitlab.com/qemu-project/qemu/-/issues/708

Quoted 37 lines
Quoted 37 lines

as files 'description' and 'uid' under Linux sysfs.

Message-id: [email protected]

---
  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 d0f4867fdf..f2514ce77c 100644
@@ -229,6 +229,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 +2 -0
index 8383b83ee3..2fb70847cb 100644
@@ -1812,11 +1812,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",
Quoted 8 lines

hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1823

Quoted 7 lines
hw/i386/acpi-build.c +2 -0
+                                             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)));

why it's 1, and not 0 as in virt-arm?

Marc-Andre and I looked at machines with hardware TPMs and that's what we found there as well, a '1'.

Quoted 15 lines
Quoted 15 lines
hw/i386/acpi-build.c +2 -0
                  aml_append(dev, aml_name_decl("_STA", aml_int(0xF)));
                  crs = aml_resource_template();
@@ -1844,6 +1848,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));
@@ -1851,6 +1857,8 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
 
Quoted 3 lines

hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1859

Quoted 2 lines
hw/i386/acpi-build.c +0 -0
          aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
 

no necessary ^^^ empty line

fixed

Quoted 6 lines
Quoted 6 lines
hw/i386/acpi-build.c +2 -0
+        aml_append(dev, aml_name_decl("_UID", aml_int(1)));
+
          tpm_build_ppi_acpi(tpm, dev);
 
          aml_append(sb_scope, dev);
#8 lore raw

Re: [PATCH v4 2/3] acpi: tpm: Add missing device identification objects

Quoted 5 lines · Stefan Berger
Quoted 3 lines · Igor Mammedov

On Wed, 22 Dec 2021 21:23:09 -0500
Stefan Berger <[email protected]> wrote:

Quoted 7 lines
Quoted 2 lines
Quoted 1 line

Add missing device identification objects _STR and _UID. They will appear

why, does it break anything or it's just cosmetic?

I don't know about whether any software needs these entries but it's driven by this:

https://gitlab.com/qemu-project/qemu/-/issues/708

Ok so you might want to add
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/708

in the commit message. Please see:
https://www.qemu.org/docs/master/devel/submitting-a-patch.html#write-a-meaningful-commit-message

Quoted 75 lines
Quoted 38 lines
Quoted 38 lines

as files 'description' and 'uid' under Linux sysfs.

Message-id: [email protected]

---
  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 d0f4867fdf..f2514ce77c 100644
@@ -229,6 +229,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 +3 -0
index 8383b83ee3..2fb70847cb 100644
@@ -1812,11 +1812,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
Quoted 8 lines

hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1823

Quoted 7 lines
hw/i386/acpi-build.c +1 -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)));

why it's 1, and not 0 as in virt-arm?

Marc-Andre and I looked at machines with hardware TPMs and that's what we found there as well, a '1'.

Quoted 17 lines
Quoted 14 lines
hw/i386/acpi-build.c +2 -0
                    aml_append(dev, aml_name_decl("_STA", aml_int(0xF)));
                  crs = aml_resource_template();
@@ -1844,6 +1848,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));

hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1858

Quoted 2 lines
hw/i386/acpi-build.c +0 -0
@@ -1851,6 +1857,8 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
            aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
 

no necessary ^^^ empty line

fixed

Quoted 5 lines
Quoted 5 lines
hw/i386/acpi-build.c +2 -0
+        aml_append(dev, aml_name_decl("_UID", aml_int(1)));
+
          tpm_build_ppi_acpi(tpm, dev);
            aml_append(sb_scope, dev);
#9 lore raw

Re: [PATCH v4 2/3] acpi: tpm: Add missing device identification objects

Quoted 12 lines · Ani Sinha
Quoted 9 lines · Stefan Berger
Quoted 5 lines · Igor Mammedov
Quoted 1 line · On Wed, 22 Dec 2021 21:23:09 -0500 Stefan Berger <[email protected]> wrote:

Add missing device identification objects _STR and _UID. They will appear

why, does it break anything or it's just cosmetic?

I don't know about whether any software needs these entries but it's driven by this:

Quoted 6 lines
Quoted 1 line

https://gitlab.com/qemu-project/qemu/-/issues/708

Ok so you might want to add
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/708

in the commit message. Please see:
https://www.qemu.org/docs/master/devel/submitting-a-patch.html#write-a-meaningful-commit-message

Ooops, I will change this here to Resolves:

Quoted 70 lines
Quoted 70 lines
Quoted 37 lines
Quoted 37 lines

as files 'description' and 'uid' under Linux sysfs.

Message-id: [email protected]

---
   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 d0f4867fdf..f2514ce77c 100644
@@ -229,6 +229,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 +3 -0
index 8383b83ee3..2fb70847cb 100644
@@ -1812,11 +1812,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
Quoted 8 lines

hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1823

Quoted 7 lines
hw/i386/acpi-build.c +1 -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)));

why it's 1, and not 0 as in virt-arm?

Marc-Andre and I looked at machines with hardware TPMs and that's what we found there as well, a '1'.

Quoted 8 lines
Quoted 8 lines
hw/i386/acpi-build.c +2 -0
                     aml_append(dev, aml_name_decl("_STA", aml_int(0xF)));
                   crs = aml_resource_template();
@@ -1844,6 +1848,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")));
Quoted 8 lines

hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1858

Quoted 7 lines
hw/i386/acpi-build.c +0 -0
           crs = aml_resource_template();
           aml_append(crs, aml_memory32_fixed(TPM_CRB_ADDR_BASE,
                                              TPM_CRB_ADDR_SIZE,

AML_READ_WRITE));

hw/i386/acpi-build.c +0 -0
@@ -1851,6 +1857,8 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
             aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
 

no necessary ^^^ empty line

fixed

Quoted 4 lines
Quoted 4 lines
hw/i386/acpi-build.c +2 -0
+        aml_append(dev, aml_name_decl("_UID", aml_int(1)));
+
           tpm_build_ppi_acpi(tpm, dev);
             aml_append(sb_scope, dev);
#10 lore raw

Re: [PATCH v4 2/3] acpi: tpm: Add missing device identification objects

In reply to Stefan Berger
Quoted 59 lines · On Tue, 4 Jan 2022 09:48:32 -0500 Stefan Berger <[email protected]> wrote:
Quoted 5 lines · Igor Mammedov
Quoted 1 line · On Wed, 22 Dec 2021 21:23:09 -0500 Stefan Berger <[email protected]> wrote:

Add missing device identification objects _STR and _UID. They will appear

why, does it break anything or it's just cosmetic?

I don't know about whether any software needs these entries but it's driven by this:

https://gitlab.com/qemu-project/qemu/-/issues/708

Quoted 37 lines
Quoted 37 lines

as files 'description' and 'uid' under Linux sysfs.

Message-id: [email protected]

---
  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 d0f4867fdf..f2514ce77c 100644
@@ -229,6 +229,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 +2 -0
index 8383b83ee3..2fb70847cb 100644
@@ -1812,11 +1812,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",
Quoted 8 lines

hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1823

Quoted 7 lines
hw/i386/acpi-build.c +2 -0
+                                             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)));  

why it's 1, and not 0 as in virt-arm?

Quoted 2 lines

Marc-Andre and I looked at machines with hardware TPMs and that's what we found there as well, a '1'.

perhaps mention that in commit message

Quoted 28 lines
Quoted 17 lines
Quoted 17 lines
hw/i386/acpi-build.c +2 -0
                  aml_append(dev, aml_name_decl("_STA", aml_int(0xF)));
                  crs = aml_resource_template();
@@ -1844,6 +1848,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));
@@ -1851,6 +1857,8 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
 
Quoted 3 lines

hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1859

Quoted 2 lines
hw/i386/acpi-build.c +0 -0
          aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
 

no necessary ^^^ empty line

fixed

Quoted 6 lines
Quoted 6 lines
hw/i386/acpi-build.c +2 -0
+        aml_append(dev, aml_name_decl("_UID", aml_int(1)));
+
          tpm_build_ppi_acpi(tpm, dev);
 
          aml_append(sb_scope, dev);  
#11 lore raw

Re: [PATCH v4 2/3] acpi: tpm: Add missing device identification objects

Quoted 60 lines · Igor Mammedov
Quoted 57 lines · On Tue, 4 Jan 2022 09:48:32 -0500 Stefan Berger <[email protected]> wrote:
Quoted 5 lines · Igor Mammedov
Quoted 1 line · On Wed, 22 Dec 2021 21:23:09 -0500 Stefan Berger <[email protected]> wrote:

Add missing device identification objects _STR and _UID. They will appear

why, does it break anything or it's just cosmetic?

I don't know about whether any software needs these entries but it's driven by this:

https://gitlab.com/qemu-project/qemu/-/issues/708

Quoted 45 lines
Quoted 34 lines

as files 'description' and 'uid' under Linux sysfs.

Message-id: [email protected]

---
   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 d0f4867fdf..f2514ce77c 100644
@@ -229,6 +229,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 +0 -0
index 8383b83ee3..2fb70847cb 100644
@@ -1812,11 +1812,15 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
                       dev = aml_device("TPM");
                       aml_append(dev, aml_name_decl("_HID",

hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1823

Quoted 10 lines
hw/i386/acpi-build.c +4 -0
                                                     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)));

why it's 1, and not 0 as in virt-arm?

Quoted 3 lines
Quoted 2 lines

Marc-Andre and I looked at machines with hardware TPMs and that's what we found there as well, a '1'.

perhaps mention that in commit message

Added to v5 2/3.

#12 lore raw

PATCH v4 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]>

Message-id: [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 0ebdf6fbd77967f1ab5d5337b7b1fed314cfaca8..fb9dd1f0599afd6b555ea570ecd00a3bb227aa84 100644
GIT binary patch
tests/data/acpi/q35/DSDT.tis.tpm2 binary +0 -0
index dcbb7f0af377425db53130e8ba1c62c09c22e006..00d732e46f5d9d056e557bd026fa30f9db3b8c30 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
Acked-by on v4 3/3
#13 lore raw

Re: [PATCH v4 3/3] tests: acpi: Add updated TPM related tables

Quoted 10 lines · Stefan Berger

The updated TPM related tables have the following additions:

   Device (TPM)
   {
       Name (_HID, "MSFT0101" /* TPM 2.0 Security Device */)  // _HID: Hardware ID
(quoted diff) +2 -0
+      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
Quoted 4 lines
Cc Michael S. Tsirkin <[email protected]>
Cc Igor Mammedov <[email protected]>
Cc Ani Sinha <[email protected]>
Quoted 41 lines

Message-id: [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 0ebdf6fbd77967f1ab5d5337b7b1fed314cfaca8..fb9dd1f0599afd6b555ea570ecd00a3bb227aa84 100644
GIT binary patch
tests/data/acpi/q35/DSDT.tis.tpm2 binary +0 -0
index dcbb7f0af377425db53130e8ba1c62c09c22e006..00d732e46f5d9d056e557bd026fa30f9db3b8c30 100644
GIT binary patch
tests/qtest/bios-tables-test-allowed-diff.h +0 -3
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",
--

2.31.1