From patchwork Fri Jun 28 18:26:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 255637 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BE2302C0091 for ; Sat, 29 Jun 2013 05:03:42 +1000 (EST) Received: from localhost ([::1]:51447 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsdZU-0005bw-4K for incoming@patchwork.ozlabs.org; Fri, 28 Jun 2013 14:39:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60998) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsdOj-0006sq-0K for qemu-devel@nongnu.org; Fri, 28 Jun 2013 14:27:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UsdOg-0000YU-UD for qemu-devel@nongnu.org; Fri, 28 Jun 2013 14:27:52 -0400 Received: from mail-ea0-x22e.google.com ([2a00:1450:4013:c01::22e]:34439) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsdOg-0000YJ-Mb for qemu-devel@nongnu.org; Fri, 28 Jun 2013 14:27:50 -0400 Received: by mail-ea0-f174.google.com with SMTP id o10so1197176eaj.33 for ; Fri, 28 Jun 2013 11:27:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; bh=tgxgPQaqcNjtT+xrgZTMweze0rlzhCtXGsB8rSlLDKs=; b=tJO6X3m0PoU1SGDtjm2OWZtPULWl2BRhpq44nVWAmXPffhHhjNN6+0d7paakDo1arg hK5vN4BMnf3cTOfeaGInKmZZai7WMI1qweVh4zhz0yV8DTSlaMB3gTu74sXKEQGdwi2J xHUrkbSOsv4xp94waVvFYho6GhWKhQ0r7/UtrbrUURbPRe2pW9AdcqNtnJHhKTPLeIW+ AougPI5DmVBMmrIqWYJ+NndoAs7RkMmIt+rc+Ekpgtr0dsUpNLwH4KT/501Sy7GGzasW yk3Yy4dX+oKKawEMwNHEtnbhC/n+7EabpAtrMB6EqIZ+vKZk/T8xQ+LrEi0SmLmPvXL0 CXqg== X-Received: by 10.14.104.135 with SMTP id i7mr14719285eeg.3.1372444070028; Fri, 28 Jun 2013 11:27:50 -0700 (PDT) Received: from playground.lan (net-37-116-217-184.cust.dsl.vodafone.it. [37.116.217.184]) by mx.google.com with ESMTPSA id o5sm12035344eef.5.2013.06.28.11.27.48 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 28 Jun 2013 11:27:49 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 28 Jun 2013 20:26:46 +0200 Message-Id: <1372444009-11544-28-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1372444009-11544-1-git-send-email-pbonzini@redhat.com> References: <1372444009-11544-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::22e Subject: [Qemu-devel] [PATCH 27/30] exec: change some APIs to take AddressSpaceDispatch X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Paolo Bonzini Reviewed-by: Jan Kiszka --- exec.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/exec.c b/exec.c index 7f87e16..528c4d7 100644 --- a/exec.c +++ b/exec.c @@ -236,11 +236,10 @@ bool memory_region_is_unassigned(MemoryRegion *mr) && mr != &io_mem_watch; } -static MemoryRegionSection *address_space_lookup_region(AddressSpace *as, +static MemoryRegionSection *address_space_lookup_region(AddressSpaceDispatch *d, hwaddr addr, bool resolve_subpage) { - AddressSpaceDispatch *d = as->dispatch; MemoryRegionSection *section; subpage_t *subpage; @@ -254,13 +253,13 @@ static MemoryRegionSection *address_space_lookup_region(AddressSpace *as, } static MemoryRegionSection * -address_space_translate_internal(AddressSpace *as, hwaddr addr, hwaddr *xlat, +address_space_translate_internal(AddressSpaceDispatch *d, hwaddr addr, hwaddr *xlat, hwaddr *plen, bool resolve_subpage) { MemoryRegionSection *section; Int128 diff; - section = address_space_lookup_region(as, addr, resolve_subpage); + section = address_space_lookup_region(d, addr, resolve_subpage); /* Compute offset within MemoryRegionSection */ addr -= section->offset_within_address_space; @@ -282,7 +281,7 @@ MemoryRegion *address_space_translate(AddressSpace *as, hwaddr addr, hwaddr len = *plen; for (;;) { - section = address_space_translate_internal(as, addr, &addr, plen, true); + section = address_space_translate_internal(as->dispatch, addr, &addr, plen, true); mr = section->mr; if (!mr->iommu_ops) { @@ -311,7 +310,7 @@ address_space_translate_for_iotlb(AddressSpace *as, hwaddr addr, hwaddr *xlat, hwaddr *plen) { MemoryRegionSection *section; - section = address_space_translate_internal(as, addr, xlat, plen, false); + section = address_space_translate_internal(as->dispatch, addr, xlat, plen, false); assert(!section->mr->iommu_ops); return section;