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

383d26
From 5a7d9ce549b777d52cd680327e4dc17921ab882c Mon Sep 17 00:00:00 2001
383d26
From: Serhii Popovych <spopovyc@redhat.com>
383d26
Date: Wed, 2 May 2018 18:52:27 +0200
383d26
Subject: [PATCH 04/13] spapr: Add ibm, max-associativity-domains property
383d26
383d26
RH-Author: Serhii Popovych <spopovyc@redhat.com>
383d26
Message-id: <1525287148-92715-2-git-send-email-spopovyc@redhat.com>
383d26
Patchwork-id: 80013
383d26
O-Subject: [RHEL-7.6 qemu-kvm-rhev PATCH 1/2] spapr: Add ibm, max-associativity-domains property
383d26
Bugzilla: 1570525
383d26
RH-Acked-by: David Gibson <dgibson@redhat.com>
383d26
RH-Acked-by: Thomas Huth <thuth@redhat.com>
383d26
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
383d26
383d26
Now recent kernels (i.e. since linux-stable commit a346137e9142
383d26
("powerpc/numa: Use ibm,max-associativity-domains to discover possible nodes")
383d26
support this property to mark initially memory-less NUMA nodes as "possible"
383d26
to allow further memory hot-add to them.
383d26
383d26
Advertise this property for pSeries machines to let guest kernels detect
383d26
maximum supported node configuration and benefit from kernel side change
383d26
when hot-add memory to specific, possibly empty before, NUMA node.
383d26
383d26
Signed-off-by: Serhii Popovych <spopovyc@redhat.com>
383d26
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
383d26
(cherry picked from commit da9f80fbad21319194e73355dea8a1cff6a574e4)
383d26
Signed-off-by: Serhii Popovych <spopovyc@redhat.com>
383d26
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
383d26
---
383d26
 hw/ppc/spapr.c | 10 ++++++++++
383d26
 1 file changed, 10 insertions(+)
383d26
383d26
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
383d26
index 360a258..c9561e1 100644
383d26
--- a/hw/ppc/spapr.c
383d26
+++ b/hw/ppc/spapr.c
383d26
@@ -910,6 +910,13 @@ static void spapr_dt_rtas(sPAPRMachineState *spapr, void *fdt)
383d26
         0, cpu_to_be32(SPAPR_MEMORY_BLOCK_SIZE),
383d26
         cpu_to_be32(max_cpus / smp_threads),
383d26
     };
383d26
+    uint32_t maxdomains[] = {
383d26
+        cpu_to_be32(4),
383d26
+        cpu_to_be32(0),
383d26
+        cpu_to_be32(0),
383d26
+        cpu_to_be32(0),
383d26
+        cpu_to_be32(nb_numa_nodes ? nb_numa_nodes - 1 : 0),
383d26
+    };
383d26
 
383d26
     _FDT(rtas = fdt_add_subnode(fdt, 0, "rtas"));
383d26
 
383d26
@@ -946,6 +953,9 @@ static void spapr_dt_rtas(sPAPRMachineState *spapr, void *fdt)
383d26
     _FDT(fdt_setprop(fdt, rtas, "ibm,associativity-reference-points",
383d26
                      refpoints, sizeof(refpoints)));
383d26
 
383d26
+    _FDT(fdt_setprop(fdt, rtas, "ibm,max-associativity-domains",
383d26
+                     maxdomains, sizeof(maxdomains)));
383d26
+
383d26
     _FDT(fdt_setprop_cell(fdt, rtas, "rtas-error-log-max",
383d26
                           RTAS_ERROR_LOG_MAX));
383d26
     _FDT(fdt_setprop_cell(fdt, rtas, "rtas-event-scan-rate",
383d26
-- 
383d26
1.8.3.1
383d26