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

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