Blame SOURCES/kvm-ppc-spapr-Add-hotremovable-flag-on-DIMM-LMBs-on-drme.patch

c687bc
From 5b826e7ed09ecf3b2837d147fec6b593f629e450 Mon Sep 17 00:00:00 2001
c687bc
From: Greg Kurz <gkurz@redhat.com>
c687bc
Date: Fri, 4 Dec 2020 15:07:59 -0500
c687bc
Subject: [PATCH 01/14] ppc/spapr: Add hotremovable flag on DIMM LMBs on
c687bc
 drmem_v2
c687bc
MIME-Version: 1.0
c687bc
Content-Type: text/plain; charset=UTF-8
c687bc
Content-Transfer-Encoding: 8bit
c687bc
c687bc
RH-Author: Greg Kurz <gkurz@redhat.com>
c687bc
Message-id: <20201204150800.264829-2-gkurz@redhat.com>
c687bc
Patchwork-id: 100217
c687bc
O-Subject: [RHEL-8.4.0 qemu-kvm PATCH 1/2] ppc/spapr: Add hotremovable flag on DIMM LMBs on drmem_v2
c687bc
Bugzilla: 1901837
c687bc
RH-Acked-by: Danilo de Paula <ddepaula@redhat.com>
c687bc
RH-Acked-by: David Gibson <dgibson@redhat.com>
c687bc
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
c687bc
c687bc
From: Leonardo Bras <leonardo@linux.ibm.com>
c687bc
c687bc
On reboot, all memory that was previously added using object_add and
c687bc
device_add is placed in this DIMM area.
c687bc
c687bc
The new SPAPR_LMB_FLAGS_HOTREMOVABLE flag helps Linux to put this memory in
c687bc
the correct memory zone, so no unmovable allocations are made there,
c687bc
allowing the object to be easily hot-removed by device_del and
c687bc
object_del.
c687bc
c687bc
This new flag was accepted in Power Architecture documentation.
c687bc
c687bc
Signed-off-by: Leonardo Bras <leobras.c@gmail.com>
c687bc
Reviewed-by: Bharata B Rao <bharata@linux.ibm.com>
c687bc
Message-Id: <20200511200201.58537-1-leobras.c@gmail.com>
c687bc
[dwg: Fixed syntax error spotted by Cédric Le Goater]
c687bc
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
c687bc
(cherry picked from commit 0911a60c76b8598f1863c6951b2b690059465153)
c687bc
Signed-off-by: Greg Kurz <gkurz@redhat.com>
c687bc
c687bc
Conflicts:
c687bc
	hw/ppc/pnv.c
c687bc
c687bc
The changes in this file clearly don't belong to this
c687bc
patch. Same goes for the changes in target/ppc/cpu.h and
c687bc
target/ppc/excp_helper.c. Something went wrong when the
c687bc
patch was applied. Anyway, downstream doesn't especially
c687bc
care for pnv, so just drop the changes.
c687bc
c687bc
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
c687bc
---
c687bc
 hw/ppc/spapr.c         | 3 ++-
c687bc
 include/hw/ppc/spapr.h | 1 +
c687bc
 2 files changed, 3 insertions(+), 1 deletion(-)
c687bc
c687bc
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
c687bc
index a330f038b95..c74079702d0 100644
c687bc
--- a/hw/ppc/spapr.c
c687bc
+++ b/hw/ppc/spapr.c
c687bc
@@ -690,7 +690,8 @@ static int spapr_populate_drmem_v2(SpaprMachineState *spapr, void *fdt,
c687bc
         g_assert(drc);
c687bc
         elem = spapr_get_drconf_cell(size / lmb_size, addr,
c687bc
                                      spapr_drc_index(drc), node,
c687bc
-                                     SPAPR_LMB_FLAGS_ASSIGNED);
c687bc
+                                     (SPAPR_LMB_FLAGS_ASSIGNED |
c687bc
+                                      SPAPR_LMB_FLAGS_HOTREMOVABLE));
c687bc
         QSIMPLEQ_INSERT_TAIL(&drconf_queue, elem, entry);
c687bc
         nr_entries++;
c687bc
         cur_addr = addr + size;
c687bc
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
c687bc
index aa89cc4a95c..e047dabf300 100644
c687bc
--- a/include/hw/ppc/spapr.h
c687bc
+++ b/include/hw/ppc/spapr.h
c687bc
@@ -847,6 +847,7 @@ int spapr_rtc_import_offset(SpaprRtcState *rtc, int64_t legacy_offset);
c687bc
 #define SPAPR_LMB_FLAGS_ASSIGNED 0x00000008
c687bc
 #define SPAPR_LMB_FLAGS_DRC_INVALID 0x00000020
c687bc
 #define SPAPR_LMB_FLAGS_RESERVED 0x00000080
c687bc
+#define SPAPR_LMB_FLAGS_HOTREMOVABLE 0x00000100
c687bc
 
c687bc
 void spapr_do_system_reset_on_cpu(CPUState *cs, run_on_cpu_data arg);
c687bc
 
c687bc
-- 
c687bc
2.27.0
c687bc