* [PATCH] ACPI: APEI: EINJ: Fix EINJv2 memory injection
@ 2026-04-15 16:36 Tony Luck
2026-04-15 17:05 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: Tony Luck @ 2026-04-15 16:36 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Herman Li, Zaid Alali, Jiaqi Yan, linux-acpi, linux-kernel,
patches, 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.
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@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ACPI: APEI: EINJ: Fix EINJv2 memory injection
2026-04-15 16:36 [PATCH] ACPI: APEI: EINJ: Fix EINJv2 memory injection Tony Luck
@ 2026-04-15 17:05 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2026-04-15 17:05 UTC (permalink / raw)
To: Tony Luck
Cc: Rafael J. Wysocki, Herman Li, Zaid Alali, Jiaqi Yan, linux-acpi,
linux-kernel, patches
On Wed, Apr 15, 2026 at 6:36 PM Tony Luck <tony.luck@intel.com> 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@intel.com>
> Signed-off-by: Tony Luck <tony.luck@intel.com>
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
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-04-15 17:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-15 16:36 [PATCH] ACPI: APEI: EINJ: Fix EINJv2 memory injection Tony Luck
2026-04-15 17:05 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox