|
|
9bac43 |
From 1b3b5dcbfa953d50e2b9df7d620bb53234a4f477 Mon Sep 17 00:00:00 2001
|
|
|
9bac43 |
From: David Gibson <dgibson@redhat.com>
|
|
|
9bac43 |
Date: Thu, 16 Nov 2017 03:07:21 +0100
|
|
|
9bac43 |
Subject: [PATCH 17/30] memory: Rename mem_begin/mem_commit/mem_add helpers
|
|
|
9bac43 |
|
|
|
9bac43 |
RH-Author: David Gibson <dgibson@redhat.com>
|
|
|
9bac43 |
Message-id: <20171116030732.8560-12-dgibson@redhat.com>
|
|
|
9bac43 |
Patchwork-id: 77698
|
|
|
9bac43 |
O-Subject: [PATCH 11/22] memory: Rename mem_begin/mem_commit/mem_add helpers
|
|
|
9bac43 |
Bugzilla: 1481593
|
|
|
9bac43 |
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
|
|
9bac43 |
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9bac43 |
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
|
|
|
9bac43 |
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
|
|
|
9bac43 |
|
|
|
9bac43 |
From: Alexey Kardashevskiy <aik@ozlabs.ru>
|
|
|
9bac43 |
|
|
|
9bac43 |
This renames some helpers to reflect better what they do.
|
|
|
9bac43 |
|
|
|
9bac43 |
This should cause no behavioural change.
|
|
|
9bac43 |
|
|
|
9bac43 |
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
|
|
|
9bac43 |
Message-Id: <20170921085110.25598-9-aik@ozlabs.ru>
|
|
|
9bac43 |
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9bac43 |
(cherry picked from commit 8629d3fcb77e9775e44d9051bad0fb5187925eae)
|
|
|
9bac43 |
|
|
|
9bac43 |
Signed-off-by: David Gibson <dgibson@redhat.com>
|
|
|
9bac43 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9bac43 |
---
|
|
|
9bac43 |
exec.c | 12 +++---------
|
|
|
9bac43 |
include/exec/memory-internal.h | 6 +++---
|
|
|
9bac43 |
memory.c | 6 +++---
|
|
|
9bac43 |
3 files changed, 9 insertions(+), 15 deletions(-)
|
|
|
9bac43 |
|
|
|
9bac43 |
diff --git a/exec.c b/exec.c
|
|
|
9bac43 |
index d1d8486..1b30e1e 100644
|
|
|
9bac43 |
--- a/exec.c
|
|
|
9bac43 |
+++ b/exec.c
|
|
|
9bac43 |
@@ -359,7 +359,7 @@ static void phys_page_compact(PhysPageEntry *lp, Node *nodes)
|
|
|
9bac43 |
}
|
|
|
9bac43 |
}
|
|
|
9bac43 |
|
|
|
9bac43 |
-static void phys_page_compact_all(AddressSpaceDispatch *d, int nodes_nb)
|
|
|
9bac43 |
+void address_space_dispatch_compact(AddressSpaceDispatch *d)
|
|
|
9bac43 |
{
|
|
|
9bac43 |
if (d->phys_map.skip) {
|
|
|
9bac43 |
phys_page_compact(&d->phys_map, d->map.nodes);
|
|
|
9bac43 |
@@ -1358,7 +1358,7 @@ static void register_multipage(FlatView *fv,
|
|
|
9bac43 |
phys_page_set(d, start_addr >> TARGET_PAGE_BITS, num_pages, section_index);
|
|
|
9bac43 |
}
|
|
|
9bac43 |
|
|
|
9bac43 |
-void mem_add(FlatView *fv, MemoryRegionSection *section)
|
|
|
9bac43 |
+void flatview_add_to_dispatch(FlatView *fv, MemoryRegionSection *section)
|
|
|
9bac43 |
{
|
|
|
9bac43 |
MemoryRegionSection now = *section, remain = *section;
|
|
|
9bac43 |
Int128 page_size = int128_make64(TARGET_PAGE_SIZE);
|
|
|
9bac43 |
@@ -2684,9 +2684,8 @@ static void io_mem_init(void)
|
|
|
9bac43 |
NULL, UINT64_MAX);
|
|
|
9bac43 |
}
|
|
|
9bac43 |
|
|
|
9bac43 |
-AddressSpaceDispatch *mem_begin(AddressSpace *as)
|
|
|
9bac43 |
+AddressSpaceDispatch *address_space_dispatch_new(FlatView *fv)
|
|
|
9bac43 |
{
|
|
|
9bac43 |
- FlatView *fv = address_space_to_flatview(as);
|
|
|
9bac43 |
AddressSpaceDispatch *d = g_new0(AddressSpaceDispatch, 1);
|
|
|
9bac43 |
uint16_t n;
|
|
|
9bac43 |
|
|
|
9bac43 |
@@ -2710,11 +2709,6 @@ void address_space_dispatch_free(AddressSpaceDispatch *d)
|
|
|
9bac43 |
g_free(d);
|
|
|
9bac43 |
}
|
|
|
9bac43 |
|
|
|
9bac43 |
-void mem_commit(AddressSpaceDispatch *d)
|
|
|
9bac43 |
-{
|
|
|
9bac43 |
- phys_page_compact_all(d, d->map.nodes_nb);
|
|
|
9bac43 |
-}
|
|
|
9bac43 |
-
|
|
|
9bac43 |
static void tcg_commit(MemoryListener *listener)
|
|
|
9bac43 |
{
|
|
|
9bac43 |
CPUAddressSpace *cpuas;
|
|
|
9bac43 |
diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h
|
|
|
9bac43 |
index 1cf8ad9..d4a35c6 100644
|
|
|
9bac43 |
--- a/include/exec/memory-internal.h
|
|
|
9bac43 |
+++ b/include/exec/memory-internal.h
|
|
|
9bac43 |
@@ -27,9 +27,9 @@ extern const MemoryRegionOps unassigned_mem_ops;
|
|
|
9bac43 |
bool memory_region_access_valid(MemoryRegion *mr, hwaddr addr,
|
|
|
9bac43 |
unsigned size, bool is_write);
|
|
|
9bac43 |
|
|
|
9bac43 |
-void mem_add(FlatView *fv, MemoryRegionSection *section);
|
|
|
9bac43 |
-AddressSpaceDispatch *mem_begin(AddressSpace *as);
|
|
|
9bac43 |
-void mem_commit(AddressSpaceDispatch *d);
|
|
|
9bac43 |
+void flatview_add_to_dispatch(FlatView *fv, MemoryRegionSection *section);
|
|
|
9bac43 |
+AddressSpaceDispatch *address_space_dispatch_new(FlatView *fv);
|
|
|
9bac43 |
+void address_space_dispatch_compact(AddressSpaceDispatch *d);
|
|
|
9bac43 |
|
|
|
9bac43 |
AddressSpaceDispatch *address_space_to_dispatch(AddressSpace *as);
|
|
|
9bac43 |
AddressSpaceDispatch *flatview_to_dispatch(FlatView *fv);
|
|
|
9bac43 |
diff --git a/memory.c b/memory.c
|
|
|
9bac43 |
index 6678a53..b7d2536 100644
|
|
|
9bac43 |
--- a/memory.c
|
|
|
9bac43 |
+++ b/memory.c
|
|
|
9bac43 |
@@ -909,13 +909,13 @@ static void address_space_update_topology(AddressSpace *as)
|
|
|
9bac43 |
FlatView *new_view = generate_memory_topology(as->root);
|
|
|
9bac43 |
int i;
|
|
|
9bac43 |
|
|
|
9bac43 |
- new_view->dispatch = mem_begin(as);
|
|
|
9bac43 |
+ new_view->dispatch = address_space_dispatch_new(new_view);
|
|
|
9bac43 |
for (i = 0; i < new_view->nr; i++) {
|
|
|
9bac43 |
MemoryRegionSection mrs =
|
|
|
9bac43 |
section_from_flat_range(&new_view->ranges[i], new_view);
|
|
|
9bac43 |
- mem_add(new_view, &mrs);
|
|
|
9bac43 |
+ flatview_add_to_dispatch(new_view, &mrs);
|
|
|
9bac43 |
}
|
|
|
9bac43 |
- mem_commit(new_view->dispatch);
|
|
|
9bac43 |
+ address_space_dispatch_compact(new_view->dispatch);
|
|
|
9bac43 |
|
|
|
9bac43 |
if (!QTAILQ_EMPTY(&as->listeners)) {
|
|
|
9bac43 |
address_space_update_topology_pass(as, old_view, new_view, false);
|
|
|
9bac43 |
--
|
|
|
9bac43 |
1.8.3.1
|
|
|
9bac43 |
|