ARM QEMU ABORT exceptions (instruction, data)
Posted: Sat Mar 01, 2014 2:10 pm
Hey guys. I will likely figure this out so if no one replies do not worry. Once I figure it out I will update this post, but at the moment I was busy with some other things and figured someone might know the answer off the top of their head. Also, going to put it into the wiki for anyone else.
I am doing development on QEMU with the ARM and I have implemented my (SWI instruction) software interrupt and I was working on the instruction abort and data abort exceptions. The problem is I can never seem to get them to trigger. I have tried writing values all through memory in a loop, and also reading values. It seems like QEMU just gives me a 0x0 for a location that does not exist and any writes go through but do not change the value from 0x0.
This of course is not abnormal to me because I figure QEMU is just ignoring the writes, and returning 0 for any 32-bit reads at least. Also, I have read that real hardware can choose to not generate the exceptions depending on the memory hardware if it so desired. Also as you can see below I am incrementing by one which produces unaligned memory accesses (which correctly return undefined results), but do not trigger an exception. I have also read some hardware does or does not generate an abort on unaligned memory access.
Basically, I am wondering is this correct? Or, does it generate ABORT exceptions in some situations?
Here is my code that is running:
I know it is running because I am getting output, and I can see it as it runs over my boot image. Also, QEMU will fault out at certain positions in the MMIO range for certain hardware with unimplemented, but even beyond those places I get the same result.
I am doing development on QEMU with the ARM and I have implemented my (SWI instruction) software interrupt and I was working on the instruction abort and data abort exceptions. The problem is I can never seem to get them to trigger. I have tried writing values all through memory in a loop, and also reading values. It seems like QEMU just gives me a 0x0 for a location that does not exist and any writes go through but do not change the value from 0x0.
This of course is not abnormal to me because I figure QEMU is just ignoring the writes, and returning 0 for any 32-bit reads at least. Also, I have read that real hardware can choose to not generate the exceptions depending on the memory hardware if it so desired. Also as you can see below I am incrementing by one which produces unaligned memory accesses (which correctly return undefined results), but do not trigger an exception. I have also read some hardware does or does not generate an abort on unaligned memory access.
Basically, I am wondering is this correct? Or, does it generate ABORT exceptions in some situations?
Here is my code that is running:
Code: Select all
uint32 volatile *p = (uint32*)0x100;
while (1) {
if (*p == 0)
*p = 0x12345678;
k_sprintf(buf, "%x [%x]\n", p, *p);
k_serdbg_puts(buf);
p = (uint32*)((uintptr)p + 0x1);
}