]> Git Repo - qemu.git/commitdiff
target/i386: fix translation for icount mode
authorPavel Dovgalyuk <[email protected]>
Thu, 20 Sep 2018 07:17:03 +0000 (10:17 +0300)
committerPaolo Bonzini <[email protected]>
Tue, 2 Oct 2018 17:09:13 +0000 (19:09 +0200)
This patch fixes the checking of boundary crossing instructions.
In icount mode only first instruction of the block may cross
the page boundary to keep the translation deterministic.
These conditions already existed, but compared the wrong variable.

Signed-off-by: Pavel Dovgalyuk <[email protected]>
Message-Id: <20180920071702.22477.43980.stgit@pasha-VirtualBox>
Signed-off-by: Paolo Bonzini <[email protected]>
target/i386/translate.c

index 8fcd88e326a13952ba28467f478e1ec97c731902..83c1ebe49176d68143a07695faaacaa8cc83612e 100644 (file)
@@ -8538,10 +8538,10 @@ static void i386_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu)
            chance to happen */
         dc->base.is_jmp = DISAS_TOO_MANY;
     } else if ((tb_cflags(dc->base.tb) & CF_USE_ICOUNT)
-               && ((dc->base.pc_next & TARGET_PAGE_MASK)
-                   != ((dc->base.pc_next + TARGET_MAX_INSN_SIZE - 1)
+               && ((pc_next & TARGET_PAGE_MASK)
+                   != ((pc_next + TARGET_MAX_INSN_SIZE - 1)
                        & TARGET_PAGE_MASK)
-                   || (dc->base.pc_next & ~TARGET_PAGE_MASK) == 0)) {
+                   || (pc_next & ~TARGET_PAGE_MASK) == 0)) {
         /* Do not cross the boundary of the pages in icount mode,
            it can cause an exception. Do it only when boundary is
            crossed by the first instruction in the block.
This page took 0.044965 seconds and 4 git commands to generate.