lkml.org 
[lkml]   [2011]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] ARM: vfp: Fix up exception location in Thumb mode
From
On 15 January 2011 15:40, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Sat, Jan 15, 2011 at 03:31:04PM +0000, Catalin Marinas wrote:
>> On 14 January 2011 17:30, Russell King - ARM Linux
>> <linux@arm.linux.org.uk> wrote:
>> > +@  r9  = normal "successful" return address
>> >  @  r10 = vfp_state union
>> >  @  r11 = CPU number
>> > -@  lr  = failure return
>> > -
>> > +@  lr  = unrecognised instruction return address
>> > +@  IRQs enabled.
>> >  ENTRY(vfp_support_entry)
>> >        DBGSTR3 "instr %08x pc %08x state %p", r0, r2, r10
>> >
>> > @@ -138,9 +138,12 @@ check_for_exception:
>> >                                        @ exception before retrying branch
>> >                                        @ out before setting an FPEXC that
>> >                                        @ stops us reading stuff
>> > -       VFPFMXR FPEXC, r1               @ restore FPEXC last
>> > -       sub     r2, r2, #4
>> > -       str     r2, [sp, #S_PC]         @ retry the instruction
>> > +       VFPFMXR FPEXC, r1               @ Restore FPEXC last
>> > +       sub     r2, r2, #4              @ Retry current instruction - if Thumb
>> > +       str     r2, [sp, #S_PC]         @ mode it's two 16-bit instructions,
>> > +                                       @ else it's one 32-bit instruction, so
>> > +                                       @ always subtract 4 from the following
>> > +                                       @ instruction address.
>>
>> I would say it's always a 32-bit instruction but made up of two 16-bit
>> values to allow half-word alignment.
>
> Do you have a suggested replacement text?

Maybe something like: Retry the current VFP instruction (32-bit in
both ARM and Thumb modes).

(I was wondering whether we can get on the above code path with
asynchronous VFP exceptions where the interrupted instruction may not
be the VFP one. But I think all Thumb-2 processors these days generate
synchronous exceptions)

--
Catalin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-01-16 22:27    [W:0.097 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site