tpm: Add missing ACPI device identification objects
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
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.
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
@@ -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
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]>Signed-off-by Stefan Berger <[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@@ -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
PATCH v4 2/3 acpi: tpm: Add missing device identification objects
In reply to Stefan BergerAdd 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
@@ -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
@@ -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
Re: [PATCH v4 2/3] acpi: tpm: Add missing device identification objects
Quoted 9 lines · Stefan Berger
Add missing device identification objects
_STRand_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]>Signed-off-by Stefan Berger <[email protected]>
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@@ -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@@ -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.
Quoted 16 lines
hw/i386/acpi-build.c +2
-1crs =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
Re: [PATCH v4 2/3] acpi: tpm: Add missing device identification objects
In reply to Stefan BergerQuoted 20 lines · Stefan Berger
Add missing device identification objects
_STRand_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]>Signed-off-by Stefan Berger <[email protected]>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
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
-0Aml *crs =aml_resource_template ();hw/i386/acpi-build.c +8
-0@@ -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);
Re: [PATCH v4 2/3] acpi: tpm: Add missing device identification objects
In reply to Stefan BergerQuoted 1 line · On Wed, 22 Dec 2021 21:23:09 -0500 Stefan Berger <[email protected]> wrote:
Add missing device identification objects
_STRand_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.
Cc Shannon Zhao <[email protected]>Cc Michael S. Tsirkin <[email protected]>Cc Igor Mammedov <[email protected]>Cc Ani Sinha <[email protected]>Signed-off-by Stefan Berger <[email protected]>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@@ -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@@ -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
-0aml_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
-0aml_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);
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
_STRand_UID. They will appearwhy, 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.
Cc Shannon Zhao <[email protected]>Cc Michael S. Tsirkin <[email protected]>Cc Igor Mammedov <[email protected]>Cc Ani Sinha <[email protected]>Signed-off-by Stefan Berger <[email protected]>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@@ -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@@ -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
-0aml_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
-0aml_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);
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
_STRand_UID. They will appearwhy, 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:
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.
Cc Shannon Zhao <[email protected]>Cc Michael S. Tsirkin <[email protected]>Cc Igor Mammedov <[email protected]>Cc Ani Sinha <[email protected]>Signed-off-by Stefan Berger <[email protected]>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@@ -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@@ -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.0Quoted 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
-0Device"))); }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
-0aml_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);
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
_STRand_UID. They will appearwhy, 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
Ok so you might want to add
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/708in 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.
Cc Shannon Zhao <[email protected]>Cc Michael S. Tsirkin <[email protected]>Cc Igor Mammedov <[email protected]>Cc Ani Sinha <[email protected]>Signed-off-by Stefan Berger <[email protected]>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@@ -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@@ -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.0Quoted 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
-0Device"))); }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
-0aml_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
-0crs =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);
Re: [PATCH v4 2/3] acpi: tpm: Add missing device identification objects
In reply to Stefan BergerQuoted 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
_STRand_UID. They will appearwhy, 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.
Cc Shannon Zhao <[email protected]>Cc Michael S. Tsirkin <[email protected]>Cc Igor Mammedov <[email protected]>Cc Ani Sinha <[email protected]>Signed-off-by Stefan Berger <[email protected]>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@@ -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@@ -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
-0aml_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
-0aml_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);
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
_STRand_UID. They will appearwhy, 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.
Cc Shannon Zhao <[email protected]>Cc Michael S. Tsirkin <[email protected]>Cc Igor Mammedov <[email protected]>Cc Ani Sinha <[email protected]>Signed-off-by Stefan Berger <[email protected]>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@@ -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@@ -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
-0aml_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.
PATCH v4 3/3 tests: acpi: Add updated TPM related tables
In reply to Stefan BergerThe 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
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
tests/data/acpi/q35/DSDT.tis.tpm2 binary +0 -0
tests/qtest/bios-tables-test-allowed-diff.h +0 -2
@@ -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
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]>Signed-off-by Stefan Berger <[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
-0tests/data/acpi/q35/DSDT.tis.tpm2 binary +0
-0tests/qtest/bios-tables-test-allowed-diff.h +0
-3@@ -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