Thread (10 messages) 10 messages, 4 authors, 2014-03-31
STALE4478d

[PATCH 5/5] arm: Enable IRQs before attempting to read user space in __und_usr

From: Alexey Ignatov <hidden>
Date: 2013-11-22 09:47:09

On 10:29 Thu 21 Nov     , Russell King - ARM Linux wrote:
On Thu, Nov 21, 2013 at 09:35:34AM +0000, Alexey Ignatov wrote:
quoted
Catalin Marinas <catalin.marinas <at> arm.com> writes:
quoted
The Undef abort handler in the kernel reads the undefined instruction
from user space. If the page table was modified from another CPU, the
user access could fail and do_page_fault() will be executed with
interrupts disabled. This can potentially deadlock on ARM11MPCore or on
Cortex-A15 with erratum 798181 workaround enabled (both implying IPI for
TLB maintenance with page table lock held).

This patch enables the IRQs in __und_usr before attempting to read the
instruction from user space.
This patch moves enable_irq call from do_fpe directly to __und_usr handler,
but __und_svc handler also calls do_fpe (via call_fpe), so now this codepath
runs with disabled irqs. This behavior change doesn't look good for me.
However, you're not executing FPA instructions in the kernel as a general
rule, so it doesn't matter.
Theoretically, ok.

It seems that we cought this deadlock on Cortex-A15 and this patch fixes things
(testing in progress). Is there any plans to mainline?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help