Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1637683
| Path | csiph.com!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | "Baicar, Tyler" <tbaicar@codeaurora.org> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH V15 06/11] acpi: apei: handle SEA notification type for ARMv8 |
| Date | Mon, 08 May 2017 22:00:01 +0200 |
| Message-ID | <tEWZ3-8eF-9@gated-at.bofh.it> (permalink) |
| References | <txKpX-3KK-7@gated-at.bofh.it> <txKpY-3KK-39@gated-at.bofh.it> <tEUNA-6V3-25@gated-at.bofh.it> |
| X-Original-To | James Morse <james.morse@arm.com> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1494273583; bh=jitJmnYECTp6HV+5ozEWUrYBXXGtYuaiuJFCMUg9iuo=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=KpH5FcQQ16rCPSLmSVjbBkpynaKIe1aaauB9wFzER/KO0BM6o1ZKeF5XhabN7/6An CYXfrpFaomOuYcf6ARKAAMPc99kLYFl7GXmUu+vg0rb+YoCaTinUtNriKXguF2rIgS Ux5DqoECXlwJlczkXgsndpYaNmPFtFquEvmS9d2k= |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1494273581; bh=jitJmnYECTp6HV+5ozEWUrYBXXGtYuaiuJFCMUg9iuo=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=dbLmORW62rDVFPA5vaB5LQbDkeDITszAocl64k+UWC6AyqoJAgcTcNO49bIDcdwQJ uYjAHkBhHbVYvXPe3tPSoRtslVR5IE8GZNcGcVTAqYYr9OVbcQXjBiEm9NCcBkPClf +6a0ODuy3XWjxvADyTwVkQJUgZMaI3ub3ox/Z4wU= |
| Dmarc-Filter | OpenDMARC Filter v1.3.2 smtp.codeaurora.org 5ECB56028F |
| Authentication-Results | pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org |
| Authentication-Results | pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=tbaicar@codeaurora.org |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=windows-1252; format=flowed |
| Content-Transfer-Encoding | 7bit |
| Content-Language | en-US |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 69 |
| Organization | linux.* mail to news gateway |
| X-Original-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, bp@alien8.de, rafael@kernel.org, tony.luck@intel.com, gengdongjiu@huawei.com, xiexiuqi@huawei.com |
| X-Original-Date | Mon, 8 May 2017 13:59:37 -0600 |
| X-Original-Message-ID | <9e26f779-5eae-2558-6045-10c1afde9bf2@codeaurora.org> |
| X-Original-References | <1492556723-9189-1-git-send-email-tbaicar@codeaurora.org> <1492556723-9189-7-git-send-email-tbaicar@codeaurora.org> <5910AAB8.8070703@arm.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1637683 |
Show key headers only | View raw
On 5/8/2017 11:28 AM, James Morse wrote:
> Hi Tyler,
>
> On 19/04/17 00:05, 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 b74d8b7..10013ff 100644
>> --- a/arch/arm64/mm/fault.c
>> +++ b/arch/arm64/mm/fault.c
>> @@ -518,6 +520,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",
>> inf->name, 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(CONFIG_ACPI_APEI_SEA)) {
>> + nmi_enter();
>> + ghes_notify_sea();
>> + nmi_exit();
>> + }
>> +
>> info.si_signo = SIGBUS;
>> info.si_errno = 0;
>> info.si_code = 0;
>
> I was tidying up the masking/unmasking in entry.S, something I wasn't aware of
> that leads to a bug:
> entry.S will unmask interrupts for instruction/data aborts that came from a
> context with interrupts enabled. This makes sense for get_user() and friends...
> For do_sea() we pull nmi_enter() as this can interrupt interrupts-masked code,
> such as APEI, but if we end up in here with interrupts unmasked we can take an
> IRQ from this 'NMI' context, which will inherit the in_nmi() and could lead to
> the deadlock we were originally trying to avoid.
>
> Teaching entry.S to spot external aborts is messy. I think the two choices are
> to either mask interrupts when calling nmi_enter() (as these things should be
> mutually exclusive), or to conditionally call nmi_enter() based on
> interrupts_enabled(regs). I prefer the second one as it matches the notify_sea()
> while interruptible that happens when KVM takes one of these.
Hello James,
So it would need to be like this?
if(interrupts_enabled(regs))
nmi_enter();
ghes_notify_sea();
if(interrupts_enabled(regs))
nmi_exit();
Thanks,
Tyler
--
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH V15 06/11] acpi: apei: handle SEA notification type for ARMv8 James Morse <james.morse@arm.com> - 2017-05-08 19:40 +0200 Re: [PATCH V15 06/11] acpi: apei: handle SEA notification type for ARMv8 "Baicar, Tyler" <tbaicar@codeaurora.org> - 2017-05-08 22:00 +0200
csiph-web