yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-Revert-spapr-Don-t-allow-memory-hotplug-to-memory-le.patch

26ba25
From c30a2c251e309eba40fd04e36b80016e4858c586 Mon Sep 17 00:00:00 2001
26ba25
From: Serhii Popovych <spopovyc@redhat.com>
26ba25
Date: Wed, 11 Jul 2018 17:11:45 +0100
26ba25
Subject: [PATCH 2/4] Revert "spapr: Don't allow memory hotplug to memory less
26ba25
 nodes"
26ba25
26ba25
RH-Author: Serhii Popovych <spopovyc@redhat.com>
26ba25
Message-id: <1531329105-80927-3-git-send-email-spopovyc@redhat.com>
26ba25
Patchwork-id: 81313
26ba25
O-Subject: [RHEL-8.0 qemu-kvm PATCH 2/2] Revert "spapr: Don't allow memory hotplug to memory less nodes"
26ba25
Bugzilla: 1599593
26ba25
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
26ba25
RH-Acked-by: David Gibson <dgibson@redhat.com>
26ba25
RH-Acked-by: Thomas Huth <thuth@redhat.com>
26ba25
26ba25
This reverts commit b556854bd8524c26b8be98ab1bfdf0826831e793.
26ba25
26ba25
Leave change @node type from uint32_t to to int from reverted commit
26ba25
because node < 0 is always false.
26ba25
26ba25
Note that implementing capability or some trick to detect if guest
26ba25
kernel does not support hot-add to memory: this returns previous
26ba25
behavour where memory added to first non-empty node.
26ba25
26ba25
Signed-off-by: Serhii Popovych <spopovyc@redhat.com>
26ba25
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
26ba25
(cherry picked from commit e47f1d2786c3d01a7894a493aafe0efa6b64453c)
26ba25
Signed-off-by: Serhii Popovych <spopovyc@redhat.com>
26ba25
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
26ba25
---
26ba25
 hw/ppc/spapr.c | 22 ----------------------
26ba25
 1 file changed, 22 deletions(-)
26ba25
26ba25
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
26ba25
index f3da93f..ef00937 100644
26ba25
--- a/hw/ppc/spapr.c
26ba25
+++ b/hw/ppc/spapr.c
26ba25
@@ -3489,28 +3489,6 @@ static void spapr_machine_device_plug(HotplugHandler *hotplug_dev,
26ba25
             return;
26ba25
         }
26ba25
 
26ba25
-        /*
26ba25
-         * Currently PowerPC kernel doesn't allow hot-adding memory to
26ba25
-         * memory-less node, but instead will silently add the memory
26ba25
-         * to the first node that has some memory. This causes two
26ba25
-         * unexpected behaviours for the user.
26ba25
-         *
26ba25
-         * - Memory gets hotplugged to a different node than what the user
26ba25
-         *   specified.
26ba25
-         * - Since pc-dimm subsystem in QEMU still thinks that memory belongs
26ba25
-         *   to memory-less node, a reboot will set things accordingly
26ba25
-         *   and the previously hotplugged memory now ends in the right node.
26ba25
-         *   This appears as if some memory moved from one node to another.
26ba25
-         *
26ba25
-         * So until kernel starts supporting memory hotplug to memory-less
26ba25
-         * nodes, just prevent such attempts upfront in QEMU.
26ba25
-         */
26ba25
-        if (nb_numa_nodes && !numa_info[node].node_mem) {
26ba25
-            error_setg(errp, "Can't hotplug memory to memory-less node %d",
26ba25
-                       node);
26ba25
-            return;
26ba25
-        }
26ba25
-
26ba25
         spapr_memory_plug(hotplug_dev, dev, node, errp);
26ba25
     } else if (object_dynamic_cast(OBJECT(dev), TYPE_SPAPR_CPU_CORE)) {
26ba25
         spapr_core_plug(hotplug_dev, dev, errp);
26ba25
-- 
26ba25
1.8.3.1
26ba25