qemu-devel
[Top][All Lists]
Advanced

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

Re: [RFC] q800: fix I/O memory map


From: Philippe Mathieu-Daudé
Subject: Re: [RFC] q800: fix I/O memory map
Date: Sat, 2 Nov 2019 20:54:29 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1

On 11/2/19 7:10 PM, Laurent Vivier wrote:
Paolo,

the RFC was mainly for you:

Is this the good way to replicate 256 times a memory chunk containing a
bunch of different MMIO spaces?

I asked Richard about this and he said this is OK because this is
the FlatView memory tree. It is then optimized in AddressSpace
(see memory_region_transaction_commit). What matters in term of
performance are the AddressSpaces.

...
+    /*
+     * Memory from VIA_BASE to VIA_BASE + 0x40000 is repeated
+     * from VIA_BASE + 0x40000 to VIA_BASE + 0x4000000
+     */
+    for (i = 1; i < 256; i++) {
+        MemoryRegion *io = g_malloc(sizeof(*io));
+        char *name = g_strdup_printf("mac_m68k.io[%d]", i);
+
+        memory_region_init_alias(io, NULL, name, get_system_memory(),
+                                 VIA_BASE, 0x40000);
+        memory_region_add_subregion(get_system_memory(),
+                                    VIA_BASE + i * 0x40000, io);
+        g_free(name);
+    }
+
...
Thanks,
Laurent




reply via email to

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