Re: [PATCH 1/2] ARM: Pass IFSR register to do_PrefetchAbort()

From: Kirill A. Shutemov
Date: Sun Sep 20 2009 - 05:35:31 EST


On Sun, Sep 20, 2009 at 11:15 AM, Russell King - ARM Linux
<linux@xxxxxxxxxxxxxxxx> wrote:
> On Sat, Sep 19, 2009 at 12:03:16PM +0100, Russell King - ARM Linux wrote:
>> On Fri, Sep 18, 2009 at 11:55:42PM +0300, Kirill A. Shutemov wrote:
>> > It needed for proper prefetch abort handling on ARMv7.
>>
>> I think the only thing which is missing is an explaination about why
>> this is desirable given that only later CPUs can give this additional
>> information.
>
> So you've posted it to the patch system, without further discussion here.
>
> I think the solution is wrong - it makes instruction permission faults
> unnecessarily noisy, which is not what the decoding table is supposed
> to be doing. ÂThe decoding table's bad entries are there to catch those
> _unexpected_ cases.
>
> Instead, I suggest that you have a look at this:
>
> Â Â Â Âif (fsr & (1 << 11)) /* write? */
> Â Â Â Â Â Â Â Âmask = VM_WRITE;
> Â Â Â Âelse
> Â Â Â Â Â Â Â Âmask = VM_READ|VM_EXEC|VM_WRITE;
>
> Â Â Â Âfault = VM_FAULT_BADACCESS;
> Â Â Â Âif (!(vma->vm_flags & mask))
> Â Â Â Â Â Â Â Âgoto out;
>
> in __do_page_fault - if we are handling a prefetch abort, we really only
> want to check that the VMA has VM_EXEC permission, not that it can be
> read and written as well.
>

Ok, so __do_page_fault() should know where we are: in data abort or in
prefetch abort. What is right way to do it? Should we create one more
argument or use one of reserved bits IFSR?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/