From patchwork Wed Jul 31 20:38:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 170256 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp4476582ile; Wed, 31 Jul 2019 13:46:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVoYhH4uyZhQaMTBnbdhxbSUWGEzmZYoJYma+WcuBeV3O1jWa4c+9Ne7TqlpnKuX6237zk X-Received: by 2002:a17:906:ad82:: with SMTP id la2mr29779595ejb.123.1564605973831; Wed, 31 Jul 2019 13:46:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564605973; cv=none; d=google.com; s=arc-20160816; b=Wy7TSZheJCC1Bf1PcLvCL2zQ1Wtmth4v8W9NNhEoV6ejuVGm5jIyiTLV7qQZNUcHn0 tdgP2pizBGRWPl5/qoqyBG0I0NiQs/6KrCPyY/P7ZP2mhFQVC37VxHi/b+z7Usjhhgt1 KvjxL/cVGYqVUl+v27nyVdrmrfFZ9engtvPIWYYcmL5FTL9rfJtXmhAQnIwxwrcZLc7+ WSB1G5hFi7gatUJrSI0GHbYjBhCOpOuNqc2RKMg+hSViB/sU6s47FebI7CPoH08i/U87 vYhoBE/Qkt0NFfamYX7qynozF7OPQXq8pj3zbIpEMiTz+4QwrxK78jaaXfz4z+UOYR/W av8w== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=uNn5q4INDqZzSSWnDmMk9zDSnWJbLDXBWQcIuUU2uJI=; b=htq4zPRMi5bnVFhxbiedXukbP3UHU64IRkj/Gz725XQmPY9vldDzuEKMHfS/lvjLwg toYIvxsYoy5YG3JHVRCSYCt/gF361vn6oB3Cei2mP3XbIF5NPcx2EhKLG8JRg6d2g60i b2Epj6mCxXs513dNDSZjJxUjpY00tng03O8dcwzUQyc6/qRKyRt2DF/4WCEJ26cqcC9N Mi7/la/62rmu0/ZZ50KkbQJEaz787wBRz43Gen9nYQsf9Uf+G6zgXS151fJiFB1WWp9t 5lh2QH0KjRTwhWKgc1zCBIMP9R+u7fFL6PVjx0+aJRPJgooBoWM1Cc+/B3sGQtw1s9I3 j3vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Z7CoxzCy; 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 h11si19988958ejb.137.2019.07.31.13.46.13 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 Jul 2019 13:46:13 -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=Z7CoxzCy; 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]:44370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsvUC-0003ZK-Qn for patch@linaro.org; Wed, 31 Jul 2019 16:46:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32849) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsvMw-00052Z-2m for qemu-devel@nongnu.org; Wed, 31 Jul 2019 16:38:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsvMu-0003ad-HN for qemu-devel@nongnu.org; Wed, 31 Jul 2019 16:38:41 -0400 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:32941) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hsvMu-0003a4-A3 for qemu-devel@nongnu.org; Wed, 31 Jul 2019 16:38:40 -0400 Received: by mail-pg1-x542.google.com with SMTP id n190so1202372pgn.0 for ; Wed, 31 Jul 2019 13:38:40 -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; bh=uNn5q4INDqZzSSWnDmMk9zDSnWJbLDXBWQcIuUU2uJI=; b=Z7CoxzCy7QzgKSn7JoSt1DYfrp/h+j3DRImGw5eTnQYNT05aU5yG6PH19lI08Oc2Mc OYFD/NRagj8NbGPMqM0YojWoortqXmBm3imFic2o+VZQqHspWlm/NKYfHItMCwaHdxEs z8LZY7XseWXFpasA+AD5VRVJoNb2+aZmdy+NOjFPhKR93qoUwpmI/a4YFm1mKco+6fOh KQIy4NX1pbso1YyxH9Am4evsc7J6BvN75BY1AoWlkfOqq3qlOyV1VvV0TVglIZcONbxK 0jpkdMJQHTnIenX0l3orH4NaCF2S5gVX9VqiBv9HsqD3RaS78FVWtsD1XSQZ7+VDcSdn 4AtQ== 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; bh=uNn5q4INDqZzSSWnDmMk9zDSnWJbLDXBWQcIuUU2uJI=; b=R//Q8WijVX13K4kdDHDK4pVDTBSTEFoE8VJ4swrvIqxCIuBWqcJjUduINVvhpvKaXM wGxXQ1UDzVQkiKQLLDyBjyF+qn2U7kO77dAnX1fDETpVsuATsOq9a7DfJ4vkP2DLJ7hJ 59T75oWO/SjxgU/wc+M7D18EZeZvEGJsahpaUKVjiSVGAgx8cBvM+eKKP9M9GhfUEter mvmjtX6Gp1byYvKK2Crq2WV9ADGd8d9mBIzIRvLAvFjXDTZyBO4k+bf+HQJKxi8wm8UJ LETgQor5vWlN/hoQPzfSTDctmnfZwuzVe/HqCnnsDqhp+rd11yoC1tNXzMONx6lLLMYS TmFA== X-Gm-Message-State: APjAAAUif1TR2O3tRMSgQBFHdwtAZLI00RyKCknUeKzDyQHTScVNNMqZ 02KsANqwsgmlq7YInkNiMjijrtMb8PU= X-Received: by 2002:a63:ff65:: with SMTP id s37mr73372006pgk.102.1564605519022; Wed, 31 Jul 2019 13:38:39 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id g4sm84054164pfo.93.2019.07.31.13.38.37 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 31 Jul 2019 13:38:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 31 Jul 2019 13:38:00 -0700 Message-Id: <20190731203813.30765-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190731203813.30765-1-richard.henderson@linaro.org> References: <20190731203813.30765-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::542 Subject: [Qemu-devel] [PATCH v2 19/32] target/arm: Rename ARMMMUIdx*_S1E3 to ARMMMUIdx*_SE3 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@linaro.org, qemu-arm@nongnu.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is part of a reorganization to the set of mmu_idx. The EL3 regime only has a single stage translation, and is always secure. Signed-off-by: Richard Henderson --- target/arm/cpu.h | 4 ++-- target/arm/internals.h | 2 +- target/arm/helper.c | 18 +++++++++--------- target/arm/translate.c | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) -- 2.17.1 diff --git a/target/arm/cpu.h b/target/arm/cpu.h index c7ce8a4da5..94337b2fb0 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -2853,7 +2853,7 @@ typedef enum ARMMMUIdx { ARMMMUIdx_EL10_0 = 0 | ARM_MMU_IDX_A, ARMMMUIdx_EL10_1 = 1 | ARM_MMU_IDX_A, ARMMMUIdx_S1E2 = 2 | ARM_MMU_IDX_A, - ARMMMUIdx_S1E3 = 3 | ARM_MMU_IDX_A, + ARMMMUIdx_SE3 = 3 | ARM_MMU_IDX_A, ARMMMUIdx_SE0 = 4 | ARM_MMU_IDX_A, ARMMMUIdx_SE1 = 5 | ARM_MMU_IDX_A, ARMMMUIdx_Stage2 = 6 | ARM_MMU_IDX_A, @@ -2879,7 +2879,7 @@ typedef enum ARMMMUIdxBit { ARMMMUIdxBit_EL10_0 = 1 << 0, ARMMMUIdxBit_EL10_1 = 1 << 1, ARMMMUIdxBit_S1E2 = 1 << 2, - ARMMMUIdxBit_S1E3 = 1 << 3, + ARMMMUIdxBit_SE3 = 1 << 3, ARMMMUIdxBit_SE0 = 1 << 4, ARMMMUIdxBit_SE1 = 1 << 5, ARMMMUIdxBit_Stage2 = 1 << 6, diff --git a/target/arm/internals.h b/target/arm/internals.h index c505cae30c..dbb46da549 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -819,7 +819,7 @@ static inline bool regime_is_secure(CPUARMState *env, ARMMMUIdx mmu_idx) case ARMMMUIdx_MPriv: case ARMMMUIdx_MUser: return false; - case ARMMMUIdx_S1E3: + case ARMMMUIdx_SE3: case ARMMMUIdx_SE0: case ARMMMUIdx_SE1: case ARMMMUIdx_MSPrivNegPri: diff --git a/target/arm/helper.c b/target/arm/helper.c index e0d4f33026..e5b07b4770 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -3116,7 +3116,7 @@ static void ats_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) /* stage 1 current state PL1: ATS1CPR, ATS1CPW */ switch (el) { case 3: - mmu_idx = ARMMMUIdx_S1E3; + mmu_idx = ARMMMUIdx_SE3; break; case 2: mmu_idx = ARMMMUIdx_Stage1_E1; @@ -3198,7 +3198,7 @@ static void ats_write64(CPUARMState *env, const ARMCPRegInfo *ri, mmu_idx = ARMMMUIdx_S1E2; break; case 6: /* AT S1E3R, AT S1E3W */ - mmu_idx = ARMMMUIdx_S1E3; + mmu_idx = ARMMMUIdx_SE3; break; default: g_assert_not_reached(); @@ -3422,9 +3422,9 @@ static void update_lpae_el1_asid(CPUARMState *env, int secure) ttbr0 = env->cp15.ttbr0_s; ttbr1 = env->cp15.ttbr1_s; ttcr = env->cp15.tcr_el[3].raw_tcr; - /* Note that cp15.ttbr0_s == cp15.ttbr0_el[3], so S1E3 is affected. */ + /* Note that cp15.ttbr0_s == cp15.ttbr0_el[3], so SE3 is affected. */ /* ??? Secure EL3 really using the ASID field? Doesn't make sense. */ - idxmask = ARMMMUIdxBit_SE1 | ARMMMUIdxBit_SE0 | ARMMMUIdxBit_S1E3; + idxmask = ARMMMUIdxBit_SE1 | ARMMMUIdxBit_SE0 | ARMMMUIdxBit_SE3; break; case ARM_CP_SECSTATE_NS: ttbr0 = env->cp15.ttbr0_ns; @@ -3967,7 +3967,7 @@ static void tlbi_aa64_alle3_write(CPUARMState *env, const ARMCPRegInfo *ri, ARMCPU *cpu = env_archcpu(env); CPUState *cs = CPU(cpu); - tlb_flush_by_mmuidx(cs, ARMMMUIdxBit_S1E3); + tlb_flush_by_mmuidx(cs, ARMMMUIdxBit_SE3); } static void tlbi_aa64_alle1is_write(CPUARMState *env, const ARMCPRegInfo *ri, @@ -3992,7 +3992,7 @@ static void tlbi_aa64_alle3is_write(CPUARMState *env, const ARMCPRegInfo *ri, { CPUState *cs = env_cpu(env); - tlb_flush_by_mmuidx_all_cpus_synced(cs, ARMMMUIdxBit_S1E3); + tlb_flush_by_mmuidx_all_cpus_synced(cs, ARMMMUIdxBit_SE3); } static void tlbi_aa64_vae2_write(CPUARMState *env, const ARMCPRegInfo *ri, @@ -4020,7 +4020,7 @@ static void tlbi_aa64_vae3_write(CPUARMState *env, const ARMCPRegInfo *ri, CPUState *cs = CPU(cpu); uint64_t pageaddr = sextract64(value << 12, 0, 56); - tlb_flush_page_by_mmuidx(cs, pageaddr, ARMMMUIdxBit_S1E3); + tlb_flush_page_by_mmuidx(cs, pageaddr, ARMMMUIdxBit_SE3); } static void tlbi_aa64_vae1is_write(CPUARMState *env, const ARMCPRegInfo *ri, @@ -4069,7 +4069,7 @@ static void tlbi_aa64_vae3is_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t pageaddr = sextract64(value << 12, 0, 56); tlb_flush_page_by_mmuidx_all_cpus_synced(cs, pageaddr, - ARMMMUIdxBit_S1E3); + ARMMMUIdxBit_SE3); } static void tlbi_aa64_ipas2e1_write(CPUARMState *env, const ARMCPRegInfo *ri, @@ -8693,7 +8693,7 @@ static inline uint32_t regime_el(CPUARMState *env, ARMMMUIdx mmu_idx) case ARMMMUIdx_Stage2: case ARMMMUIdx_S1E2: return 2; - case ARMMMUIdx_S1E3: + case ARMMMUIdx_SE3: return 3; case ARMMMUIdx_SE0: return arm_el_is_aa64(env, 3) ? 1 : 3; diff --git a/target/arm/translate.c b/target/arm/translate.c index 1fc2bf8a52..5372947e47 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -156,7 +156,7 @@ static inline int get_a32_user_mem_index(DisasContext *s) case ARMMMUIdx_EL10_0: case ARMMMUIdx_EL10_1: return arm_to_core_mmu_idx(ARMMMUIdx_EL10_0); - case ARMMMUIdx_S1E3: + case ARMMMUIdx_SE3: case ARMMMUIdx_SE0: case ARMMMUIdx_SE1: return arm_to_core_mmu_idx(ARMMMUIdx_SE0);