Hi,
On 06/23/2017 11:10 AM, rijurekha@...71... wrote:
Why do you say you do not save DFAR in the assembler path? Isn't DFAR saved in lines 15. and 27. below, while other registers are saved in line 3. in base-hw/src/core/spec/arm_v7/trustzone/mode_transition.s? This is where control will come for csu abort with _mon_dab_entry: _nonsecure_to_secure DAB_TYPE, 8, right?
.macro _nonsecure_to_secure exception_type, pc_adjust
ldr sp, _tz_client_context /* load context pointer*/
stmia sp, {r0-lr}^ /* save user regs r0-r12,sp,lr*/
add r0, sp, #15*4
.if \pc_adjust != 0 /* adjust pc if necessary*/
sub lr, lr, #\pc_adjust
.endif
stmia r0!, {lr} /* save pc*/
mrs r1, spsr /* spsr to r0*/
mov r2, #\exception_type /* exception reason to r1*/
b _nonsecure_kernel_entry
.endm /* _non_to_secure */
_nonsecure_kernel_entry:
stmia r0!, {r1-r2} /* save spsr, and exception reason */
mrc p15, 0, r3, c6, c0, 0 /* move DFAR to r3 */
mrc p15, 0, r4, c2, c0, 0 /* move TTBR0 to r4 */
mrc p15, 0, r5, c2, c0, 1 /* move TTBR1 to r5 */
mrc p15, 0, r6, c2, c0, 2 /* move TTBRC to r6 */
mov r1, #0
mcr p15, 0, r1, c1, c1, 0 /* disable non-secure bit */
_save_bank 27 /* save undefined banks */
_save_bank 19 /* save supervisor banks */
_save_bank 23 /* save abort banks */
_save_bank 18 /* save irq banks */
_save_bank 17 /* save fiq banks */
stmia r0!, {r8-r12} /* save fiq r8-r12 */
stmia r0!, {r3-r6} /* save MMU registers */
cps #SVC_MODE
adr r0, _tz_master_context
_restore_kernel_sp r0, r1, r2 /* apply kernel sp */
add r1, r0, #LR_OFFSET
ldm r1, {lr, pc}
Ok sorry, I was not aware anymore that we save *normal world* DFAR in the assembly path. Anyway, what you are interested in when receiving a data-abort in monitor mode is the *secure world* DFAR register as it contains the security violation address. Therefore, you cannot uncomment the overwriting of the VM state's DFAR register in the high-level C++ code, because it saves a different register. Or you add another register value to the end of the VM state and differentiate in between secure and normal world DFAR register.
Also, is there a tutorial how to use jtag to debug genode assembly? WE have never used jtag, but have an olimex arm-usb-ocd-h.
No. There is nothing special about JTAG debugging Genode in contrast to debugging any other software target, but I'm afraid debugging with Olimex some specific ARM hardware is out of scope of this mailing list. I have to admit that I primarily used Lauterbach, which is more expensive but quite convenient (advertisement ends here).
Regards Stefan
Thanks! Riju
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ genode-main mailing list genode-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main