diff mbox

[Bug,1180970] Re: qemu: fatal: Trying to execute code outside RAM or ROM; worked in 1.4.0, fails in 1.4.92

Message ID 20130529190533.22795.97633.malone@wampee.canonical.com
State New
Headers show

Commit Message

Duane Voth May 29, 2013, 7:05 p.m. UTC
I just tried Richard's fix against HEAD (6a4e17711) and it works for me.
I also like that his fix clearly constrains aflag to the values 1 and 2
for 64bit mode - a concept which matches the intent of the 0x67 prefix.

$ git diff target-i386/translate.c
diff mbox

Patch

diff --git a/target-i386/translate.c b/target-i386/translate.c
index 0aeccdb..cb7fe0b 100644
--- a/target-i386/translate.c
+++ b/target-i386/translate.c
@@ -4816,6 +4816,8 @@  static target_ulong disas_insn(CPUX86State *env, DisasCont
         if (!(prefixes & PREFIX_ADR)) {
             aflag = 2;
         }
+        /* 0x67 toggles between 64-bit and 32-bit addressing */
+        aflag = (prefixes & PREFIX_ADR ? 1 : 2);
     }
 #endif