From patchwork Fri Jun 4 15:52:11 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: 454105 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp584472jae; Fri, 4 Jun 2021 09:52:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzm2vu/MqOBigkFWcRek+vmh96q28PXZQbefG+9WxDz/U5ks+3m1TkJWrFInnJjv3RK6iO X-Received: by 2002:ab0:6646:: with SMTP id b6mr4314470uaq.1.1622825541652; Fri, 04 Jun 2021 09:52:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622825541; cv=none; d=google.com; s=arc-20160816; b=Wz8H4PQTfoYUgLSjvQv/T/g55AZmCi1DVpB4d6Ji0dnlF+lM+d4kMYrwGpSACQ1FSM /FhczjeVb8gY47o+00efDpYHBLhiv3UH5bugloVA77HX1o6698qgJNjz0PjZBHNBFxj6 JrFRk20xl3PyxBOBESMCYLzRME4im9w8voaFSJ2/GOeYQG99zaSabQSpWzmGTEHn7DXr RA7ihOi5K6NVduaVV3/a/92HdEZckdwGqhgCuuCAMA69Izl7SKah64SgUNeFC211VesD zYV2ujrwmzZIhMYHmoscLr0gi+sP8LUsuql5EaP9Quq8QeFpgTetJX7UnevYImbzzWJm 0L5g== 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=g+Q0O4/5dNcGlD5UswsObaT0lA+we8GvoPB9oAtz7uU=; b=iGlOyLCPMIse5ntoRpU1zEdLmxd6Ey6o2RbvG0oxlUpeF2b7Sj3kStULep/itHIn5E f7khcWRLmkotqqqo7FgW6u8qFQZuh6LEKaZaswzpihGUwPzReeggKrxFz/R2y9QWrs0Z QUTpmo7NGYFZEnL0Z7TlPykg6KmMyYXU3ltUr/75Ox+1sMsHemOPejr/xuW/pcwcOe3f SvXX7fNISBZaM5iX4HcSAcku5IXE216vtSqBp6h82uQIGU17XGlU3quh/DHCx6OTNYMV EeVMWWixI+yPmvz0mIUgtSp3Q5X+AqcDXQqiI+ClJVQjbXycGaL97mi+QyByLCM/BfK6 qYDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ZUqdxDtO; 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 q99si3752287uaq.212.2021.06.04.09.52.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Jun 2021 09:52:21 -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=ZUqdxDtO; 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]:34512 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpD3U-0007Mb-SD for patch@linaro.org; Fri, 04 Jun 2021 12:52:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33714) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpCkq-0008UQ-GM for qemu-devel@nongnu.org; Fri, 04 Jun 2021 12:33:06 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:33391) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpCke-0002Ci-Bv for qemu-devel@nongnu.org; Fri, 04 Jun 2021 12:33:04 -0400 Received: by mail-wr1-x433.google.com with SMTP id a20so9970592wrc.0 for ; Fri, 04 Jun 2021 09:32:51 -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=g+Q0O4/5dNcGlD5UswsObaT0lA+we8GvoPB9oAtz7uU=; b=ZUqdxDtOXBlUTU70E4QInDY4qg3i0sn6r4uCyhH4FcORUrlcmUbbb066JybG0E5tgl zN/5YDs1jwsArbJa0ViqtUITGzqr5aW4+hHDncXPx7P9YHH/30MLRienUPO1kL960nwE SkB5m35SdySz4NmDgKEAWMB04gEfIQVtZlwHoEalOhPKEIhTnppnIwPNrpA4j9oVzGwU 5OIl684i6YYmyv4QjsHLAeSTkiaz4N3yI59yIw6saEq455CdtcGHm+T1v9ztqUrV1ovc a5MNtl9hifxKHik8We3xKiGhovBj2HhJt8ndh5m32mpCjNYdPn0VJoyJvL6MBuBu2oNJ hMpg== 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=g+Q0O4/5dNcGlD5UswsObaT0lA+we8GvoPB9oAtz7uU=; b=V4UFSPb/i+PdjTxdvKK4wWH1YxPOh8Ah0kWYw1Y8vmE1CFA+ITdBGi6TQ+owJUrxQB Mx69zkfyJDX82B35m5e/gZxrPjaUZQoO0nt07dJ4+Vp9NeJxkOzpUfeajkfW3tgm806+ 45tzCjL/JgQk/TrfiAHU80+KlwICBaOIqJxsjgvN9r5wLiEuY76D6IAbQMRDtS0yo6vP G9ouwuLQFIGJfjLW3A+0d7P6KK95ODYGw5dqsou0NPz7TDQAOnN0CXrPQoMON2XC4d7u sLGrsOfB9PZ/w7H04Ap3bf7sIVfwaEie9HyTuSszAsXYXNfP2Z3QRPiauS7Nq2PJSP7o ud7w== X-Gm-Message-State: AOAM532EqgwVS7Opc7IgtLFcDkjEyCoTKjHHBnGVD2kAcAL63qRkq0gf pJY0m05QZiKFzoPAY8cBngJN8Q== X-Received: by 2002:a05:6000:18ac:: with SMTP id b12mr4660754wri.44.1622824371142; Fri, 04 Jun 2021 09:32:51 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id m11sm5748495wmq.33.2021.06.04.09.32.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 09:32:43 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A8E821FF8F; Fri, 4 Jun 2021 16:53:17 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v16 38/99] target/arm: move arm_sctlr away from tcg helpers Date: Fri, 4 Jun 2021 16:52:11 +0100 Message-Id: <20210604155312.15902-39-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::433; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x433.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=unavailable 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 this function is used for kvm too, add it to the cpu-common module. Signed-off-by: Claudio Fontana Signed-off-by: Alex Bennée --- target/arm/cpu-common.c | 11 +++++++++++ target/arm/tcg/helper.c | 11 ----------- 2 files changed, 11 insertions(+), 11 deletions(-) -- 2.20.1 Reviewed-by: Richard Henderson diff --git a/target/arm/cpu-common.c b/target/arm/cpu-common.c index a34f7f19d8..93aea216cc 100644 --- a/target/arm/cpu-common.c +++ b/target/arm/cpu-common.c @@ -342,3 +342,14 @@ uint32_t sve_zcr_len_for_el(CPUARMState *env, int el) } /* #endif TARGET_AARCH64 , see matching comment above */ + +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; + } + return env->cp15.sctlr_el[el]; +} diff --git a/target/arm/tcg/helper.c b/target/arm/tcg/helper.c index 93fa3fa2a9..b9ea043f20 100644 --- a/target/arm/tcg/helper.c +++ b/target/arm/tcg/helper.c @@ -1675,17 +1675,6 @@ void arm_cpu_do_interrupt(CPUState *cs) } #endif /* !CONFIG_USER_ONLY */ -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; - } - return env->cp15.sctlr_el[el]; -} - /* Returns true if the stage 1 translation regime is using LPAE format page * tables. Used when raising alignment exceptions, whose FSR changes depending * on whether the long or short descriptor format is in use. */