[lkml]   [2010]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [patch 071/149] ARM: 6166/1: Proper prefetch abort handling on pre-ARMv6
On Thu, Jul 01, 2010 at 11:48:37PM +0100, Russell King wrote:
> On Fri, Jul 02, 2010 at 01:25:41AM +0300, Kirill A. Shutemov wrote:
> > On Thu, Jul 01, 2010 at 03:17:28PM -0700, Greg KH wrote:
> > > We (well, I) like to keep the commit log identical to what is upstream
> > > just to make things easier all around. Otherwise people start asking
> > > for spelling fixes, clarifications, and all sorts of other stuff (like
> > > this.)
> >
> > Ok, fair enough.
> >
> > I asked for it because I was confused by this commit message while
> > investigate (the same) problem on ARMv7 CPU.
> You shouldn't get anywhere near this on ARMv7, because we know the cause
> of the prefetch abort on those CPUs.
> On pre-ARMv6 CPUs, we always treat all prefetch aborts as a translation
> faults. The problem which this commit addresses occurs when userspace
> tries to execute code above TASK_SIZE - we're sent into a loop of prefetch
> aborts (because we are unable to determine that it is a permission fault.)
> ARMv6 and ARMv7 CPUs have an instruction fault status register, which
> tells us why the abort happened. On these CPUs, permission faults go
> nowhere near the translation fault handler.

I know it. I was involved in writing this code.

> One possibility is that for some reason you're using the legacy prefetch
> abort code or pre-IFSR code, which will always tell the kernel that its
> a translation fault - and in this case, this patch would improve the
> situation. What kernel version are you using?


> The commit message is accurate for the kernel version to which it was
> originally applied.

Simple testcase:

#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

int main(int argc, char **argv)
int fd;
void (*p)(void);

fd = open("/dev/urandom", O_RDONLY);
read(0, &p, sizeof(p));
printf("p: %p\n", p);
return 0;

If you run this test in loop on kernel without the patch you'll finally
get hung instead SIGSEGV.

It seems the patch fixes more than it was written for. :)

Kirill A. Shutemov

 \ /
  Last update: 2010-07-02 01:01    [W:0.416 / U:1.144 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site