Skip to contentSkip to conversation

ACPI DSDT: Make control method `IQCR` serialized

PATCH In review Michael S. Tsirkin 3 participants 3 messages Nov 14, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI DSDT: Make control method `IQCR` serialized

Forward-port the following commit from seabios:

commit 995bbeef78b338370f426bf8d0399038c3fa259c

Author: Paul Menzel <[email protected]>
Date:   Thu Oct 3 11:30:52 2013 +0200

The ASL Optimizing Compiler version 20130823-32 [Sep 11 2013] issues the following warning.

$ make
[…]
Compiling IASL out/src/fw/acpi-dsdt.hex
out/src/fw/acpi-dsdt.dsl.i 360: Method(IQCR, 1, NotSerialized) {
Remark 2120 - ^ Control Method should be made Serialized (due to creation of named objects within)
[…]
ASL Input: out/src/fw/acpi-dsdt.dsl.i - 475 lines, 19181 bytes, 316 keywords
AML Output: out/src/fw/acpi-dsdt.aml - 4407 bytes, 159 named objects, 157 executable opcodes
Listing File: out/src/fw/acpi-dsdt.lst - 143715 bytes
Hex Dump: out/src/fw/acpi-dsdt.hex - 41661 bytes

Compilation complete. 0 Errors, 0 Warnings, 1 Remarks, 246 Optimizations […]

After changing the parameter from NotSerialized to Serialized, the remark is indeed gone and there is no size change.

The remark was added in ACPICA version 20130517 [1] and gives the following explanation.

If a thread blocks within the method for any reason, and another thread enters the method, the method will fail because an attempt will be made to create the same (named) object twice.

In this case, issue a remark that the method should be marked serialized. ACPICA BZ 909.

[1] https://github.com/acpica/acpica/commit/ba84d0fc18ba910a47a3f71c68a43543c06e6831

---
 hw/i386/acpi-dsdt.dsl               | 2 +-
 hw/i386/acpi-dsdt.hex.generated     | 4 ++--
 hw/i386/q35-acpi-dsdt.dsl           | 2 +-
 hw/i386/q35-acpi-dsdt.hex.generated | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)
hw/i386/acpi-dsdt.dsl +1 -1
index 90efce0..a377424 100644
@@ -235,7 +235,7 @@ DefinitionBlock (
             }
             Return (0x0B)
         }
-        Method(IQCR, 1, NotSerialized) {
+        Method(IQCR, 1, Serialized) {
             // _CRS method - get current settings
             Name(PRR0, ResourceTemplate() {
                 Interrupt(, Level, ActiveHigh, Shared) { 0 }
hw/i386/acpi-dsdt.hex.generated +2 -2
index 2c01107..f8bd4ea 100644
@@ -8,7 +8,7 @@ static unsigned char AcpiDsdtAmlCode[] = {
 0x0,
 0x0,
 0x1,
-0xe0,
+0xd8,
 0x42,
 0x58,
 0x50,
@@ -3379,7 +3379,7 @@ static unsigned char AcpiDsdtAmlCode[] = {
 0x51,
 0x43,
 0x52,
-0x1,
+0x9,
 0x8,
 0x50,
 0x52,
hw/i386/q35-acpi-dsdt.dsl +1 -1
index 21c89b0..575c5d7 100644
@@ -333,7 +333,7 @@ DefinitionBlock (
             }
             Return (0x0B)
         }
-        Method(IQCR, 1, NotSerialized) {
+        Method(IQCR, 1, Serialized) {
             // _CRS method - get current settings
             Name(PRR0, ResourceTemplate() {
                 Interrupt(, Level, ActiveHigh, Shared) { 0 }
hw/i386/q35-acpi-dsdt.hex.generated +2 -2
index 32c16ff..111ad3e 100644
@@ -8,7 +8,7 @@ static unsigned char Q35AcpiDsdtAmlCode[] = {
 0x0,
 0x0,
 0x1,
-0x6,
+0xfe,
 0x42,
 0x58,
 0x50,
@@ -5338,7 +5338,7 @@ static unsigned char Q35AcpiDsdtAmlCode[] = {
 0x51,
 0x43,
 0x52,
-0x1,
+0x9,
 0x8,
 0x50,
 0x52,
Signature · 1 line
MST
Tested-by on v1 1/1
#1 lore raw
Quoted 36 lines · Michael S. Tsirkin

Forward-port the following commit from seabios:

commit 995bbeef78b338370f426bf8d0399038c3fa259c

Author: Paul Menzel <[email protected]>
Date:   Thu Oct 3 11:30:52 2013 +0200

The ASL Optimizing Compiler version 20130823-32 [Sep 11 2013] issues the following warning.

$ make
[…]
Compiling IASL out/src/fw/acpi-dsdt.hex
out/src/fw/acpi-dsdt.dsl.i 360: Method(IQCR, 1, NotSerialized) {
Remark 2120 - ^ Control Method should be made Serialized (due to creation of named objects within)
[…]
ASL Input: out/src/fw/acpi-dsdt.dsl.i - 475 lines, 19181 bytes, 316 keywords
AML Output: out/src/fw/acpi-dsdt.aml - 4407 bytes, 159 named objects, 157 executable opcodes
Listing File: out/src/fw/acpi-dsdt.lst - 143715 bytes
Hex Dump: out/src/fw/acpi-dsdt.hex - 41661 bytes

Compilation complete. 0 Errors, 0 Warnings, 1 Remarks, 246 Optimizations […]

After changing the parameter from NotSerialized to Serialized, the remark is indeed gone and there is no size change.

The remark was added in ACPICA version 20130517 [1] and gives the following explanation.

If a thread blocks within the method for any reason, and another thread enters the method, the method will fail because an attempt will be made to create the same (named) object twice.

In this case, issue a remark that the method should be marked serialized. ACPICA BZ 909.

Quoted 6 lines

[1] https://github.com/acpica/acpica/commit/ba84d0fc18ba910a47a3f71c68a43543c06e6831

Dumped the acpi tables and verified that is ok now. Thanks!

Quoted 77 lines
---
 hw/i386/acpi-dsdt.dsl               | 2 +-
 hw/i386/acpi-dsdt.hex.generated     | 4 ++--
 hw/i386/q35-acpi-dsdt.dsl           | 2 +-
 hw/i386/q35-acpi-dsdt.hex.generated | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)
hw/i386/acpi-dsdt.dsl +1 -1
index 90efce0..a377424 100644
@@ -235,7 +235,7 @@ DefinitionBlock (
             }
             Return (0x0B)
         }
-        Method(IQCR, 1, NotSerialized) {
+        Method(IQCR, 1, Serialized) {
             // _CRS method - get current settings
             Name(PRR0, ResourceTemplate() {
                 Interrupt(, Level, ActiveHigh, Shared) { 0 }
hw/i386/acpi-dsdt.hex.generated +2 -2
index 2c01107..f8bd4ea 100644
@@ -8,7 +8,7 @@ static unsigned char AcpiDsdtAmlCode[] = {
 0x0,
 0x0,
 0x1,
-0xe0,
+0xd8,
 0x42,
 0x58,
 0x50,
@@ -3379,7 +3379,7 @@ static unsigned char AcpiDsdtAmlCode[] = {
 0x51,
 0x43,
 0x52,
-0x1,
+0x9,
 0x8,
 0x50,
 0x52,
hw/i386/q35-acpi-dsdt.dsl +1 -1
index 21c89b0..575c5d7 100644
@@ -333,7 +333,7 @@ DefinitionBlock (
             }
             Return (0x0B)
         }
-        Method(IQCR, 1, NotSerialized) {
+        Method(IQCR, 1, Serialized) {
             // _CRS method - get current settings
             Name(PRR0, ResourceTemplate() {
                 Interrupt(, Level, ActiveHigh, Shared) { 0 }
hw/i386/q35-acpi-dsdt.hex.generated +2 -2
index 32c16ff..111ad3e 100644
@@ -8,7 +8,7 @@ static unsigned char Q35AcpiDsdtAmlCode[] = {
 0x0,
 0x0,
 0x1,
-0x6,
+0xfe,
 0x42,
 0x58,
 0x50,
@@ -5338,7 +5338,7 @@ static unsigned char Q35AcpiDsdtAmlCode[] = {
 0x51,
 0x43,
 0x52,
-0x1,
+0x9,
 0x8,
 0x50,
 0x52,
Reviewed-by on v1 1/1
#2 lore raw
In reply to Michael S. Tsirkin
Quoted 40 lines · Michael S. Tsirkin

Forward-port the following commit from seabios:

commit 995bbeef78b338370f426bf8d0399038c3fa259c

Author: Paul Menzel <[email protected]>
Date:   Thu Oct 3 11:30:52 2013 +0200

The ASL Optimizing Compiler version 20130823-32 [Sep 11 2013] issues the following warning.

$ make
[…]
Compiling IASL out/src/fw/acpi-dsdt.hex
out/src/fw/acpi-dsdt.dsl.i 360: Method(IQCR, 1, NotSerialized) {
Remark 2120 - ^ Control Method should be made Serialized (due to creation of named objects within)
[…]
ASL Input: out/src/fw/acpi-dsdt.dsl.i - 475 lines, 19181 bytes, 316 keywords
AML Output: out/src/fw/acpi-dsdt.aml - 4407 bytes, 159 named objects, 157 executable opcodes
Listing File: out/src/fw/acpi-dsdt.lst - 143715 bytes
Hex Dump: out/src/fw/acpi-dsdt.hex - 41661 bytes

Compilation complete. 0 Errors, 0 Warnings, 1 Remarks, 246 Optimizations […]

After changing the parameter from NotSerialized to Serialized, the remark is indeed gone and there is no size change.

The remark was added in ACPICA version 20130517 [1] and gives the following explanation.

If a thread blocks within the method for any reason, and another thread enters the method, the method will fail because an attempt will be made to create the same (named) object twice.

In this case, issue a remark that the method should be marked serialized. ACPICA BZ 909.

[1] https://github.com/acpica/acpica/commit/ba84d0fc18ba910a47a3f71c68a43543c06e6831

Quoted 8 lines
---
 hw/i386/acpi-dsdt.dsl               | 2 +-
 hw/i386/acpi-dsdt.hex.generated     | 4 ++--
 hw/i386/q35-acpi-dsdt.dsl           | 2 +-
 hw/i386/q35-acpi-dsdt.hex.generated | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

The analysis / evolution of the iasl change
<https://bugs.acpica.org/show_bug.cgi?id=909> is instrumental.

The patch looks good to me (although you could sell me anything in the binary part).