ACPI: APEI: EINJ: Fix EINJv2 memory injection
Tony Luck
reviewerPATCH 1/1 ACPI: APEI: EINJ: Fix EINJv2 memory injection
EINJ trigger actions for memory error injection often include access to the target injection address. This address does not need to special mapping.
The code to drop the target address from the resource list only checked for V1 injection signature.
Add a test for the EINJ V2 memory injection signature.
Reported-by Herman Li <[email protected]>
Signed-off-by Tony Luck <[email protected]>
--- drivers/acpi/apei/einj-core.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/acpi/apei/einj-core.c +12 -1
@@ -401,6 +401,17 @@ static struct acpi_generic_address *einj_get_trigger_parameter_region(return NULL ; } + +static bool is_memory_injection (u32 type,u64 param2) +{ +if (is_v2) +return type &BIT (1 ); +else if (param_extension || acpi5) +return (type &MEM_ERROR_MASK ) && param2; + +return false; +} +/* Execute instructions in trigger error action table */ static int __einj_error_trigger (u64 trigger_paddr,u32 type,u64 param1,u64 param2)
@@ -480,7 +491,7 @@ static int __einj_error_trigger(u64 trigger_paddr, u32 type,* This will cause resource conflict with regular memory. So * remove it from trigger table resources. */ -if ((param_extension || acpi5) && (type &MEM_ERROR_MASK ) && param2) { +if (is_memory_injection (type, param2)) {struct apei_resources addr_resources;apei_resources_init (&addr_resources);
Signature · 1 line
2.53.0
Rafael J. Wysocki
maintainerQuoted 5 lines · Tony Luck
EINJ trigger actions for memory error injection often include access to the target injection address. This address does not need to special mapping.
Quoted 7 lines
The code to drop the target address from the resource list only checked for V1 injection signature.
Add a test for the EINJ V2 memory injection signature.
Reported-by Herman Li <[email protected]>Signed-off-by Tony Luck <[email protected]>
Can you please provide a Fixes: tag for this?
Quoted 39 lines
--- drivers/acpi/apei/einj-core.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)drivers/acpi/apei/einj-core.c +12
-2@@ -401,6 +401,17 @@ static struct acpi_generic_address *einj_get_trigger_parameter_region(return NULL ; } + +static bool is_memory_injection (u32 type,u64 param2) +{ +if (is_v2) +return type &BIT (1 ); +else if (param_extension || acpi5) +return (type &MEM_ERROR_MASK ) && param2; + +return false; +} +/* Execute instructions in trigger error action table */ static int __einj_error_trigger (u64 trigger_paddr,u32 type,u64 param1,u64 param2)@@ -480,7 +491,7 @@ static int __einj_error_trigger(u64 trigger_paddr, u32 type,* This will cause resource conflict with regular memory. So * remove it from trigger table resources. */ -if ((param_extension || acpi5) && (type &MEM_ERROR_MASK ) && param2) { +if (is_memory_injection (type, param2)) {struct apei_resources addr_resources;apei_resources_init (&addr_resources); --2.53.0