From nobody Sun Nov 24 00:31:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1728432492; cv=none; d=zohomail.com; s=zohoarc; b=BMZKGfzcndk4uFFyTFjk+o230mMtgdATagMJWUF4g02+tNFfUViQ5nItT7tkefxLaRDe638NplIGpCkPAz4FL2pR/RXwPfguCEkg8CKqzKJvLjoiVkrm16FhKX+XnvK9vMFSAZ7IIM0dhtuxDzLzzpSyrjqBcK5i2YL9FuedrUY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728432492; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=I928rOfU7rFS4/uAexBKDkmn1Lv4VMSl/VKyNRV9wmg=; b=Cf48Uq0QOxAdtB+L4DvNS2jnvO4edjITwlM+j/oCSFKniy0hSomAkvZybL1Mr6nfW1j8WL6sbpe1tHMJVPqxaJGyg++EKMGYj+qqCcJybUgWroEUcoBgBf3sItIH+P6ZPwlFuiLpcvfscL1rGwHrZWVne+C02bA3tqrjw7fWeCg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728432492576319.82930142849546; Tue, 8 Oct 2024 17:08:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syKCY-0004Po-1x; Tue, 08 Oct 2024 20:05:14 -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 1syKCV-0004NN-Bs for qemu-devel@nongnu.org; Tue, 08 Oct 2024 20:05:11 -0400 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1syKCT-0002tu-B3 for qemu-devel@nongnu.org; Tue, 08 Oct 2024 20:05:11 -0400 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-20b86298710so53280025ad.1 for ; Tue, 08 Oct 2024 17:05:08 -0700 (PDT) Received: from stoup.. (174-21-81-121.tukw.qwest.net. [174.21.81.121]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20c138cecf2sm60705105ad.104.2024.10.08.17.05.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2024 17:05:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728432308; x=1729037108; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=I928rOfU7rFS4/uAexBKDkmn1Lv4VMSl/VKyNRV9wmg=; b=yc0D//L+IZ+3lFanqlfWduQKjeLINYYiwuiwituX6sA4X+IDYDVSRDQnNZYF53jvXX I3Ko/WLd2/QMMzIxxE72CGNXT/u/coAyHi1zsFapuB2TyPF4znfouhMxNfU+QZHfJ9d1 sOREAS49oAFZes8T1sr8zn6rpMnKJSnmf/fdcq9n8q/1O6SdRfPq4PYoQp7TL1JEZRk/ sYGmuW/AVtDZ1pPDcwBRg4gTgUr4ePwDvjpdLbYVqyToMqCG3IxYd1dcli0Vhs6Zd3xE 0mx9si5SKOQZfE3BzQVvng7r6AF4oVmUOb8ZJi0cY3hdmV0Z8mG5gfygV3jmukM8aqXu xX3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728432308; x=1729037108; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I928rOfU7rFS4/uAexBKDkmn1Lv4VMSl/VKyNRV9wmg=; b=J2sL2PgI7XuF4YMpr6KN1b+PzEyeS0ObA980d8TxTTs2YRap0iI0WA+26gVlzfRD62 9Q/U6EXOOR0BB6FyZFw85/EKOdA2tf8y3GQgpnkclbKR5kyUvMVWpYZE6xI8a8kb/dmb qLXW9CcpAgAST4Ja+BOuvL/W4N+009xNwlf8dOY7oChaaSTiT5mtOBCW1vLyRVR8hHvF wKOm1wu16yD0/esjv5SA+osTVAFn8gkIEA79+HSeQZOvI7TlRSuYlnh23lbBE5YR2jdz SvZ5MJJZq6hcd+oYakKHXdkWgxHNDd++9X79NVGGH3sP+zWnFGBYvw9d60aDySYYNvJu rdIQ== X-Gm-Message-State: AOJu0YwoFMcdzJcoVbWHgKbDBWwdEDaSYsJAZn+RN8qZvbbouNbSaMgC tF1GMewinmcjIWBx2N3NfsmdEoDjknSV3uzYGgx6bHHGISTpEOvrx+Q4yXddKJVVPC517POwHoc E X-Google-Smtp-Source: AGHT+IFMRMcxUNXCHul99WM0nOEYQH8Nd6y4x6kBohzqFF7CIBlmB9qDX2IdxPxzJUxR3zV7HkR2Wg== X-Received: by 2002:a17:902:da8d:b0:20b:7be8:8ecf with SMTP id d9443c01a7336-20c6379030emr10548965ad.53.1728432307943; Tue, 08 Oct 2024 17:05:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@kernel.org, peter.maydell@linaro.org, alex.bennee@linaro.org, linux-parisc@vger.kernel.org, qemu-arm@nongnu.org, Helge Deller , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 13/20] target/arm: Pass MemOp to get_phys_addr_with_space_nogpc Date: Tue, 8 Oct 2024 17:04:46 -0700 Message-ID: <20241009000453.315652-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241009000453.315652-1-richard.henderson@linaro.org> References: <20241009000453.315652-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1728432493265116600 Zero is the safe do-nothing value for callers to use. Reviewed-by: Helge Deller Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/internals.h | 3 ++- target/arm/helper.c | 9 +++++---- target/arm/ptw.c | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/target/arm/internals.h b/target/arm/internals.h index 2b16579fa5..a6088d551c 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -1461,6 +1461,7 @@ bool get_phys_addr(CPUARMState *env, vaddr address, * @env: CPUARMState * @address: virtual address to get physical address for * @access_type: 0 for read, 1 for write, 2 for execute + * @memop: memory operation feeding this access, or 0 for none * @mmu_idx: MMU index indicating required translation regime * @space: security space for the access * @result: set on translation success. @@ -1470,7 +1471,7 @@ bool get_phys_addr(CPUARMState *env, vaddr address, * a Granule Protection Check on the resulting address. */ bool get_phys_addr_with_space_nogpc(CPUARMState *env, vaddr address, - MMUAccessType access_type, + MMUAccessType access_type, MemOp memop, ARMMMUIdx mmu_idx, ARMSecuritySpace sp= ace, GetPhysAddrResult *result, ARMMMUFaultInfo *fi) diff --git a/target/arm/helper.c b/target/arm/helper.c index 3f77b40734..0a731a38e8 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -3599,11 +3599,12 @@ static uint64_t do_ats_write(CPUARMState *env, uint= 64_t value, GetPhysAddrResult res =3D {}; =20 /* - * I_MXTJT: Granule protection checks are not performed on the final a= ddress - * of a successful translation. + * I_MXTJT: Granule protection checks are not performed on the final + * address of a successful translation. This is a translation not a + * memory reference, so "memop =3D none =3D 0". */ - ret =3D get_phys_addr_with_space_nogpc(env, value, access_type, mmu_id= x, ss, - &res, &fi); + ret =3D get_phys_addr_with_space_nogpc(env, value, access_type, 0, + mmu_idx, ss, &res, &fi); =20 /* * ATS operations only do S1 or S1+S2 translations, so we never diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 373095a339..9af86da597 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -3559,7 +3559,7 @@ static bool get_phys_addr_gpc(CPUARMState *env, S1Tra= nslate *ptw, } =20 bool get_phys_addr_with_space_nogpc(CPUARMState *env, vaddr address, - MMUAccessType access_type, + MMUAccessType access_type, MemOp memop, ARMMMUIdx mmu_idx, ARMSecuritySpace sp= ace, GetPhysAddrResult *result, ARMMMUFaultInfo *fi) --=20 2.43.0