From patchwork Tue May 20 11:17:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 350651 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3EF9414007F for ; Tue, 20 May 2014 21:18:37 +1000 (EST) Received: from localhost ([::1]:52553 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wmi42-0004AW-Ri for incoming@patchwork.ozlabs.org; Tue, 20 May 2014 07:18:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46043) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wmi3i-0003sa-NT for qemu-devel@nongnu.org; Tue, 20 May 2014 07:18:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wmi3c-0000Bk-KK for qemu-devel@nongnu.org; Tue, 20 May 2014 07:18:14 -0400 Received: from mail-lb0-x235.google.com ([2a00:1450:4010:c04::235]:59187) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wmi3c-0000A0-D0; Tue, 20 May 2014 07:18:08 -0400 Received: by mail-lb0-f181.google.com with SMTP id q8so253032lbi.40 for ; Tue, 20 May 2014 04:18:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=HtKkMuaGlEmJ78ASqXntZa/+c5aqaj3hwzbnuP9NolQ=; b=CXCjj7dXUIYnyyMbrxNlnCgxM0qKT6o0FhGfDRvdvCPRZHiXGBD/RzT11e8hhyYQya oTGyCnEokUbtTh4PCM9IS5kWZXgqwgPJt0MzgefwkZfkZgbKkNG+Qogd1EAKi/nmhouc nxOXkf098/UO4K0QemAPDPiVqhSl+QU61EGncyRd9BDqeQd9qbmoemEa5TCVUBooVkR/ 2s3jCshaC+JJUKDwG2rpas9L7kbVRdmzAeYrqZ/s+RXvl3MPHs7w6wiasG0yn8zq7v2v 2HTYtED91xHDTYLFz68lnU/Nhe3PFE7tHu/lKl3174/R+7gnBU1AJCGBJdVZ1bz2K77s ftxQ== X-Received: by 10.112.158.101 with SMTP id wt5mr1198957lbb.77.1400584686832; Tue, 20 May 2014 04:18:06 -0700 (PDT) Received: from octofox.metropolis ([5.18.160.91]) by mx.google.com with ESMTPSA id k1sm20538310lbb.9.2014.05.20.04.18.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 May 2014 04:18:05 -0700 (PDT) From: Max Filippov To: qemu-devel@nongnu.org Date: Tue, 20 May 2014 15:17:50 +0400 Message-Id: <1400584670-1708-1-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 1.8.1.4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::235 Cc: Max Filippov , qemu-stable@nongnu.org Subject: [Qemu-devel] [PATCH] target-xtensa: fix cross-page jumps/calls at the end of TB X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Move cross-page jump check to gen_jump_slot and use tb->pc instead of dc->pc to check for cross-page jumps. When TB ends at the page boundary dc->pc points to the next page allowing chaining to TBs in it. Cc: qemu-stable@nongnu.org Signed-off-by: Max Filippov --- target-xtensa/translate.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c index 764cee9..d93d0a3 100644 --- a/target-xtensa/translate.c +++ b/target-xtensa/translate.c @@ -401,7 +401,7 @@ static void gen_jump_slot(DisasContext *dc, TCGv dest, int slot) if (dc->singlestep_enabled) { gen_exception(dc, EXCP_DEBUG); } else { - if (slot >= 0) { + if (slot >= 0 && ((dc->tb->pc ^ dest) & TARGET_PAGE_MASK) == 0) { tcg_gen_goto_tb(slot); tcg_gen_exit_tb((uintptr_t)dc->tb + slot); } else { @@ -419,9 +419,6 @@ static void gen_jump(DisasContext *dc, TCGv dest) static void gen_jumpi(DisasContext *dc, uint32_t dest, int slot) { TCGv_i32 tmp = tcg_const_i32(dest); - if (((dc->pc ^ dest) & TARGET_PAGE_MASK) != 0) { - slot = -1; - } gen_jump_slot(dc, tmp, slot); tcg_temp_free(tmp); } @@ -447,9 +444,6 @@ static void gen_callw(DisasContext *dc, int callinc, TCGv_i32 dest) static void gen_callwi(DisasContext *dc, int callinc, uint32_t dest, int slot) { TCGv_i32 tmp = tcg_const_i32(dest); - if (((dc->pc ^ dest) & TARGET_PAGE_MASK) != 0) { - slot = -1; - } gen_callw_slot(dc, callinc, tmp, slot); tcg_temp_free(tmp); }