|
From: | Riihimaki Juha |
Subject: | Re: [Qemu-devel] [PATCH] fix ARMv7 MOV R15, xxx operation |
Date: | Fri, 13 Mar 2009 20:26:19 +0200 |
On Mar 13, 2009, at 17:13, ext Laurent Desnogues wrote:
On Fri, Mar 13, 2009 at 3:18 PM, Riihimaki Juha <address@hidden> wrote:I suppose changing the store_reg and gen_movl_reg_TN functions intarget-arm/translate.c to include an extra check when destination is R15 like "if in ARM state and arch >= 7 then bx else..." might do the trick more generally but do you think it introduces the change in a too wide scope?I'm afraid that'd be too wide as it would effect ld/st exclusive, gen_exception_return and gen_lookup_tb (plus iwmmxt code).
Thanks, that is what I thought as well. It would also have slowed down thumb processing due to the extra check introduced in all stores to r15 even though the changed functionality only affects arm state. I guess then that there is no generic place where this could be easily fixed but instead the handling of all affected commands would need to be changed similarly to the patch that I sent for the mov command? Seems a little bit clumsy approach to duplicate the same piece of code in several places imho so if you have any better suggestions...
On a sidenote, I also noticed that the arm emulation currently allows jumping to unaligned memory addresses in arm mode since it only clears the least significant bit when storing to r15. However, since armv6 the two least significant bits should be automatically ignored. This hasn't caused me any problems (yet) since I guess programs rarely rely on this feature.
Juha
[Prev in Thread] | Current Thread | [Next in Thread] |