提交 ee49089d 编写于 作者: C Chen Gong 提交者: Len Brown

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: NTony Luck <tony.luck@lintel.com>
Signed-off-by: NChen Gong <gong.chen@linux.intel.com>
Signed-off-by: NLen Brown <len.brown@intel.com>
上级 185210cc
...@@ -74,6 +74,8 @@ struct vendor_error_type_extension { ...@@ -74,6 +74,8 @@ struct vendor_error_type_extension {
u8 reserved[3]; u8 reserved[3];
}; };
static u32 notrigger;
static u32 vendor_flags; static u32 vendor_flags;
static struct debugfs_blob_wrapper vendor_blob; static struct debugfs_blob_wrapper vendor_blob;
static char vendor_dev[64]; static char vendor_dev[64];
...@@ -496,9 +498,11 @@ static int __einj_error_inject(u32 type, u64 param1, u64 param2) ...@@ -496,9 +498,11 @@ static int __einj_error_inject(u32 type, u64 param1, u64 param2)
if (rc) if (rc)
return rc; return rc;
trigger_paddr = apei_exec_ctx_get_output(&ctx); trigger_paddr = apei_exec_ctx_get_output(&ctx);
rc = __einj_error_trigger(trigger_paddr, type, param1, param2); if (notrigger == 0) {
if (rc) rc = __einj_error_trigger(trigger_paddr, type, param1, param2);
return rc; if (rc)
return rc;
}
rc = apei_exec_run_optional(&ctx, ACPI_EINJ_END_OPERATION); rc = apei_exec_run_optional(&ctx, ACPI_EINJ_END_OPERATION);
return rc; return rc;
...@@ -700,6 +704,11 @@ static int __init einj_init(void) ...@@ -700,6 +704,11 @@ static int __init einj_init(void)
einj_debug_dir, &error_param2); einj_debug_dir, &error_param2);
if (!fentry) if (!fentry)
goto err_unmap; goto err_unmap;
fentry = debugfs_create_x32("notrigger", S_IRUSR | S_IWUSR,
einj_debug_dir, &notrigger);
if (!fentry)
goto err_unmap;
} }
if (vendor_dev[0]) { if (vendor_dev[0]) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册