From patchwork Mon Aug 22 15:26:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 599133 Delivered-To: patch@linaro.org Received: by 2002:a05:6918:5e84:b0:d4:ea33:5523 with SMTP id nd4csp1811855ysb; Mon, 22 Aug 2022 08:57:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR4k2HDJ/Qj7y4N+wzQTDIg8VTNGTQ9KMlYmfC1L8smFwBMYs7hVHlB0TAMtm0AHPlTv2uv8 X-Received: by 2002:ae9:ef0c:0:b0:6ba:c385:d7de with SMTP id d12-20020ae9ef0c000000b006bac385d7demr13068017qkg.585.1661183866482; Mon, 22 Aug 2022 08:57:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661183866; cv=none; d=google.com; s=arc-20160816; b=vp+t/68ercdu2J7iZUwDHySpnqpO7OZeOisKIbTykIYyR2b+VcNy0CeiTmNaSRaVyG V+DpVqKmvbZW+VsgYWxH3/Cb+oRfZGJkbNuO33OQAFry7aFmpn1lJ8HmnSp9SntiL8XG m7hZMeqHx3GGqdOQBUMvCLj0z8tXldPX9aMcxR7eBIpSEOyt3E6L40Vd9pHYK8PelJQz aXMp0OxRTzGZ+6eepCj0E2IuYzkWoyef3uwQTa7WaKq8chZojqvZpJaw1T2zZSecIAy5 BvEiLwEBaQ2J4Jx4gg7XLrl4835YtEPRyn6Fq4N2QtpkW2kuwu3KMEjaEiIWl+U8kk8b 50zg== 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:cc:to :from:dkim-signature; bh=1eh9DETdW0GbelT1RBsxHXY98fMacnuqD6EL7eauGgo=; b=PKrD2r9AmdQhdxMAp7a0+EWKhNWiipTYJGYlVLF6GCMVTZnXAoMcp4xi7ZC2JIEADD XnDSw6nQ5UzQqr3GQW2iVAqM6HOJaCtlYx0rTMU5ro1aJCJGGLKoEUhZe8bs2J2rPd91 tFPmbK+JsTerFht9OIVM05gZ/k4XLkgyJU+Quvc8cuushAPGqOJOg9FV9d+d020npxae GiZ05Mp/ZZ2JVGgRnM1or6Ow//W2Cx6eRO0vgu10HKljhgkK4wH3Ek+ZHtTV8vUIP5rX xKCCkl5gOjEi8VaaRTix+rK8BRYjVLFXu4Ude6Nx0pDiIEmCnxKqIeeQvistLl4Mzvng lUuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uh4Mnjf1; 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 13-20020a05621420ad00b00496c56acc23si3379990qvd.293.2022.08.22.08.57.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Aug 2022 08:57:46 -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=uh4Mnjf1; 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]:52564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQ9oA-0003sG-1n for patch@linaro.org; Mon, 22 Aug 2022 11:57:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33316) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQ9LM-0007Vk-N3 for qemu-devel@nongnu.org; Mon, 22 Aug 2022 11:28:00 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]:34374) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQ9LG-0000iG-OZ for qemu-devel@nongnu.org; Mon, 22 Aug 2022 11:28:00 -0400 Received: by mail-pl1-x632.google.com with SMTP id jl18so10251796plb.1 for ; Mon, 22 Aug 2022 08:27:54 -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:cc:to:from:from:to:cc; bh=1eh9DETdW0GbelT1RBsxHXY98fMacnuqD6EL7eauGgo=; b=uh4Mnjf1Tj+JoUM49nZJOdbZYwEzSE4XOAJOFM41uoIBywpVKK/exeLo8jOe6skHvu i36lc9g8D4KhQzmo/1ZNbDL+brtcxOig2A2vi3SsEiHiiB6snnwaMQyrfE1b0CcW+ID7 GcY9pN+vFTSXBYe8AVfvtXlGFFh0k5zPplAsCuMQttK+ZluAFA8dyRY1skHe4Ns5r8c6 PzHsVi6Ss+IxbVMSAJAfaxvymEmjzi9YHby5ioPYPSFkGDrUZcJDf9s26WPch5pPz8A+ TBMZnSZsyh198fapgEb1yEE2cwL6NoqRAoSqdHfr3F1MqBwCYbUqSM6aG3HXEQrsYKxt QtLg== 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:cc:to:from:x-gm-message-state:from:to:cc; bh=1eh9DETdW0GbelT1RBsxHXY98fMacnuqD6EL7eauGgo=; b=k7S2ub+mQkKdXSWg88IwmG4S2E1A0FwJxDlIZbi32ohvgCv8caatRariTcILFsZoaN jRXe7LsXhwAUYsKHMSOKuuk4/oWFZkL4ReGrP30PuKGtQI25DCCNR4rReb1kMR0bb0wI R9tQe/ursDsNRx/w+rl0cJsTSDx1WDGMgLrj+mnaPoFY9qg2GyVQetNzrLzr7mH5BHyS FmwkBJZkAUwStdhzhsNc1JJ2jneCEgvRY9aW4Th7G6r6SzofEH9UF4YaHS/sO2yaK0C+ 6fYZ8zjyFmI9E6fsloS3rp38qqE6rsOw+5CMgA/NGzjhRv3D/PHdSvb5hqXGBjHxDSN+ Nppw== X-Gm-Message-State: ACgBeo2KvKZ2RWpVHxssfbC0Ef/n+lzzC07/Hd8QLU4JUDzlc+ZMnhKZ ldQfvA4MuvgAtWUvj6q9pthrTUenruoNWw== X-Received: by 2002:a17:902:d48f:b0:16f:a73:bf04 with SMTP id c15-20020a170902d48f00b0016f0a73bf04mr20911488plg.43.1661182073118; Mon, 22 Aug 2022 08:27:53 -0700 (PDT) Received: from stoup.. ([71.212.157.236]) by smtp.gmail.com with ESMTPSA id q7-20020a17090311c700b0016bffc59718sm8665222plh.58.2022.08.22.08.27.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Aug 2022 08:27:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v2 13/66] target/arm: Add is_secure parameter to get_phys_addr_v5 Date: Mon, 22 Aug 2022 08:26:48 -0700 Message-Id: <20220822152741.1617527-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220822152741.1617527-1-richard.henderson@linaro.org> References: <20220822152741.1617527-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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, T_SCC_BODY_TEXT_LINE=-0.01 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" 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 Reviewed-by: Peter Maydell --- target/arm/ptw.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 5628581ddc..4609278b42 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; } @@ -2512,7 +2511,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); } }