Skip to content

Commit ee49089

Browse files
Chen Gonglenb
authored andcommitted
ACPI, APEI, EINJ, new parameter to control trigger action
Some APEI firmware implementation will access injected address specified in param1 to trigger the error when injecting memory error, which means if one SRAR error is injected, the crash always happens because it is executed in kernel context. This new parameter can disable trigger action and control is taken over by the user. In this way, an SRAR error can happen in user context instead of crashing the system. This function is highly depended on BIOS implementation so please ensure you know the BIOS trigger procedure before you enable this switch. v2: notrigger should be created together with param1/param2 Tested-by: Tony Luck <tony.luck@lintel.com> Signed-off-by: Chen Gong <gong.chen@linux.intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
1 parent 185210c commit ee49089

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

‎drivers/acpi/apei/einj.c‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ struct vendor_error_type_extension {
7474
u8 reserved[3];
7575
};
7676

77+
static u32 notrigger;
78+
7779
static u32 vendor_flags;
7880
static struct debugfs_blob_wrapper vendor_blob;
7981
static char vendor_dev[64];
@@ -496,9 +498,11 @@ static int __einj_error_inject(u32 type, u64 param1, u64 param2)
496498
if (rc)
497499
return rc;
498500
trigger_paddr = apei_exec_ctx_get_output(&ctx);
499-
rc = __einj_error_trigger(trigger_paddr, type, param1, param2);
500-
if (rc)
501-
return rc;
501+
if (notrigger == 0) {
502+
rc = __einj_error_trigger(trigger_paddr, type, param1, param2);
503+
if (rc)
504+
return rc;
505+
}
502506
rc = apei_exec_run_optional(&ctx, ACPI_EINJ_END_OPERATION);
503507

504508
return rc;
@@ -700,6 +704,11 @@ static int __init einj_init(void)
700704
einj_debug_dir, &error_param2);
701705
if (!fentry)
702706
goto err_unmap;
707+
708+
fentry = debugfs_create_x32("notrigger", S_IRUSR | S_IWUSR,
709+
einj_debug_dir, &notrigger);
710+
if (!fentry)
711+
goto err_unmap;
703712
}
704713

705714
if (vendor_dev[0]) {

0 commit comments

Comments
 (0)