qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 21/27] pc: add memory hotplug 440fx machine


From: Li Guang
Subject: Re: [Qemu-devel] [PATCH 21/27] pc: add memory hotplug 440fx machine
Date: Thu, 21 Nov 2013 13:48:56 +0800
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.1.16) Gecko/20120421 Iceape/2.0.11

Hi, Igor

Igor Mammedov wrote:
Add DimmBus for memory hotplug below 4Gb or above 4Gb depending
on initial memory size and hotplug memory size.
...
+static
+void pc_hotplug_memory_init_impl(Object *owner,
+                                 MemoryRegion *system_memory,
+                                 ram_addr_t low_hotplug_mem_start,
+                                 ram_addr_t low_hotplug_mem_end,
+                                 DimmBus *hotplug_mem_bus,
+                                 ram_addr_t *high_mem_end)
+{
+    QemuOpts *opts = qemu_opts_find(qemu_find_opts("memory-opts"), NULL);
+    ram_addr_t ram_size = qemu_opt_get_size(opts, "mem", 0);
+    ram_addr_t maxmem = qemu_opt_get_size(opts, "maxmem", 0);
+    ram_addr_t hotplug_mem_size;
+
+    if (maxmem<= ram_size) {
+        /* Disable ACPI migration code and creation of memory devices in SSDT 
*/

Why not give the memory that not be hot-added a chance to be placed on one memory slot? if all memory can be hot-added and hot-removed, then we can bring in more flexibility for
memory hotplug feature.

Thanks!

+        qemu_opt_set_number(opts, "slots", 0);
+        return;
+    }
+
+    hotplug_mem_size = maxmem - ram_size;
+    if (hotplug_mem_size<= (low_hotplug_mem_end - low_hotplug_mem_start)) {
+        hotplug_mem_bus->base = low_hotplug_mem_start;
+    } else {
+        hotplug_mem_bus->base = ROUND_UP(*high_mem_end, 1ULL<<  30);
+        *high_mem_end = hotplug_mem_bus->base + hotplug_mem_size;
+    }
+
...




reply via email to

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