From patchwork Tue Jun 1 19:35:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matheus K. Ferst" X-Patchwork-Id: 451420 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp2098360jao; Tue, 1 Jun 2021 12:36:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSAx0u7sAZdYBgsRMll8dYNQiYc3ubtGsuux2tzQJ/TFVtY7eC7Vtly4kU/jSHlStJGaNq X-Received: by 2002:a67:2c09:: with SMTP id s9mr13153828vss.44.1622576173573; Tue, 01 Jun 2021 12:36:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622576173; cv=none; d=google.com; s=arc-20160816; b=UGiJvXtuLhqNtFGG1fGI+VfPkAeOyjgczMHNrBN9EV2THDBTPAu/Lt6c/iZDJwsHgL r73Objr8Ujrg+b2b6Vcsp8R91VWM0AZ4/mOfuQ5wKfx3TsgYDyTeQ299JuQWn9z52j0A gnLZ5b5LWqikte5T82FFx6UKrLOI74Nvd23HhyavO7yO2V1+Rae7fk9lC1W7eDrc8oHC HnaC0/viHozzVWLdUGXizcDPg+Pbmf9Stx/b5RoA6FMDRMLYEg9rSKG/oFYiOaEDWPvm luUWWI/4CV25XxM19sD+hkk7mOKmnDx11MXDI+K8nIxVpnJxr7grg+1eMZ34Cgw3WToc 4hrw== 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; bh=k+t/ZDyiETUTxOTsaNdKGCHu3bMxNu33K2rLtkN3n1I=; b=mrS99vjKIPJZuzPZ6DdN1usihhfSBxfKywJ4vGoNalGTksuQ3OQ1bZ9on4Su8fq0d9 SeO6CH5dSH1f9pa7rLFsf8nz+SFzBk3fvUpf3We98VyTDM6/pgX59/d6Fj3OrcsO9zlm 6s6Jovild8qP78dEjWQeqSwlIApKtVtl/my0K76zF03YVbI/KeJ+x39jtOZVxxR9pvmy u7En8E48HF3dMd6HESG67Q7iWgByspF31G6oP8va3MZUVWeG/9/l0B/QfffO6HHX0OOc B3DT5LCkK2JP/tC/8fWw2rQrraHJunPS3+lIW8lD7l1icEo6/eQYBy35AzZXlJf8tKxC blTQ== ARC-Authentication-Results: i=1; mx.google.com; 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 34si4634498uap.261.2021.06.01.12.36.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 01 Jun 2021 12:36:13 -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; 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]:57506 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loABQ-0001Sg-TP for patch@linaro.org; Tue, 01 Jun 2021 15:36:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33304) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loAB5-0001Ph-MC; Tue, 01 Jun 2021 15:35:51 -0400 Received: from [201.28.113.2] (port=31942 helo=outlook.eldorado.org.br) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loAB4-0002Jl-6u; Tue, 01 Jun 2021 15:35:51 -0400 Received: from power9a ([10.10.71.235]) by outlook.eldorado.org.br with Microsoft SMTPSVC(8.5.9600.16384); Tue, 1 Jun 2021 16:35:40 -0300 Received: from eldorado.org.br (unknown [10.10.70.45]) by power9a (Postfix) with ESMTP id 5596E80148B; Tue, 1 Jun 2021 16:35:40 -0300 (-03) From: matheus.ferst@eldorado.org.br To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Subject: [PATCH v6 02/14] target/ppc: Move page crossing check to ppc_tr_translate_insn Date: Tue, 1 Jun 2021 16:35:16 -0300 Message-Id: <20210601193528.2533031-3-matheus.ferst@eldorado.org.br> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210601193528.2533031-1-matheus.ferst@eldorado.org.br> References: <20210601193528.2533031-1-matheus.ferst@eldorado.org.br> MIME-Version: 1.0 X-OriginalArrivalTime: 01 Jun 2021 19:35:40.0815 (UTC) FILETIME=[4E2FE9F0:01D7571D] X-Host-Lookup-Failed: Reverse DNS lookup failed for 201.28.113.2 (failed) Received-SPF: pass client-ip=201.28.113.2; envelope-from=matheus.ferst@eldorado.org.br; helo=outlook.eldorado.org.br X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, RDNS_NONE=0.793, SPF_HELO_NONE=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@linaro.org, f4bug@amsat.org, groug@kaod.org, luis.pires@eldorado.org.br, lagarcia@br.ibm.com, Matheus Ferst , david@gibson.dropbear.id.au 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 --- target/ppc/translate.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- 2.25.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); }