* [v2 PATCH 1/2] ACPI, APEI, EINJ, new parameter to control trigger action
@ 2012-02-17 7:11 Chen Gong
2012-02-19 16:21 ` Jiang Liu
0 siblings, 1 reply; 9+ messages in thread
From: Chen Gong @ 2012-02-17 7:11 UTC (permalink / raw)
To: tony.luck, ying.huang, lenb; +Cc: linux-acpi, Chen Gong
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>
---
drivers/acpi/apei/einj.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c
index 4ca087d..afc380c 100644
--- a/drivers/acpi/apei/einj.c
+++ b/drivers/acpi/apei/einj.c
@@ -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;
@@ -700,6 +704,11 @@ static int __init einj_init(void)
einj_debug_dir, &error_param2);
if (!fentry)
goto err_unmap;
+
+ fentry = debugfs_create_x32("notrigger", S_IRUSR | S_IWUSR,
+ einj_debug_dir, ¬rigger);
+ if (!fentry)
+ goto err_unmap;
}
if (vendor_dev[0]) {
--
1.7.8.2.302.g17b4e
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [v2 PATCH 1/2] ACPI, APEI, EINJ, new parameter to control trigger action
2012-02-17 7:11 [v2 PATCH 1/2] ACPI, APEI, EINJ, new parameter to control trigger action Chen Gong
@ 2012-02-19 16:21 ` Jiang Liu
2012-02-20 2:02 ` Chen Gong
2012-02-21 17:56 ` Luck, Tony
0 siblings, 2 replies; 9+ messages in thread
From: Jiang Liu @ 2012-02-19 16:21 UTC (permalink / raw)
To: Chen Gong; +Cc: tony.luck, ying.huang, lenb, linux-acpi
On 02/17/2012 03:11 PM, Chen Gong wrote:
> 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>
> ---
> drivers/acpi/apei/einj.c | 15 ++++++++++++---
> 1 files changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c
> index 4ca087d..afc380c 100644
> --- a/drivers/acpi/apei/einj.c
> +++ b/drivers/acpi/apei/einj.c
> @@ -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);
Suggest to reset the notrigger flag to default value (zero) after the injection
operation, so the test script doesn't need to explicitly set the notrigger flag
for each injection operation and it's backward compatible with existing scripts.
It would be better to reset the param2 too for the same reason.
>
> return rc;
> @@ -700,6 +704,11 @@ static int __init einj_init(void)
> einj_debug_dir, &error_param2);
> if (!fentry)
> goto err_unmap;
> +
> + fentry = debugfs_create_x32("notrigger", S_IRUSR | S_IWUSR,
> + einj_debug_dir, ¬rigger);
> + if (!fentry)
> + goto err_unmap;
> }
>
> if (vendor_dev[0]) {
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [v2 PATCH 1/2] ACPI, APEI, EINJ, new parameter to control trigger action
2012-02-19 16:21 ` Jiang Liu
@ 2012-02-20 2:02 ` Chen Gong
2012-02-21 17:56 ` Luck, Tony
1 sibling, 0 replies; 9+ messages in thread
From: Chen Gong @ 2012-02-20 2:02 UTC (permalink / raw)
To: Jiang Liu; +Cc: tony.luck, ying.huang, lenb, linux-acpi
于 2012/2/20 0:21, Jiang Liu 写道:
> On 02/17/2012 03:11 PM, Chen Gong wrote:
>> 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>
>> ---
>> drivers/acpi/apei/einj.c | 15 ++++++++++++---
>> 1 files changed, 12 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c
>> index 4ca087d..afc380c 100644
>> --- a/drivers/acpi/apei/einj.c
>> +++ b/drivers/acpi/apei/einj.c
>> @@ -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);
> Suggest to reset the notrigger flag to default value (zero) after the injection
> operation, so the test script doesn't need to explicitly set the notrigger flag
> for each injection operation and it's backward compatible with existing scripts.
> It would be better to reset the param2 too for the same reason.
>
I ever thought about this question, but it looks current implementation is
established by usage so I don't think it needs to be fixed, otherwise it has
strong requirement. As for the scripts, I assume you point to mce-test, I will
update them after this patch is merged into the kernel.
Thx for your comments.
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [v2 PATCH 1/2] ACPI, APEI, EINJ, new parameter to control trigger action
2012-02-19 16:21 ` Jiang Liu
2012-02-20 2:02 ` Chen Gong
@ 2012-02-21 17:56 ` Luck, Tony
1 sibling, 0 replies; 9+ messages in thread
From: Luck, Tony @ 2012-02-21 17:56 UTC (permalink / raw)
To: Jiang Liu, Chen Gong
Cc: Huang, Ying, lenb@kernel.org, linux-acpi@vger.kernel.org
> Suggest to reset the notrigger flag to default value (zero) after the injection
> operation, so the test script doesn't need to explicitly set the notrigger flag
> for each injection operation and it's backward compatible with existing scripts.
> It would be better to reset the param2 too for the same reason.
That might cause more confusion. We haven't documented the behavior of the
other files here after an error is injected ... but their actual behavior has
always been that values written are sticky. I.e. you can write a script to
inject three errors to the same page like this:
echo 0x8 > error_type
echo 0x12340000 > param1
echo 0xfffffffffffff000 > param2
echo 1 > error_inject
sleep 1
echo 1 > error_inject
sleep 1
echo 1 > error_inject
so I think that it might be surprising if "notrigger" was not sticky
like everything else.
-Tony
^ permalink raw reply [flat|nested] 9+ messages in thread
* resend these two patches about *notrigger* parameter
@ 2012-03-15 8:53 Chen Gong
2012-03-15 8:53 ` [v2 PATCH 1/2] ACPI, APEI, EINJ, new parameter to control trigger action Chen Gong
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Chen Gong @ 2012-03-15 8:53 UTC (permalink / raw)
To: tony.luck, ying.huang, lenb; +Cc: linux-acpi
[v2 PATCH 1/2] ACPI, APEI, EINJ, new parameter to
[v2 PATCH 2/2] Update documentation for parameter
Hi, Len
Would you please help to merge these 2 patches for APEI
enhancement? They have been posted about one month eariler.
It looks like no one has objection.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [v2 PATCH 1/2] ACPI, APEI, EINJ, new parameter to control trigger action
2012-03-15 8:53 resend these two patches about *notrigger* parameter Chen Gong
@ 2012-03-15 8:53 ` Chen Gong
2012-03-15 8:53 ` [v2 PATCH 2/2] Update documentation for parameter *notrigger* in einj.txt Chen Gong
2012-03-15 16:46 ` resend these two patches about *notrigger* parameter Luck, Tony
2 siblings, 0 replies; 9+ messages in thread
From: Chen Gong @ 2012-03-15 8:53 UTC (permalink / raw)
To: tony.luck, ying.huang, lenb; +Cc: linux-acpi, Chen Gong
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>
---
drivers/acpi/apei/einj.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c
index 3d3816f..8e17936 100644
--- a/drivers/acpi/apei/einj.c
+++ b/drivers/acpi/apei/einj.c
@@ -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;
@@ -700,6 +704,11 @@ static int __init einj_init(void)
einj_debug_dir, &error_param2);
if (!fentry)
goto err_unmap;
+
+ fentry = debugfs_create_x32("notrigger", S_IRUSR | S_IWUSR,
+ einj_debug_dir, ¬rigger);
+ if (!fentry)
+ goto err_unmap;
}
if (vendor_dev[0]) {
--
1.7.8.2.302.g17b4e
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [v2 PATCH 2/2] Update documentation for parameter *notrigger* in einj.txt
2012-03-15 8:53 resend these two patches about *notrigger* parameter Chen Gong
2012-03-15 8:53 ` [v2 PATCH 1/2] ACPI, APEI, EINJ, new parameter to control trigger action Chen Gong
@ 2012-03-15 8:53 ` Chen Gong
2012-03-15 16:46 ` resend these two patches about *notrigger* parameter Luck, Tony
2 siblings, 0 replies; 9+ messages in thread
From: Chen Gong @ 2012-03-15 8:53 UTC (permalink / raw)
To: tony.luck, ying.huang, lenb; +Cc: linux-acpi, Chen Gong
Add description of parameter notrigger in the einj.txt.
One can utilize this new parameter to do some SRAR injection
test. Pay attention, the operation is highly depended on the
BIOS implementation. If no proper BIOS supports it, even if
enabling this parameter, expected result will not happen.
v2:
Update the documentation suggested by Tony
Suggested-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
---
Documentation/acpi/apei/einj.txt | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/Documentation/acpi/apei/einj.txt b/Documentation/acpi/apei/einj.txt
index e7cc363..e20b6da 100644
--- a/Documentation/acpi/apei/einj.txt
+++ b/Documentation/acpi/apei/einj.txt
@@ -53,6 +53,14 @@ directory apei/einj. The following files are provided.
This file is used to set the second error parameter value. Effect of
parameter depends on error_type specified.
+- notrigger
+ The EINJ mechanism is a two step process. First inject the error, then
+ perform some actions to trigger it. Setting "notrigger" to 1 skips the
+ trigger phase, which *may* allow the user to cause the error in some other
+ context by a simple access to the cpu, memory location, or device that is
+ the target of the error injection. Whether this actually works depends
+ on what operations the BIOS actually includes in the trigger phase.
+
BIOS versions based in the ACPI 4.0 specification have limited options
to control where the errors are injected. Your BIOS may support an
extension (enabled with the param_extension=1 module parameter, or
--
1.7.8.2.302.g17b4e
^ permalink raw reply related [flat|nested] 9+ messages in thread
* RE: resend these two patches about *notrigger* parameter
2012-03-15 8:53 resend these two patches about *notrigger* parameter Chen Gong
2012-03-15 8:53 ` [v2 PATCH 1/2] ACPI, APEI, EINJ, new parameter to control trigger action Chen Gong
2012-03-15 8:53 ` [v2 PATCH 2/2] Update documentation for parameter *notrigger* in einj.txt Chen Gong
@ 2012-03-15 16:46 ` Luck, Tony
2012-03-16 5:48 ` Chen Gong
2 siblings, 1 reply; 9+ messages in thread
From: Luck, Tony @ 2012-03-15 16:46 UTC (permalink / raw)
To: lenb@kernel.org; +Cc: linux-acpi@vger.kernel.org, Chen Gong, Huang, Ying
> [v2 PATCH 1/2] ACPI, APEI, EINJ, new parameter to
> [v2 PATCH 2/2] Update documentation for parameter
>
> Hi, Len
>
> Would you please help to merge these 2 patches for APEI
> enhancement? They have been posted about one month eariler.
> It looks like no one has objection.
They are already "Tested-by" and "Suggested-by" me ... you can
add "Acked-by: Tony Luck <tony.luck@intel.com>" too if you like.
-Tony
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: resend these two patches about *notrigger* parameter
2012-03-15 16:46 ` resend these two patches about *notrigger* parameter Luck, Tony
@ 2012-03-16 5:48 ` Chen Gong
0 siblings, 0 replies; 9+ messages in thread
From: Chen Gong @ 2012-03-16 5:48 UTC (permalink / raw)
To: Luck, Tony; +Cc: lenb@kernel.org, linux-acpi@vger.kernel.org, Huang, Ying
于 3/16/2012 12:46 AM, Luck, Tony 写道:
>> [v2 PATCH 1/2] ACPI, APEI, EINJ, new parameter to
>> [v2 PATCH 2/2] Update documentation for parameter
>>
>> Hi, Len
>>
>> Would you please help to merge these 2 patches for APEI
>> enhancement? They have been posted about one month eariler.
>> It looks like no one has objection.
> They are already "Tested-by" and "Suggested-by" me ... you can
> add "Acked-by: Tony Luck<tony.luck@intel.com>" too if you like.
>
> -Tony
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
Thx Tony. I'd like to do that.
Len
If you have no objection, please help to add "Acked-by: Tony Luck
<tony.luck@intel.com>".
Thx a lot!
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2012-03-16 5:48 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-15 8:53 resend these two patches about *notrigger* parameter Chen Gong
2012-03-15 8:53 ` [v2 PATCH 1/2] ACPI, APEI, EINJ, new parameter to control trigger action Chen Gong
2012-03-15 8:53 ` [v2 PATCH 2/2] Update documentation for parameter *notrigger* in einj.txt Chen Gong
2012-03-15 16:46 ` resend these two patches about *notrigger* parameter Luck, Tony
2012-03-16 5:48 ` Chen Gong
-- strict thread matches above, loose matches on Subject: below --
2012-02-17 7:11 [v2 PATCH 1/2] ACPI, APEI, EINJ, new parameter to control trigger action Chen Gong
2012-02-19 16:21 ` Jiang Liu
2012-02-20 2:02 ` Chen Gong
2012-02-21 17:56 ` Luck, Tony
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).