From patchwork Thu Jun 3 08:22:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 453234 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp86731jao; Thu, 3 Jun 2021 01:46:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfUc0sfD69tmt4Snzwe4xapqvrSlPuubhhWIcCwMFV6FIqMUNagx9/9Ww3UjcPgpnNvdUo X-Received: by 2002:a92:7b01:: with SMTP id w1mr28764174ilc.100.1622709987927; Thu, 03 Jun 2021 01:46:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622709987; cv=none; d=google.com; s=arc-20160816; b=pKoIVMaPCTfDyyIdc3v8GBYUBs7+RITFyFt0lwGJvixzCvDVkG83vDK7ZU8dpdrVO7 IHVj8eBVa/GNkPav2avZEXoUdXOjspBDUnxM6/wD2pCkn2nDaezCGNYFGr/xxYo6nbcP 1Lh76YpgRkcKtlXxZ9Osdu6K3ezDbVIk899yYfyEQQLRf1gpNx11D7Ji2e/gFfKRQqWr XHFzunz12reAMy8Yd43+w+ujU0lnBgJLJsS3jN4GFM1F0TvDDWCyb6EFXJgwoHsp6Ds2 AqsRrTpBe9rarb2D+Avy+Xrmo0xMiqnG0ADT1yOa6gRJoZ+0nGFAoCscJLc3X57b4mMZ JX9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=YPCX6FLFl4uac05AC8k+vLhmbHGB6M8sufjnVWlB+W8=; b=MIPAL3NNdN+e53S1PcMOFpBdOl3ZbONpvE3IRU80R5AMIlPNTPif3SR7YDmOZKRznK rVlKIACL/fU0/LquEUht/gvg1VNFGjNVwvPnMVxSjpZmFFH5tty1FkrcNsrqvskns0cg ZzXVE58lLwl2txQpxvaf+44nq6X2l7iJMwSpF2o53WdEejTWh/iaqhgiB3+W201+og6B fD6JACVbDcckPaJ2LX/gvoKx1MHOaX9UFpORB4rObiDQSjavoJvxbpt/MdsIjyCDlucX xX8Is1N3S7rUlFax0maWRJkvE972cuVpfKc1pnhFCsbxe2OtETHslbFYrQirnWySXkLf 94Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gibson.dropbear.id.au header.s=201602 header.b=YGQn5EEh; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k17si2525344ion.39.2021.06.03.01.46.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Jun 2021 01:46:27 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@gibson.dropbear.id.au header.s=201602 header.b=YGQn5EEh; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:46610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loizj-0007dk-Do for patch@linaro.org; Thu, 03 Jun 2021 04:46:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39832) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loidb-0007gf-ET; Thu, 03 Jun 2021 04:23:36 -0400 Received: from bilbo.ozlabs.org ([203.11.71.1]:50687 helo=ozlabs.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loidX-0000Gh-SH; Thu, 03 Jun 2021 04:23:35 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 4Fwf5p5xFbz9t1Q; Thu, 3 Jun 2021 18:22:38 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1622708558; bh=xI0yU8K+AIE6+Ph7gQtn9MOOEp3goTTC14cj4zuAKiA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YGQn5EEhMcr2EubEFcITB1dWpgiCT/fWjFQ/7pc51DButk7FsBBV//zmfkbP2p/w7 zb9hW2x+tSOoO1EO8Y7YuJ3rFC6bNIWNk1cu1xUERXuF0J7vrhSV+LMc8r7xUnnquc aiHQZ4YcyjPqMZJH6FO8/T3QyxBeKgd1UAzIaRlA= From: David Gibson To: peter.maydell@linaro.org, groug@kaod.org Subject: [PULL 29/42] target/ppc: Move page crossing check to ppc_tr_translate_insn Date: Thu, 3 Jun 2021 18:22:18 +1000 Message-Id: <20210603082231.601214-30-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210603082231.601214-1-david@gibson.dropbear.id.au> References: <20210603082231.601214-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Received-SPF: pass client-ip=203.11.71.1; envelope-from=dgibson@ozlabs.org; helo=ozlabs.org X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , David Gibson , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Matheus Ferst Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson With prefixed instructions, the number of instructions remaining until the page crossing is no longer constant. Signed-off-by: Richard Henderson Signed-off-by: Matheus Ferst Message-Id: <20210601193528.2533031-3-matheus.ferst@eldorado.org.br> Signed-off-by: David Gibson --- target/ppc/translate.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- 2.31.1 diff --git a/target/ppc/translate.c b/target/ppc/translate.c index 11fd3342a0..d2c9fd9dd7 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -8821,9 +8821,6 @@ static void ppc_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) if (ctx->singlestep_enabled & (CPU_SINGLE_STEP | GDBSTUB_SINGLE_STEP)) { ctx->base.max_insns = 1; - } else { - int bound = -(ctx->base.pc_first | TARGET_PAGE_MASK) / 4; - ctx->base.max_insns = MIN(ctx->base.max_insns, bound); } } @@ -8874,6 +8871,12 @@ static void ppc_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) gen_invalid(ctx); } + /* End the TB when crossing a page boundary. */ + if (ctx->base.is_jmp == DISAS_NEXT && + !(ctx->base.pc_next & ~TARGET_PAGE_MASK)) { + ctx->base.is_jmp = DISAS_TOO_MANY; + } + translator_loop_temp_check(&ctx->base); }