Re: [PATCH] ACPI: APEI: EINJ: Fix EINJv2 memory injection

From: Rafael J. Wysocki

Date: Wed Apr 15 2026 - 13:24:42 EST


On Wed, Apr 15, 2026 at 6:36 PM Tony Luck <tony.luck@xxxxxxxxx> wrote:
>
> 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 <herman.li@xxxxxxxxx>
> Signed-off-by: Tony Luck <tony.luck@xxxxxxxxx>

Can you please provide a Fixes: tag for this?

> ---
> drivers/acpi/apei/einj-core.c | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/apei/einj-core.c b/drivers/acpi/apei/einj-core.c
> index a9248af078f6..ba0ce71b7adb 100644
> --- a/drivers/acpi/apei/einj-core.c
> +++ b/drivers/acpi/apei/einj-core.c
> @@ -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
>
>