Linux MIPS Architecture development
 help / color / mirror / Atom feed
* how to debug mips AdEL error? Cause register's ExcCode field equal to '4' (AdEL)
@ 2009-04-27  3:33 Bob Zhang
  2009-04-27  3:43 ` Bob Zhang
  0 siblings, 1 reply; 2+ messages in thread
From: Bob Zhang @ 2009-04-27  3:33 UTC (permalink / raw)
  To: linux-mips; +Cc: bob.zhang2004, Christophe.Carvounas, Bob Zhang

I am porting suspend2 to mips archtecture,
suspend is OK, but resume has kernel panic.

my mips is mips4KE
I only want to know how to debug this issue from kernel panic info
,thanks very much! any comments will be welcome.

this kernel panic:
About to restore original console.
swsusp_default_console_level = 1
console_loglevel=7
default_message_loglevel = 4
orig_default_message_loglevel=0
at end of do_software_suspend
Kernel unaligned instruction access in unaligned.c::do_ade, line 446:

CPU Regs : ===========================================================
$0 : 00000000 80290000 00000100 fffdffff 00000007 00000006 8023427c 820e83d4
$8 : 00000000 00000000 00000000 820e83dc 820e83f4 820e8000 80278010 00000000
$16: 8028f7b8 0000d32b 0000132b 802a53a0 0000d34d 7fff7d48 00000004 00000014
$24: 8200000c 2abe4090                   820e8000 820e9e70 00000000 0000000a
Hi : 0000007a
Lo : 000000b7
epc   : 0000000a    Tainted: G Z             # obvisouly 0x0000000a is
error , 1:too small 2:not 4 byte boundary.
BadVaddr:0000000a                              #equal to epc value.
Status: 10008403
Cause : 10800010                                 #ExcCode is AdEL
PrId  : 0001906c
Process init (pid: 1, stackpage=820e8000)
show_stack ============================================================
Stack:    80287ce0 0000003e 0000003c 800b93cc 00000000 00000400 80111b40
 00000000 0000134d ffffffff 0000d34d 10008400 00000001 800b9460 0000000b
 00000185 00000004 00000001 10008400 802a4fc4 80287cf0 10008400 00000001
 0000000a 80287ce0 0000003c 800b9ac0 800b99bc 802391b0 10008400 8023916c
 802391b0 802a4fc2 802a4fc4 800b9868 820b6d94 00000185 820b72e0 80238ac2
 7fff7ba8 00000022 00000000 8028a23c 80287cdc 802391b0 8023916c 8023916c
 802391b0 80287cdc 00000014 00000005 800da974 80238aa0 99669967 83feb000
 8028a9d4 00000202 00000000 0000000b 7fff7ba8 00000000 00000001 00008400
 820b1ea0 00000000 00000002 8028a9d4 00000003 820e9ef8 00000002 00000000
 7fff7ba8 0000000b 00000000 7fff7a28 7fff7d48 00000004 00000014 00000000
 2ab61a30 00000000 00000000 2abe7bf0 7fff79b8 00000005 0040709c 00000000
 00000000 2ab61a94 00000008 00008413 10800020 fbbffffe fb7fffff ffffdffb
 bfefefef fdf67ffe b6edefff f7f7fff6 efedffff
show_trace =============================================================
Call Trace:   [<800b93cc>] [<80111b40>] [<800b9460>] [<800b9ac0>] [<800b99bc>]
 [<802391b0>] [<8023916c>] [<802391b0>] [<800b9868>] [<80238ac2>] [<802391b0>]
 [<8023916c>] [<8023916c>] [<802391b0>] [<800da974>] [<80238aa0>]
show_code ==============================================================

Code:<7>init: Forwarding exception at [<800acfe0>] (802569d8)
 (Bad address in epc)

Kernel panic: Attempted to kill init!
 UART_MSR_ANY_DELTA



about error exception :mips mannual :
4.8.9 Address Error Exception — Instruction Fetch/Data Access
An address error exception occurs on an instruction or data access
when an attempt is made to execute one of the following:
       • Fetch an instruction, load a word, or store a word that is
not aligned on a word boundary
       • Load or store a halfword that is not aligned on a halfword boundary
       • Reference the kernel address space from user mode

Note that in the case of an instruction fetch that is not aligned on a
word boundary, PC is updated before the condition
is detected. Therefore, both EPC and BadVAddr point to the unaligned
instruction address. In the case of a data
access the exception is taken if either an unaligned address or an
address that was inaccessible in the current processor
mode was referenced by a load or store instruction.
Cause Register ExcCode Value:
    ADEL: Reference was a load or an instruction fetch
    ADES: Reference was a store


Please note : kernel has printed EPC and Cause ,Status registers value:
epc   : 0000000a    Tainted: G Z
BadVaddr:0000000a
Status: 10008403
Cause : 10800010

I judge this Cause's ExcCode register (bit6:2) is 2#000100    , 10#4

Table 5.23 Cause Register ExcCode Field
    4 16#04 AdEL Address error exception (load or instruction fetch)

so this error is AdEL exception.

from this info:
     "Note that in the case of an instruction fetch that is not
aligned on a word boundary, PC is updated before the condition
      is detected. Therefore, both EPC and BadVAddr point to the
unaligned instruction address"
we know, this AdEL is of "instruction fetch" error.


5.2.9 BadVAddr Register (CP0 Register 8, Select 0)
The BadVAddr register is a read-only register that captures the most
recent virtual address that caused one of the following
exceptions:
• Address error (AdEL or AdES)
• TLB Refill (4KEc core)
• TLB Invalid (4KEc core)
• TLB Modified (4KEc core)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: how to debug mips AdEL error? Cause register's ExcCode field equal to '4' (AdEL)
  2009-04-27  3:33 how to debug mips AdEL error? Cause register's ExcCode field equal to '4' (AdEL) Bob Zhang
@ 2009-04-27  3:43 ` Bob Zhang
  0 siblings, 0 replies; 2+ messages in thread
From: Bob Zhang @ 2009-04-27  3:43 UTC (permalink / raw)
  To: linux-mips; +Cc: bob.zhang2004, Christophe.Carvounas, Bob Zhang

through the kernel panic info:
CPU Regs : ===========================================================
$0 : 00000000 80290000 00000100 fffdffff 00000007 00000006 8023427c 820e83d4
$8 : 00000000 00000000 00000000 820e83dc 820e83f4 820e8000 80278010 00000000
$16: 8028f7b8 0000d32b 0000132b 802a53a0 0000d34d 7fff7d48 00000004 00000014
$24: 8200000c 2abe4090                   820e8000 820e9e70 00000000 0000000a

we can know , the ra register is 0x0000000a
after sub-function executed completely , it will return $ra.

through code trace , I know the last function is "__call_console_drivers" .

I dissable the vmlinux code,

and grab section:

00000000800b9364 <__call_console_drivers>:
    800b9364:	27bdffd8 	addiu	$sp,$sp,-40
    800b9368:	afb00010 	sw	$s0,16($sp)
    800b936c:	3c108028 	lui	$s0,0x8028
    800b9370:	8e107d1c 	lw	$s0,32028($s0)
    800b9374:	afb10014 	sw	$s1,20($sp)
    800b9378:	00808821 	move	$s1,$a0
    800b937c:	afb40020 	sw	$s4,32($sp)
    800b9380:	00a0a021 	move	$s4,$a1
    800b9384:	afbf0024 	sw	$ra,36($sp)    #save ra into SP
    800b9388:	afb3001c 	sw	$s3,28($sp)
    800b938c:	12000012 	beqz	$s0,800b93d8 <__call_console_drivers+74>
    800b9390:	afb20018 	sw	$s2,24($sp)
    800b9394:	32323fff 	andi	$s2,$s1,0x3fff
    800b9398:	3c13802a 	lui	$s3,0x802a
    800b939c:	267353a0 	addiu	$s3,$s3,21408
    800b93a0:	9602001c 	lhu	$v0,28($s0)
    800b93a4:	30420004 	andi	$v0,$v0,0x4
    800b93a8:	50400009 	beqzl	$v0,800b93d0 <__call_console_drivers+6c>
    800b93ac:	8e100024 	lw	$s0,36($s0)
    800b93b0:	8e020008 	lw	$v0,8($s0)
    800b93b4:	50400006 	beqzl	$v0,800b93d0 <__call_console_drivers+6c>
    800b93b8:	8e100024 	lw	$s0,36($s0)
    800b93bc:	02002021 	move	$a0,$s0
    800b93c0:	02532821 	addu	$a1,$s2,$s3
    800b93c4:	0040f809 	jalr	$v0
    800b93c8:	02913023 	subu	$a2,$s4,$s1
    800b93cc:	8e100024 	lw	$s0,36($s0)
    800b93d0:	5600fff4 	bnezl	$s0,800b93a4 <__call_console_drivers+40>
    800b93d4:	9602001c 	lhu	$v0,28($s0)
    800b93d8:	8fbf0024 	lw	$ra,36($sp)
    800b93dc:	8fb40020 	lw	$s4,32($sp)
    800b93e0:	8fb3001c 	lw	$s3,28($sp)
    800b93e4:	8fb20018 	lw	$s2,24($sp)
    800b93e8:	8fb10014 	lw	$s1,20($sp)
    800b93ec:	8fb00010 	lw	$s0,16($sp)
    800b93f0:	03e00008 	jr	$ra                      # error should be here.
    800b93f4:	27bd0028 	addiu	$sp,$sp,40



Any comment? thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-27  3:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-27  3:33 how to debug mips AdEL error? Cause register's ExcCode field equal to '4' (AdEL) Bob Zhang
2009-04-27  3:43 ` Bob Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox