From patchwork Thu Sep 22 16:35:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 608226 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp455337pvb; Thu, 22 Sep 2022 09:55:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6mmvVsVjlj8mgQ3XNWDN36ObRJoVChZveQKx2mJqx5F0q9NdJm2EpThmHutcIkoUbfLkcu X-Received: by 2002:a05:6214:d85:b0:4aa:acc6:750 with SMTP id e5-20020a0562140d8500b004aaacc60750mr3400038qve.58.1663865704846; Thu, 22 Sep 2022 09:55:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663865704; cv=none; d=google.com; s=arc-20160816; b=F8ugQg4YhtvSCl9H5Y0eR7afzgn1uDQOlYCP71HT3xVKf/+QScHuHOPfwsuuELqOkO /O4L+nwkRTWuVkjtNcqzVxmjpE6SzsCvnCHzO7mhnjQmE+EzhL7GjPA50Dqe1rnISBL0 +cl2thX0VzWGUbwSt6mh8AITTIkytq3QtRdCzzsURXGlIuUPK41mVzEvdG01T/iIMMoW h7uYZc1wjoJTqCtpQwRBD4NtsA2MIKUmMQkidp5DSSZ/5w43Rm8OtPzIk5GCBL+bKJ91 876X4aTrl+pRKMKw2LdXKu2h0wX+uNXSW7Ei3CI14P8uE5Bl4ZiBg+pMN6ZTIQxV4awS NcNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=oH2L/FyjI2KdEq5MITDl2AegrqX2BdO76qwDWANjXFo=; b=S9gXwGA3Gpg8zAsQ4m9oRpA10bThZcfGAkNcYjjy3DkpLjmTG26Js9zYKIrg//t+qA +9k8Cmmaej8B+nxRUS9apcpms6sho4vuBbPKqQ2C3zD35xOdVThqGIt3r5B7Lnzfg5N4 dG77q6BdvajogAQELDJUzgNRNoeo4hHkLLDo2jyh7GYKaZwQ6dJz+B/jVSIHkBC95eQ2 6gO4JnUhkFI4fRRXPVl33eIAvtm+ncOw2oMGjbjS/hg9gGibxk5cu7ode5t2btEpOtZl 2X4UGWpp+DzZ7hm2k37nZmlib/NpD75cW5PAKja1PWM0h/NeAlJO7etXssEvHuzaOIqm roKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VfNM77wU; 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=pass (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 r13-20020ac87eed000000b0034a0edc7637si3112168qtc.436.2022.09.22.09.55.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Sep 2022 09:55:04 -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=pass header.i=@linaro.org header.s=google header.b=VfNM77wU; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obPTc-0001WQ-AJ for patch@linaro.org; Thu, 22 Sep 2022 12:55:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPB1-0002B0-2g for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:59 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:42806) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPAz-0005Pz-Dt for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:50 -0400 Received: by mail-wm1-x32c.google.com with SMTP id o20-20020a05600c4fd400b003b4a516c479so1704933wmq.1 for ; Thu, 22 Sep 2022 09:35:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=oH2L/FyjI2KdEq5MITDl2AegrqX2BdO76qwDWANjXFo=; b=VfNM77wUOsfNPwA775z2CDAytoGbsMoXsUBjCeU9Sgy6bOUztVHn5BRAG301oUuvuD t96dmT5rO6UGQyDv7J3NFLGiR/3lVdLL1E8LDj4R2HBylX9qNvskDNY/F9cOr4mq8TOb iUAlnGtuHDSVyKt5AgHNj7nCc6QwGYet80pv/ky+5xKR1HzQwDV43cq7FopLb0o7F+EZ FwzlKyFKGLNG5yph21h399FjlrT7OsE/+ofGqt4UbhL9BCto6G7Zso+QGtKtfPCd+H1w 4rnzzmbuzZHdnCNk9BSCMgiedsAcTGK3gF+vmc4AOKY0cwJlneBYJDYF8VyJXvLfMPM5 YIJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=oH2L/FyjI2KdEq5MITDl2AegrqX2BdO76qwDWANjXFo=; b=0TEF24j6egVVEi9REJNOgnVJ+CFl9F0fKlHAWVG71W6U/UJogE8k8PelekL0qGglKJ Jb9zPYB7ZxN1SmicTakT4wzL9PklQnfFari5V5EaGp00Iq6sJKzNuB5EYSffsar1EkMv rtMCuV4h+JRRTyZ2HvdsO86CMNhgM2ykeeU+YtMYGLgqHi9f91qFzWVSiE7OllEGATK2 unUtiF8JTiHDfUVe2Cgm+xaWjARgjZ+g2vgrH/cBf6UG2+efnPlxygq5EAuCenBzQdoO C38Mzj712A6KN8aPgPEqE9CEjeTVHp/ZQmX6d24TK9x2gM0VXl7SStwy0BDiaHFdGHWt zvVA== X-Gm-Message-State: ACrzQf1wd/7yiqN505Uff3/DwKGc88yWKq1v7jVs0zfqhRxJ2VH7rv7O xeIjT86J3gIEETcE68negAAOLjerNIWk+w== X-Received: by 2002:a7b:c34c:0:b0:3b3:4067:d473 with SMTP id l12-20020a7bc34c000000b003b34067d473mr3061954wmj.52.1663864548114; Thu, 22 Sep 2022 09:35:48 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:47 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 14/39] target/arm: Add is_secure parameter to get_phys_addr_v5 Date: Thu, 22 Sep 2022 17:35:11 +0100 Message-Id: <20220922163536.1096175-15-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32c.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Remove the use of regime_is_secure from get_phys_addr_v5, passing the new parameter to the lookup instead. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson [PMM: Folded in definition of local is_secure in get_phys_addr(), since I dropped the earlier patch that would have provided it] Message-id: 20220822152741.1617527-14-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/ptw.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 308a9cc3ac9..96639da504e 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -414,7 +414,8 @@ static int simple_ap_to_rw_prot(CPUARMState *env, ARMMMUIdx mmu_idx, int ap) static bool get_phys_addr_v5(CPUARMState *env, uint32_t address, MMUAccessType access_type, ARMMMUIdx mmu_idx, - GetPhysAddrResult *result, ARMMMUFaultInfo *fi) + bool is_secure, GetPhysAddrResult *result, + ARMMMUFaultInfo *fi) { int level = 1; uint32_t table; @@ -433,8 +434,7 @@ static bool get_phys_addr_v5(CPUARMState *env, uint32_t address, fi->type = ARMFault_Translation; goto do_fault; } - desc = arm_ldl_ptw(env, table, regime_is_secure(env, mmu_idx), - mmu_idx, fi); + desc = arm_ldl_ptw(env, table, is_secure, mmu_idx, fi); if (fi->type != ARMFault_None) { goto do_fault; } @@ -472,8 +472,7 @@ static bool get_phys_addr_v5(CPUARMState *env, uint32_t address, /* Fine pagetable. */ table = (desc & 0xfffff000) | ((address >> 8) & 0xffc); } - desc = arm_ldl_ptw(env, table, regime_is_secure(env, mmu_idx), - mmu_idx, fi); + desc = arm_ldl_ptw(env, table, is_secure, mmu_idx, fi); if (fi->type != ARMFault_None) { goto do_fault; } @@ -2291,6 +2290,7 @@ bool get_phys_addr(CPUARMState *env, target_ulong address, GetPhysAddrResult *result, ARMMMUFaultInfo *fi) { ARMMMUIdx s1_mmu_idx = stage_1_mmu_idx(mmu_idx); + bool is_secure = regime_is_secure(env, mmu_idx); if (mmu_idx != s1_mmu_idx) { /* @@ -2393,7 +2393,7 @@ bool get_phys_addr(CPUARMState *env, target_ulong address, * cannot upgrade an non-secure translation regime's attributes * to secure. */ - result->attrs.secure = regime_is_secure(env, mmu_idx); + result->attrs.secure = is_secure; result->attrs.user = regime_is_user(env, mmu_idx); /* @@ -2515,7 +2515,7 @@ bool get_phys_addr(CPUARMState *env, target_ulong address, result, fi); } else { return get_phys_addr_v5(env, address, access_type, mmu_idx, - result, fi); + is_secure, result, fi); } }