From patchwork Fri Jun 4 15:52:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 454109 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp589372jae; Fri, 4 Jun 2021 09:59:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyO8nF9Xo/w50fWGOfnyTXsOTlOVjp8jXNq8qbDxG27e9/DSvqzDyEKi30S8mwRFJSpDi54 X-Received: by 2002:a9d:3d1:: with SMTP id f75mr1418876otf.278.1622825945303; Fri, 04 Jun 2021 09:59:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622825945; cv=none; d=google.com; s=arc-20160816; b=CzGxc00OOpx+TMXa8fAzFxpSwmjCV2HwCFdQb6Rqgcv34bfUkVb11A6J4VA/YSx3Mp OZKdpAKOrfmrhnyylBspYSgiHqHu3fU2crYBkFqzzRc9LEyv8WyxHmIZwqZiM8BsFWZz Qxc8I80VhsR6oYCy3gQbd0CG4ebSbgwKBcEw+eV8cYTlMurOgT5SjLgcKqL3yAQQtvZU VrD1NjkHiI8vNLbMqSDB3vxlzkMkhldjyYDLBj2+/TX3LEIE6v9qLCIqAorQuz4HUnEx 5vAQO3JGSOQNO7k4yyMc+92f4qx1LPSsFhiCZ8R52Z+BET/mVwjQtiyiHflxbxQNnS8X r8vA== 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=dQ5wxdfmiKKfim62JoM4B+biad6w8O8eV+yYLw/gu6A=; b=u5IrSCHKcPDVW/QcE/+OR89CPrZHENMtYxaP3sjUCMFRQwKhH0K1WO7wNYOPvDZNmo TTxcHT2oNOjZ7hN4cJ2FMpApG8H6V7CCfZ69hRl4LagreTIfrD9WEu3WijSBPTpavg3L m9ysIWwze7a2Tm1a/hKaH5Ac8xQGM22RDc8eNBFse7hW6B9i8zeITuATBR5iZtiIBsbR j4CWMPf82i/nadhafJ2uSqY+R+6Tr7z2k6Pb6XT0Ih0l0dnUxlm7TwaiK7cm/9frX7Dr YGYO5paAQMTlp5tWrx9IkOizlLsrkUoAnHnprsV5STFNrDIozqOvzr+q5GBzxUbNJ38i Mmug== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=UJ5lzGop; 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=fail (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 q65si2223195ooq.56.2021.06.04.09.59.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Jun 2021 09:59:05 -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=@linaro.org header.s=google header.b=UJ5lzGop; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpDA0-0008BT-NZ for patch@linaro.org; Fri, 04 Jun 2021 12:59:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpCRC-0002g5-A8 for qemu-devel@nongnu.org; Fri, 04 Jun 2021 12:12:46 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:45998) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpCR7-0003nJ-Tc for qemu-devel@nongnu.org; Fri, 04 Jun 2021 12:12:46 -0400 Received: by mail-wr1-x42b.google.com with SMTP id z8so9831691wrp.12 for ; Fri, 04 Jun 2021 09:12:41 -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=dQ5wxdfmiKKfim62JoM4B+biad6w8O8eV+yYLw/gu6A=; b=UJ5lzGopsP9AQtjSgFaH1tpTRzHkHZ/Vq1B2TWuYenV1Wu/faEwBOseEXSRS5oigbX +4CSqyhboHFqh5+npL7V6R6cxMq/jE8LvXbq5G/46qWnKOOyWbI+ifSQcOnDbwM3HC66 vyd7X1wxtPPCP3vmso89pBgQ1k3vEV6gfJu1QG4fNlKLqR5wMS6v0WgFSzTnSUItHsde su25ryqMMGLLXTyDYevVndq4Pw/RhI+O3PP/HXKibfnYP/bTS0a6zM7yWYA2VrCEqRGe FfRE277Derg5DcQy6/gWZR1luhFS9CN8dkuNrM8NNEOUj8p4Y3p39C5nWjEC2mdG0NsR g2XA== 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=dQ5wxdfmiKKfim62JoM4B+biad6w8O8eV+yYLw/gu6A=; b=g36zxwWmLppCBeqtvOH96A6j7KmYKaWWutJ27BDylDo3fiQ48YLcuysAqB7t39BHFV Hd18q8BkrydbzG43cUzShV8WQZWDAJBv1RVnPBWFqd92zzGPt5RrjyH0Xd7e9ahfP4qd BdxnqXRjnGq3lNj3VFLuKgicIeqp28YGXEvDhTEWiadLlVr3JQWZGKBDhpW3ZOIKQJT0 UEHdkFE38gQRZ54C+W/dy7rYIehi9uDouNfrOd17wS/2cfGMFpd2APpSUbyB8M0eK3Ps 6RlT6bkqLFdgwqdlLvK1hNi4jlZoLSfvZpujCTmruAd7Qs1X31aRXvRDrodAaRVO537P MHyQ== X-Gm-Message-State: AOAM533zHZBeDuM+n993OwDFEp9l9vSHAnS8F3v+vz7suNy+enoH47yI JFL2d5zQ+FZb6Hk4iBlFoQ9LOA== X-Received: by 2002:a5d:4287:: with SMTP id k7mr4860461wrq.98.1622823160471; Fri, 04 Jun 2021 09:12:40 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id u7sm1508669wrt.18.2021.06.04.09.12.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 09:12:37 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 1A3B920002; Fri, 4 Jun 2021 16:53:23 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v16 84/99] target/arm: cpu-common: wrap a64-only check with is_a64 Date: Fri, 4 Jun 2021 16:52:57 +0100 Message-Id: <20210604155312.15902-85-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210604155312.15902-1-alex.bennee@linaro.org> References: <20210604155312.15902-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42b.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: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Claudio Fontana Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Claudio Fontana now that is_a64() is just always false when !TARGET_AARCH64, we can just use that instead of introducing a new ifdef. Signed-off-by: Claudio Fontana Signed-off-by: Alex Bennée --- target/arm/cpu-common.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) -- 2.20.1 Acked-by: Richard Henderson diff --git a/target/arm/cpu-common.c b/target/arm/cpu-common.c index b7a199a8d6..585223350f 100644 --- a/target/arm/cpu-common.c +++ b/target/arm/cpu-common.c @@ -305,9 +305,13 @@ uint64_t arm_sctlr(CPUARMState *env, int el) { /* Only EL0 needs to be adjusted for EL1&0 or EL2&0. */ if (el == 0) { - ARMMMUIdx mmu_idx = arm_mmu_idx_el(env, 0); - el = (mmu_idx == ARMMMUIdx_E20_0 || mmu_idx == ARMMMUIdx_SE20_0) - ? 2 : 1; + if (is_a64(env)) { + ARMMMUIdx mmu_idx = arm_mmu_idx_el(env, 0); + el = (mmu_idx == ARMMMUIdx_E20_0 || mmu_idx == ARMMMUIdx_SE20_0) + ? 2 : 1; + } else { + el = 1; + } } return env->cp15.sctlr_el[el]; }