On 28 August 2013 05:39, Stefan Weil <s...@weilnetz.de> wrote: > These unimplemented opcodes are handled like illegal opcodes, but > they are used in existing code. We should at least report when they > are executed.
Yeah, seems reasonable. (There might be other unimplemented bits lurking too but we can add logging when we find them.) > Signed-off-by: Stefan Weil <s...@weilnetz.de> Reviewed-by: Peter Maydell <peter.mayd...@linaro.org> > When running a QEMU system emulation of an ARM system > (Raspberry PI), Linux booted, but when I tried to run a > user session, it terminated without error message. > > It took me some time to see that bash got an illegal > instruction exception. It was caused by ARM opcode 'setend' > which is not implemented in QEMU's ARM emulation. > The patch should help detecting similar scenarios in > the future. > > Raspberry PI uses 'setend' in an optimized version of > memcmp, so lots of other executables also fail with QEMU. > > As a workaround, the preloading of that optimized code > can be removed. Of course an improved QEMU emulation > would be better. setend is kinda hard to emulate[*] and it's generally not used by anything (except this weird memcmp implementation). I'm inclined to think this "optimized" version of memcmp is a bad idea -- I think setend is expensive on hardware, and I've never seen it suggested by any of the toolchain folks who do work on optimised versions of string routines. OTOH I haven't run any benchmarks and hopefully whoever wrote that rpi code did. [*] not impossible, we already do something on the ppc that's similar; however I'd really want to take the time to figure out how to do endianness swapping "properly" and what qemu does currently before messing with it. -- PMM