diff options
author | David 'Digit' Turner <digit@google.com> | 2009-10-06 11:18:29 -0700 |
---|---|---|
committer | David 'Digit' Turner <digit@google.com> | 2009-10-06 11:18:29 -0700 |
commit | bcc6ae14820ddb24e2403d84b420ce61f371ae94 (patch) | |
tree | 0a66fe380b727cf9fce01569c07a4a08f81c40b9 /android | |
parent | ddf49e53df97a349f42c733059165dc73c9907dc (diff) | |
download | external_qemu-bcc6ae14820ddb24e2403d84b420ce61f371ae94.zip external_qemu-bcc6ae14820ddb24e2403d84b420ce61f371ae94.tar.gz external_qemu-bcc6ae14820ddb24e2403d84b420ce61f371ae94.tar.bz2 |
Finally fix ARMv7 NEON emulation.
The real problem was the size of the static intermediate TCG opcode buffer.
Due to its SIMD nature, a single Neon instruction can generate a very large number
of corresponding TCG opcodes. Using lots of Neon instructions in a big looop like
the one we have in our ARMv7-optimized memcpy did generate enough opcodes to
overwrite the static gen_opc_buf buffer, resulting in overwrites into the following
global buffer (gen_opparam_buf) corresponding to opcode parameters.
The end result was generation of really broken host machine code, and completely
unreliable emulation, including potential assertion failure in the liveness analysis
pass.
This patch does the following:
- bumps the buffer size from 512 to 2048
- adds sanity checks that will abort the emulator if another similar overwrite
is detected before machine code is generated.
- remove the previous hack where we disabled the liveness analysis pass for ARMv7
Note that fixing the code generator to not use a static buffer is not trivial at
this point, and that we much prefer to stay true to the upstream sources at the
moment.
Keep in mind that a previous patch also fixed a bug in the ARM->TCG translator
(typo required changing a 0 into a 1) which affected Neon instructions too.
I can't believe I just lost 2 weeks of my life on that bug :-(
Diffstat (limited to 'android')
-rw-r--r-- | android/main.c | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/android/main.c b/android/main.c index 686dac8..682cfce 100644 --- a/android/main.c +++ b/android/main.c @@ -67,8 +67,6 @@ #include "android/globals.h" #include "tcpdump.h" -#include "tcg.h" - /* in vl.c */ extern void qemu_help(int code); @@ -2358,14 +2356,6 @@ int main(int argc, char **argv) args[n++] = "-cpu"; args[n++] = "cortex-a8"; } - /* we also disable liveness analysis in the code generator, because it seems - * that ARMv7 -> x86 code generation triggers a fatal assertion when it is - * activated. The drawback is that the generated code is slower, but at the - * moment, ARMv7 emulation is only used to run the dex preopt pass within the - * Android build system. This hack should be removed when we fix the code - * generator. - */ - tcg_disable_liveness_analysis = 1; } args[n++] = "-initrd"; |