From 415b9a089ec8b033ad2efdf3c161c7b0a838f747 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 15 Oct 2024 19:52:58 +0800 Subject: [PATCH 1/6] patch on qemu v6.2.0 to support memory hotplug from 0 --- update_for_memory_hotplug_from_0.patch | 88 ++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 update_for_memory_hotplug_from_0.patch diff --git a/update_for_memory_hotplug_from_0.patch b/update_for_memory_hotplug_from_0.patch new file mode 100644 index 00000000..bc92965f --- /dev/null +++ b/update_for_memory_hotplug_from_0.patch @@ -0,0 +1,88 @@ +Subject: [PATCH] update for memory hotplug based on v6.2.0 +--- +Index: backends/hostmem-file.c +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c +--- a/backends/hostmem-file.c (revision 10e12c5989316c925d07ff0c810b7cfbaa93f78a) ++++ b/backends/hostmem-file.c (revision 8587a8f999cdf3ed08311e16652f3b664c4855ed) +@@ -43,7 +43,6 @@ + gchar *name; + + if (!backend->size) { +- error_setg(errp, "can't create backend with size 0"); + return; + } + if (!fb->mem_path) { +Index: backends/hostmem.c +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/backends/hostmem.c b/backends/hostmem.c +--- a/backends/hostmem.c (revision 10e12c5989316c925d07ff0c810b7cfbaa93f78a) ++++ b/backends/hostmem.c (revision 8587a8f999cdf3ed08311e16652f3b664c4855ed) +@@ -64,12 +64,6 @@ + if (!visit_type_size(v, name, &value, errp)) { + return; + } +- if (!value) { +- error_setg(errp, +- "property '%s' of %s doesn't take value '%" PRIu64 "'", +- name, object_get_typename(obj), value); +- return; +- } + backend->size = value; + } + +@@ -337,6 +331,9 @@ + goto out; + } + ++ if (0 == backend->size) { ++ return; ++ } + ptr = memory_region_get_ram_ptr(&backend->mr); + sz = memory_region_size(&backend->mr); + +Index: hw/core/machine.c +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/hw/core/machine.c b/hw/core/machine.c +--- a/hw/core/machine.c (revision 10e12c5989316c925d07ff0c810b7cfbaa93f78a) ++++ b/hw/core/machine.c (revision 8587a8f999cdf3ed08311e16652f3b664c4855ed) +@@ -1084,7 +1084,10 @@ + HostMemoryBackend *backend) + { + MemoryRegion *ret = host_memory_backend_get_memory(backend); +- ++ if (NULL == ret) ++ { ++ return ret; ++ } + if (memory_region_is_mapped(ret)) { + error_report("memory backend %s can't be used multiple times.", + object_get_canonical_path_component(OBJECT(backend))); +Index: hw/core/numa.c +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/hw/core/numa.c b/hw/core/numa.c +--- a/hw/core/numa.c (revision 10e12c5989316c925d07ff0c810b7cfbaa93f78a) ++++ b/hw/core/numa.c (revision 8587a8f999cdf3ed08311e16652f3b664c4855ed) +@@ -629,6 +629,10 @@ + continue; + } + MemoryRegion *seg = machine_consume_memdev(ms, backend); ++ if (seg == NULL) ++ { ++ continue; ++ } + memory_region_add_subregion(ram, addr, seg); + addr += size; + } -- Gitee From c7c92c7a14ad405d9fc15b21f73479d4bc364109 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 15 Oct 2024 21:56:09 +0800 Subject: [PATCH 2/6] qemu.spec, patch on qemu v6.2.0 to support memory hotplug from 0 --- qemu.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/qemu.spec b/qemu.spec index 417538f3..b3afa853 100644 --- a/qemu.spec +++ b/qemu.spec @@ -1048,6 +1048,7 @@ Patch1033: system-physmem-Propagate-AddressSpace-to-MapClient-h.patch Patch1034: system-physmem-Per-AddressSpace-bounce-buffering.patch Patch1035: softmmu-Support-concurrent-bounce-buffers-CVE-2024-8.patch Patch1036: mac_dbdma-Remove-leftover-dma_memory_unmap-calls-CVE.patch +Patch1037: update_for_memory_hotplug_from_0.patch BuildRequires: flex -- Gitee From 7181a3bccce0984952aac8387d3f8c658b3f7ebd Mon Sep 17 00:00:00 2001 From: root Date: Tue, 15 Oct 2024 22:10:49 +0800 Subject: [PATCH 3/6] update changelog in qemu.spec --- qemu.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qemu.spec b/qemu.spec index b3afa853..64528a31 100644 --- a/qemu.spec +++ b/qemu.spec @@ -1648,6 +1648,10 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Mon Oct 15 2024 - 10:6.2.0-101 +- qemu.spec, patch on qemu v6.2.0 to support memory hotplug from 0 +- patch on qemu v6.2.0 to support memory hotplug from 0 + * Mon Oct 14 2024 - 10:6.2.0-100 - mac_dbdma: Remove leftover `dma_memory_unmap` calls(CVE-2024-8612) - softmmu: Support concurrent bounce buffers(CVE-2024-8612) -- Gitee From 9811eed6b61c1c27a3a7e7a5e7388ef0396539e6 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 16 Oct 2024 09:34:42 +0800 Subject: [PATCH 4/6] update release version in qemu.spec --- qemu.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu.spec b/qemu.spec index 64528a31..d8b40096 100644 --- a/qemu.spec +++ b/qemu.spec @@ -3,7 +3,7 @@ Name: qemu Version: 6.2.0 -Release: 100 +Release: 101 Epoch: 10 Summary: QEMU is a generic and open source machine emulator and virtualizer License: GPLv2 and BSD and MIT and CC-BY-SA-4.0 -- Gitee From 7f549c0550dd4765d73d8ec77c4d1fd3fefdd751 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 16 Oct 2024 10:47:21 +0800 Subject: [PATCH 5/6] update changelog in qemu.spec --- qemu.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qemu.spec b/qemu.spec index d8b40096..f5e1d2c7 100644 --- a/qemu.spec +++ b/qemu.spec @@ -1649,6 +1649,9 @@ getent passwd qemu >/dev/null || \ %changelog * Mon Oct 15 2024 - 10:6.2.0-101 +- update changelog in qemu.spec +- update release version in qemu.spec +- update changelog in qemu.spec - qemu.spec, patch on qemu v6.2.0 to support memory hotplug from 0 - patch on qemu v6.2.0 to support memory hotplug from 0 -- Gitee From e58a75c0114885f1922214a6912a5ffb5dfb2524 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 16 Oct 2024 10:51:12 +0800 Subject: [PATCH 6/6] update changelog date --- qemu.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qemu.spec b/qemu.spec index f5e1d2c7..9fb41ea1 100644 --- a/qemu.spec +++ b/qemu.spec @@ -1648,7 +1648,8 @@ getent passwd qemu >/dev/null || \ %endif %changelog -* Mon Oct 15 2024 - 10:6.2.0-101 +* Mon Oct 16 2024 - 10:6.2.0-101 +- update changelog date - update changelog in qemu.spec - update release version in qemu.spec - update changelog in qemu.spec -- Gitee