qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH qemu v5 18/18] memory: Avoid temporary FlatView allo


From: Alexey Kardashevskiy
Subject: [Qemu-devel] [PATCH qemu v5 18/18] memory: Avoid temporary FlatView allocation in a single child case
Date: Thu, 21 Sep 2017 18:51:10 +1000

The root MR may be enabled but the only child may be not (this is
the case for the PCI bus master address space) so check this and avoid
allocating temporary FV if that nested MR is not enabled.

This does not make any difference though.

Signed-off-by: Alexey Kardashevskiy <address@hidden>
---
 memory.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/memory.c b/memory.c
index 5c21563745..bf71f19fec 100644
--- a/memory.c
+++ b/memory.c
@@ -748,9 +748,14 @@ static FlatView *generate_memory_topology(MemoryRegion *mr)
     int i;
     FlatView *view;
     bool use_empty = false;
+    MemoryRegion *child = QTAILQ_FIRST(&mr->subregions);
 
     if (!mr->enabled) {
         use_empty = true;
+    } else if (child && !child->enabled &&
+               !QTAILQ_NEXT(child, subregions_link) &&
+               !child->addr && int128_eq(child->size, mr->size)) {
+        use_empty = true;
     } else {
         view = flatview_new(mr);
         if (mr) {
-- 
2.11.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]