Skip to contentSkip to conversation

tpm: Add missing ACPI device identification objects

PATCH Superseded Stefan Berger 4 participants 19 messages Nov 9, 2021 – Nov 10, 2021

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v2 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

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 v2 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/data/acpi/q35/DSDT.tis.tpm12          | Bin 8894 -> 0 bytes
 tests/data/acpi/q35/DSDT.tis.tpm2           | Bin 8894 -> 0 bytes
 tests/data/acpi/q35/TCPA.tis.tpm12          | Bin 50 -> 0 bytes
 tests/data/acpi/q35/TPM2.tis.tpm2           | Bin 76 -> 0 bytes
 tests/qtest/bios-tables-test-allowed-diff.h |  11 +++++++++++
 5 files changed, 11 insertions(+)
tests/data/acpi/q35/DSDT.tis.tpm12 binary +0 -0
index c96b5277a14ae98174408d690d6e0246bd932623..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
GIT binary patch
tests/data/acpi/q35/DSDT.tis.tpm2 binary +0 -0
index c92d4d29c79352a60974ea9f665d0b9a410a4bac..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
GIT binary patch
tests/data/acpi/q35/TCPA.tis.tpm12 binary +0 -0
index a56961b413e7715b3d60f9836d1c8f2f4c7347cb..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
GIT binary patch
tests/data/acpi/q35/TPM2.tis.tpm2 binary +0 -0
index fe0f05987be40f1c1742ae189df7821adc522fc0..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
GIT binary patch
tests/qtest/bios-tables-test-allowed-diff.h +11 -0
index dfb8523c8b..9743422eee 100644
@@ -1 +1,12 @@
 /* List of comma-separated changed AML files to ignore */
+"tests/data/acpi/q35/APIC.tis.tpm2",
+"tests/data/acpi/q35/DSDT.tis.tpm12",
+"tests/data/acpi/q35/DSDT.tis.tpm2",
+"tests/data/acpi/q35/FACP.tis.tpm2",
+"tests/data/acpi/q35/FACS.tis.tpm2",
+"tests/data/acpi/q35/HPET.tis.tpm2",
+"tests/data/acpi/q35/MCFG.tis.tpm2",
+"tests/data/acpi/q35/TCPA.tis.dsl",
+"tests/data/acpi/q35/TCPA.tis.tpm12",
+"tests/data/acpi/q35/TPM2.tis.tpm2",
+"tests/data/acpi/q35/WAET.tis.tpm2",
Signature · 1 line
2.31.1
#2 lore raw

Re: [PATCH v2 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]>

Why do it though?
I don't think it's a good idea - will make it harder to see what the changes are.

Quoted 197 lines
---
 tests/data/acpi/q35/DSDT.tis.tpm12          | Bin 8894 -> 0 bytes
 tests/data/acpi/q35/DSDT.tis.tpm2           | Bin 8894 -> 0 bytes
 tests/data/acpi/q35/TCPA.tis.tpm12          | Bin 50 -> 0 bytes
 tests/data/acpi/q35/TPM2.tis.tpm2           | Bin 76 -> 0 bytes
 tests/qtest/bios-tables-test-allowed-diff.h |  11 +++++++++++
 5 files changed, 11 insertions(+)
tests/data/acpi/q35/DSDT.tis.tpm12 binary +0 -0
index c96b5277a14ae98174408d690d6e0246bd932623..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
GIT binary patch
tests/data/acpi/q35/DSDT.tis.tpm2 binary +0 -0
index c92d4d29c79352a60974ea9f665d0b9a410a4bac..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
GIT binary patch
tests/data/acpi/q35/TCPA.tis.tpm12 binary +0 -0
index a56961b413e7715b3d60f9836d1c8f2f4c7347cb..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
GIT binary patch
tests/data/acpi/q35/TPM2.tis.tpm2 binary +0 -0
index fe0f05987be40f1c1742ae189df7821adc522fc0..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
GIT binary patch
tests/qtest/bios-tables-test-allowed-diff.h +11 -0
index dfb8523c8b..9743422eee 100644
@@ -1 +1,12 @@
 /* List of comma-separated changed AML files to ignore */
+"tests/data/acpi/q35/APIC.tis.tpm2",
+"tests/data/acpi/q35/DSDT.tis.tpm12",
+"tests/data/acpi/q35/DSDT.tis.tpm2",
+"tests/data/acpi/q35/FACP.tis.tpm2",
+"tests/data/acpi/q35/FACS.tis.tpm2",
+"tests/data/acpi/q35/HPET.tis.tpm2",
+"tests/data/acpi/q35/MCFG.tis.tpm2",
+"tests/data/acpi/q35/TCPA.tis.dsl",
+"tests/data/acpi/q35/TCPA.tis.tpm12",
+"tests/data/acpi/q35/TPM2.tis.tpm2",
+"tests/data/acpi/q35/WAET.tis.tpm2",
Signature · 1 line
2.31.1
#3 lore raw

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

Quoted 9 lines · Michael S. Tsirkin
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]>

Why do it though?

With 'it' are you referring to the empty files? Should I just leave the file untouched and just ignore them?

How many patches should it be? One for ignoring the about-to-change tables, one that does the changes, and one that re-introduces the tables? Or squash them together in less patches?

Quoted 2 lines

I don't think it's a good idea - will make it harder to see what the changes are.

   Stefan

Quoted 198 lines
Quoted 198 lines
---
  tests/data/acpi/q35/DSDT.tis.tpm12          | Bin 8894 -> 0 bytes
  tests/data/acpi/q35/DSDT.tis.tpm2           | Bin 8894 -> 0 bytes
  tests/data/acpi/q35/TCPA.tis.tpm12          | Bin 50 -> 0 bytes
  tests/data/acpi/q35/TPM2.tis.tpm2           | Bin 76 -> 0 bytes
  tests/qtest/bios-tables-test-allowed-diff.h |  11 +++++++++++
  5 files changed, 11 insertions(+)
tests/data/acpi/q35/DSDT.tis.tpm12 binary +0 -0
index c96b5277a14ae98174408d690d6e0246bd932623..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
GIT binary patch
tests/data/acpi/q35/DSDT.tis.tpm2 binary +0 -0
index c92d4d29c79352a60974ea9f665d0b9a410a4bac..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
GIT binary patch
tests/data/acpi/q35/TCPA.tis.tpm12 binary +0 -0
index a56961b413e7715b3d60f9836d1c8f2f4c7347cb..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
GIT binary patch
tests/data/acpi/q35/TPM2.tis.tpm2 binary +0 -0
index fe0f05987be40f1c1742ae189df7821adc522fc0..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
GIT binary patch
tests/qtest/bios-tables-test-allowed-diff.h +11 -0
index dfb8523c8b..9743422eee 100644
@@ -1 +1,12 @@
  /* List of comma-separated changed AML files to ignore */
+"tests/data/acpi/q35/APIC.tis.tpm2",
+"tests/data/acpi/q35/DSDT.tis.tpm12",
+"tests/data/acpi/q35/DSDT.tis.tpm2",
+"tests/data/acpi/q35/FACP.tis.tpm2",
+"tests/data/acpi/q35/FACS.tis.tpm2",
+"tests/data/acpi/q35/HPET.tis.tpm2",
+"tests/data/acpi/q35/MCFG.tis.tpm2",
+"tests/data/acpi/q35/TCPA.tis.dsl",
+"tests/data/acpi/q35/TCPA.tis.tpm12",
+"tests/data/acpi/q35/TPM2.tis.tpm2",
+"tests/data/acpi/q35/WAET.tis.tpm2",
Signature · 1 line
2.31.1
#4 lore raw

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

Quoted 10 lines · Stefan Berger
Quoted 8 lines · Michael S. Tsirkin
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 7 lines
Quoted 1 line

Why do it though?

With 'it' are you referring to the empty files? Should I just leave the file untouched and just ignore them?

How many patches should it be? One for ignoring the about-to-change tables, one that does the changes, and one that re-introduces the tables?

This, yes.

Quoted 2 lines

Or squash
them together in less patches?

Pls don't squash since this makes it harder to rebase/cherry-pick. With this approach one just re-generates patches on rebase.

Quoted 203 lines
Quoted 2 lines

I don't think it's a good idea - will make it harder to see what the changes are.

   Stefan

Quoted 198 lines
Quoted 198 lines
---
  tests/data/acpi/q35/DSDT.tis.tpm12          | Bin 8894 -> 0 bytes
  tests/data/acpi/q35/DSDT.tis.tpm2           | Bin 8894 -> 0 bytes
  tests/data/acpi/q35/TCPA.tis.tpm12          | Bin 50 -> 0 bytes
  tests/data/acpi/q35/TPM2.tis.tpm2           | Bin 76 -> 0 bytes
  tests/qtest/bios-tables-test-allowed-diff.h |  11 +++++++++++
  5 files changed, 11 insertions(+)
tests/data/acpi/q35/DSDT.tis.tpm12 binary +0 -0
index c96b5277a14ae98174408d690d6e0246bd932623..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
GIT binary patch
tests/data/acpi/q35/DSDT.tis.tpm2 binary +0 -0
index c92d4d29c79352a60974ea9f665d0b9a410a4bac..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
GIT binary patch
tests/data/acpi/q35/TCPA.tis.tpm12 binary +0 -0
index a56961b413e7715b3d60f9836d1c8f2f4c7347cb..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
GIT binary patch
tests/data/acpi/q35/TPM2.tis.tpm2 binary +0 -0
index fe0f05987be40f1c1742ae189df7821adc522fc0..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
GIT binary patch
tests/qtest/bios-tables-test-allowed-diff.h +11 -0
index dfb8523c8b..9743422eee 100644
@@ -1 +1,12 @@
  /* List of comma-separated changed AML files to ignore */
+"tests/data/acpi/q35/APIC.tis.tpm2",
+"tests/data/acpi/q35/DSDT.tis.tpm12",
+"tests/data/acpi/q35/DSDT.tis.tpm2",
+"tests/data/acpi/q35/FACP.tis.tpm2",
+"tests/data/acpi/q35/FACS.tis.tpm2",
+"tests/data/acpi/q35/HPET.tis.tpm2",
+"tests/data/acpi/q35/MCFG.tis.tpm2",
+"tests/data/acpi/q35/TCPA.tis.dsl",
+"tests/data/acpi/q35/TCPA.tis.tpm12",
+"tests/data/acpi/q35/TPM2.tis.tpm2",
+"tests/data/acpi/q35/WAET.tis.tpm2",
Signature · 1 line
2.31.1
#5 lore raw

PATCH v2 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
#6 lore raw

Re: [PATCH v2 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.

Do you want this in 6.2?

Quoted 22 lines
---
 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 +0 -0
index a3ad6abd33..5bd2160a89 100644

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

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

When we support more versions, won't this make us
do annoying tricks to say so in the string?
Why not just "TPM device" to future-proof it?

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

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

The ACPI spec mentions also matching on _CID.

Quoted 22 lines
hw/i386/acpi-build.c +4 -0
                 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
#7 lore raw

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

Quoted 11 lines · Michael S. Tsirkin
Quoted 9 lines · Stefan Berger

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

Do you want this in 6.2?

Yes.

Quoted 17 lines
Quoted 17 lines
---
  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)));
 
Quoted 16 lines

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

Quoted 12 lines
hw/arm/virt-acpi-build.c +0 -0
      Aml *crs = aml_resource_template();
hw/i386/acpi-build.c +3 -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")));

When we support more versions, won't this make us
do annoying tricks to say so in the string?
Why not just "TPM device" to future-proof it?

I am not sure what other version there will be and I haven't seen any other descriptions than the one reported here:

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

That's why I took TPM 2.0 device. My TPM 1.2 machine doesn't report it for a TPM 1.2.

Quoted 9 lines

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

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

The ACPI spec mentions also matching on _CID.

"6.1.2 _CID (Compatible ID)
This optional object is used to supply OSPM with a device?s Plug and Play-Compatible Device ID. Use _CID

objects when a device has no other defined hardware standard method to report its compatible IDs"

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.

Is _CID a must-have for TPM now? We have _HID.

Quoted 23 lines
Quoted 23 lines
hw/i386/acpi-build.c +4 -0
                  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
#8 lore raw

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

Quoted 49 lines · Stefan Berger
Quoted 11 lines · Michael S. Tsirkin
Quoted 9 lines · Stefan Berger

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

Do you want this in 6.2?

Yes.

Quoted 23 lines
Quoted 23 lines
---
  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 +0 -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",
Quoted 8 lines

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

Quoted 4 lines
hw/i386/acpi-build.c +3 -0
                                                    aml_string("MSFT0101")));
+                    aml_append(dev,
+                               aml_name_decl("_STR",
+                                             aml_string("TPM 2.0 Device")));

When we support more versions, won't this make us
do annoying tricks to say so in the string?
Why not just "TPM device" to future-proof it?

Quoted 9 lines

I am not sure what other version there will be and I haven't seen any other descriptions than the one reported here:

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

That's why I took TPM 2.0 device. My TPM 1.2 machine doesn't report it for a TPM 1.2.

ok

Quoted 25 lines
Quoted 9 lines

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

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

The ACPI spec mentions also matching on _CID.

"6.1.2 _CID (Compatible ID)
This optional object is used to supply OSPM with a device?s Plug and Play-Compatible Device ID. Use _CID

objects when a device has no other defined hardware standard method to report its compatible IDs"

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

Is _CID a must-have for TPM now? We have _HID.

the spec says UID is unique for all
devices with a given CID or HID. Does this mean just HID is used if no CID? Or that all devices without CID must have unique UIDs?

I think the former but just making sure.

Quoted 20 lines
Quoted 20 lines
Quoted 20 lines
hw/i386/acpi-build.c +4 -0
                  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
#9 lore raw

PATCH v2 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 0 -> 8900 bytes
 tests/data/acpi/q35/DSDT.tis.tpm2           | Bin 0 -> 8921 bytes
 tests/data/acpi/q35/TCPA.tis.tpm12          | Bin 0 -> 50 bytes
 tests/data/acpi/q35/TPM2.tis.tpm2           | Bin 0 -> 76 bytes
 tests/qtest/bios-tables-test-allowed-diff.h |  11 -----------
 5 files changed, 11 deletions(-)
tests/data/acpi/q35/DSDT.tis.tpm12 binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..dc1c990496a8fb0fc268081a54c5af363bcd833f 100644
GIT binary patch
tests/data/acpi/q35/DSDT.tis.tpm2 binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..1314a5d3dad1b7b9aff782e649058873c492acb0 100644
GIT binary patch
tests/data/acpi/q35/TCPA.tis.tpm12 binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..a56961b413e7715b3d60f9836d1c8f2f4c7347cb 100644
GIT binary patch
tests/data/acpi/q35/TPM2.tis.tpm2 binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..fe0f05987be40f1c1742ae189df7821adc522fc0 100644
GIT binary patch
tests/qtest/bios-tables-test-allowed-diff.h +0 -11
index 9743422eee..dfb8523c8b 100644
@@ -1,12 +1 @@
 /* List of comma-separated changed AML files to ignore */
-"tests/data/acpi/q35/APIC.tis.tpm2",
-"tests/data/acpi/q35/DSDT.tis.tpm12",
-"tests/data/acpi/q35/DSDT.tis.tpm2",
-"tests/data/acpi/q35/FACP.tis.tpm2",
-"tests/data/acpi/q35/FACS.tis.tpm2",
-"tests/data/acpi/q35/HPET.tis.tpm2",
-"tests/data/acpi/q35/MCFG.tis.tpm2",
-"tests/data/acpi/q35/TCPA.tis.dsl",
-"tests/data/acpi/q35/TCPA.tis.tpm12",
-"tests/data/acpi/q35/TPM2.tis.tpm2",
-"tests/data/acpi/q35/WAET.tis.tpm2",
Signature · 1 line
2.31.1
#10 lore raw

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

Quoted 14 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
Cc Michael S. Tsirkin <[email protected]>
Cc Igor Mammedov <[email protected]>
Cc Ani Sinha <[email protected]>
Quoted 7 lines
---
 tests/data/acpi/q35/DSDT.tis.tpm12          | Bin 0 -> 8900 bytes
 tests/data/acpi/q35/DSDT.tis.tpm2           | Bin 0 -> 8921 bytes
 tests/data/acpi/q35/TCPA.tis.tpm12          | Bin 0 -> 50 bytes
 tests/data/acpi/q35/TPM2.tis.tpm2           | Bin 0 -> 76 bytes
 tests/qtest/bios-tables-test-allowed-diff.h |  11 -----------
 5 files changed, 11 deletions(-)

A disadvantage to doing it like this is that git thinks it's ok to replace any empty file with this, so if acpi changed in any way git will happily resolve it replacing it with this version.

Quoted 192 lines
tests/data/acpi/q35/DSDT.tis.tpm12 binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..dc1c990496a8fb0fc268081a54c5af363bcd833f 100644
GIT binary patch
tests/data/acpi/q35/DSDT.tis.tpm2 binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..1314a5d3dad1b7b9aff782e649058873c492acb0 100644
GIT binary patch
tests/data/acpi/q35/TCPA.tis.tpm12 binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..a56961b413e7715b3d60f9836d1c8f2f4c7347cb 100644
GIT binary patch
tests/data/acpi/q35/TPM2.tis.tpm2 binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..fe0f05987be40f1c1742ae189df7821adc522fc0 100644
GIT binary patch
tests/qtest/bios-tables-test-allowed-diff.h +0 -11
index 9743422eee..dfb8523c8b 100644
@@ -1,12 +1 @@
 /* List of comma-separated changed AML files to ignore */
-"tests/data/acpi/q35/APIC.tis.tpm2",
-"tests/data/acpi/q35/DSDT.tis.tpm12",
-"tests/data/acpi/q35/DSDT.tis.tpm2",
-"tests/data/acpi/q35/FACP.tis.tpm2",
-"tests/data/acpi/q35/FACS.tis.tpm2",
-"tests/data/acpi/q35/HPET.tis.tpm2",
-"tests/data/acpi/q35/MCFG.tis.tpm2",
-"tests/data/acpi/q35/TCPA.tis.dsl",
-"tests/data/acpi/q35/TCPA.tis.tpm12",
-"tests/data/acpi/q35/TPM2.tis.tpm2",
-"tests/data/acpi/q35/WAET.tis.tpm2",
Signature · 1 line
2.31.1
#11 lore raw

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

Quoted 23 lines · Michael S. Tsirkin
Quoted 14 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
Cc Michael S. Tsirkin <[email protected]>
Cc Igor Mammedov <[email protected]>
Cc Ani Sinha <[email protected]>
Quoted 7 lines
---
 tests/data/acpi/q35/DSDT.tis.tpm12          | Bin 0 -> 8900 bytes
 tests/data/acpi/q35/DSDT.tis.tpm2           | Bin 0 -> 8921 bytes
 tests/data/acpi/q35/TCPA.tis.tpm12          | Bin 0 -> 50 bytes
 tests/data/acpi/q35/TPM2.tis.tpm2           | Bin 0 -> 76 bytes
 tests/qtest/bios-tables-test-allowed-diff.h |  11 -----------
 5 files changed, 11 deletions(-)
Quoted 4 lines

A disadvantage to doing it like this is that git thinks it's ok to replace any empty file with this, so if acpi changed in any way git will happily resolve it replacing it with this version.

Do we actually need to be storing these binary files in git at all ?

IIUC, the test will do two things

- memcmp the expected binary we store, against the new binary we generated.
- if they differ, then disassemble both and report the differences in a user friendly-ish way

What if we only stored the sha256 checksum of the binary *and* the dissasembled output in git, never the full binary.

IIUC, that would give us the same level of diagnostic output from the test failures. The dissasembled output would then give us meaningful patches for reviewers to look at. The author wouldn't have to describe the difference in the commit message as Stefan has (helpfully) done here.

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#12 lore raw

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

Quoted 35 lines · Daniel P. Berrangé
Quoted 23 lines · Michael S. Tsirkin
Quoted 14 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
Cc Michael S. Tsirkin <[email protected]>
Cc Igor Mammedov <[email protected]>
Cc Ani Sinha <[email protected]>
Quoted 7 lines
---
 tests/data/acpi/q35/DSDT.tis.tpm12          | Bin 0 -> 8900 bytes
 tests/data/acpi/q35/DSDT.tis.tpm2           | Bin 0 -> 8921 bytes
 tests/data/acpi/q35/TCPA.tis.tpm12          | Bin 0 -> 50 bytes
 tests/data/acpi/q35/TPM2.tis.tpm2           | Bin 0 -> 76 bytes
 tests/qtest/bios-tables-test-allowed-diff.h |  11 -----------
 5 files changed, 11 deletions(-)
Quoted 4 lines

A disadvantage to doing it like this is that git thinks it's ok to replace any empty file with this, so if acpi changed in any way git will happily resolve it replacing it with this version.

Do we actually need to be storing these binary files in git at all ?

IIUC, the test will do two things

Quoted 7 lines

- memcmp the expected binary we store, against the new binary we generated.
- if they differ, then disassemble both and report the differences in a user friendly-ish way

What if we only stored the sha256 checksum of the binary *and* the dissasembled output in git, never the full binary.

If you are going down that path, why need the sha256 at all? The test can disassemble the tables from qemu and only compare the disassembled ASL.

Quoted 16 lines

IIUC, that would give us the same level of diagnostic output from the test failures. The dissasembled output would then give us meaningful patches for reviewers to look at. The author wouldn't have to describe the difference in the commit message as Stefan has (helpfully) done here.

Regards,
Daniel
--

|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#13 lore raw

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

Quoted 41 lines · Ani Sinha
Quoted 40 lines · Daniel P. Berrangé
Quoted 23 lines · Michael S. Tsirkin
Quoted 14 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
Cc Michael S. Tsirkin <[email protected]>
Cc Igor Mammedov <[email protected]>
Cc Ani Sinha <[email protected]>
Quoted 7 lines
---
 tests/data/acpi/q35/DSDT.tis.tpm12          | Bin 0 -> 8900 bytes
 tests/data/acpi/q35/DSDT.tis.tpm2           | Bin 0 -> 8921 bytes
 tests/data/acpi/q35/TCPA.tis.tpm12          | Bin 0 -> 50 bytes
 tests/data/acpi/q35/TPM2.tis.tpm2           | Bin 0 -> 76 bytes
 tests/qtest/bios-tables-test-allowed-diff.h |  11 -----------
 5 files changed, 11 deletions(-)
Quoted 4 lines

A disadvantage to doing it like this is that git thinks it's ok to replace any empty file with this, so if acpi changed in any way git will happily resolve it replacing it with this version.

Do we actually need to be storing these binary files in git at all ?

IIUC, the test will do two things

- memcmp the expected binary we store, against the new binary we generated.
- if they differ, then disassemble both and report the differences in a user friendly-ish way

Quoted 6 lines
Quoted 2 lines

What if we only stored the sha256 checksum of the binary *and* the dissasembled output in git, never the full binary.

If you are going down that path, why need the sha256 at all? The test can disassemble the tables from qemu and only compare the disassembled ASL.

We don't currently mandate 'iasl' as a dependancy. Currently we still run the tests, but without the pretty error message details.

If we didn't have the sha256, we would either need iasl to be mandatory, or not run the test at all.

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#14 lore raw

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

In reply to Ani Sinha
Quoted 41 lines · Ani Sinha
Quoted 40 lines · Daniel P. Berrangé
Quoted 23 lines · Michael S. Tsirkin
Quoted 14 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
Cc Michael S. Tsirkin <[email protected]>
Cc Igor Mammedov <[email protected]>
Cc Ani Sinha <[email protected]>
Quoted 7 lines
---
 tests/data/acpi/q35/DSDT.tis.tpm12          | Bin 0 -> 8900 bytes
 tests/data/acpi/q35/DSDT.tis.tpm2           | Bin 0 -> 8921 bytes
 tests/data/acpi/q35/TCPA.tis.tpm12          | Bin 0 -> 50 bytes
 tests/data/acpi/q35/TPM2.tis.tpm2           | Bin 0 -> 76 bytes
 tests/qtest/bios-tables-test-allowed-diff.h |  11 -----------
 5 files changed, 11 deletions(-)
Quoted 4 lines

A disadvantage to doing it like this is that git thinks it's ok to replace any empty file with this, so if acpi changed in any way git will happily resolve it replacing it with this version.

Do we actually need to be storing these binary files in git at all ?

IIUC, the test will do two things

- memcmp the expected binary we store, against the new binary we generated.
- if they differ, then disassemble both and report the differences in a user friendly-ish way

Quoted 6 lines
Quoted 2 lines

What if we only stored the sha256 checksum of the binary *and* the dissasembled output in git, never the full binary.

If you are going down that path, why need the sha256 at all? The test can disassemble the tables from qemu and only compare the disassembled ASL.

The output isn't stable unfortunately, so it can't replace the binary.. However, the process of documenting what changed is quite fiddly, so I am open to including both the binary and the dis-assembled file. An issue is that iasl does not support all platforms that qemu supports, in particular the disassembler is broken on BE platforms. Not sure how big a deal that is ...

Quoted 16 lines
Quoted 16 lines

IIUC, that would give us the same level of diagnostic output from the test failures. The dissasembled output would then give us meaningful patches for reviewers to look at. The author wouldn't have to describe the difference in the commit message as Stefan has (helpfully) done here.

Regards,
Daniel
--

|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#15 lore raw

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

In reply to Daniel P. Berrangé
Quoted 32 lines · Daniel P. Berrangé
Quoted 23 lines · Michael S. Tsirkin
Quoted 14 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
Cc Michael S. Tsirkin <[email protected]>
Cc Igor Mammedov <[email protected]>
Cc Ani Sinha <[email protected]>
Quoted 7 lines
---
 tests/data/acpi/q35/DSDT.tis.tpm12          | Bin 0 -> 8900 bytes
 tests/data/acpi/q35/DSDT.tis.tpm2           | Bin 0 -> 8921 bytes
 tests/data/acpi/q35/TCPA.tis.tpm12          | Bin 0 -> 50 bytes
 tests/data/acpi/q35/TPM2.tis.tpm2           | Bin 0 -> 76 bytes
 tests/qtest/bios-tables-test-allowed-diff.h |  11 -----------
 5 files changed, 11 deletions(-)
Quoted 4 lines

A disadvantage to doing it like this is that git thinks it's ok to replace any empty file with this, so if acpi changed in any way git will happily resolve it replacing it with this version.

Do we actually need to be storing these binary files in git at all ?

Quoted 6 lines

IIUC, the test will do two things

- memcmp the expected binary we store, against the new binary we generated.
- if they differ, then disassemble both and report the differences in a user friendly-ish way

Second if iasl is installed.

Quoted 1 line

What if we only stored the sha256 checksum of the binary

Hmm, point being? Same some space?

Quoted 2 lines

*and*
the dissasembled output in git, never the full binary.

We used to. The issue is that dissasembled output depends very much on the disassembler. Disassembling both with the same tool is one way to address this.

Quoted 14 lines

IIUC, that would give us the same level of diagnostic output from the test failures. The dissasembled output would then give us meaningful patches for reviewers to look at. The author wouldn't have to describe the difference in the commit message as Stefan has (helpfully) done here.

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#16 lore raw

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

Quoted 44 lines · Michael S. Tsirkin
Quoted 32 lines · Daniel P. Berrangé
Quoted 23 lines · Michael S. Tsirkin
Quoted 14 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
Cc Michael S. Tsirkin <[email protected]>
Cc Igor Mammedov <[email protected]>
Cc Ani Sinha <[email protected]>
Quoted 7 lines
---
 tests/data/acpi/q35/DSDT.tis.tpm12          | Bin 0 -> 8900 bytes
 tests/data/acpi/q35/DSDT.tis.tpm2           | Bin 0 -> 8921 bytes
 tests/data/acpi/q35/TCPA.tis.tpm12          | Bin 0 -> 50 bytes
 tests/data/acpi/q35/TPM2.tis.tpm2           | Bin 0 -> 76 bytes
 tests/qtest/bios-tables-test-allowed-diff.h |  11 -----------
 5 files changed, 11 deletions(-)
Quoted 4 lines

A disadvantage to doing it like this is that git thinks it's ok to replace any empty file with this, so if acpi changed in any way git will happily resolve it replacing it with this version.

Do we actually need to be storing these binary files in git at all ?

Quoted 6 lines

IIUC, the test will do two things

- memcmp the expected binary we store, against the new binary we generated.
- if they differ, then disassemble both and report the differences in a user friendly-ish way

Second if iasl is installed.

Quoted 1 line

What if we only stored the sha256 checksum of the binary

Quoted 8 lines

Hmm, point being? Same some space?

Quoted 2 lines

*and*
the dissasembled output in git, never the full binary.

We used to. The issue is that dissasembled output depends very much on the disassembler. Disassembling both with the same tool is one way to address this.

Oh, so new isal releases can change the format, that's annoying :-(

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#17 lore raw

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

Quoted 51 lines · Daniel P. Berrangé
Quoted 49 lines · Michael S. Tsirkin
Quoted 32 lines · Daniel P. Berrangé
Quoted 23 lines · Michael S. Tsirkin
Quoted 14 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
Cc Michael S. Tsirkin <[email protected]>
Cc Igor Mammedov <[email protected]>
Cc Ani Sinha <[email protected]>
Quoted 7 lines
---
 tests/data/acpi/q35/DSDT.tis.tpm12          | Bin 0 -> 8900 bytes
 tests/data/acpi/q35/DSDT.tis.tpm2           | Bin 0 -> 8921 bytes
 tests/data/acpi/q35/TCPA.tis.tpm12          | Bin 0 -> 50 bytes
 tests/data/acpi/q35/TPM2.tis.tpm2           | Bin 0 -> 76 bytes
 tests/qtest/bios-tables-test-allowed-diff.h |  11 -----------
 5 files changed, 11 deletions(-)
Quoted 4 lines

A disadvantage to doing it like this is that git thinks it's ok to replace any empty file with this, so if acpi changed in any way git will happily resolve it replacing it with this version.

Do we actually need to be storing these binary files in git at all ?

Quoted 6 lines

IIUC, the test will do two things

- memcmp the expected binary we store, against the new binary we generated.
- if they differ, then disassemble both and report the differences in a user friendly-ish way

Second if iasl is installed.

Quoted 1 line

What if we only stored the sha256 checksum of the binary

Hmm, point being? Same some space?

Quoted 2 lines

*and*
the dissasembled output in git, never the full binary.

Quoted 6 lines
Quoted 3 lines

We used to. The issue is that dissasembled output depends very much on the disassembler. Disassembling both with the same tool is one way to address this.

Oh, so new isal releases can change the format, that's annoying :-(

Additionally, depending on iasl binary being used, some tables may or may not be properly interpreted or recognized. For example, the existing iasl binary that comes with the dostro does not recognize the new VIOT tables. One has to use a binary directly compiled from the upstream iasl repo at this time.

Quoted 8 lines

Regards,
Daniel
--

|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#18 lore raw

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

In reply to Daniel P. Berrangé
Quoted 50 lines · Daniel P. Berrangé
Quoted 49 lines · Michael S. Tsirkin
Quoted 32 lines · Daniel P. Berrangé
Quoted 23 lines · Michael S. Tsirkin
Quoted 14 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
Cc Michael S. Tsirkin <[email protected]>
Cc Igor Mammedov <[email protected]>
Cc Ani Sinha <[email protected]>
Quoted 7 lines
---
 tests/data/acpi/q35/DSDT.tis.tpm12          | Bin 0 -> 8900 bytes
 tests/data/acpi/q35/DSDT.tis.tpm2           | Bin 0 -> 8921 bytes
 tests/data/acpi/q35/TCPA.tis.tpm12          | Bin 0 -> 50 bytes
 tests/data/acpi/q35/TPM2.tis.tpm2           | Bin 0 -> 76 bytes
 tests/qtest/bios-tables-test-allowed-diff.h |  11 -----------
 5 files changed, 11 deletions(-)
Quoted 4 lines

A disadvantage to doing it like this is that git thinks it's ok to replace any empty file with this, so if acpi changed in any way git will happily resolve it replacing it with this version.

Do we actually need to be storing these binary files in git at all ?

Quoted 6 lines

IIUC, the test will do two things

- memcmp the expected binary we store, against the new binary we generated.
- if they differ, then disassemble both and report the differences in a user friendly-ish way

Second if iasl is installed.

Quoted 1 line

What if we only stored the sha256 checksum of the binary

Hmm, point being? Same some space?

Quoted 2 lines

*and*
the dissasembled output in git, never the full binary.

Quoted 6 lines
Quoted 3 lines

We used to. The issue is that dissasembled output depends very much on the disassembler. Disassembling both with the same tool is one way to address this.

Oh, so new isal releases can change the format, that's annoying :-(

Well iasl never promised to generate exactly the same output for the same input. For example, at some point they
started adding comments documenting the output.
How stable it's been recently/on platforms we care about - I don't know. I'm fine with adding the disassembled files and seeing
where does it lead us.

Quoted 6 lines

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|