From patchwork Tue Aug 22 15:08:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 110682 Delivered-To: patches@linaro.org Received: by 10.140.95.78 with SMTP id h72csp2816301qge; Tue, 22 Aug 2017 08:09:12 -0700 (PDT) X-Received: by 10.223.141.230 with SMTP id o93mr681648wrb.110.1503414552735; Tue, 22 Aug 2017 08:09:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503414552; cv=none; d=google.com; s=arc-20160816; b=x7QcPzNzqr/pSJSgVwEaVsFOD1I20WsPGo3NnrG9BX+StJGh56y4VKmMjRvWydMWz9 D4jR5he4SlKAY4Ux/4jur/aAE6EKbgpIlJ1Ch8M/9gcsvKI5OQiLf0yZaxaY8mODHnJ+ j59SSJ545H4jrGvv08vrX6SyvFXoaeWUumeSz28FyIzPgzOvIGIqefzSkl46F8UxH8UU cusTfWZB7/+GnrjZWefyCiWvyWYxVn1h2CWAfMmHOWUbUSKIkEWzlgGOYBtolMUIR6VY 8qev+yEa89fl3DKY75D8xp+R885I+NcUflL65cr7eRFDI3uL4p0d91eU0gOTHR+xzgTP jzug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=sZxHIQ0uWucKo+x7Wygy7dwH0CR+l8l/OL+PUZTpbcs=; b=Pex9io9RpSpLZO5MmBeWsFvI73+uykwFp5Q/tfL0micpweZWpZrvxBkieZHqI1So4S /0+p3JBtsj/f0a8mAo690JrWXPnShzS8I+ktc5rW5u+0C1gc7xn+Vbab8DhhqIZBngmv u0FDGM/lrp8XYMPSUouz4oLnsVuT9bNGVO+P6dyNeoRRJqF0YpLAlXCCJGR63r++Hkv8 vYZ/qiMc93MRwe7V22iVxvCI6hsmx4oHbCuGeVa4+OZoEI1CoLu71ciAOzZ1s2vGfeDz 69WdvMFofaaMocTPOEl7LOD3DzGWjdsdS15zvd7dQeqksLnSLY5RROsBQVUa10ux6qjf hdvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by mx.google.com with ESMTPS id 137si42270wmk.261.2017.08.22.08.09.12 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2017 08:09:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) client-ip=2001:8b0:1d0::2; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1dkAnn-0004m0-Pn; Tue, 22 Aug 2017 16:09:11 +0100 From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: patches@linaro.org Subject: [PATCH 19/20] target/arm: Move regime_is_secure() to target/arm/internals.h Date: Tue, 22 Aug 2017 16:08:58 +0100 Message-Id: <1503414539-28762-20-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503414539-28762-1-git-send-email-peter.maydell@linaro.org> References: <1503414539-28762-1-git-send-email-peter.maydell@linaro.org> Move the regime_is_secure() utility function to internals.h; we are going to want to call it from translate.c. Signed-off-by: Peter Maydell --- target/arm/internals.h | 26 ++++++++++++++++++++++++++ target/arm/helper.c | 26 -------------------------- 2 files changed, 26 insertions(+), 26 deletions(-) -- 2.7.4 Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé diff --git a/target/arm/internals.h b/target/arm/internals.h index bb06946..eb171b1 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -478,4 +478,30 @@ static inline void arm_call_el_change_hook(ARMCPU *cpu) } } +/* Return true if this address translation regime is secure */ +static inline bool regime_is_secure(CPUARMState *env, ARMMMUIdx mmu_idx) +{ + switch (mmu_idx) { + case ARMMMUIdx_S12NSE0: + case ARMMMUIdx_S12NSE1: + case ARMMMUIdx_S1NSE0: + case ARMMMUIdx_S1NSE1: + case ARMMMUIdx_S1E2: + case ARMMMUIdx_S2NS: + case ARMMMUIdx_MPriv: + case ARMMMUIdx_MNegPri: + case ARMMMUIdx_MUser: + return false; + case ARMMMUIdx_S1E3: + case ARMMMUIdx_S1SE0: + case ARMMMUIdx_S1SE1: + case ARMMMUIdx_MSPriv: + case ARMMMUIdx_MSNegPri: + case ARMMMUIdx_MSUser: + return true; + default: + g_assert_not_reached(); + } +} + #endif diff --git a/target/arm/helper.c b/target/arm/helper.c index 67b3874..b1ae73c 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -7060,32 +7060,6 @@ static inline uint32_t regime_el(CPUARMState *env, ARMMMUIdx mmu_idx) } } -/* Return true if this address translation regime is secure */ -static inline bool regime_is_secure(CPUARMState *env, ARMMMUIdx mmu_idx) -{ - switch (mmu_idx) { - case ARMMMUIdx_S12NSE0: - case ARMMMUIdx_S12NSE1: - case ARMMMUIdx_S1NSE0: - case ARMMMUIdx_S1NSE1: - case ARMMMUIdx_S1E2: - case ARMMMUIdx_S2NS: - case ARMMMUIdx_MPriv: - case ARMMMUIdx_MNegPri: - case ARMMMUIdx_MUser: - return false; - case ARMMMUIdx_S1E3: - case ARMMMUIdx_S1SE0: - case ARMMMUIdx_S1SE1: - case ARMMMUIdx_MSPriv: - case ARMMMUIdx_MSNegPri: - case ARMMMUIdx_MSUser: - return true; - default: - g_assert_not_reached(); - } -} - /* Return the SCTLR value which controls this address translation regime */ static inline uint32_t regime_sctlr(CPUARMState *env, ARMMMUIdx mmu_idx) {