Skip to contentSkip to conversation

Store correct IPs

PATCH New Alexander Graf 1 participant 1 message Jun 4, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Store correct IPs

If a VMEXIT occurs, the IP value needs to be current. This is the case with most instructions, except for CPUID and invlpg.

Alex

translate.c +2 -1
Index: target-i386/translate.c
===================================================================
@@ -6407,6 +6407,7 @@
         break;
 #endif
     case 0x1a2: /* cpuid */
+        gen_jmp_im(s->pc - s->cs_base);
         tcg_gen_helper_0_0(helper_cpuid);
         break;
     case 0xf4: /* hlt */
@@ -6700,8 +6701,8 @@
                     }
                 } else {
                     gen_lea_modrm(s, modrm, &reg_addr, &offset_addr);
+                    gen_jmp_im(s->pc - s->cs_base);
                     tcg_gen_helper_0_1(helper_invlpg, cpu_A0);
-                    gen_jmp_im(s->pc - s->cs_base);
                     gen_eob(s);
                 }
             }