mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Xie XiuQi <xiexiuqi@huawei.com>
To: <catalin.marinas@arm.com>, <will.deacon@arm.com>,
	<mingo@redhat.com>, <mark.rutland@arm.com>,
	<ard.biesheuvel@linaro.org>, <james.morse@arm.com>,
	<Dave.Martin@arm.com>, <takahiro.akashi@linaro.org>,
	<tbaicar@codeaurora.org>, <stephen.boyd@linaro.org>, <bp@suse.de>,
	<julien.thierry@arm.com>, <shiju.jose@huawei.com>,
	<zjzhang@codeaurora.org>
Cc: <linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <linux-acpi@vger.kernel.org>,
	<xiexiuqi@huawei.com>, <wangxiongfeng2@huawei.com>,
	<zhengqiang10@huawei.com>, <gengdongjiu@huawei.com>,
	<huawei.libin@huawei.com>, <wangkefeng.wang@huawei.com>,
	<lijinyue@huawei.com>, <guohanjun@huawei.com>,
	<hanjun.guo@linaro.org>, <cj.chengjian@huawei.com>
Subject: [PATCH v4 4/4] arm64/ras: save error address from memory section for recovery
Date: Wed, 27 Sep 2017 20:50:20 +0800	[thread overview]
Message-ID: <1506516620-20033-5-git-send-email-xiexiuqi@huawei.com> (raw)
In-Reply-To: <1506516620-20033-1-git-send-email-xiexiuqi@huawei.com>

In some platform, when SEA triggerred, physical address might be
reported by memory section, so we save it for error recovery later.

Signed-off-by: Xie XiuQi <xiexiuqi@huawei.com>
---
 arch/arm64/kernel/ras.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/arch/arm64/kernel/ras.c b/arch/arm64/kernel/ras.c
index c48503c..ff24181 100644
--- a/arch/arm64/kernel/ras.c
+++ b/arch/arm64/kernel/ras.c
@@ -140,3 +140,34 @@ void ghes_arm_process_error(struct ghes *ghes, struct cper_sec_proc_arm *err)
 	if (info_saved)
 		set_thread_flag(TIF_SEA_NOTIFY);
 }
+
+int ghes_mem_err_callback(struct notifier_block *nb, unsigned long val, void *data)
+{
+	bool info_saved = false;
+	struct ghes_mem_err *ghes_mem = (struct ghes_mem_err *)data;
+	struct cper_sec_mem_err *mem_err = ghes_mem->mem_err;
+
+	if ((ghes_mem->notify_type != ACPI_HEST_NOTIFY_SEA) ||
+	    (ghes_mem->severity != CPER_SEV_RECOVERABLE))
+		return 0;
+
+	if (mem_err->validation_bits & CPER_MEM_VALID_PA)
+		info_saved = sea_save_info(mem_err->physical_addr);
+
+	if (info_saved)
+		set_thread_flag(TIF_SEA_NOTIFY);
+
+	return 0;
+}
+
+static struct notifier_block ghes_mem_err_nb = {
+	.notifier_call	= ghes_mem_err_callback,
+};
+
+static int arm64_err_recov_init(void)
+{
+	atomic_notifier_chain_register(&ghes_mem_err_chain, &ghes_mem_err_nb);
+	return 0;
+}
+
+late_initcall(arm64_err_recov_init);
-- 
1.8.3.1

  parent reply	other threads:[~2017-09-27 12:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-27 12:50 [PATCH v4 0/4] arm64/ras: support sea error recovery Xie XiuQi
2017-09-27 12:50 ` [PATCH v4 1/4] ACPI, CPER: add arm error info type definition Xie XiuQi
2017-09-27 12:50 ` [PATCH v4 2/4] arm64/ras: support sea error recovery Xie XiuQi
2017-09-27 12:50 ` [PATCH v4 3/4] GHES: add a notify chain for process memory section Xie XiuQi
2017-09-27 12:50 ` Xie XiuQi [this message]
2018-01-25 17:11 ` [PATCH v4 0/4] arm64/ras: support sea error recovery Tyler Baicar
2018-01-26  2:09   ` Xie XiuQi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1506516620-20033-5-git-send-email-xiexiuqi@huawei.com \
    --to=xiexiuqi@huawei.com \
    --cc=Dave.Martin@arm.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=bp@suse.de \
    --cc=catalin.marinas@arm.com \
    --cc=cj.chengjian@huawei.com \
    --cc=gengdongjiu@huawei.com \
    --cc=guohanjun@huawei.com \
    --cc=hanjun.guo@linaro.org \
    --cc=huawei.libin@huawei.com \
    --cc=james.morse@arm.com \
    --cc=julien.thierry@arm.com \
    --cc=lijinyue@huawei.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=shiju.jose@huawei.com \
    --cc=stephen.boyd@linaro.org \
    --cc=takahiro.akashi@linaro.org \
    --cc=tbaicar@codeaurora.org \
    --cc=wangkefeng.wang@huawei.com \
    --cc=wangxiongfeng2@huawei.com \
    --cc=will.deacon@arm.com \
    --cc=zhengqiang10@huawei.com \
    --cc=zjzhang@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®