From patchwork Wed Jul 31 20:37:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 170251 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp4475399ile; Wed, 31 Jul 2019 13:44:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzT3rZX4rk01ZSZW7fD7oh9S7x84VrLFu4f/CNGPygA7GG3T81/oVH4Iemybf+K04eMjo9H X-Received: by 2002:a67:f7cd:: with SMTP id a13mr17398142vsp.163.1564605884202; Wed, 31 Jul 2019 13:44:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564605884; cv=none; d=google.com; s=arc-20160816; b=xudIfirfDeojbtja9OFuQiFFgJgJr5jSwtA2ENDSAqueewm5R+a6ZMGSxsLLkEmBAi QENI8EZ2yzC0vPewt+a3wC7p8BmWYgIHgJ29ugAwDf0shXaTT2ilrZh1iRefbWRsPYHZ xUNv/4LsGFOXiD2HSukGMvjnjSFt3cFDWfPcvMYT6g1nk0ctrxGNCQnFZOvhJuzUtW6b oQ7lKhwusXzBmYuI9+n8RGasyLhVkx95/MNw1sqdVkP+liVLslTSL5P8Dq8IovuPIvLG ni3r++1+zGaTKl1/Q9sL7Gcwsc0w7qJHNmyD6pPKaQXonQVEaeGsS98J0NPbmvSc97PG 29eg== 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=VjzDc7lTBTDRBT8iLvPhCchzYrLI8WxMxxlUTCAkZXM=; b=ypmhTSX4zWfM6A6zeTKf7wrhjjTxtDq7Yx40zWsH4QOQwKTGYO3icOPaIqCf1agpml PY1mRVG83DxH/K2kE9lxfru1CYz4lFM/tt30c1ydJRdhLpvlzHTvyMCzaB2QR04PMfk3 AP+K/ROqY9YZrJOfCIZsQFg+J84M3W75YcFjjhHrJmqFFq3mHYBD05tdnkU9EcHu32OP i9lkPvK4MAqYwRTGxLuSeIWOZV5cM67+U7AaL1cfqfMMj+UdHMdY+OxaBRV74gKVdSXW BH4Hz2lQpZQ8HcHyRzVWqra1Kjncy7+ew9OoApC+H3dHCPQSzVJSxcwQ9J9fFpvLJ1hB Njfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=yPTd0O7f; 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 k18si16021039vsm.418.2019.07.31.13.44.44 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 Jul 2019 13:44:44 -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=yPTd0O7f; 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]:44331 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsvSl-00082f-Pi for patch@linaro.org; Wed, 31 Jul 2019 16:44:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32786) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsvMt-0004uz-EJ for qemu-devel@nongnu.org; Wed, 31 Jul 2019 16:38:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsvMs-0003YS-5C for qemu-devel@nongnu.org; Wed, 31 Jul 2019 16:38:39 -0400 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:46530) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hsvMr-0003YC-Ve for qemu-devel@nongnu.org; Wed, 31 Jul 2019 16:38:38 -0400 Received: by mail-pf1-x442.google.com with SMTP id c3so9373793pfa.13 for ; Wed, 31 Jul 2019 13:38:37 -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=VjzDc7lTBTDRBT8iLvPhCchzYrLI8WxMxxlUTCAkZXM=; b=yPTd0O7fRJX3oN/NIk1KJXpMXKNUSUieojMA6sirH87WzI0hLAImW/7xL6AAADqdGj rpCbee1zgVQHL0x4O6SWurc2E7M8vyiXRrD/XH+fKl7EY19JDbMCPP+HjsMa3UqjpevD ceDIHyrTIvQ728fqiyNHc4NAlNtS1Mr4z43dIU9wHC5xgCithjZ9DCXeeidAAuqfFlwg Ztm4xIfvWWnH9wMN09ws2TrENC3djDwlhFmPcULTIm2APPYy4w7Nnsg34oPLnA5uvpE9 xhOPFM1j2+6xZ7/zKa2lkTXcawHqmptADbus7fN3ItMJgnSqt+v3WXkVYXYK82d3YAc2 oH+g== 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=VjzDc7lTBTDRBT8iLvPhCchzYrLI8WxMxxlUTCAkZXM=; b=rysktvuW9EfG0ybGhX4+uxSxygm1mfhMQPtX7TA98Mic6/dHPleOhNqe7qwjHOMgt2 JluB3rvyLuMPyN+mnL1tF/PgSYUiyk5Xu7WtAfJIyHdn1hBa1LT1uGCx3zgzVe1N2T9o NvOd9sT3YiRBd/Xzvlahm5jkqOsffKPF1+mxDveuVyvC8zKK2AhlyjeXDGVDd+LBWJF1 zHje/EbK1SwnMq/+OT4VcjQXD4KV4E4vFsHuWcmEYM3MyCLs68WSXyxiTLPww+EWpfds mL/stutgBmgAXFIEPwQLC3HPeDfZ0sxz3i5mQXMw7UFRk380lpWPukcby7qapJPgcpV7 /L2Q== X-Gm-Message-State: APjAAAWt6Yk72V396Qu2a5TB9+Pgmpjg3kg9ZWaRsjwN6B+5AJeMsMQn thG1aSMw+16bUTfx3GGdmnss+vIOEVg= X-Received: by 2002:a17:90a:2343:: with SMTP id f61mr4805864pje.130.1564605516716; Wed, 31 Jul 2019 13:38:36 -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.35 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 31 Jul 2019 13:38:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 31 Jul 2019 13:37:58 -0700 Message-Id: <20190731203813.30765-18-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::442 Subject: [Qemu-devel] [PATCH v2 17/32] target/arm: Rename ARMMMUIdx_S1NSE* to ARMMMUIdx_Stage1_E* 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 EL1&0 regime is the only one that uses 2-stage translation. Spelling out Stage avoids confusion with Secure. Signed-off-by: Richard Henderson --- target/arm/cpu.h | 4 ++-- target/arm/internals.h | 6 +++--- target/arm/helper.c | 24 ++++++++++++------------ 3 files changed, 17 insertions(+), 17 deletions(-) -- 2.17.1 diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 14730d29c6..ade558f63c 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -2868,8 +2868,8 @@ typedef enum ARMMMUIdx { /* Indexes below here don't have TLBs and are used only for AT system * instructions or for the first stage of an S12 page table walk. */ - ARMMMUIdx_S1NSE0 = 0 | ARM_MMU_IDX_NOTLB, - ARMMMUIdx_S1NSE1 = 1 | ARM_MMU_IDX_NOTLB, + ARMMMUIdx_Stage1_E0 = 0 | ARM_MMU_IDX_NOTLB, + ARMMMUIdx_Stage1_E1 = 1 | ARM_MMU_IDX_NOTLB, } ARMMMUIdx; /* Bit macros for the core-mmu-index values for each index, diff --git a/target/arm/internals.h b/target/arm/internals.h index 1caa15e7e0..cd9b1acb20 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -810,8 +810,8 @@ static inline bool regime_is_secure(CPUARMState *env, ARMMMUIdx mmu_idx) switch (mmu_idx) { case ARMMMUIdx_EL10_0: case ARMMMUIdx_EL10_1: - case ARMMMUIdx_S1NSE0: - case ARMMMUIdx_S1NSE1: + case ARMMMUIdx_Stage1_E0: + case ARMMMUIdx_Stage1_E1: case ARMMMUIdx_S1E2: case ARMMMUIdx_Stage2: case ARMMMUIdx_MPrivNegPri: @@ -966,7 +966,7 @@ ARMMMUIdx arm_mmu_idx(CPUARMState *env); #ifdef CONFIG_USER_ONLY static inline ARMMMUIdx arm_stage1_mmu_idx(CPUARMState *env) { - return ARMMMUIdx_S1NSE0; + return ARMMMUIdx_Stage1_E0; } #else ARMMMUIdx arm_stage1_mmu_idx(CPUARMState *env); diff --git a/target/arm/helper.c b/target/arm/helper.c index 6c8eddfdf4..4c0c314c1a 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -3119,10 +3119,10 @@ static void ats_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) mmu_idx = ARMMMUIdx_S1E3; break; case 2: - mmu_idx = ARMMMUIdx_S1NSE1; + mmu_idx = ARMMMUIdx_Stage1_E1; break; case 1: - mmu_idx = secure ? ARMMMUIdx_S1SE1 : ARMMMUIdx_S1NSE1; + mmu_idx = secure ? ARMMMUIdx_S1SE1 : ARMMMUIdx_Stage1_E1; break; default: g_assert_not_reached(); @@ -3135,10 +3135,10 @@ static void ats_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) mmu_idx = ARMMMUIdx_S1SE0; break; case 2: - mmu_idx = ARMMMUIdx_S1NSE0; + mmu_idx = ARMMMUIdx_Stage1_E0; break; case 1: - mmu_idx = secure ? ARMMMUIdx_S1SE0 : ARMMMUIdx_S1NSE0; + mmu_idx = secure ? ARMMMUIdx_S1SE0 : ARMMMUIdx_Stage1_E0; break; default: g_assert_not_reached(); @@ -3192,7 +3192,7 @@ static void ats_write64(CPUARMState *env, const ARMCPRegInfo *ri, case 0: switch (ri->opc1) { case 0: /* AT S1E1R, AT S1E1W */ - mmu_idx = secure ? ARMMMUIdx_S1SE1 : ARMMMUIdx_S1NSE1; + mmu_idx = secure ? ARMMMUIdx_S1SE1 : ARMMMUIdx_Stage1_E1; break; case 4: /* AT S1E2R, AT S1E2W */ mmu_idx = ARMMMUIdx_S1E2; @@ -3205,7 +3205,7 @@ static void ats_write64(CPUARMState *env, const ARMCPRegInfo *ri, } break; case 2: /* AT S1E0R, AT S1E0W */ - mmu_idx = secure ? ARMMMUIdx_S1SE0 : ARMMMUIdx_S1NSE0; + mmu_idx = secure ? ARMMMUIdx_S1SE0 : ARMMMUIdx_Stage1_E0; break; case 4: /* AT S12E1R, AT S12E1W */ mmu_idx = secure ? ARMMMUIdx_S1SE1 : ARMMMUIdx_EL10_1; @@ -8698,8 +8698,8 @@ static inline uint32_t regime_el(CPUARMState *env, ARMMMUIdx mmu_idx) case ARMMMUIdx_S1SE0: return arm_el_is_aa64(env, 3) ? 1 : 3; case ARMMMUIdx_S1SE1: - case ARMMMUIdx_S1NSE0: - case ARMMMUIdx_S1NSE1: + case ARMMMUIdx_Stage1_E0: + case ARMMMUIdx_Stage1_E1: case ARMMMUIdx_MPrivNegPri: case ARMMMUIdx_MUserNegPri: case ARMMMUIdx_MPriv: @@ -8757,7 +8757,7 @@ static inline bool regime_translation_disabled(CPUARMState *env, } if ((env->cp15.hcr_el2 & HCR_DC) && - (mmu_idx == ARMMMUIdx_S1NSE0 || mmu_idx == ARMMMUIdx_S1NSE1)) { + (mmu_idx == ARMMMUIdx_Stage1_E0 || mmu_idx == ARMMMUIdx_Stage1_E1)) { /* HCR.DC means SCTLR_EL1.M behaves as 0 */ return true; } @@ -8802,7 +8802,7 @@ static inline TCR *regime_tcr(CPUARMState *env, ARMMMUIdx mmu_idx) static inline ARMMMUIdx stage_1_mmu_idx(ARMMMUIdx mmu_idx) { if (mmu_idx == ARMMMUIdx_EL10_0 || mmu_idx == ARMMMUIdx_EL10_1) { - mmu_idx += (ARMMMUIdx_S1NSE0 - ARMMMUIdx_EL10_0); + mmu_idx += (ARMMMUIdx_Stage1_E0 - ARMMMUIdx_EL10_0); } return mmu_idx; } @@ -8837,7 +8837,7 @@ static inline bool regime_is_user(CPUARMState *env, ARMMMUIdx mmu_idx) { switch (mmu_idx) { case ARMMMUIdx_S1SE0: - case ARMMMUIdx_S1NSE0: + case ARMMMUIdx_Stage1_E0: case ARMMMUIdx_MUser: case ARMMMUIdx_MSUser: case ARMMMUIdx_MUserNegPri: @@ -9068,7 +9068,7 @@ static hwaddr S1_ptw_translate(CPUARMState *env, ARMMMUIdx mmu_idx, hwaddr addr, MemTxAttrs txattrs, ARMMMUFaultInfo *fi) { - if ((mmu_idx == ARMMMUIdx_S1NSE0 || mmu_idx == ARMMMUIdx_S1NSE1) && + if ((mmu_idx == ARMMMUIdx_Stage1_E0 || mmu_idx == ARMMMUIdx_Stage1_E1) && !regime_translation_disabled(env, ARMMMUIdx_Stage2)) { target_ulong s2size; hwaddr s2pa;