From nobody Wed Feb 11 02:33:27 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 1506037299960327.8071202007767; Thu, 21 Sep 2017 16:41:39 -0700 (PDT) Received: from localhost ([::1]:55969 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvB68-0000iW-6t for importer@patchew.org; Thu, 21 Sep 2017 19:41:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvAiM-0004j4-D6 for qemu-devel@nongnu.org; Thu, 21 Sep 2017 19:17:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dvAiL-0004Dw-D1 for qemu-devel@nongnu.org; Thu, 21 Sep 2017 19:17:02 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:35974) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dvAiL-0004Cc-6n for qemu-devel@nongnu.org; Thu, 21 Sep 2017 19:17:01 -0400 Received: by mail-wm0-x243.google.com with SMTP id r136so6437096wmf.3 for ; Thu, 21 Sep 2017 16:17:01 -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.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Sep 2017 16:16:59 -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=n+IOuPQ4ITtTtWsE51LyoRZDnSfCOR8Y3UTDBo5GNeE=; b=KG30Cd9J7s8/Hj34F6Z74b3TZ7Ca2u8ClDn/yyVq6Ml8emOxZkTv11z6CzzuBmUz5R h0X5/VwKFNEtz2tSYQQaFukNacdtgD88rMPdS8+8T+A2aaaqarbYi00SESJWOX5vPXq6 us5MzUfFWkAq9POEzmw6iPeO9C7QHG9pWRFgbmkBeaW5+yDkQTDV/K+rlIabnEa5ga4S Qp52uhX0rOK3zVlpclVnKFz/4ICvHPb9RwYd7czSnJHX9RLFybqEd7qHiAVXlhbWZwuF OLMqvg3zAbXL6B3CeESZwS/Hq90DtMpTwmRQ0e/UcUwUUMBlgn68I8MWf5hKDpWREKsU q4hA== 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=n+IOuPQ4ITtTtWsE51LyoRZDnSfCOR8Y3UTDBo5GNeE=; b=RINE1YhfK3FWaUGINVeklaWQpYpwgvLANusz4/214+RqzDqu7xeaYmfylwSrL7byXC cDPVmqIiW5pmBNboj4UZNg76iRkpI39KkweJiDCVnbUWS5EMMDWulaKjOppt7mTejdf/ 6584ChU26wWiJ5Oq/0pObcIwoTbfqOEwNR+qjKlu/K09PHXawQE6pMbL7+zxwAdWVWix EEF1FENVTYeUWd+EV87V9mu3ztUJursLNgs2+8bYYdFIDfOR/TBrF4ZyNeP7pwMa5tJn RuSFOK4j2PQVWkt9hHocTdkqKzPUNg2xMy3+KTHNp4eZvWb9QmG1wLhBWrPO6lfny1Q2 zEsw== X-Gm-Message-State: AHPjjUh6raqpaf8Tcyi7HlzQqJWA47yFOJd9T9C0B2fcjLxRe+uoiSqn UwljmdCLdirdfWp0RmocuAogSsUb X-Google-Smtp-Source: AOwi7QD8VEIDa+mYLxjVn/qXA8/MtoESVbf8COPRIn823aoRam9UrRTUq8VrLALY8Dc2LRHdjkDegA== X-Received: by 10.28.18.210 with SMTP id 201mr2036698wms.135.1506035819979; Thu, 21 Sep 2017 16:16:59 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 22 Sep 2017 01:16:21 +0200 Message-Id: <1506035800-30509-14-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:c09::243 Subject: [Qemu-devel] [PULL 13/32] memory: Rename mem_begin/mem_commit/mem_add helpers 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 renames some helpers to reflect better what they do. This should cause no behavioural change. Signed-off-by: Alexey Kardashevskiy Message-Id: <20170921085110.25598-9-aik@ozlabs.ru> Signed-off-by: Paolo Bonzini --- exec.c | 12 +++--------- include/exec/memory-internal.h | 6 +++--- memory.c | 6 +++--- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/exec.c b/exec.c index 548ec71..b085f82 100644 --- a/exec.c +++ b/exec.c @@ -358,7 +358,7 @@ static void phys_page_compact(PhysPageEntry *lp, Node *= nodes) } } =20 -static void phys_page_compact_all(AddressSpaceDispatch *d, int nodes_nb) +void address_space_dispatch_compact(AddressSpaceDispatch *d) { if (d->phys_map.skip) { phys_page_compact(&d->phys_map, d->map.nodes); @@ -1346,7 +1346,7 @@ static void register_multipage(FlatView *fv, phys_page_set(d, start_addr >> TARGET_PAGE_BITS, num_pages, section_in= dex); } =20 -void mem_add(FlatView *fv, MemoryRegionSection *section) +void flatview_add_to_dispatch(FlatView *fv, MemoryRegionSection *section) { MemoryRegionSection now =3D *section, remain =3D *section; Int128 page_size =3D int128_make64(TARGET_PAGE_SIZE); @@ -2672,9 +2672,8 @@ static void io_mem_init(void) NULL, UINT64_MAX); } =20 -AddressSpaceDispatch *mem_begin(AddressSpace *as) +AddressSpaceDispatch *address_space_dispatch_new(FlatView *fv) { - FlatView *fv =3D address_space_to_flatview(as); AddressSpaceDispatch *d =3D g_new0(AddressSpaceDispatch, 1); uint16_t n; =20 @@ -2698,11 +2697,6 @@ void address_space_dispatch_free(AddressSpaceDispatc= h *d) g_free(d); } =20 -void mem_commit(AddressSpaceDispatch *d) -{ - phys_page_compact_all(d, d->map.nodes_nb); -} - static void tcg_commit(MemoryListener *listener) { CPUAddressSpace *cpuas; diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h index 1cf8ad9..d4a35c6 100644 --- a/include/exec/memory-internal.h +++ b/include/exec/memory-internal.h @@ -27,9 +27,9 @@ extern const MemoryRegionOps unassigned_mem_ops; bool memory_region_access_valid(MemoryRegion *mr, hwaddr addr, unsigned size, bool is_write); =20 -void mem_add(FlatView *fv, MemoryRegionSection *section); -AddressSpaceDispatch *mem_begin(AddressSpace *as); -void mem_commit(AddressSpaceDispatch *d); +void flatview_add_to_dispatch(FlatView *fv, MemoryRegionSection *section); +AddressSpaceDispatch *address_space_dispatch_new(FlatView *fv); +void address_space_dispatch_compact(AddressSpaceDispatch *d); =20 AddressSpaceDispatch *address_space_to_dispatch(AddressSpace *as); AddressSpaceDispatch *flatview_to_dispatch(FlatView *fv); diff --git a/memory.c b/memory.c index bf3728a..c374317 100644 --- a/memory.c +++ b/memory.c @@ -910,13 +910,13 @@ static void address_space_update_topology(AddressSpac= e *as) FlatView *new_view =3D generate_memory_topology(as->root); int i; =20 - new_view->dispatch =3D mem_begin(as); + new_view->dispatch =3D address_space_dispatch_new(new_view); for (i =3D 0; i < new_view->nr; i++) { MemoryRegionSection mrs =3D section_from_flat_range(&new_view->ranges[i], new_view); - mem_add(new_view, &mrs); + flatview_add_to_dispatch(new_view, &mrs); } - mem_commit(new_view->dispatch); + address_space_dispatch_compact(new_view->dispatch); =20 if (!QTAILQ_EMPTY(&as->listeners)) { address_space_update_topology_pass(as, old_view, new_view, false); --=20 1.8.3.1