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 1525166032461132.77033013190476; Tue, 1 May 2018 02:13:52 -0700 (PDT) Received: from localhost ([::1]:37313 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDRM3-0005Nc-O7 for importer@patchew.org; Tue, 01 May 2018 05:13:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDR8Z-0003aG-S0 for qemu-devel@nongnu.org; Tue, 01 May 2018 04:59:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDR8Y-0007tc-SZ for qemu-devel@nongnu.org; Tue, 01 May 2018 04:59:51 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:41396) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fDR8Y-0007sf-M7 for qemu-devel@nongnu.org; Tue, 01 May 2018 04:59:50 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1fDR8V-0007Q5-Tg; Tue, 01 May 2018 09:59:47 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Tue, 1 May 2018 09:59:37 +0100 Message-Id: <20180501085939.6201-11-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 10/12] Make address_space_get_iotlb_entry() 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 address_space_get_iotlb_entry(). Signed-off-by: Peter Maydell --- include/exec/memory.h | 2 +- exec.c | 2 +- hw/virtio/vhost.c | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index bd50424804..16a82d9722 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1897,7 +1897,7 @@ void stq_be_phys_cached(MemoryRegionCache *cache, hwa= ddr addr, uint64_t val); * entry. Should be called from an RCU critical section. */ IOMMUTLBEntry address_space_get_iotlb_entry(AddressSpace *as, hwaddr addr, - bool is_write); + bool is_write, MemTxAttrs attr= s); =20 /* address_space_translate: translate an address range into an address spa= ce * into a MemoryRegion and an address range into that section. Should be diff --git a/exec.c b/exec.c index 41f7a7f5c4..c29bf47ce2 100644 --- a/exec.c +++ b/exec.c @@ -547,7 +547,7 @@ translate_fail: =20 /* Called from RCU critical section */ IOMMUTLBEntry address_space_get_iotlb_entry(AddressSpace *as, hwaddr addr, - bool is_write) + bool is_write, MemTxAttrs attr= s) { MemoryRegionSection section; hwaddr xlat, page_mask; diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 9d5850a7d7..48f4fd7cc9 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -895,7 +895,8 @@ int vhost_device_iotlb_miss(struct vhost_dev *dev, uint= 64_t iova, int write) rcu_read_lock(); =20 iotlb =3D address_space_get_iotlb_entry(dev->vdev->dma_as, - iova, write); + iova, write, + MEMTXATTRS_UNSPECIFIED); if (iotlb.target_as !=3D NULL) { ret =3D vhost_memory_region_lookup(dev, iotlb.translated_addr, &uaddr, &len); --=20 2.17.0