From patchwork Wed Oct 9 00:04:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 833832 Delivered-To: patch@linaro.org Received: by 2002:adf:a1d9:0:b0:367:895a:4699 with SMTP id v25csp556494wrv; Tue, 8 Oct 2024 17:08:10 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVYrv52I0ozkZX7jkuwbV3zVhS+CeoE7FA0HK604GpYUuUZu+dD4mcHYSrnnHH/W+o5+7RFRw==@linaro.org X-Google-Smtp-Source: AGHT+IFOrASz8cl6jWNQlrENw5jbN+0yaKYkpAguQFoYr+T4kfn7MbzEhKEyAbcE0PzIZHRKduRy X-Received: by 2002:a05:620a:2945:b0:7a9:9a64:cdab with SMTP id af79cd13be357-7b0874b2f3dmr87957085a.45.1728432490731; Tue, 08 Oct 2024 17:08:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728432490; cv=none; d=google.com; s=arc-20240605; b=Hj3GLOTV74Z8MaKsdj0fyvsUm21EBu2U8AdtSFPwdZO391TmG0il2w0ootI/hHUb5J PBhMfDggxo90xETmnClvd5VlThUvwaH2kuyR/Qj0xFO08HXJ8vK5MXwiWcg4CTjBLRAC MfttIylUXUtdHUkcmQJ8HW7cO73DOqLBFePCZDlL8Fvmo7uudZ2e+5SVt79xLfhYNqnR rWMXtvWiAhKOYgdhRXZt/xQvcUVKyoqH4wV2+bT1vT7lKWCfCzFUWqVF+ett1WBFcCJ5 8UrDrLkH6IcKWbJ10yHT7gKqtkiiJMMnN0eHjC0eo8vmTrvSwGPqdJauhxhXscYjJrfb C0BA== 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=HpCts7Lc7po90jMJZMaWUdEUzHFwVBTsaL90Hh3zO7Y=; fh=3RK8noKPsRgJpwHDkrKY6p9N6ePZuLOt1ZjdS1VodvU=; b=cgW+JoHRRq04LOCdwB/w+q5OyN87OhFb4SVA33Xee14IIvXu2dx+gcr6ISYxZVwavH 68dh8h0mHfOfvwkTL0Bl24lq/ZTrq4lu7OALL9IHQWO9FXC9BssQAk2SxfmYMPDg6pYA rKnfHj2tTd/iuAr/grigDlpIDDGmgE5KMxYn75UYnFzgBWt6D83xcPyGgTXC0/wcmEGx lRVyFbfajHB2bvOjWR9CLtYVORL5FYMXjLiwLJkVjnm4txs8LLHl8tM2EI3wB2C+5VYG UT3GkEja2I0Y2VO7Lf+p+a7m5/GlcBZAM9FoEsoFLlJODfB5wHLglX0VAPW9UI7Osgyr 07gQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CkEt7i4A; 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 af79cd13be357-7afee40f4d4si65762285a.317.2024.10.08.17.08.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Oct 2024 17:08:10 -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=CkEt7i4A; 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 1syKCa-0004Sr-Qq; Tue, 08 Oct 2024 20:05:16 -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 1syKCY-0004Ps-29 for qemu-devel@nongnu.org; Tue, 08 Oct 2024 20:05:14 -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 1syKCV-0002uo-4c for qemu-devel@nongnu.org; Tue, 08 Oct 2024 20:05:12 -0400 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-208cf673b8dso68771795ad.3 for ; Tue, 08 Oct 2024 17:05:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728432310; x=1729037110; 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=HpCts7Lc7po90jMJZMaWUdEUzHFwVBTsaL90Hh3zO7Y=; b=CkEt7i4AM9zM3IIh0AOS7bpPHSCnvlfX1qFxZB4sT+EqkeKwXd6Yl2aufbaXiO9EUE KlstvE5w0NyS0KfTtSASAyHQy+amoiGTsJV6mNex1uZb55+dBP6zsO/gvDEWIpR+8fwq sNUgZN5Or6Duyb9tb83ryRplsGaQMIYAkAlPy7xK6VMbkLBIb2eQ9AEClOcJAbRCNClc /93xyn7CR0taBJvrO9Kv0hAcdVmpv6D2Yy8dZGJPfMy+XA2k072cEV3cV6Lsg+qrtyqV K2jp3gNur3AM/ag2eqM4H5ITaqGb2ahNs48mYnExx7A9L/0F9sxnLMwdF5mm17itxItX e7IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728432310; x=1729037110; 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=HpCts7Lc7po90jMJZMaWUdEUzHFwVBTsaL90Hh3zO7Y=; b=gf182TIs6KdmR8hyrXDBV/LtNYjl9Ihp/Mk7H+S7k0E9+ghekcQ2lFxdaV0OcfBmsA DcI1/IRI5qnjdNuk+8Fhq6wQ2HjI1MpWPWCtl8Dluh8paMgjlciaTJIqNgrDkd9EPv9f r8bwrXAX5gRRkq3AP8CxdPLwzTYnoykJHvzShA3JtCeJeBu+Id0UXdEbJK1MuJEWmxbF Gstaa1O3nM1v8bhlwAIy3WWGErh5iYHuDPrwY3R76kyMAJbRnyzB1lvHDkKn0N6y0FA0 WhmbVnS1YbKY8iVow7/fy2823JhKRoKkqM2TLx5nJ3jhSVx2BtVZEhXAdYvGFspByHeG JQEA== X-Gm-Message-State: AOJu0Yz8q4yAkWasf3jQy9h+xAihzF8AsWK/xhGDTvzUmXh3TDqkxSa1 ilzZHtOzoDtqdQB4FIfFTg37piEIUDOVLJ5XIr93u3LJFUCiWWlIncFdKOQhuf3f5wfru93Bzfp S X-Received: by 2002:a17:903:22c9:b0:20c:5960:bd35 with SMTP id d9443c01a7336-20c63710345mr8780115ad.20.1728432309687; Tue, 08 Oct 2024 17:05:09 -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.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2024 17:05:09 -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 15/20] target/arm: Pass MemOp to get_phys_addr_nogpc Date: Tue, 8 Oct 2024 17:04:48 -0700 Message-ID: <20241009000453.315652-16-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=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 Zero is the safe do-nothing value for callers to use. Pass the value through from get_phys_addr_gpc and get_phys_addr_with_space_nogpc. Reviewed-by: Helge Deller Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/ptw.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index e92537d8f2..0445c3ccf3 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -75,7 +75,7 @@ typedef struct S1Translate { static bool get_phys_addr_nogpc(CPUARMState *env, S1Translate *ptw, vaddr address, - MMUAccessType access_type, + MMUAccessType access_type, MemOp memop, GetPhysAddrResult *result, ARMMMUFaultInfo *fi); @@ -3313,7 +3313,7 @@ static bool get_phys_addr_twostage(CPUARMState *env, S1Translate *ptw, ARMSecuritySpace ipa_space; uint64_t hcr; - ret = get_phys_addr_nogpc(env, ptw, address, access_type, result, fi); + ret = get_phys_addr_nogpc(env, ptw, address, access_type, 0, result, fi); /* If S1 fails, return early. */ if (ret) { @@ -3339,7 +3339,7 @@ static bool get_phys_addr_twostage(CPUARMState *env, S1Translate *ptw, cacheattrs1 = result->cacheattrs; memset(result, 0, sizeof(*result)); - ret = get_phys_addr_nogpc(env, ptw, ipa, access_type, result, fi); + ret = get_phys_addr_nogpc(env, ptw, ipa, access_type, 0, result, fi); fi->s2addr = ipa; /* Combine the S1 and S2 perms. */ @@ -3406,7 +3406,7 @@ static bool get_phys_addr_twostage(CPUARMState *env, S1Translate *ptw, static bool get_phys_addr_nogpc(CPUARMState *env, S1Translate *ptw, vaddr address, - MMUAccessType access_type, + MMUAccessType access_type, MemOp memop, GetPhysAddrResult *result, ARMMMUFaultInfo *fi) { @@ -3547,7 +3547,8 @@ static bool get_phys_addr_gpc(CPUARMState *env, S1Translate *ptw, GetPhysAddrResult *result, ARMMMUFaultInfo *fi) { - if (get_phys_addr_nogpc(env, ptw, address, access_type, result, fi)) { + if (get_phys_addr_nogpc(env, ptw, address, access_type, + memop, result, fi)) { return true; } if (!granule_protection_check(env, result->f.phys_addr, @@ -3568,7 +3569,8 @@ bool get_phys_addr_with_space_nogpc(CPUARMState *env, vaddr address, .in_mmu_idx = mmu_idx, .in_space = space, }; - return get_phys_addr_nogpc(env, &ptw, address, access_type, result, fi); + return get_phys_addr_nogpc(env, &ptw, address, access_type, + memop, result, fi); } bool get_phys_addr(CPUARMState *env, vaddr address,