From nobody Wed Oct 29 11:33:37 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15251655761611002.1260489725827; Tue, 1 May 2018 02:06:16 -0700 (PDT) Received: from localhost ([::1]:35844 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDREk-0007XU-Mh for importer@patchew.org; Tue, 01 May 2018 05:06:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDR8X-0003Xm-Ov for qemu-devel@nongnu.org; Tue, 01 May 2018 04:59:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDR8W-0007sV-M9 for qemu-devel@nongnu.org; Tue, 01 May 2018 04:59:49 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:41356) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fDR8W-0007mW-Fo for qemu-devel@nongnu.org; Tue, 01 May 2018 04:59:48 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1fDR8U-0007Oy-B5; Tue, 01 May 2018 09:59:46 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Tue, 1 May 2018 09:59:35 +0100 Message-Id: <20180501085939.6201-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180501085939.6201-1-peter.maydell@linaro.org> References: <20180501085939.6201-1-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [RFC PATCH v2 08/12] Make flatview_access_valid() take a MemTxAttrs argument X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Eric Auger , patches@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" As part of plumbing MemTxAttrs down to the IOMMU translate method, add MemTxAttrs as an argument to flatview_access_valid(). Its callers now all have an attrs value to hand, so we can correct our earlier temporary use of MEMTXATTRS_UNSPECIFIED. Signed-off-by: Peter Maydell --- exec.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/exec.c b/exec.c index 3ceeb0643f..0eef4702a5 100644 --- a/exec.c +++ b/exec.c @@ -2662,7 +2662,7 @@ static MemTxResult flatview_read(FlatView *fv, hwaddr= addr, static MemTxResult flatview_write(FlatView *fv, hwaddr addr, MemTxAttrs at= trs, const uint8_t *buf, int len); static bool flatview_access_valid(FlatView *fv, hwaddr addr, int len, - bool is_write); + bool is_write, MemTxAttrs attrs); =20 static MemTxResult subpage_read(void *opaque, hwaddr addr, uint64_t *data, unsigned len, MemTxAttrs attrs) @@ -2738,7 +2738,7 @@ static bool subpage_accepts(void *opaque, hwaddr addr, #endif =20 return flatview_access_valid(subpage->fv, addr + subpage->base, - len, is_write); + len, is_write, attrs); } =20 static const MemoryRegionOps subpage_ops =3D { @@ -3426,7 +3426,7 @@ static void cpu_notify_map_clients(void) } =20 static bool flatview_access_valid(FlatView *fv, hwaddr addr, int len, - bool is_write) + bool is_write, MemTxAttrs attrs) { MemoryRegion *mr; hwaddr l, xlat; @@ -3437,8 +3437,7 @@ static bool flatview_access_valid(FlatView *fv, hwadd= r addr, int len, if (!memory_access_is_direct(mr, is_write)) { l =3D memory_access_size(mr, l, addr); /* When our callers all have attrs we'll pass them through her= e */ - if (!memory_region_access_valid(mr, xlat, l, is_write, - MEMTXATTRS_UNSPECIFIED)) { + if (!memory_region_access_valid(mr, xlat, l, is_write, attrs))= { return false; } } @@ -3458,7 +3457,7 @@ bool address_space_access_valid(AddressSpace *as, hwa= ddr addr, =20 rcu_read_lock(); fv =3D address_space_to_flatview(as); - result =3D flatview_access_valid(fv, addr, len, is_write); + result =3D flatview_access_valid(fv, addr, len, is_write, attrs); rcu_read_unlock(); return result; } --=20 2.17.0