Russell King - ARM Linux Admin wrote:

> The most important thing you can do is:
>
> 1. report the version of the kernel you're seeing this problem with
> 2. lookup the values of PC and LR in the System.map file corresponding
>    with the running kernel, and list the entries (2 or 3) around them.
> (this is to try to confirm whether the fault did actually happen in
> get_fiq_regs).
>
> Secondly, make sure that you're passing a valid kernel buffer in to
> get_fiq_regs().

I am using kernel version 2.2.14.
I know the precise instruction in 'get_fiq_regs' which generates the data
abort. I have described it below:

Here is what I get on the screen. I have added few printk statements to
fiq.c, which produce the
'Register after <....>' in the following display. I have addes these
statements after each assembly instruction
in 'get_fiq_regs' in fiq.c. From there I infered that the kernel crashes
when it tries to execute the instruction
'msr cpsr, %1'.
I have also added a 'struct pt_regs regs' to 'get_fiq_regs', in order to
produce this register dump using 'show_regs'.
'tmp' and 'tmp2' are the variables you see in 'get_fiq_regs'.

The questions I have are as follows:

1) Why is it showing Mode USER_26 instead of SVC_32 or USER_32? Who does set
it to USER_26?
2) I would expect the mode to be SVC_32 since ARM boots up in that mode, and
I could not find a place
    where the kernel switches to USER mode from the SVC mode.
3) Why does it generate a data abort when I try to change the mode to
FIQ_32? Is it because ARM does
    not allow to change to a priviledged mode from a USER mode? In that
case, do I need to use an SWI,
   and add some support to change the mode to SVC?
4) I tried to call this 'get_fiq_regs' even before /linuxrc was run. But the
kerenl crashed in exactly the same way!

==========================================================================
claim_fiq return value= 0
Entered get_fiq_regs

Registers after < mrs %, cpsr >:
---------------------------------
pc : [<d0002000>]    lr : [<00000000>]
sp : 0000001a  ip : 00000000  fp : 00000001
r10: c0044a54  r9 : c0048634  r8 : c0cf5ea0
r7 : c0cf5ed0  r6 : c010fb81  r5 : 00000019  r4 : 00000000
r3 : c010e704  r2 : c003abdc  r1 : c00dd020  r0 : c0cf5e80
Flags: NZcV  IRQs on  FIQs off  Mode USER_26  Segment user
Control: 017D  Table: C153C015  DAC: 00000015
tmp= 60000013, tmp2= d0002240

Registers after < bic %, %, #0xf >:
-------------------------------------
pc : [<d0002000>]    lr : [<00000000>]
sp : 0000001a  ip : 00000000  fp : 00000001
r10: c0044a54  r9 : c0048634  r8 : c0cf5ea0
r7 : c0cf5ed0  r6 : c010fb81  r5 : 00000019  r4 : 00000000
r3 : c010e704  r2 : c003abdc  r1 : c00dd020  r0 : c0cf5e80
Flags: NZcV  IRQs on  FIQs off  Mode USER_26  Segment user
Control: 017D  Table: C153C015  DAC: 00000015
tmp= 60000013, tmp2= 60000010

Registers after < orr %, %, #0xc1 >:
--------------------------------------
pc : [<d0002000>]    lr : [<00000000>]
sp : 0000001a  ip : 00000000  fp : 00000001
r10: c0044a54  r9 : c0048634  r8 : c0cf5ea0
r7 : c0cf5ed0  r6 : c010fb81  r5 : 00000019  r4 : 00000000
r3 : c010e704  r2 : c003abdc  r1 : c00dd020  r0 : c0cf5e80
Flags: NZcV  IRQs on  FIQs off  Mode USER_26  Segment user
Control: 017D  Table: C153C015  DAC: 00000015
tmp= 60000013, tmp2= 600000d1
Bad mode in data abort handler detected: mode FIQ_32
pc : [<c00f204c>]    lr : [<c0048634>]
sp : c0cf5e2c  ip : c0cf5e30  fp : c0cf5ee0
r10: 02000194  r9 : ffffffff  r8 : c0da20e0
r7 : c010fb68  r6 : 600000d1  r5 : c0cf5e74  r4 : c010fb67
r3 : 0e0e0e00  r2 : 0e0e0e01  r1 : 0000000e  r0 : c010fb67
Flags: Nzcv  IRQs off  FIQs off  Mode FIQ_32  Segment user
Control: 017D  Table: C153C015  DAC: 00000015
Internal error: Oops: 0
CPU: 0
pc : [<c00f204c>]    lr : [<c0048634>]
sp : c0cf5e2c  ip : c0cf5e30  fp : c0cf5ee0
r10: 02000194  r9 : ffffffff  r8 : c0da20e0
r7 : c010fb68  r6 : 600000d1  r5 : c0cf5e74  r4 : c010fb67
r3 : 0e0e0e00  r2 : 0e0e0e01  r1 : 0000000e  r0 : c010fb67
Flags: Nzcv  IRQs off  FIQs off  Mode FIQ_32  Segment user
Control: 017D  Table: C153C015  DAC: 00000015
Process test (pid: 6, stackpage=c0cf5000)
Stack:
c0cf5e60:          c0048634 c00f204c 800000d1  ffffffff c0cf5e80 c00dd020
c003a
c0cf5e80: c010e704 00000000 00000019 c010fb81  c0cf5ed0 c0cf5ea0 c0048634
c0044
c0cf5ea0: 00000001 00000000 0000001a 00000000  d0002000 d0002240 d0002100
00000
c0cf5ec0: d0002000 d0002240 d0002100 c0da20e0  ffffffff c0cf5f50 c0cf5ee4
c00dc
c0cf5ee0: c003feac c0da8460 c0cf5f0c c0cf5ef8  c0067afc c006cf54 c0da8460
00000
c0cf5f00: c0cf5f40 c0cf5f10 c0067db8 c0067a54  c0cbc005 00000008 27cc4124
00000
c0cf5f20: 00000002 00000003 c0cbc000 00000000  c0da20e0 c0fd4754 c0da8460
00000
c0cf5f40: 00000000 c0cf5f6c c0cf5f54 c005f94c  c00dc01c c0da20e0 c0fd4754
00000
c0cf5f60: c0cf5f90 c0cf5f70 c005e374 c005f900  00000003 00000002 00000000
c0cbc
c0cf5f80: c0cf6000 c0cf5fb0 c0cf5f94 c005e4b4  c005e298 00000001 c003a648
00000
c0cf5fa0: c0cf4000 00000000 c0cf5fb4 c003a4a0  c005e480 00000001 0202d8b8
00000
c0cf5fc0: 00000000 00000000 00000001 bfffff64  020000c0 00000000 0202d8a0
00000
c0cf5fe0: 02000194 bfffff30 bfffff34 bfffff1c  020001c4 02006004 60000010
0202d
Backtrace:
Function entered at [<c003fe9c>] from [<c00dc14c>]
  r9 = ffffffff
  r8 = c0da20e0
  r7 = d0002100
  r6 = d0002240
  r5 = d0002000
  r4 = 00000000
Function entered at [<c00dc00c>] from [<c005f94c>]
  r9 = 00000000
  r8 = 00000000
  r7 = c0da8460
  r6 = c0fd4754
  r5 = c0da20e0
  r4 = 00000000
Function entered at [<c005f8f0>] from [<c005e374>]
  r6 = 00000000
  r5 = c0fd4754
  r4 = c0da20e0
Function entered at [<c005e288>] from [<c005e4b4>]
  r8 = c0cf6000
  r7 = c0cbc000
  r6 = 00000000
  r5 = 00000002
  r4 = 00000003
Function entered at [<c005e470>] from [<c003a4a0>]
  r7 = c0cf4000
  r6 = 00000005
  r5 = c003a648
  r4 = 00000001
Printing from traps.c
Received args: pc = c00f204c, user= 0
module_start= c1800000, module_end= c2000000
A: pmin= fffffffe, pmax= 3
C: pc= c00f204c, pmin= fffffffe, pmax= 3
Code: e2832001 e50b2028 (e5d31001) e3510000 1affff04
===============================================================================

Thanks for the help.

Umesh Puranik


_______________________________________________
http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm

Reply via email to