From patchwork Thu Aug 24 09:28:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 716509 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp1235962wrp; Thu, 24 Aug 2023 02:29:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF9nhnZEmcvzN85wcbcGWHiwWHPKPwlebpY2s9OF+X9/J6S8ExsUHSbPFB9kf81/bFB5cq3 X-Received: by 2002:a0c:f54b:0:b0:63f:5868:ae45 with SMTP id p11-20020a0cf54b000000b0063f5868ae45mr15181651qvm.11.1692869387400; Thu, 24 Aug 2023 02:29:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692869387; cv=none; d=google.com; s=arc-20160816; b=iJEuCiwHY45Vyq8QLvVlxnL0NagP28GUbgvkFij3mWSik/2nFH5HaWCoWuqnJDWNTa I9cJ+LpsmkfhCcVPr4NCDZGt6w0RNvTpkf3lB9PY3bQ47gfl3b0LN/L3/gM08VGiInBZ +v3nQKfInvnFeGGmjbEBHRpObop3aBSnlJ2U2abaIz6kHOwB6c2nItp5iSueupcgFMC4 yoit5jmGsbE6HUwvTTwcKq4fcufYNjc1d/6gdJFd/tQXz+gpOZ1Dab7NwaIFvOBRFmP7 x01vTxJT57YtCFzKsTA3wVXHMOv5PExVI5WVetJwd6ibqh23/dCUjmCEo14pCSa/RTKI b1RQ== 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=rLfi7iwoUxJ42LFstDjsa56QpNDGkJ2EfgGmjg+R5ng=; fh=bFDrUYhlTVi/QyetgXx/byg2+yO/22Hp9SjwoefyKLk=; b=aXyP6xeDZi+lFkqpYFJDMmMYR5wDS/c6r2IzcT6YkTVd1kk8JHFXpZPHwRFwYZN61b 6jXTHGD45rY0shfDhyrGTmVydJnPUuQEGfcUOUOaInZiOvMLEs/dTt+QRJLe7h6Fxvj9 U4nXRQjVYcSVAkvXMFPvqqCIrdiGF21PPu1ZAC1L5eR8i7LrcWgIwrO6bQbNsR6VKQ0S RZhvv9aVacGDywS6EWjOwpK6fDLX1t9hIvQVja6dYk1aupSDJiQFQmsQfUw7FxIMx6Lr FNScwSWr8fgTH9Yi9zc73YcvLnJvJvsC1y+mR4ZDpljch+Ew9264zrOmHU0iiUOSbws9 +/2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="gp/+/ReP"; 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 u3-20020a05620a022300b0076ce743153asi7829551qkm.705.2023.08.24.02.29.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Aug 2023 02:29:47 -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="gp/+/ReP"; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZ6et-0008AE-3W; Thu, 24 Aug 2023 05:29:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZ6eE-0004Uq-8J for qemu-devel@nongnu.org; Thu, 24 Aug 2023 05:29:02 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qZ6e9-00051D-MK for qemu-devel@nongnu.org; Thu, 24 Aug 2023 05:29:01 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-31771bb4869so5775916f8f.0 for ; Thu, 24 Aug 2023 02:28:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692869329; x=1693474129; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=rLfi7iwoUxJ42LFstDjsa56QpNDGkJ2EfgGmjg+R5ng=; b=gp/+/RePpuSG+wcjMG+bGMJbv1ehxwX65Kb7ORcWzwsw7fR9eeVIx62EY8XXJdBi0t wpbpoYe5rkuUJyK1alLQBdS74uuSR4eXj4kh9UrbEGzt5jxk9pJfBHo5oN5lCCK7zmkj w0W1wByJsCDyNDTzX3Ot8b4eIxg+oFuBZivEDt7DizzA0gKlEpiVReMwQFlIvJxzIBiQ PDRDze2R9xP2Kn23MOKwd5PrfkiKj0ztLgf6YOca8BdnVYPJ0+el3T9tw8rVgTMO3Mqk 2/1vPXJKVPn9Y/kMAzi7KyjGOeNMqqR3aGdiOolZCzWxsmcMWUaWPOQY4wezgm1pno1k 1VoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692869329; x=1693474129; 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:message-id:reply-to; bh=rLfi7iwoUxJ42LFstDjsa56QpNDGkJ2EfgGmjg+R5ng=; b=eozIdafPwbhCuUT9a+GhTlQdHT7BPJCjl5tQOVubrim1xrSpyQXavSEdwWLRFUlJVy HWbMD1u66rP0HZWJ7mRpqO6ydrcl84vE5Thl4jMm0eyd/doIgz9D9xd1OLUfOYPN1XKW uzu0r2kQE2DLUwOhHktcZX+cFiwPWGqHvAownwXFfk80NaeNygY5ZYgzM97VQnEnUomP LpljE3W1rF4jJYanFqltsLU2Ryscq1W4XHTJdenqPpT3cSAXPsUtzjfbO0iejUj+mpSP EavTZDOjw/KlD/aeAh0c2nzniU4jmxiCAhYphhcsBVr6guU29p7i23NEfxTwZcYzGUhA BSKw== X-Gm-Message-State: AOJu0Yxdin1Hcen/m9pUDmR9idJcpz3vFQYLliJFEU2wOZ/LnXU/5/Li 1FaaVJyiaB6oX18QychLLl65RBG0TbXRjVy2234= X-Received: by 2002:a05:6000:889:b0:31a:d6cb:7f9e with SMTP id cs9-20020a056000088900b0031ad6cb7f9emr10911942wrb.21.1692869329202; Thu, 24 Aug 2023 02:28:49 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id s12-20020adfeccc000000b00317b5c8a4f1sm21844004wro.60.2023.08.24.02.28.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Aug 2023 02:28:48 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 23/35] target/arm/ptw: Drop S1Translate::out_secure Date: Thu, 24 Aug 2023 10:28:24 +0100 Message-Id: <20230824092836.2239644-24-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230824092836.2239644-1-peter.maydell@linaro.org> References: <20230824092836.2239644-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42d.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-bounces+patch=linaro.org@nongnu.org We only use S1Translate::out_secure in two places, where we are setting up MemTxAttrs for a page table load. We can use arm_space_is_secure(ptw->out_space) instead, which guarantees that we're setting the MemTxAttrs secure and space fields consistently, and allows us to drop the out_secure field in S1Translate entirely. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20230807141514.19075-12-peter.maydell@linaro.org --- target/arm/ptw.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 78bc679deef..312ccabe92e 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -63,7 +63,6 @@ typedef struct S1Translate { * Stage 2 is indicated by in_mmu_idx set to ARMMMUIdx_Stage2{,_S}. */ bool in_s1_is_el0; - bool out_secure; bool out_rw; bool out_be; ARMSecuritySpace out_space; @@ -553,7 +552,6 @@ static bool S1_ptw_translate(CPUARMState *env, S1Translate *ptw, pte_attrs = s2.cacheattrs.attrs; ptw->out_host = NULL; ptw->out_rw = false; - ptw->out_secure = s2.f.attrs.secure; ptw->out_space = s2.f.attrs.space; } else { #ifdef CONFIG_TCG @@ -572,7 +570,6 @@ static bool S1_ptw_translate(CPUARMState *env, S1Translate *ptw, ptw->out_phys = full->phys_addr | (addr & ~TARGET_PAGE_MASK); ptw->out_rw = full->prot & PAGE_WRITE; pte_attrs = full->pte_attrs; - ptw->out_secure = full->attrs.secure; ptw->out_space = full->attrs.space; #else g_assert_not_reached(); @@ -630,8 +627,8 @@ static uint32_t arm_ldl_ptw(CPUARMState *env, S1Translate *ptw, } else { /* Page tables are in MMIO. */ MemTxAttrs attrs = { - .secure = ptw->out_secure, .space = ptw->out_space, + .secure = arm_space_is_secure(ptw->out_space), }; AddressSpace *as = arm_addressspace(cs, attrs); MemTxResult result = MEMTX_OK; @@ -676,8 +673,8 @@ static uint64_t arm_ldq_ptw(CPUARMState *env, S1Translate *ptw, } else { /* Page tables are in MMIO. */ MemTxAttrs attrs = { - .secure = ptw->out_secure, .space = ptw->out_space, + .secure = arm_space_is_secure(ptw->out_space), }; AddressSpace *as = arm_addressspace(cs, attrs); MemTxResult result = MEMTX_OK;