yeahuh / rpms / qemu-kvm

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