Skip to contentSkip to conversation

ACPI, APEI, EINJ, new parameter to control trigger action

PATCH Superseded Chen Gong 1 participant 1 message Feb 16, 2012

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Chen Gong

author
#0 lore raw

PATCH 1/1 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 open this switch.

---
 drivers/acpi/apei/einj.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)
drivers/acpi/apei/einj.c +11 -3
index 4ca087d..4a3ebb5 100644
@@ -74,6 +74,8 @@ struct vendor_error_type_extension {
 	u8	reserved[3];
 };
 
+static u32 notrigger;
+
 static u32 vendor_flags;
 static struct debugfs_blob_wrapper vendor_blob;
 static char vendor_dev[64];
@@ -496,9 +498,11 @@ static int __einj_error_inject(u32 type, u64 param1, u64 param2)
 	if (rc)
 		return rc;
 	trigger_paddr = apei_exec_ctx_get_output(&ctx);
-	rc = __einj_error_trigger(trigger_paddr, type, param1, param2);
-	if (rc)
-		return rc;
+	if (notrigger == 0) {
+		rc = __einj_error_trigger(trigger_paddr, type, param1, param2);
+		if (rc)
+			return rc;
+	}
 	rc = apei_exec_run_optional(&ctx, ACPI_EINJ_END_OPERATION);
 
 	return rc;
@@ -677,6 +681,10 @@ static int __init einj_init(void)
 				     einj_debug_dir, NULL, &error_inject_fops);
 	if (!fentry)
 		goto err_cleanup;
+	fentry = debugfs_create_x32("notrigger", S_IRUSR | S_IWUSR,
+				    einj_debug_dir, &notrigger);
+	if (!fentry)
+		goto err_cleanup;
 
 	apei_resources_init(&einj_resources);
 	einj_exec_ctx_init(&ctx);
Signature · 1 line
1.7.8.2.302.g17b4e