]> git.proxmox.com Git - mirror_qemu.git/commitdiff
target/hppa: Check for page crossings in use_goto_tb
authorRichard Henderson <richard.henderson@linaro.org>
Fri, 8 Mar 2019 18:49:57 +0000 (10:49 -0800)
committerRichard Henderson <richard.henderson@linaro.org>
Tue, 12 Mar 2019 16:13:43 +0000 (09:13 -0700)
We got away with eliding this check when target/hppa was user-only,
but missed adding this check when adding system support.

Fixes an early crash in the HP-UX 11 installer.

Reported-by: Sven Schnelle <svens@stackframe.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
target/hppa/translate.c

index dc5636fe94311438b7193c23df51c838ac5866b6..6c815e05c2617711ecea05d308037d4df3b0e909 100644 (file)
@@ -816,12 +816,10 @@ static bool gen_illegal(DisasContext *ctx)
 
 static bool use_goto_tb(DisasContext *ctx, target_ureg dest)
 {
-    /* Suppress goto_tb in the case of single-steping and IO.  */
-    if ((tb_cflags(ctx->base.tb) & CF_LAST_IO)
-        || ctx->base.singlestep_enabled) {
-        return false;
-    }
-    return true;
+    /* Suppress goto_tb for page crossing, IO, or single-steping.  */
+    return !(((ctx->base.pc_first ^ dest) & TARGET_PAGE_MASK)
+             || (tb_cflags(ctx->base.tb) & CF_LAST_IO)
+             || ctx->base.singlestep_enabled);
 }
 
 /* If the next insn is to be nullified, and it's on the same page,