cmd: acpi: Print revisions in hex format
PATCH 1/1 cmd: acpi: Print revisions in hex format
The revisions are usually dates in hex-decimal format representing YYYYmmdd. Print them in hex to see this clearly.
Before:
...
FACP 000e5420 0000f4 (v06 U-BOOT U-BOOTBL 538970376 INTL 0) DSDT 000e4780 000ba0 (v02 U-BOOT U-BOOTBL 65536 INTL 538968870)
...
After:
...
FACP 000e5420 0000f4 (v06 U-BOOT U-BOOTBL 20200908 INTL 0) DSDT 000e4780 000ba0 (v02 U-BOOT U-BOOTBL 10000 INTL 20200326)
...
--- cmd/acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
cmd/acpi.c +1 -1
@@ -26,7 +26,7 @@ static void dump_hdr(struct acpi_table_header *hdr)printf ("%.*s %08lx %06x" ,ACPI_NAME_LEN , hdr->signature, (ulong )map_to_sysmem (hdr), hdr->length);if (has_hdr) { -printf (" (v%02d %.6s %.8s %u %.4s %d)\n" , hdr->revision, +printf (" (v%02d %.6s %.8s %x %.4s %x)\n" , hdr->revision, hdr->oem_id, hdr->oem_table_id, hdr->oem_revision, hdr->aslc_id, hdr->aslc_revision); }else {
Signature · 1 line
2.28.0
PATCH 1/1 cmd: acpi: Print revisions in hex format
Hi Andy,
-----"Andy Shevchenko" <[email protected]> schrieb: -----
Quoted 16 lines
Betreff: [PATCH v1] cmd: acpi: Print revisions in hex format
The revisions are usually dates in hex-decimal format representing YYYYmmdd. Print them in hex to see this clearly.
Before:
...
FACP000e54200000f4 (v06 U-BOOT U-BOOTBL 538970376 INTL 0) DSDT000e4780000ba0 (v02 U-BOOT U-BOOTBL 65536 INTL 538968870)
...
After:
...
FACP000e54200000f4 (v06 U-BOOT U-BOOTBL 20200908 INTL 0) DSDT000e4780000ba0 (v02 U-BOOT U-BOOTBL 10000 INTL 20200326)
...
Quoted 6 lines
Fixes 0b885bcfd9b0 ("acpi: Add an acpi command")Cc Wolfgang Wallner <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>--- cmd/acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Tested on a custom Apollolake board.
Related to "acpi list":
During my recent ACPI debugging I found it very useful to have the checksum printed for each table with "acpi list". Would there be interest to have that upstream? If so I would send a patch.
regards, Wolfgang
PATCH 1/1 cmd: acpi: Print revisions in hex format
Quoted 24 lines · Wolfgang Wallner
-----"Andy Shevchenko" <[email protected]> schrieb: -----
Quoted 16 lines
Betreff: [PATCH v1] cmd: acpi: Print revisions in hex format
The revisions are usually dates in hex-decimal format representing YYYYmmdd. Print them in hex to see this clearly.
Before:
...
FACP000e54200000f4 (v06 U-BOOT U-BOOTBL 538970376 INTL 0) DSDT000e4780000ba0 (v02 U-BOOT U-BOOTBL 65536 INTL 538968870)
...
After:
...
FACP000e54200000f4 (v06 U-BOOT U-BOOTBL 20200908 INTL 0) DSDT000e4780000ba0 (v02 U-BOOT U-BOOTBL 10000 INTL 20200326)
...Quoted 6 lines
Fixes 0b885bcfd9b0 ("acpi: Add an acpi command")Cc Wolfgang Wallner <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>--- cmd/acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 3 lines
Reviewed-by Wolfgang Wallner <[email protected]>Tested-by Wolfgang Wallner <[email protected]>Tested on a custom Apollolake board.
Thanks!
Quoted 4 lines
Related to "acpi list":
During my recent ACPI debugging I found it very useful to have the checksum printed for each table with "acpi list". Would there be interest to have that upstream? If so I would send a patch.
Can you elaborate what was the problem that checksum helped?
Signature · 2 lines
With Best Regards, Andy Shevchenko
PATCH 1/1 cmd: acpi: Print revisions in hex format
Hi Andy,
-----"Andy Shevchenko" <[email protected]> schrieb: -----
Quoted 28 lines
Betreff: Re: [PATCH v1] cmd: acpi: Print revisions in hex format
Quoted 24 lines · Wolfgang Wallner
-----"Andy Shevchenko" <[email protected]> schrieb: -----
Quoted 22 lines
Betreff: [PATCH v1] cmd: acpi: Print revisions in hex format
The revisions are usually dates in hex-decimal format representing YYYYmmdd. Print them in hex to see this clearly.
Before:
...
FACP000e54200000f4 (v06 U-BOOT U-BOOTBL 538970376 INTL 0) DSDT000e4780000ba0 (v02 U-BOOT U-BOOTBL 65536 INTL 538968870)
...
After:
...
FACP000e54200000f4 (v06 U-BOOT U-BOOTBL 20200908 INTL 0) DSDT000e4780000ba0 (v02 U-BOOT U-BOOTBL 10000 INTL 20200326)
...Fixes 0b885bcfd9b0 ("acpi: Add an acpi command")Cc Wolfgang Wallner <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>--- cmd/acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 5 lines
Quoted 3 lines
Reviewed-by Wolfgang Wallner <[email protected]>Tested-by Wolfgang Wallner <[email protected]>Tested on a custom Apollolake board.
Thanks!
You're welcome.
Quoted 7 lines
Quoted 5 lines
Related to "acpi list":
During my recent ACPI debugging I found it very useful to have the checksum printed for each table with "acpi list". Would there be interest to have that upstream? If so I would send a patch.Can you elaborate what was the problem that checksum helped?
Sure. I saw two strange things with the ACPI checksums:
1) The DSDT length included uninitialized bytes from alignment. This is described in the following link:
https://lists.denx.de/pipermail/u-boot/2020-September/425378.html
This was the actual bug I was looking for.
2) acpi_create_spcr() is missing a memset(). The other acpi_create_xxxx() functions perform a memset on their structure, acpi_create_spcr() does not and as a result the contents of this table are party uninitialized.
I plan to send a patch for both of them.
Regards, Wolfgang
PATCH 1/1 cmd: acpi: Print revisions in hex format
Quoted 4 lines · Wolfgang Wallner
-----"Andy Shevchenko" <[email protected]> schrieb: -----
Quoted 3 lines
Quoted 1 line · Wolfgang Wallner
-----"Andy Shevchenko" <[email protected]> schrieb: -----
...
Quoted 14 lines
Quoted 6 lines
Quoted 4 lines
Related to "acpi list":
During my recent ACPI debugging I found it very useful to have the checksum printed for each table with "acpi list". Would there be interest to have that upstream? If so I would send a patch.Can you elaborate what was the problem that checksum helped?
Sure. I saw two strange things with the ACPI checksums:
1) The DSDT length included uninitialized bytes from alignment. This is described in the following link:
https://lists.denx.de/pipermail/u-boot/2020-September/425378.html
Quoted 7 lines
This was the actual bug I was looking for.
2)
acpi_create_spcr()is missing amemset(). The otheracpi_create_xxxx()functions perform a memset on their structure,acpi_create_spcr()does not and as a result the contents of this table are party uninitialized.I plan to send a patch for both of them.
I'm not sure I understood how checksum pointed to uninitialized data?
Signature · 2 lines
With Best Regards, Andy Shevchenko
PATCH 1/1 cmd: acpi: Print revisions in hex format
In reply to Wolfgang WallnerHi Andy,
-----"Andy Shevchenko" <[email protected]> schrieb: -----
Quoted 26 lines
Betreff: Re: [PATCH v1] cmd: acpi: Print revisions in hex format
Quoted 4 lines · Wolfgang Wallner
-----"Andy Shevchenko" <[email protected]> schrieb: -----
Quoted 3 lines
Quoted 1 line · Wolfgang Wallner
-----"Andy Shevchenko" <[email protected]> schrieb: -----
...
Quoted 16 lines
Quoted 6 lines
Quoted 4 lines
Related to "acpi list":
During my recent ACPI debugging I found it very useful to have the checksum printed for each table with "acpi list". Would there be interest to have that upstream? If so I would send a patch.Can you elaborate what was the problem that checksum helped?
Sure. I saw two strange things with the ACPI checksums:
1) The DSDT length included uninitialized bytes from alignment. This is described in the following link:
https://lists.denx.de/pipermail/u-boot/2020-September/425378.htmlThis was the actual bug I was looking for.
Quoted 7 lines
Quoted 5 lines
2)
acpi_create_spcr()is missing amemset(). The otheracpi_create_xxxx()functions perform a memset on their structure,acpi_create_spcr()does not and as a result the contents of this table are party uninitialized.I plan to send a patch for both of them.
I'm not sure I understood how checksum pointed to uninitialized data?
After adding the checksums to "acpi list" I realized that the checksums for DSDT and SPCR where different after every reset. Looking at the code each turned out to be somehow related to uninitialized memory.
regards, Wolfgang
PS: My mail client has somehow corrupted your last mail, and I can't open it. A colleague has forwarded it to me so I could reply. This is why I reply to my own mail.
PATCH 1/1 cmd: acpi: Print revisions in hex format
Quoted 7 lines · Wolfgang Wallner
-----"Andy Shevchenko" <[email protected]> schrieb: -----
Quoted 6 lines
Betreff: Re: [PATCH v1] cmd: acpi: Print revisions in hex format
Quoted 4 lines · Wolfgang Wallner
-----"Andy Shevchenko" <[email protected]> schrieb: -----
Quoted 3 lines
Quoted 1 line · Wolfgang Wallner
-----"Andy Shevchenko" <[email protected]> schrieb: -----
...
Quoted 20 lines
Quoted 20 lines
Quoted 20 lines
Quoted 6 lines
Quoted 4 lines
Related to "acpi list":
During my recent ACPI debugging I found it very useful to have the checksum printed for each table with "acpi list". Would there be interest to have that upstream? If so I would send a patch.Can you elaborate what was the problem that checksum helped?
Sure. I saw two strange things with the ACPI checksums:
1) The DSDT length included uninitialized bytes from alignment. This is described in the following link:
https://lists.denx.de/pipermail/u-boot/2020-September/425378.htmlThis was the actual bug I was looking for.
2)
acpi_create_spcr()is missing amemset(). The otheracpi_create_xxxx()functions perform a memset on their structure,acpi_create_spcr()does not and as a result the contents of this table are party uninitialized.
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
I plan to send a patch for both of them.
I'm not sure I understood how checksum pointed to uninitialized data?
After adding the checksums to "acpi list" I realized that the checksums for DSDT and SPCR where different after every reset. Looking at the code each turned out to be somehow related to uninitialized memory.
I see. I would rather to have it as a separate (sub-)command. But I leave this to Simon.
Signature · 2 lines
With Best Regards, Andy Shevchenko
PATCH 1/1 cmd: acpi: Print revisions in hex format
In reply to Andy ShevchenkoQuoted 15 lines · Andy Shevchenko
The revisions are usually dates in hex-decimal format representing YYYYmmdd. Print them in hex to see this clearly.
Before:
...
FACP000e54200000f4 (v06 U-BOOT U-BOOTBL 538970376 INTL 0) DSDT000e4780000ba0 (v02 U-BOOT U-BOOTBL 65536 INTL 538968870)
...
After:
...
FACP000e54200000f4 (v06 U-BOOT U-BOOTBL 20200908 INTL 0) DSDT000e4780000ba0 (v02 U-BOOT U-BOOTBL 10000 INTL 20200326)
...
Quoted 7 lines
Fixes 0b885bcfd9b0 ("acpi: Add an acpi command")Cc Wolfgang Wallner <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>--- cmd/acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH 1/1 cmd: acpi: Print revisions in hex format
Quoted 26 lines · Bin Meng
Quoted 15 lines · Andy Shevchenko
The revisions are usually dates in hex-decimal format representing YYYYmmdd. Print them in hex to see this clearly.
Before:
...
FACP000e54200000f4 (v06 U-BOOT U-BOOTBL 538970376 INTL 0) DSDT000e4780000ba0 (v02 U-BOOT U-BOOTBL 65536 INTL 538968870)
...
After:
...
FACP000e54200000f4 (v06 U-BOOT U-BOOTBL 20200908 INTL 0) DSDT000e4780000ba0 (v02 U-BOOT U-BOOTBL 10000 INTL 20200326)
...Quoted 7 lines
Fixes 0b885bcfd9b0 ("acpi: Add an acpi command")Cc Wolfgang Wallner <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>--- cmd/acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 1 line
Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86, thanks!
PATCH 1/1 cmd: acpi: Print revisions in hex format
In reply to Andy ShevchenkoHi Andy,
Quoted 27 lines · Andy Shevchenko
The revisions are usually dates in hex-decimal format representing YYYYmmdd. Print them in hex to see this clearly.
Before:
...
FACP000e54200000f4 (v06 U-BOOT U-BOOTBL 538970376 INTL 0) DSDT000e4780000ba0 (v02 U-BOOT U-BOOTBL 65536 INTL 538968870)
...
After:
...
FACP000e54200000f4 (v06 U-BOOT U-BOOTBL 20200908 INTL 0) DSDT000e4780000ba0 (v02 U-BOOT U-BOOTBL 10000 INTL 20200326)
...Fixes 0b885bcfd9b0 ("acpi: Add an acpi command")Cc Wolfgang Wallner <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>--- cmd/acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)cmd/acpi.c +0
-0
cmd/acpi.c static void dump_hdr(struct acpi_table_header *hdr)
Quoted 9 lines
cmd/acpi.c +1
-2@@ -26,7 +26,7 @@ static void dump_hdr(struct acpi_table_header *hdr)printf ("%.*s %08lx %06x" ,ACPI_NAME_LEN , hdr->signature, (ulong )map_to_sysmem (hdr), hdr->length);if (has_hdr) { -printf (" (v%02d %.6s %.8s %u %.4s %d)\n" , hdr->revision, +printf (" (v%02d %.6s %.8s %x %.4s %x)\n" , hdr->revision, hdr->oem_id, hdr->oem_table_id, hdr->oem_revision, hdr->aslc_id, hdr->aslc_revision); }else { --
This unfortunately breaks the unit test.
/u/test/dm/acpi.c:371, dm_test_acpi_cmd_list(): console:
Expected 'RSDT 0570ebf0 000030 (v01 U-BOOT U-BOOTBL 538970401 INTL 0)', got 'RSDT 0570ebf0 000030 (v01 U-BOOT U-BOOTBL 20200921 INTL 0)'
Failures: 2
Would you please resend v2 to fix this?
Regards,
Bin
PATCH 1/1 cmd: acpi: Print revisions in hex format
Quoted 41 lines · Bin Meng
Quoted 27 lines · Andy Shevchenko
The revisions are usually dates in hex-decimal format representing YYYYmmdd. Print them in hex to see this clearly.
Before:
...
FACP000e54200000f4 (v06 U-BOOT U-BOOTBL 538970376 INTL 0) DSDT000e4780000ba0 (v02 U-BOOT U-BOOTBL 65536 INTL 538968870)
...
After:
...
FACP000e54200000f4 (v06 U-BOOT U-BOOTBL 20200908 INTL 0) DSDT000e4780000ba0 (v02 U-BOOT U-BOOTBL 10000 INTL 20200326)
...Fixes 0b885bcfd9b0 ("acpi: Add an acpi command")Cc Wolfgang Wallner <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>--- cmd/acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)cmd/acpi.c +0
-0cmd/acpi.c static void dump_hdr(struct acpi_table_header *hdr)
Quoted 9 lines
cmd/acpi.c +1
-2@@ -26,7 +26,7 @@ static void dump_hdr(struct acpi_table_header *hdr)printf ("%.*s %08lx %06x" ,ACPI_NAME_LEN , hdr->signature, (ulong )map_to_sysmem (hdr), hdr->length);if (has_hdr) { -printf (" (v%02d %.6s %.8s %u %.4s %d)\n" , hdr->revision, +printf (" (v%02d %.6s %.8s %x %.4s %x)\n" , hdr->revision, hdr->oem_id, hdr->oem_table_id, hdr->oem_revision, hdr->aslc_id, hdr->aslc_revision); }else { --This unfortunately breaks the unit test.
Quoted 6 lines
/u/test/dm/acpi.c:371,
dm_test_acpi_cmd_list(): console:
Expected 'RSDT0570ebf0000030 (v01 U-BOOT U-BOOTBL 538970401 INTL 0)', got 'RSDT0570ebf0000030 (v01 U-BOOT U-BOOTBL 20200921 INTL 0)'
Failures: 2Would you please resend v2 to fix this?
v2 has been just sent. Thanks!
Signature · 2 lines
With Best Regards, Andy Shevchenko