]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
spapr: Don't use weird units for MIN_RMA_SLOF
authorDavid Gibson <david@gibson.dropbear.id.au>
Tue, 10 Dec 2019 05:25:04 +0000 (16:25 +1100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Mon, 16 Mar 2020 22:41:15 +0000 (09:41 +1100)
MIN_RMA_SLOF records the minimum about of RMA that the SLOF firmware
requires.  It lets us give a meaningful error if the RMA ends up too small,
rather than just letting SLOF crash.

It's currently stored as a number of megabytes, which is strange for global
constants.  Move that megabyte scaling into the definition of the constant
like most other things use.

Change from M to MiB in the associated message while we're at it.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
hw/ppc/spapr.c

index cc10798be4181dd28c6cf5d490f6a614e2efa9e9..510494ad870eb4d9a702c1b548e5c8243320bc07 100644 (file)
 #define FW_OVERHEAD             0x2800000
 #define KERNEL_LOAD_ADDR        FW_MAX_SIZE
 
-#define MIN_RMA_SLOF            128UL
+#define MIN_RMA_SLOF            (128 * MiB)
 
 #define PHANDLE_INTC            0x00001111
 
@@ -2956,10 +2956,10 @@ static void spapr_machine_init(MachineState *machine)
         }
     }
 
-    if (spapr->rma_size < (MIN_RMA_SLOF * MiB)) {
+    if (spapr->rma_size < MIN_RMA_SLOF) {
         error_report(
-            "pSeries SLOF firmware requires >= %ldM guest RMA (Real Mode Area memory)",
-            MIN_RMA_SLOF);
+            "pSeries SLOF firmware requires >= %ldMiB guest RMA (Real Mode Area memory)",
+            MIN_RMA_SLOF / MiB);
         exit(1);
     }