From patchwork Tue Jun 29 18:54:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 468350 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp5260180jao; Tue, 29 Jun 2021 12:41:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHjE7niE6VUfZCjbAJLODxhi7xlUnDRauyGZjPc5pTrfxo1iC4y6f1cH3/fnR9iFKsOhki X-Received: by 2002:a05:622a:1102:: with SMTP id e2mr28347706qty.370.1624995690160; Tue, 29 Jun 2021 12:41:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624995690; cv=none; d=google.com; s=arc-20160816; b=jBnuBMjOe/dUEVOlBP0s6FTsDyNHGkX232A8dg3EjCxYrm5vmmlhPrkt4dyqH1Zkbk F08ic0+CvtPh1luknBaT4/oRoqoxc7W1NCGu/dnJ5/H6NX5tz6Zh3gCLyRJgKctgZ9pl NKWEJDn4eqNrXrmfM1kZJELoa+WbEGvhfXPpaSIRbFIddpSTcGGEDj/hzOOPyego1SWZ 1AF/xvEv5SUSDw4MwwcBKRj3CLsE8p/hSnJyEhOcN8K8jJZ053qATThiYybPNctBjRB0 P7s0An9tvXuQlamQKTxnzWxaRoBvGpviVa/PRK8oIfME+iOtGWZsY0i7jS7IFc0OIxSZ 5mMw== 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=FVO3wAM4GMS2A+lnpro1PCsnjfTs6t0dHZi0wN04Hig=; b=R4A6spm01sUnEuZnmS+pccfrFZZbFgdeJmAVoYX9WjV40rwqEEGzEe0DLLzUiVXabn S4fMoLC7PbSx/guDKW4jCPFtwgfJ59IyPg+QEgvhLa0dNaDk6jR4HiGxX1YnDTwf9G4b +BEZs1TN35dwEFNtlvP24bF2pPOFk/nAdhvZDMg5PhltGy/T4SgSYxXwBJfHSFLUQcMc JZqpkHgoID39xh0rrrmXtktH03NcSZfzkA7BPyBJW3Yq6svPAORjHY2YSdVHnxsGIWqK XdmlA1TK1hkDUu5/pw9yt0eUP9zeeTOdadGhHQNFsQoIl7WuCgMVbZJIg4lApH4UREdQ JPtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TLL+4wK3; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id gi12si966557qvb.205.2021.06.29.12.41.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Jun 2021 12:41:30 -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=pass header.i=@linaro.org header.s=google header.b=TLL+4wK3; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lyJbt-0001wx-Hw for patch@linaro.org; Tue, 29 Jun 2021 15:41:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38486) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyItD-00085j-7I for qemu-devel@nongnu.org; Tue, 29 Jun 2021 14:55:19 -0400 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]:54183) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lyIt9-0000tE-VI for qemu-devel@nongnu.org; Tue, 29 Jun 2021 14:55:18 -0400 Received: by mail-pj1-x1031.google.com with SMTP id q91so137176pjk.3 for ; Tue, 29 Jun 2021 11:55:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FVO3wAM4GMS2A+lnpro1PCsnjfTs6t0dHZi0wN04Hig=; b=TLL+4wK3udpyDWyTPeyZSXGi0i8iQLf8fe0LnLYK46dwU3u/IX01h6Tqv1UMr0V9Eg KyfOx9OnItPeBLLAgCRtrkyS79byqODTm17pr0r58kSJo3LvtqerERQ47l/xv1JnwvCt uxuR9V0AFojt2+Ye7RNU4BRGGylD4ENnu+d9IgJ//1nBfMy2IYJFoA3Xx1vhQYmbGbUn SCuuk91GPpC9psXHSeCJ/gt3IennLifpQbpQmS+0lEHv9kLRlvYnh7j1zUmLV8HwTHVB Dt0JZPy5oWboq4gWnINVhySuDEHKFkkabsbpQ8AqrpkClgSe/kgBR4PdtYkPDjAYAkOk hsUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FVO3wAM4GMS2A+lnpro1PCsnjfTs6t0dHZi0wN04Hig=; b=uXw59/wcSHgCWGsTuj8wNVXuNLBAn2H0XV1kTIL9QMDokQhw0IQpzxpYrnr8b958y+ fbgFG1Eg92El/dY+hZWtncto7//1soM/h704Vj4+IP2T4AKekCPqu8XsQyEefAK2mTuV JjAb8tEJc2iQ8WeUTgUT78rTIAsMNFvAzXpBtCjMS7/kTqmycYTQnDiQ4quPlThw/Q6r dsYoKzqlzx2v2imlWXZPnyDJzLN5p9IvU0FVlbCGuj8VTRvxY56rwvVNzH0bkVtihvA9 q3JVixYZDP2y3nLM+uEHqyaLTTaE7DzBwz3u2sqh4CQoAS/NPwmcjwqsjLSrI39oUUxN JjBw== X-Gm-Message-State: AOAM533n4QAAKcC/1jETEMyKfL3+nJwITwISqUgWRWXIaLVAQBBcBb9M 4QikYy6QVsYaC4zTxZPaBfHhGbMnIzyqgQ== X-Received: by 2002:a17:90a:bb13:: with SMTP id u19mr34543270pjr.113.1624992905721; Tue, 29 Jun 2021 11:55:05 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id j2sm18811253pfb.53.2021.06.29.11.55.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Jun 2021 11:55:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 17/63] target/cris: Fix use_goto_tb Date: Tue, 29 Jun 2021 11:54:09 -0700 Message-Id: <20210629185455.3131172-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210629185455.3131172-1-richard.henderson@linaro.org> References: <20210629185455.3131172-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: "Edgar E . Iglesias" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Do not skip the page check for user-only -- mmap/mprotect can still change page mappings. Only check dc->base.pc_first, not dc->ppc -- the start page is the only one that's relevant. Reviewed-by: Edgar E. Iglesias Tested-by: Edgar E. Iglesias Signed-off-by: Richard Henderson --- target/cris/translate.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) -- 2.25.1 diff --git a/target/cris/translate.c b/target/cris/translate.c index 24dbae6d58..9e1f2f9239 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -524,14 +524,9 @@ static void t_gen_cc_jmp(TCGv pc_true, TCGv pc_false) gen_set_label(l1); } -static inline bool use_goto_tb(DisasContext *dc, target_ulong dest) +static bool use_goto_tb(DisasContext *dc, target_ulong dest) { -#ifndef CONFIG_USER_ONLY - return (dc->base.pc_first & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK) || - (dc->ppc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK); -#else - return true; -#endif + return ((dest ^ dc->base.pc_first) & TARGET_PAGE_MASK) == 0; } static void gen_goto_tb(DisasContext *dc, int n, target_ulong dest)