Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755266AbdCGLiB (ORCPT ); Tue, 7 Mar 2017 06:38:01 -0500 Received: from foss.arm.com ([217.140.101.70]:46322 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754860AbdCGLhy (ORCPT ); Tue, 7 Mar 2017 06:37:54 -0500 Message-ID: <58BE9B7E.4070904@arm.com> Date: Tue, 07 Mar 2017 11:37:34 +0000 From: James Morse User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.6.0 MIME-Version: 1.0 To: Tyler Baicar CC: christoffer.dall@linaro.org, marc.zyngier@arm.com, pbonzini@redhat.com, rkrcmar@redhat.com, linux@armlinux.org.uk, catalin.marinas@arm.com, will.deacon@arm.com, rjw@rjwysocki.net, lenb@kernel.org, matt@codeblueprint.co.uk, robert.moore@intel.com, lv.zheng@intel.com, nkaje@codeaurora.org, zjzhang@codeaurora.org, mark.rutland@arm.com, akpm@linux-foundation.org, eun.taik.lee@samsung.com, sandeepa.s.prabhu@gmail.com, labbott@redhat.com, shijie.huang@arm.com, rruigrok@codeaurora.org, paul.gortmaker@windriver.com, tn@semihalf.com, fu.wei@linaro.org, rostedt@goodmis.org, bristot@redhat.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-efi@vger.kernel.org, devel@acpica.org, Suzuki.Poulose@arm.com, punit.agrawal@arm.com, astone@redhat.com, harba@codeaurora.org, hanjun.guo@linaro.org, john.garry@huawei.com, shiju.jose@huawei.com, joe@perches.com Subject: Re: [PATCH V12 05/10] acpi: apei: handle SEA notification type for ARMv8 References: <1488833103-21082-1-git-send-email-tbaicar@codeaurora.org> <1488833103-21082-6-git-send-email-tbaicar@codeaurora.org> In-Reply-To: <1488833103-21082-6-git-send-email-tbaicar@codeaurora.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3138 Lines: 91 Hi Tyler, On 06/03/17 20:44, Tyler Baicar wrote: > ARM APEI extension proposal added SEA (Synchronous External Abort) > notification type for ARMv8. > Add a new GHES error source handling function for SEA. If an error > source's notification type is SEA, then this function can be registered > into the SEA exception handler. That way GHES will parse and report > SEA exceptions when they occur. > An SEA can interrupt code that had interrupts masked and is treated as > an NMI. To aid this the page of address space for mapping APEI buffers > while in_nmi() is always reserved, and ghes_ioremap_pfn_nmi() is > changed to use the helper methods to find the prot_t to map with in > the same way as ghes_ioremap_pfn_irq(). > diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c > index d178dc0..b2d57fc 100644 > --- a/arch/arm64/mm/fault.c > +++ b/arch/arm64/mm/fault.c > @@ -41,6 +41,8 @@ > #include > #include > > +#include > + > static const char *fault_name(unsigned int esr); > > #ifdef CONFIG_KPROBES > @@ -498,6 +500,17 @@ static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs) > pr_err("Synchronous External Abort: %s (0x%08x) at 0x%016lx\n", > fault_name(esr), esr, addr); > > + /* > + * Synchronous aborts may interrupt code which had interrupts masked. > + * Before calling out into the wider kernel tell the interested > + * subsystems. > + */ > + if (IS_ENABLED(ACPI_APEI_SEA)) { IS_ENABLED() needs the CONFIG_ version of the symbols, otherwise this doesn't get built. (I guess the testing from the previous always-enabled version is still valid) > + nmi_enter(); > + ghes_notify_sea(); > + nmi_exit(); > + } > + > info.si_signo = SIGBUS; > info.si_errno = 0; > info.si_code = 0; > diff --git a/drivers/acpi/apei/Kconfig b/drivers/acpi/apei/Kconfig > index b0140c8..c545dd1 100644 > --- a/drivers/acpi/apei/Kconfig > +++ b/drivers/acpi/apei/Kconfig > @@ -39,6 +39,21 @@ config ACPI_APEI_PCIEAER > PCIe AER errors may be reported via APEI firmware first mode. > Turn on this option to enable the corresponding support. > > +config ACPI_APEI_SEA > + bool "APEI Synchronous External Abort logging/recovering support" > + depends on ARM64 && ACPI_APEI && ACPI_APEI_GHES Nit: ACPI_APEI_GHES already depends on ACPI_APEI > + default y > + help > + This option should be enabled if the system supports > + firmware first handling of SEA (Synchronous External Abort). > + SEA happens with certain faults of data abort or instruction > + abort synchronous exceptions on ARMv8 systems. If a system > + supports firmware first handling of SEA, the platform analyzes > + and handles hardware error notifications from SEA, and it may then > + form a HW error record for the OS to parse and handle. This > + option allows the OS to look for such hardware error record, and > + take appropriate action. > + > config ACPI_APEI_MEMORY_FAILURE > bool "APEI memory error recovering support" > depends on ACPI_APEI && MEMORY_FAILURE Reviewed-by: James Morse Thanks, James