[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] PPC Bug Report - Trap Exception setting SRR0 incorrectly
From: |
Ely Soto |
Subject: |
[Qemu-devel] PPC Bug Report - Trap Exception setting SRR0 incorrectly |
Date: |
Fri, 17 Nov 2006 09:33:04 -0500 |
PPC Bug Only
Call Stack
op_helper.c : do_tw()
op_helper.c : do_raise_exception_err()
op_helper.c : cpu_loop_exit()
op_helper.c : longjmp()
???
helper.c : do_interrupt()
Normally when an exception gets to
do_interrupt(), env->nip is set to the instruction after the one causing
the exception.
However, a trap instruction arrives
at the do_interrupt() with the env->nip set at the instruction that
caused the exception.
This causes an the SRR0 to get set
incorrectly to one instruction back when calling the exception handler.
I'm still learning the code so I'm
still trying to figure out the right fix since
its possible that more exceptions are
affected. I've already verified that forcing the env->nip forward for
just the trap case
fixes the execution.
From the middle of helper.c : do_interrupt()
...
case
EXCP_TRAP:
...
goto
store_current;
...
From the bottom of helper.c : do_interrupt()
...
store_current:
/*
save current instruction location */
*srr_0
= (env->nip - 4) & 0xFFFFFFFFULL;
break;
store_next:
/*
save next instruction location */
*srr_0
= env->nip & 0xFFFFFFFFULL;
break;
...
I discovered this because I'm trying
to get a vxworks debugger working when the os is running.
Ohh ya, I've got a VxWorks 6.3 kernel
up and running on PPC QEMU. 8-) Custom BSP and all.
Notice: This e-mail is intended solely for use of the individual or entity to which it is addressed and may contain information that is proprietary, privileged and exempt from disclosure under applicable law. If the reader is not the intended recipient or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. This communication may also contain data subject to U.S. export laws. If so, that data subject to the International Traffic in Arms Regulation cannot be disseminated, distributed or copied to foreign nationals, residing in the U.S. or abroad, absent the express prior approval of the U.S. Department of State. If you have received this communication in error, please notify the sender by reply e-mail and destroy the e-mail message and any physical copies made of the communication. Thank you.