From patchwork Mon Aug 22 15:26:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 599142 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:4388:0:0:0:0 with SMTP id w8csp1793057mae; Mon, 22 Aug 2022 09:25:49 -0700 (PDT) X-Google-Smtp-Source: AA6agR49fNJKNBVdUR1RUM7MXJmGs6cwcx57BLeKTXcJB3Jvv/dITWuy/SH5Nt/5bvv1Z1ZBWkw1 X-Received: by 2002:a05:6214:2462:b0:496:2772:3211 with SMTP id im2-20020a056214246200b0049627723211mr16078117qvb.28.1661185549030; Mon, 22 Aug 2022 09:25:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661185549; cv=none; d=google.com; s=arc-20160816; b=W10Xr/QV1JJDQjhkZ5UierJokNgNjYGoUMQbk4Jl4Rsc+lOELaFBH0pm6fBvL6Wf+A EZ8pRiqOjsIkJLt8AN1xhJvd0Z/OQLCO9DA678ZzYhf9nsOuBnS48XJ7yZnP3Vfbdosp TH9dTB3ZnVq0lgDyYSoJ8nIv3D3Qcy5JVF8FEO9AXX9FXOhi9uLjmdCdcnFYjBZ3Iphj TrkVwkrFOxJZoaz4/+eguyjkBJZOnvc99PaLbOF+kG1I3IP6Ij0vcX/Z4Y4/A0rs5BIO RAtSi+8c6/r9rJtsgT1nmtVxqxSZykIwoRkpzM7zHmdwPd7KTd4uQRFX/3MKgpiAHllN XJsw== 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=BX+4xB/VDWHk38SQNes18SXGBzYUd9d/yvot5DujC+I=; b=u6V0Pxo+VZeMBeBxheGuYzm3Xleu+qH7qrAFgC7lU5XOpdUHnYnYBFzH66v7L7rViN uHJtQAvjodR8uxu2tCk6L8FoVS7hVStSujeWqGmI01PXcE6b1WZD3HwX8xYc7pd14LnO 4de/J+PP3+6yRaG/PjsmFB1z5hon6dwVPmKDNXUC2zzW1+GBYp6cRRNi/NuTiypOZ3J8 3vnjMpYPVLCZG25c1jaHDe7eXq+yti4uAMiXOwm6xqFGcgNb7sLeahw0G1rarRFWOTdh rNhGEl9KOa1lww4ljTLAXWynuz/OQPdfZqb88e021nDmQDsCkf+HPEZmbEY1n8ToOLi0 jXWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n6ywuIDZ; 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 f2-20020a05620a408200b006b94668cedcsi5639534qko.630.2022.08.22.09.25.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Aug 2022 09:25:49 -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=n6ywuIDZ; 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]:38222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQAFI-0006ZK-EG for patch@linaro.org; Mon, 22 Aug 2022 12:25:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33334) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQ9LR-0007ic-04 for qemu-devel@nongnu.org; Mon, 22 Aug 2022 11:28:05 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:41944) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQ9LH-0000it-Gj for qemu-devel@nongnu.org; Mon, 22 Aug 2022 11:28:03 -0400 Received: by mail-pj1-x102e.google.com with SMTP id t2-20020a17090a4e4200b001f21572f3a4so11693294pjl.0 for ; Mon, 22 Aug 2022 08:27:55 -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=BX+4xB/VDWHk38SQNes18SXGBzYUd9d/yvot5DujC+I=; b=n6ywuIDZmU/esoI0SslXsFkFgnj4YQVQmtEk90igcrxqCbjK0fCmqqNYYuJ6i/PrV1 8xZtI3EGQ9wx979Ls7pyQr8xBd/5QLYZ29wh0vYJOGCv3Sijqg3eO9hP9Xc+CSMblkp4 pURLEQxeH28HF678GhvlvV6WO6pZ+ieI2PMynqXippJTaaEFGixlDoRyRV1vpf5GheR1 7PME3mapuHLKCGBKNbJOGncy4mt7UnYBgFTCcJm1z+YlQL2yb2X22lU7x3dh5vcdhYDT tBnW1m9vZwcVot3nOjfUrGmOveSy0sIC0Ygtd4e6vtRldKghttfSqvdKEW/3sKEL4kWr 2w4Q== 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=BX+4xB/VDWHk38SQNes18SXGBzYUd9d/yvot5DujC+I=; b=vKuU3apAgQU8+QdDGrsXRx0JLO0Cwr+lbzUInxAf3yuVJ4PmRDix1suVwSgMY+EZ+X teia6fE1y5Tocy/Yd9Sm/pvfmGwT3my7dSHf3d4VoCQ6/RxZsfLjoGVIFYTdFx4F48YK wGrWd2Q2Uv/qtteUF043LyNmv8FGni/PsjvKKWBILExhHC8JRUiL35yJ5NUzjEL77jiF Uo4O058mdTC9UiUfIoAIsr3h/+SocxGWFWb2TLeSKl5rYIPPZaXuVXSsqaLuLylxLhgW kAXR3j7EuqzChelPVD66uhAT5h4oNoKVg2zs0ZJkIgjD3DKkdsaA222ZOafRrY/guNk1 gWow== X-Gm-Message-State: ACgBeo2W9yd66m1hmFQsniaBumZtwjNL2u0A447aC3/2HZ5a0wTHkMpO qO6OdPtslhkSreGGoYPQhyja/mJUwrwttg== X-Received: by 2002:a17:902:f688:b0:172:f892:5c3c with SMTP id l8-20020a170902f68800b00172f8925c3cmr1906447plg.49.1661182074122; Mon, 22 Aug 2022 08:27:54 -0700 (PDT) Received: from stoup.. ([71.212.157.236]) by smtp.gmail.com with ESMTPSA id q7-20020a17090311c700b0016bffc59718sm8665222plh.58.2022.08.22.08.27.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Aug 2022 08:27:53 -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 14/66] target/arm: Add is_secure parameter to get_phys_addr_v6 Date: Mon, 22 Aug 2022 08:26:49 -0700 Message-Id: <20220822152741.1617527-15-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::102e; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102e.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_v6, 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 4609278b42..a6880d051b 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -533,7 +533,8 @@ do_fault: static bool get_phys_addr_v6(CPUARMState *env, uint32_t address, MMUAccessType access_type, ARMMMUIdx mmu_idx, - GetPhysAddrResult *result, ARMMMUFaultInfo *fi) + bool is_secure, GetPhysAddrResult *result, + ARMMMUFaultInfo *fi) { ARMCPU *cpu = env_archcpu(env); int level = 1; @@ -556,8 +557,7 @@ static bool get_phys_addr_v6(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; } @@ -610,8 +610,7 @@ static bool get_phys_addr_v6(CPUARMState *env, uint32_t address, ns = extract32(desc, 3, 1); /* Lookup l2 entry. */ table = (desc & 0xfffffc00) | ((address >> 10) & 0x3fc); - 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; } @@ -2508,7 +2507,7 @@ bool get_phys_addr(CPUARMState *env, target_ulong address, result, fi); } else if (regime_sctlr(env, mmu_idx) & SCTLR_XP) { return get_phys_addr_v6(env, address, access_type, mmu_idx, - result, fi); + is_secure, result, fi); } else { return get_phys_addr_v5(env, address, access_type, mmu_idx, is_secure, result, fi);