From patchwork Mon Aug 7 14:15:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 711125 Delivered-To: patch@linaro.org Received: by 2002:a05:6359:d30:b0:129:c516:61db with SMTP id gp48csp1565755rwb; Mon, 7 Aug 2023 07:17:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGCZQMv1aiTQUIBfrvzvOWoFPec8FJjnXxb5t9RY7R2yUu9OpP3G/gnn1gtuQYGiJgbfZ9Q X-Received: by 2002:a05:620a:f15:b0:76c:dc9c:3164 with SMTP id v21-20020a05620a0f1500b0076cdc9c3164mr7180914qkl.76.1691417868983; Mon, 07 Aug 2023 07:17:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691417868; cv=none; d=google.com; s=arc-20160816; b=iwI762dsS/FqxtCMentb+KajS7PqxUx6j8ssalQGWatOl0Cfu+th8OMNT+ic4Tyby8 GaEPXny04Kf3Ol7kHSeHSmT7Pip+arj5mdv+qaswDNQOQ8zWloochkrVxB8cIiQutHyJ 7q2wXEeZFV63P+L4EVN0eStG6v2XAET2FGEEIV+XRLDAw8gRfOJGP91b7xlbrSwroUUS k5u3r9ytrbgjzXXf2oJi06RWd8umnMNpGUbU9gYrHq3KCdicbWi2FF6dNclTyWBza/bS Hkb6msLV2JdRxBsHfXU2xf5XeafUa0R473t9lzT9ZTUgvUzv+9BPRU7Eq5rJFwxP0Dko t1gg== 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=/yyxHEqA/6T1J8G7sWRRyJB/3QTMgoPg9dM02AxAbq0=; fh=jvpdohKmRoZMO537s6xMKXXtj7EZws1LOMQI/oP4vXs=; b=Etu3op2pV5SlFjaFjqZkx2HOHC9iDah2WTKMWHT3cG6iY9vXvZLggGGJQjEhjtSJ9B +/R6SDTg3VpIK7iyDYYvglfG8VksDCv9QKeQce3Ozzo6RAhlg0zfzDWEH86NtrJB+6oJ XRXHUr+q6hMva4uNK7ci0LKC4djBQm5L7CNCbvBg4XkKdRtf/jjyITLy/W1i9JDS9tWd 0YdCDIPd2zosLp1bBVaLxIB6xQZxNbT/3ToRcfvIfxi3pKor/qrwHmLwCSs68rT9/dRU cHV4OymUREMSIWodhr1hm3KE7Tp0AW0J0DDP/97zzOiUgWyGvV4svBmsfwsz5GgIlGzF BnCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dCZeRDrJ; 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 q19-20020a05620a0c9300b0076ce0286171si4701908qki.643.2023.08.07.07.17.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 Aug 2023 07:17:48 -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=dCZeRDrJ; 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 1qT11t-00010b-BO; Mon, 07 Aug 2023 10:16:17 -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 1qT118-0000Av-T5 for qemu-devel@nongnu.org; Mon, 07 Aug 2023 10:15:34 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qT114-0005Uj-EK for qemu-devel@nongnu.org; Mon, 07 Aug 2023 10:15:30 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3fe5c0e58c0so9973055e9.3 for ; Mon, 07 Aug 2023 07:15:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691417723; x=1692022523; 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=/yyxHEqA/6T1J8G7sWRRyJB/3QTMgoPg9dM02AxAbq0=; b=dCZeRDrJmVUKLL6uHLM8YCsUNdsXHez4T2u/PAmTSP44PeMCIMj3JtFpIc7//ogs1Q /NCSzTbZlR+oEG0taAPZhudx+98jILtmJ3ED7enzbogBxsLKPV2gX6su06p+b0qhbQCA XRmmWDOYKmU+UzUv148HIxBkCOJ9o+x9FpQ9qqdlpi/CXrlCZkB3bg8U59/sbxhTDrLA CpnwlDBpcZ5xXR4co3Hq1knujVK5cfYDSiLgX/qG0kcIajUtgwxJ8b37uESfMZOLVVrQ jADOedeACdU1Zo1P7CPWa1Ipln5mQkgVPJQvqWarRm91uNyYZEKvB8eVBcnsD2QHPuTO Mt8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691417723; x=1692022523; 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=/yyxHEqA/6T1J8G7sWRRyJB/3QTMgoPg9dM02AxAbq0=; b=h4+mCzKklwNsOR7F1SodU8L0QG++RrslQTnp30ws5UGeqSioIXw3AKSO4SdqCgrX0Q nS3b+c8hwMLg7QPtXdCItr+bfGnAARmXAlppZm7bquigxYiHuktIAtDQn+fBuuF3/CYY NplmiRSUlRkrF/9305pymZUyrtv+UHvf6pRMnC66w2Y0wZZ0VJFGn/NDcedwBvqQgKcV 6pmRYT3geNRKxz5gt0TW3mDX6F6adsMn3J3psNKN790kVyuDAFXcuDa0ZvY+bfrhw3I2 NE0fuGZzmug45gxoqg2oB9+bSh6De65yKpFgTzGNMv67iQjVeZmufCrS76KgrY6u6GES cjEw== X-Gm-Message-State: AOJu0YydG1g79/iT3b9p2PavntY55cEOrhSTkFcIYK5PzQsyzzVMP11W FPTxaGsTcMDrfrT/0d5TvCBXow== X-Received: by 2002:adf:f60d:0:b0:317:6816:578c with SMTP id t13-20020adff60d000000b003176816578cmr7085387wrp.5.1691417722856; Mon, 07 Aug 2023 07:15:22 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id h20-20020a05600c261400b003fe2ebf479fsm10835617wma.36.2023.08.07.07.15.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Aug 2023 07:15:22 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v2 12/15] target/arm/ptw: Set attributes correctly for MMU disabled data accesses Date: Mon, 7 Aug 2023 15:15:11 +0100 Message-Id: <20230807141514.19075-13-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230807141514.19075-1-peter.maydell@linaro.org> References: <20230807141514.19075-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32b.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=unavailable 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 When the MMU is disabled, data accesses should be Device nGnRnE, Outer Shareable, Untagged. We handle the other cases from AArch64.S1DisabledOutput() correctly but missed this one. Device nGnRnE is memattr == 0, so the only part we were missing was that shareability should be set to 2 for both insn fetches and data accesses. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/ptw.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 312ccabe92e..7f217a31895 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -3108,11 +3108,13 @@ static bool get_phys_addr_disabled(CPUARMState *env, } } } - if (memattr == 0 && access_type == MMU_INST_FETCH) { - if (regime_sctlr(env, mmu_idx) & SCTLR_I) { - memattr = 0xee; /* Normal, WT, RA, NT */ - } else { - memattr = 0x44; /* Normal, NC, No */ + if (memattr == 0) { + if (access_type == MMU_INST_FETCH) { + if (regime_sctlr(env, mmu_idx) & SCTLR_I) { + memattr = 0xee; /* Normal, WT, RA, NT */ + } else { + memattr = 0x44; /* Normal, NC, No */ + } } shareability = 2; /* outer shareable */ }