From patchwork Wed Oct 9 00:04:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 833833 Delivered-To: patch@linaro.org Received: by 2002:adf:a1d9:0:b0:367:895a:4699 with SMTP id v25csp556503wrv; Tue, 8 Oct 2024 17:08:12 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU0CqiSWiW8NeVR3JVfSXH+CpZfACTStMw0H5fxC2d8ryOh8Nz8Zln92j94AXHf5JV2D9MXVA==@linaro.org X-Google-Smtp-Source: AGHT+IHkbOFU7CfVszUrZ9x/kLhfFX0HI9Ivyvw/rmm1lqEQOWdJbQ8dUZoUEu0z7QnnRBRWDqjD X-Received: by 2002:ac8:574a:0:b0:45b:16b:ecb7 with SMTP id d75a77b69052e-45fa5eca583mr9591091cf.1.1728432492399; Tue, 08 Oct 2024 17:08:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728432492; cv=none; d=google.com; s=arc-20240605; b=lOVTcleTQm0drQYRwuKpWpzxxjuh6WtjZUnzsOIy7fgyhPgHLfgBgW85OADsTXy+hH Hjtuc92h7IEYOTZQloSPEONztTFT2/TzIR/MvIDn/XsVpg7TXDmOqs2hlSRyueCDv8aM sY6ZMufmhGPbc/hm7h+mMazD47MuFmno4USeV+15xGsFjDqVxAWkKoCejeoU+yZGFEO2 +C6Ylpvo5IVo/QW7QDFLWiMFWqdkP3uX8XOGhy7jsAlf2k69RC3jVYx6T78PR3xMcXi0 tVeSGHSp+guhABBNLIMqmtmAYhWh222+to2r/Zn6CtSBCcvVp1nhAQtqMw8koDJpdHVo TKvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=I928rOfU7rFS4/uAexBKDkmn1Lv4VMSl/VKyNRV9wmg=; fh=3RK8noKPsRgJpwHDkrKY6p9N6ePZuLOt1ZjdS1VodvU=; b=KZrFV8bIQnxd/YqVbxqu41refUKx0n9mJNMZTdhp0XgNO/w3vAd60APWG7/Xb7msG4 Kgg8f3H0yr1o/xcz4G/dVEXlcbeRddgYczgCPTJtfBGF/psBV5qPPQGUz4S4OETF8PGe G5DNcNEAdbhCLkpojPpbVvQcHt2bsFUJihp9Y2HdpsaOCv4OTzWHcYKJt8HhgpwfRViv vXn5JIghSy01jPjAPmwGD2seOyLEcbpJeGzMDhDIdn8VccmlkfI75zc0MgrHHGu20eRM yV4F09f5H8eP1Aff1qXZ2hxSOmUytGgJi7iP05tPiV0qQuPvsuZyhtKbjW3HZYdEp2xO NYsA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="yc0D//L+"; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-45fb0ec52e3si4163111cf.185.2024.10.08.17.08.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Oct 2024 17:08:12 -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="yc0D//L+"; 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; dara=neutral header.i=@linaro.org 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) 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-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) 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) 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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Zero is the safe do-nothing value for callers to use. Reviewed-by: Helge Deller Reviewed-by: Philippe Mathieu-Daudé 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 space, 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, uint64_t value, GetPhysAddrResult res = {}; /* - * I_MXTJT: Granule protection checks are not performed on the final address - * 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 = none = 0". */ - ret = get_phys_addr_with_space_nogpc(env, value, access_type, mmu_idx, ss, - &res, &fi); + ret = get_phys_addr_with_space_nogpc(env, value, access_type, 0, + mmu_idx, ss, &res, &fi); /* * 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, S1Translate *ptw, } bool get_phys_addr_with_space_nogpc(CPUARMState *env, vaddr address, - MMUAccessType access_type, + MMUAccessType access_type, MemOp memop, ARMMMUIdx mmu_idx, ARMSecuritySpace space, GetPhysAddrResult *result, ARMMMUFaultInfo *fi)