From nobody Tue Feb 10 07:40:48 2026 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; dkim=fail; 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 150603628625191.97348549603566; Thu, 21 Sep 2017 16:24:46 -0700 (PDT) Received: from localhost ([::1]:55891 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvApl-0002e0-Ej for importer@patchew.org; Thu, 21 Sep 2017 19:24:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvAiD-0004bN-Pp for qemu-devel@nongnu.org; Thu, 21 Sep 2017 19:16:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dvAiC-0003zE-MP for qemu-devel@nongnu.org; Thu, 21 Sep 2017 19:16:53 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:35840) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dvAiC-0003xV-GQ for qemu-devel@nongnu.org; Thu, 21 Sep 2017 19:16:52 -0400 Received: by mail-wr0-x241.google.com with SMTP id g50so3841848wra.3 for ; Thu, 21 Sep 2017 16:16:52 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-246-117.clienti.tiscali.it. [78.12.246.117]) by smtp.gmail.com with ESMTPSA id u186sm2596278wmd.19.2017.09.21.16.16.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Sep 2017 16:16:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=tp7uIbAkeMyO4p16spWWcve5GIyEYGF2/0Q67+ytUnI=; b=ZvPCLTQ69wCUIG3BvNXtghXi/n+Qqi4rFm9baKUCdFnTAJ9+YUWA++jBoO0GwO7X06 Souq6lsFEYEx6FMT/ObQYjjF8KWxphcphpjxj4n3y92bsU5vpRTclzQjU30sGJZxm1Hv IgorIWNXi3wHWSPwkCkDBJ2eTAOlJQbh9WiAj4i6/YvKI1vuzLwGMGV3LwoZIKDZw/IY IZrk0omtwZ854HiU+DmRNCw1+PfGlGNTuQStCZlQIk+86EqtzRh3xm5taadOwqEknNge B3tmqYMWZ9TJddpTfotJmLdGDHTt8JreEL7G1qjgtEqYJB1BCmIGASkNaXPOzQXeHx1q zLqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=tp7uIbAkeMyO4p16spWWcve5GIyEYGF2/0Q67+ytUnI=; b=IRdEovKz43q9UoEQxzWqJig/u5Xh54LKll7I6/TAHnepcuyzgRVpN3xkF6r+KbYCYL vzZI94GpPxC+VChZO1K9keOvA4eucXazEgsgoA6k/C4n8lAIxYeb9ztRueraeBFccOTO O140Qz80VYrK4CM4fR64VlIFko8Vu9HlOSKFRsrtxafrrttRB3ki+F8BgiHk1mxlC5zG 6GtOlxP5R3g7GjmORASQe72ZKGg8KUeT0qOOlsLgcP1tSmEi6zrlYg94luxzLP74tYbG s0cnrh7yoD68pYmzKRYDz4r4Lr/Aq+i0ee2jhsyYKwhJfmlSu+5WTdOlblW38F0WfANx 3elg== X-Gm-Message-State: AHPjjUhEBDcGrnzecGWaBR9+ms21NjofmDMRWKUUlzFmpqUCwCJ1C7Hp J2dh6CySYyy2uToG0ZwazsAK0aih X-Google-Smtp-Source: AOwi7QA/PRchp7ZPDYPgJJm8bKIdseq6uRLBvURylGnoVEhj1FTYsnVQUPma7WGlOnFWGsHKFEasag== X-Received: by 10.223.148.6 with SMTP id 6mr3113682wrq.15.1506035811177; Thu, 21 Sep 2017 16:16:51 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 22 Sep 2017 01:16:14 +0200 Message-Id: <1506035800-30509-7-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1506035800-30509-1-git-send-email-pbonzini@redhat.com> References: <1506035800-30509-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::241 Subject: [Qemu-devel] [PULL 06/32] 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 Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Alexey Kardashevskiy 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 Message-Id: <20170921085110.25598-2-aik@ozlabs.ru> Signed-off-by: Paolo Bonzini --- exec.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/exec.c b/exec.c index a25a4c6..fd8994b 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 1.8.3.1