ACPI: PRM: Remove unnecessary strict handler address checks
Subsystems (2)
PATCH 1/1 ACPI: PRM: Remove unnecessary strict handler address checks
Commit 088984c8d54c ("ACPI: PRM: Find EFI_MEMORY_RUNTIME block for PRM handler and context") added unnecessary strict handler address checks, caused the PRM module to fail in translating memory error addresses.
Both static data buffer address and acpi parameter buffer address may be NULL if they are not needed, as described in section 4.1.2 PRM Handler Information Structure of Platform Runtime Mechanism specification [1].
Here are two examples from real hardware:
----PRMT.dsl----
- staic data address is not used
[10Ch 0268 2] Revision : 0000
[10Eh 0270 2] Length : 002C
[110h 0272 16] Handler GUID : F6A58D47-E04F-4F5A-86B8-2A50D4AA109B
[120h 0288 8] Handler address : 0000000065CE51F4 [128h 0296 8] Satic Data Address : 0000000000000000 [130h 0304 8] ACPI Parameter Address : 000000006522A718
- ACPI parameter address is not used
[1B0h 0432 2] Revision : 0000
[1B2h 0434 2] Length : 002C
[1B4h 0436 16] Handler GUID : 657E8AE6-A8FC-4877-BB28-42E7DE1899A5
[1C4h 0452 8] Handler address : 0000000065C567C8 [1CCh 0460 8] Satic Data Address : 000000006113FB98 [1D4h 0468 8] ACPI Parameter Address : 0000000000000000
--- drivers/acpi/prmt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/acpi/prmt.c +1 -3
@@ -287,9 +287,7 @@ static acpi_status acpi_platformrt_space_handler(u32 function,if (!handler || !module) goto invalid_guid; -if (!handler->handler_addr || - !handler->static_data_buffer_addr || - !handler->acpi_param_buffer_addr) { +if (!handler->handler_addr) { buffer->prm_status =PRM_HANDLER_ERROR ;return AE_OK ; }
Signature · 1 line
2.34.1
Since static_data_buffer_addr and acpi_param_buffer_addr
would be passed to FW and OS doesn't use these two,
the responsibility of check is transferred to FW.
Please have my
Quoted 58 lines · Aubrey Li
External email: Use caution opening links or attachments
Commit
088984c8d54c("ACPI: PRM: FindEFI_MEMORY_RUNTIMEblock for PRM handler and context") added unnecessary strict handler address checks, caused the PRM module to fail in translating memory error addresses.Both static data buffer address and acpi parameter buffer address may be NULL if they are not needed, as described in section 4.1.2 PRM Handler Information Structure of Platform Runtime Mechanism specification [1].
Here are two examples from real hardware:
----PRMT.dsl----
- staic data address is not used
[10Ch 0268 2] Revision : 0000
[10Eh 0270 2] Length : 002C
[110h 0272 16] Handler GUID : F6A58D47-E04F-4F5A-86B8-2A50D4AA109B[120h 0288 8] Handler address : 0000000065CE51F4 [128h 0296 8] Satic Data Address : 0000000000000000 [130h 0304 8] ACPI Parameter Address : 000000006522A718- ACPI parameter address is not used
[1B0h 0432 2] Revision : 0000
[1B2h 0434 2] Length : 002C
[1B4h 0436 16] Handler GUID : 657E8AE6-A8FC-4877-BB28-42E7DE1899A5[1C4h 0452 8] Handler address : 0000000065C567C8 [1CCh 0460 8] Satic Data Address : 000000006113FB98 [1D4h 0468 8] ACPI Parameter Address : 0000000000000000Fixes 088984c8d54c ("ACPI: PRM: Find EFI_MEMORY_RUNTIME block for PRM handler and context")Reported-and-tested-by Shi Liu <[email protected]>Cc All applicable <[email protected]>Signed-off-by Aubrey Li <[email protected]>--- drivers/acpi/prmt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/acpi/prmt.c +1
-4@@ -287,9 +287,7 @@ static acpi_status acpi_platformrt_space_handler(u32 function,if (!handler || !module) goto invalid_guid; -if (!handler->handler_addr || - !handler->static_data_buffer_addr || - !handler->acpi_param_buffer_addr) { +if (!handler->handler_addr) { buffer->prm_status =PRM_HANDLER_ERROR ;return AE_OK ; } --2.34.1
Quoted 29 lines · Aubrey Li
Commit
088984c8d54c("ACPI: PRM: FindEFI_MEMORY_RUNTIMEblock for PRM handler and context") added unnecessary strict handler address checks, caused the PRM module to fail in translating memory error addresses.Both static data buffer address and acpi parameter buffer address may be NULL if they are not needed, as described in section 4.1.2 PRM Handler Information Structure of Platform Runtime Mechanism specification [1].
Here are two examples from real hardware:
----PRMT.dsl----
- staic data address is not used
[10Ch 0268 2] Revision : 0000
[10Eh 0270 2] Length : 002C
[110h 0272 16] Handler GUID : F6A58D47-E04F-4F5A-86B8-2A50D4AA109B[120h 0288 8] Handler address : 0000000065CE51F4 [128h 0296 8] Satic Data Address : 0000000000000000 [130h 0304 8] ACPI Parameter Address : 000000006522A718- ACPI parameter address is not used
[1B0h 0432 2] Revision : 0000
[1B2h 0434 2] Length : 002C
[1B4h 0436 16] Handler GUID : 657E8AE6-A8FC-4877-BB28-42E7DE1899A5[1C4h 0452 8] Handler address : 0000000065C567C8 [1CCh 0460 8] Satic Data Address : 000000006113FB98 [1D4h 0468 8] ACPI Parameter Address : 0000000000000000
Quoted 9 lines
Fixes 088984c8d54c ("ACPI: PRM: Find EFI_MEMORY_RUNTIME block for PRM handler and context")Reported-and-tested-by Shi Liu <[email protected]>Cc All applicable <[email protected]>Signed-off-by Aubrey Li <[email protected]>--- drivers/acpi/prmt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
Quoted 18 lines
drivers/acpi/prmt.c +1
-4@@ -287,9 +287,7 @@ static acpi_status acpi_platformrt_space_handler(u32 function,if (!handler || !module) goto invalid_guid; -if (!handler->handler_addr || - !handler->static_data_buffer_addr || - !handler->acpi_param_buffer_addr) { +if (!handler->handler_addr) { buffer->prm_status =PRM_HANDLER_ERROR ;return AE_OK ; } --2.34.1
Quoted 51 lines · Ard Biesheuvel
Quoted 29 lines · Aubrey Li
Commit
088984c8d54c("ACPI: PRM: FindEFI_MEMORY_RUNTIMEblock for PRM handler and context") added unnecessary strict handler address checks, caused the PRM module to fail in translating memory error addresses.Both static data buffer address and acpi parameter buffer address may be NULL if they are not needed, as described in section 4.1.2 PRM Handler Information Structure of Platform Runtime Mechanism specification [1].
Here are two examples from real hardware:
----PRMT.dsl----
- staic data address is not used
[10Ch 0268 2] Revision : 0000
[10Eh 0270 2] Length : 002C
[110h 0272 16] Handler GUID : F6A58D47-E04F-4F5A-86B8-2A50D4AA109B[120h 0288 8] Handler address : 0000000065CE51F4 [128h 0296 8] Satic Data Address : 0000000000000000 [130h 0304 8] ACPI Parameter Address : 000000006522A718- ACPI parameter address is not used
[1B0h 0432 2] Revision : 0000
[1B2h 0434 2] Length : 002C
[1B4h 0436 16] Handler GUID : 657E8AE6-A8FC-4877-BB28-42E7DE1899A5[1C4h 0452 8] Handler address : 0000000065C567C8 [1CCh 0460 8] Satic Data Address : 000000006113FB98 [1D4h 0468 8] ACPI Parameter Address : 0000000000000000Quoted 9 lines
Fixes 088984c8d54c ("ACPI: PRM: Find EFI_MEMORY_RUNTIME block for PRM handler and context")Reported-and-tested-by Shi Liu <[email protected]>Cc All applicable <[email protected]>Signed-off-by Aubrey Li <[email protected]>--- drivers/acpi/prmt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)Acked-by Ard Biesheuvel <[email protected]>Quoted 8 lines
drivers/acpi/prmt.c +0
-0@@ -287,9 +287,7 @@ static acpi_status acpi_platformrt_space_handler(u32 function,if (!handler || !module) goto invalid_guid;
Quoted 8 lines
drivers/acpi/prmt.c static acpi_status acpi_platformrt_space_handler(u32 function,
Quoted 8 lines
drivers/acpi/prmt.c +1
-4-if (!handler->handler_addr || - !handler->static_data_buffer_addr || - !handler->acpi_param_buffer_addr) { +if (!handler->handler_addr) { buffer->prm_status =PRM_HANDLER_ERROR ;return AE_OK ; } --
Applied as 6.14-rc material, thanks!