From patchwork Mon May 17 20:50:12 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: 440231 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp1436263jac; Mon, 17 May 2021 13:58:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXz3p0cBaPy7toC/ALfNppF3LYsouOc2CbQ6l5l6y2Th9pWmrMyaVRmKbPMeP1gknqZrOn X-Received: by 2002:a6b:f311:: with SMTP id m17mr1534035ioh.162.1621285103350; Mon, 17 May 2021 13:58:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621285103; cv=none; d=google.com; s=arc-20160816; b=nwThgyqXEX+t3vC2Y+JxaE50BBlBfxvPkOZVRJYANwFFH7dzV35MClmYtAfqyK1Mcu aQfM6Oj4AhcRUTqq4GnGRuby/9UR2tMO+LWqVbEuOlDulxPt6nx0Qoi1mipeAHTgcNHz I4u2cxDmYYSI0WdZPnA5DdgV2x61x1JYMZ/uKo+yZeUzi3oOya2XE95jvRvKtFGqYOMi rXxGM9OOIRnnIu08y8i7npPbX+yxrEjh1y2lq/qQ/wE7BEzB5zhv5aE/JZokwzSOAEMy H2b1KdN1yF2IfuUSiImww7jzrmLBJmxzvtpyWdI8JBXH1BfIlKXLqAajIte48yHSYRp0 s15A== 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=QwsDbsVNOxbmNfBfZYWXeK3aHrL9g9O8QDApld4GCAc=; b=cImVzXoxnanJpbXblZ2XQ7ruGJcXod8SiN1JrmmOBr0yXQ5aly72JK9LuY4wtKpW+B BY34fANwLE7ksQ5kuNqRkdoWP6yFkV5hp180zzsXFfei2TMcM9UAfEDKRU4sEZeJ/2SN 6gReqKS0/I8KdGZ4fzX8wda35SWSmzCaQ0qUCPCaSAfhY5qlD+RGDfwTvFagwgvn95RX vp8UPMY0osiPJE3LdYD6TcnQn2KxjspdTlTh22XTrhwm72CPvdYC9ohB9emv0GImx1Kc pEQky0IpYw1AwvbO2+b+8owjji4s/J3H3oEgMDxaqd+9pC8o4UUPyf/ZPQdnr8PTNzsG HK+A== 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 h3si17967361jam.96.2021.05.17.13.58.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 May 2021 13:58:23 -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]:60158 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1likJi-0007O8-RK for patch@linaro.org; Mon, 17 May 2021 16:58:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46156) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1likEu-0005S8-R4; Mon, 17 May 2021 16:53:24 -0400 Received: from [201.28.113.2] (port=46491 helo=outlook.eldorado.org.br) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1likEt-0001mN-0I; Mon, 17 May 2021 16:53:24 -0400 Received: from power9a ([10.10.71.235]) by outlook.eldorado.org.br with Microsoft SMTPSVC(8.5.9600.16384); Mon, 17 May 2021 17:50:32 -0300 Received: from eldorado.org.br (unknown [10.10.70.45]) by power9a (Postfix) with ESMTP id C902680139F; Mon, 17 May 2021 17:50:31 -0300 (-03) From: matheus.ferst@eldorado.org.br To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Subject: [PATCH v5 10/23] target/ppc: Move page crossing check to ppc_tr_translate_insn Date: Mon, 17 May 2021 17:50:12 -0300 Message-Id: <20210517205025.3777947-11-matheus.ferst@eldorado.org.br> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210517205025.3777947-1-matheus.ferst@eldorado.org.br> References: <20210517205025.3777947-1-matheus.ferst@eldorado.org.br> MIME-Version: 1.0 X-OriginalArrivalTime: 17 May 2021 20:50:32.0300 (UTC) FILETIME=[471FE2C0:01D74B5E] 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, luis.pires@eldorado.org.br, lagarcia@br.ibm.com, bruno.larsen@eldorado.org.br, matheus.ferst@eldorado.org.br, 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 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) -- 2.25.1 diff --git a/target/ppc/translate.c b/target/ppc/translate.c index dc0f5fafc2..b1873d2dcc 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -9060,9 +9060,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); } } @@ -9117,6 +9114,11 @@ static void ppc_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) handler->count++; #endif + /* End the TB when crossing a page boundary. */ + if (ctx->base.is_jmp == DISAS_NEXT && !(pc & ~TARGET_PAGE_MASK)) { + ctx->base.is_jmp = DISAS_TOO_MANY; + } + translator_loop_temp_check(&ctx->base); }