ldesnogu
Well-Known Member
Funny example: it almost 100% the one I was discussing with a QEMU maintainer yesterday. The internal QEMU op for widening mul could be in that case changed to a non-widening one. Do you wander on QEMU IRC channel?Ari64 said:In case it's not clear what I meant, here's a theoretical example:
Code:mul %ebx mov %eax,(%esi) mov (%edi),%edx
edx is written by the first instruction but never used. It gets overwritten by the third instruction. So it's unneeded, and on ARM it's possible to use mul instead of umull for this.
I hacked QEMU to remove the flush of x86 registers cached in ARM registers around memory accesses. At the moment I don't care, but I have a solution to catch problems: regenerate the code for the block until the faulting PC, at which point I'll know in which ARM reg, x86 registers were allocated. One can then use the context passed to the signal handler to retrieve ARM reg contents. It would be costly, but it should not happen that often.The only problem is what happens when the second instruction causes a pagefault. To enter the interrupt handler with the correct values, you'd have to recalculate edx.
BTW, about the Beagle, I really am unlucky: the USB-serial cable I bought refuses to work correctly; I checked on another PC with a HW serial port and it works.
Last edited by a moderator: