yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-spapr-Add-ibm-max-associativity-domains-property.patch

ae23c9
From 7dbee79b31930ae0eab366f807ea2b6ff506fc1a Mon Sep 17 00:00:00 2001
ae23c9
From: Serhii Popovych <spopovyc@redhat.com>
ae23c9
Date: Wed, 11 Jul 2018 17:11:44 +0100
ae23c9
Subject: [PATCH 1/4] spapr: Add ibm, max-associativity-domains property
ae23c9
ae23c9
RH-Author: Serhii Popovych <spopovyc@redhat.com>
ae23c9
Message-id: <1531329105-80927-2-git-send-email-spopovyc@redhat.com>
ae23c9
Patchwork-id: 81311
ae23c9
O-Subject: [RHEL-8.0 qemu-kvm PATCH 1/2] spapr: Add ibm, max-associativity-domains property
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
Now recent kernels (i.e. since linux-stable commit a346137e9142
ae23c9
("powerpc/numa: Use ibm,max-associativity-domains to discover possible nodes")
ae23c9
support this property to mark initially memory-less NUMA nodes as "possible"
ae23c9
to allow further memory hot-add to them.
ae23c9
ae23c9
Advertise this property for pSeries machines to let guest kernels detect
ae23c9
maximum supported node configuration and benefit from kernel side change
ae23c9
when hot-add memory to specific, possibly empty before, NUMA 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 da9f80fbad21319194e73355dea8a1cff6a574e4)
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 | 10 ++++++++++
ae23c9
 1 file changed, 10 insertions(+)
ae23c9
ae23c9
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
ae23c9
index c3f08b3..f3da93f 100644
ae23c9
--- a/hw/ppc/spapr.c
ae23c9
+++ b/hw/ppc/spapr.c
ae23c9
@@ -910,6 +910,13 @@ static void spapr_dt_rtas(sPAPRMachineState *spapr, void *fdt)
ae23c9
         0, cpu_to_be32(SPAPR_MEMORY_BLOCK_SIZE),
ae23c9
         cpu_to_be32(max_cpus / smp_threads),
ae23c9
     };
ae23c9
+    uint32_t maxdomains[] = {
ae23c9
+        cpu_to_be32(4),
ae23c9
+        cpu_to_be32(0),
ae23c9
+        cpu_to_be32(0),
ae23c9
+        cpu_to_be32(0),
ae23c9
+        cpu_to_be32(nb_numa_nodes ? nb_numa_nodes - 1 : 0),
ae23c9
+    };
ae23c9
 
ae23c9
     _FDT(rtas = fdt_add_subnode(fdt, 0, "rtas"));
ae23c9
 
ae23c9
@@ -946,6 +953,9 @@ static void spapr_dt_rtas(sPAPRMachineState *spapr, void *fdt)
ae23c9
     _FDT(fdt_setprop(fdt, rtas, "ibm,associativity-reference-points",
ae23c9
                      refpoints, sizeof(refpoints)));
ae23c9
 
ae23c9
+    _FDT(fdt_setprop(fdt, rtas, "ibm,max-associativity-domains",
ae23c9
+                     maxdomains, sizeof(maxdomains)));
ae23c9
+
ae23c9
     _FDT(fdt_setprop_cell(fdt, rtas, "rtas-error-log-max",
ae23c9
                           RTAS_ERROR_LOG_MAX));
ae23c9
     _FDT(fdt_setprop_cell(fdt, rtas, "rtas-event-scan-rate",
ae23c9
-- 
ae23c9
1.8.3.1
ae23c9