Skip to contentSkip to conversation

acpi: remove length check for large registers

PATCH In review Linn Crosetto 2 participants 4 messages Mar 15, 2013 – Mar 19, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 acpi: remove length check for large registers

The legacy bit width field in the Generic Address Structure is 1 byte, limiting the reportable register width to 255 bits. Larger registers will cause a length mismatch warning to be printed in acpi_tb_validate_fadt().

To avoid the warning, disable the length mismatch check for registers larger than 255 bits.

---
 drivers/acpi/acpica/tbfadt.c | 1 +
 1 file changed, 1 insertion(+)
drivers/acpi/acpica/tbfadt.c +1 -0
index 74181bf..e87abcd 100644
@@ -561,6 +561,7 @@ static void acpi_tb_validate_fadt(void)
 		 * legacy length field and the corresponding 64-bit X length field.
 		 */
 		if (address64->address &&
+		    ACPI_MUL_8(length) <= ACPI_UINT8_MAX &&
 		    (address64->bit_width != ACPI_MUL_8(length))) {
 			ACPI_BIOS_WARNING((AE_INFO,
 					   "32/64X length mismatch in FADT/%s: %u/%u",
Signature · 1 line
1.7.11.3
#1 lore raw

Linn,

Can you explain in a bit more detail what brings this up?

I'm aware of the limitation of the generic address structure, but we are forced by the (current) ACPI specification to use it if it is present for a given register.

Thanks,
Bob

Quoted 36 lines

-----Original Message-----
From: Linn Crosetto [mailto:[email protected]]
Sent: Friday, March 15, 2013 12:56 PM
To: [email protected]; Moore, Robert; [email protected]; Zheng, Lv; linux- [email protected]
Cc: [email protected]; Linn Crosetto
Subject: [PATCH] acpi: remove length check for large registers

The legacy bit width field in the Generic Address Structure is 1 byte, limiting the reportable register width to 255 bits. Larger registers will cause a length mismatch warning to be printed in acpi_tb_validate_fadt().

To avoid the warning, disable the length mismatch check for registers larger than 255 bits.

---
 drivers/acpi/acpica/tbfadt.c | 1 +
 1 file changed, 1 insertion(+)
drivers/acpi/acpica/tbfadt.c +0 -0
index 74181bf..e87abcd 100644
@@ -561,6 +561,7 @@ static void acpi_tb_validate_fadt(void)
 		 * legacy length field and the corresponding 64-bit X length

field.

drivers/acpi/acpica/tbfadt.c +1 -0
 		 */
 		if (address64->address &&
+		    ACPI_MUL_8(length) <= ACPI_UINT8_MAX &&
 		    (address64->bit_width != ACPI_MUL_8(length))) {
 			ACPI_BIOS_WARNING((AE_INFO,
 					   "32/64X length mismatch in FADT/%s:

%u/%u",
--
1.7.11.3

#2 lore raw
Quoted 3 lines · Robert

Can you explain in a bit more detail what brings this up?

I'm aware of the limitation of the generic address structure, but we are forced by the (current) ACPI specification to use it if it is present for a given register.

A system with a GPE block bit_width of 256 triggers it. In this case, the length check can never succeed.

Thanks,
Linn

#3 lore raw
In reply to Linn Crosetto

Linn,

We will integrate this change into ACPICA for the next release, later in March 2013. Thanks,
Bob

Quoted 36 lines

-----Original Message-----
From: Linn Crosetto [mailto:[email protected]]
Sent: Friday, March 15, 2013 12:56 PM
To: [email protected]; Moore, Robert; [email protected]; Zheng, Lv; linux- [email protected]
Cc: [email protected]; Linn Crosetto
Subject: [PATCH] acpi: remove length check for large registers

The legacy bit width field in the Generic Address Structure is 1 byte, limiting the reportable register width to 255 bits. Larger registers will cause a length mismatch warning to be printed in acpi_tb_validate_fadt().

To avoid the warning, disable the length mismatch check for registers larger than 255 bits.

---
 drivers/acpi/acpica/tbfadt.c | 1 +
 1 file changed, 1 insertion(+)
drivers/acpi/acpica/tbfadt.c +0 -0
index 74181bf..e87abcd 100644
@@ -561,6 +561,7 @@ static void acpi_tb_validate_fadt(void)
 		 * legacy length field and the corresponding 64-bit X length

field.

drivers/acpi/acpica/tbfadt.c +1 -0
 		 */
 		if (address64->address &&
+		    ACPI_MUL_8(length) <= ACPI_UINT8_MAX &&
 		    (address64->bit_width != ACPI_MUL_8(length))) {
 			ACPI_BIOS_WARNING((AE_INFO,
 					   "32/64X length mismatch in FADT/%s:

%u/%u",
--
1.7.11.3