From nobody Mon Nov 3 20:10:43 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505984572648688.5185823432516; Thu, 21 Sep 2017 02:02:52 -0700 (PDT) Received: from localhost ([::1]:52471 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duxNk-00064m-0z for importer@patchew.org; Thu, 21 Sep 2017 05:02:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48718) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duxD9-0005Va-RD for qemu-devel@nongnu.org; Thu, 21 Sep 2017 04:51:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duxD6-0001dh-P3 for qemu-devel@nongnu.org; Thu, 21 Sep 2017 04:51:55 -0400 Received: from ozlabs.ru ([107.173.13.209]:54272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duxD6-0001dL-De for qemu-devel@nongnu.org; Thu, 21 Sep 2017 04:51:52 -0400 Received: from vpl1.ozlabs.ibm.com (localhost [IPv6:::1]) by ozlabs.ru (Postfix) with ESMTP id B169E3A60031; Thu, 21 Sep 2017 04:52:37 -0400 (EDT) From: Alexey Kardashevskiy To: qemu-devel@nongnu.org Date: Thu, 21 Sep 2017 18:50:53 +1000 Message-Id: <20170921085110.25598-2-aik@ozlabs.ru> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170921085110.25598-1-aik@ozlabs.ru> References: <20170921085110.25598-1-aik@ozlabs.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 107.173.13.209 Subject: [Qemu-devel] [PATCH qemu v5 01/18] exec: Explicitly export target AS from address_space_translate_internal 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: Alexey Kardashevskiy , Paolo Bonzini 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" This adds an AS** parameter to address_space_do_translate() to make it easier for the next patch to share FlatViews. This should cause no behavioural change. Signed-off-by: Alexey Kardashevskiy --- exec.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/exec.c b/exec.c index a25a4c6018..fd8994b25d 100644 --- a/exec.c +++ b/exec.c @@ -476,7 +476,8 @@ static MemoryRegionSection address_space_do_translate(A= ddressSpace *as, hwaddr *xlat, hwaddr *plen, bool is_write, - bool is_mmio) + bool is_mmio, + AddressSpace **targe= t_as) { IOMMUTLBEntry iotlb; MemoryRegionSection *section; @@ -503,6 +504,7 @@ static MemoryRegionSection address_space_do_translate(A= ddressSpace *as, } =20 as =3D iotlb.target_as; + *target_as =3D iotlb.target_as; } =20 *xlat =3D addr; @@ -525,7 +527,7 @@ IOMMUTLBEntry address_space_get_iotlb_entry(AddressSpac= e *as, hwaddr addr, =20 /* This can never be MMIO. */ section =3D address_space_do_translate(as, addr, &xlat, &plen, - is_write, false); + is_write, false, &as); =20 /* Illegal translation */ if (section.mr =3D=3D &io_mem_unassigned) { @@ -548,7 +550,7 @@ IOMMUTLBEntry address_space_get_iotlb_entry(AddressSpac= e *as, hwaddr addr, plen -=3D 1; =20 return (IOMMUTLBEntry) { - .target_as =3D section.address_space, + .target_as =3D as, .iova =3D addr & ~plen, .translated_addr =3D xlat & ~plen, .addr_mask =3D plen, @@ -569,7 +571,8 @@ MemoryRegion *address_space_translate(AddressSpace *as,= hwaddr addr, MemoryRegionSection section; =20 /* This can be MMIO, so setup MMIO bit. */ - section =3D address_space_do_translate(as, addr, xlat, plen, is_write,= true); + section =3D address_space_do_translate(as, addr, xlat, plen, is_write,= true, + &as); mr =3D section.mr; =20 if (xen_enabled() && memory_access_is_direct(mr, is_write)) { --=20 2.11.0