From: Dongjiu Geng <gengdongjiu@huawei.com>
To: <rkrcmar@redhat.com>, <corbet@lwn.net>,
<christoffer.dall@linaro.org>, <marc.zyngier@arm.com>,
<james.morse@arm.com>, <linux@armlinux.org.uk>,
<catalin.marinas@arm.com>, <rjw@rjwysocki.net>, <bp@alien8.de>,
<lenb@kernel.org>, <kvm@vger.kernel.org>,
<linux-doc@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<kvmarm@lists.cs.columbia.edu>, <linux-acpi@vger.kernel.org>,
<devel@acpica.org>
Cc: <gengdongjiu@huawei.com>, <huangshaoyu@huawei.com>
Subject: [PATCH v10 5/5] arm64: handle NOTIFY_SEI notification by the APEI driver
Date: Sun, 4 Mar 2018 00:09:40 +0800 [thread overview]
Message-ID: <1520093380-42577-6-git-send-email-gengdongjiu@huawei.com> (raw)
In-Reply-To: <1520093380-42577-1-git-send-email-gengdongjiu@huawei.com>
Add a helper to handle the NOTIFY_SEI notification, when kernel
gets the NOTIFY_SEI notification, call this helper and let APEI
driver to handle this notification.
Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
---
arch/arm64/include/asm/system_misc.h | 1 +
arch/arm64/kernel/traps.c | 4 ++++
arch/arm64/mm/fault.c | 10 ++++++++++
3 files changed, 15 insertions(+)
diff --git a/arch/arm64/include/asm/system_misc.h b/arch/arm64/include/asm/system_misc.h
index 07aa8e3..9ee13ad 100644
--- a/arch/arm64/include/asm/system_misc.h
+++ b/arch/arm64/include/asm/system_misc.h
@@ -57,6 +57,7 @@ void hook_debug_fault_code(int nr, int (*fn)(unsigned long, unsigned int,
})
int handle_guest_sea(phys_addr_t addr, unsigned int esr);
+int handle_guest_sei(void);
#endif /* __ASSEMBLY__ */
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index e88096a..6cb280f 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -681,6 +681,10 @@ bool arm64_is_fatal_ras_serror(struct pt_regs *regs, unsigned int esr)
{
u32 aet = arm64_ras_serror_get_severity(esr);
+ /* The APEI driver may handle this RAS error. */
+ if (!handle_guest_sei())
+ return false;
+
switch (aet) {
case ESR_ELx_AET_CE: /* corrected error */
case ESR_ELx_AET_UEO: /* restartable, not yet consumed */
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index f76bb2c..8f29bd8 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -683,6 +683,16 @@ int handle_guest_sea(phys_addr_t addr, unsigned int esr)
return ret;
}
+int handle_guest_sei(void)
+{
+ int ret = -ENOENT;
+
+ if (IS_ENABLED(CONFIG_ACPI_APEI_SEI))
+ ret = ghes_notify_sei();
+
+ return ret;
+}
+
asmlinkage void __exception do_mem_abort(unsigned long addr, unsigned int esr,
struct pt_regs *regs)
{
--
1.9.1
prev parent reply other threads:[~2018-03-03 8:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-03 16:09 [PATCH v10 0/5] set VSESR_EL2 by user space and support NOTIFY_SEI notification Dongjiu Geng
2018-03-03 16:09 ` [PATCH v10 1/5] arm64: KVM: Prepare set virtual SEI syndrome value Dongjiu Geng
2018-03-15 20:37 ` James Morse
2018-03-16 7:58 ` gengdongjiu
2018-03-03 16:09 ` [PATCH v10 2/5] arm64: KVM: export the capability to set guest SError syndrome Dongjiu Geng
2018-03-15 20:39 ` James Morse
2018-03-03 16:09 ` [PATCH v10 3/5] arm/arm64: KVM: Introduce set and get per-vcpu event Dongjiu Geng
2018-03-15 20:38 ` James Morse
2018-03-03 16:09 ` [PATCH v10 4/5] ACPI / APEI: Add SEI notification type support for ARMv8 Dongjiu Geng
2018-03-03 16:09 ` Dongjiu Geng [this message]
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=1520093380-42577-6-git-send-email-gengdongjiu@huawei.com \
--to=gengdongjiu@huawei.com \
--cc=bp@alien8.de \
--cc=catalin.marinas@arm.com \
--cc=christoffer.dall@linaro.org \
--cc=corbet@lwn.net \
--cc=devel@acpica.org \
--cc=huangshaoyu@huawei.com \
--cc=james.morse@arm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=marc.zyngier@arm.com \
--cc=rjw@rjwysocki.net \
--cc=rkrcmar@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).