cryptospore / 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

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