From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:57147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2KiY-0001vS-6E for qemu-devel@nongnu.org; Fri, 08 Mar 2019 13:59:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2KiX-0001kf-Cg for qemu-devel@nongnu.org; Fri, 08 Mar 2019 13:59:38 -0500 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:44185) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2KiX-0001jE-4i for qemu-devel@nongnu.org; Fri, 08 Mar 2019 13:59:37 -0500 Received: by mail-pf1-x441.google.com with SMTP id a3so14786226pff.11 for ; Fri, 08 Mar 2019 10:59:36 -0800 (PST) From: Richard Henderson Date: Fri, 8 Mar 2019 10:59:32 -0800 Message-Id: <20190308185932.4954-1-richard.henderson@linaro.org> Subject: [Qemu-devel] [PATCH] target/hppa: Check for page crossings in use_goto_tb List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: svens@stackframe.org 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 Signed-off-by: Richard Henderson --- target/hppa/translate.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index dc5636fe94..6c815e05c2 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -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, -- 2.17.2