Skip to contentSkip to conversation

ppc/pnv: increase kernel size limit to 256MiB

PATCH Superseded Murilo Opsfelder Araujo 2 participants 4 messages Feb 25, 2019

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover ppc/pnv: increase kernel size limit to 256MiB

First patch increases kernel size limit to 256MiB to fit images generated with CONFIG_DEBUG_INFO.

Second patch just fixes a misleading comment regarding initrd size limit.

Murilo Opsfelder Araujo (2):
ppc/pnv: increase kernel size limit to 256MiB
ppc/pnv: add INITRD_MAX_SIZE constant

 hw/ppc/pnv.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/2 ppc/pnv: increase kernel size limit to 256MiB

Building kernel with CONFIG_DEBUG_INFO_REDUCED can generate a ~90MB image and building with CONFIG_DEBUG_INFO can generate a ~225M one, both exceeds the current limit of 32MiB.

Increasing kernel size limit to 256MiB should fit for now.

---
 hw/ppc/pnv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/ppc/pnv.c +2 -1
index da540860a2..000707164e 100644
@@ -54,6 +54,7 @@
 #define FW_MAX_SIZE             0x00400000
 
 #define KERNEL_LOAD_ADDR        0x20000000
+#define KERNEL_MAX_SIZE         0x10000000    /* 256MiB */
 #define INITRD_LOAD_ADDR        0x60000000
 
 static const char *pnv_chip_core_typename(const PnvChip *o)
@@ -588,7 +589,7 @@ static void pnv_init(MachineState *machine)
         long kernel_size;
 
         kernel_size = load_image_targphys(machine->kernel_filename,
-                                          KERNEL_LOAD_ADDR, 0x2000000);
+                                          KERNEL_LOAD_ADDR, KERNEL_MAX_SIZE);
         if (kernel_size < 0) {
             error_report("Could not load kernel '%s'",
                          machine->kernel_filename);
Signature · 1 line
2.20.1
#2 lore raw

PATCH 2/2 ppc/pnv: add INITRD_MAX_SIZE constant

In reply to Murilo Opsfelder Araujo

The current 0x10000000 value is actually 256MiB, not 128MB as the comment suggests. Move it to a constant and fix the comment (no change in the size value).

---
 hw/ppc/pnv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/ppc/pnv.c +2 -1
index 000707164e..514439db20 100644
@@ -56,6 +56,7 @@
 #define KERNEL_LOAD_ADDR        0x20000000
 #define KERNEL_MAX_SIZE         0x10000000    /* 256MiB */
 #define INITRD_LOAD_ADDR        0x60000000
+#define INITRD_MAX_SIZE         0x10000000    /* 256MiB */
 
 static const char *pnv_chip_core_typename(const PnvChip *o)
 {
@@ -601,7 +602,7 @@ static void pnv_init(MachineState *machine)
     if (machine->initrd_filename) {
         pnv->initrd_base = INITRD_LOAD_ADDR;
         pnv->initrd_size = load_image_targphys(machine->initrd_filename,
-                                  pnv->initrd_base, 0x10000000); /* 128MB max */
+                                  pnv->initrd_base, INITRD_MAX_SIZE);
         if (pnv->initrd_size < 0) {
             error_report("Could not load initial ram disk '%s'",
                          machine->initrd_filename);
Signature · 1 line
2.20.1
#3 lore raw

Re: [Qemu-devel] [PATCH 2/2] ppc/pnv: add INITRD_MAX_SIZE constant

Quoted 14 lines · Murilo Opsfelder Araujo

The current 0x10000000 value is actually 256MiB, not 128MB as the comment suggests. Move it to a constant and fix the comment (no change in the size value).

---
 hw/ppc/pnv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/ppc/pnv.c +0 -0
index 000707164e..514439db20 100644

hw/ppc/pnv.c line 59

Quoted 4 lines
hw/ppc/pnv.c +1 -0
@@ -56,6 +56,7 @@
 #define KERNEL_LOAD_ADDR        0x20000000
 #define KERNEL_MAX_SIZE         0x10000000    /* 256MiB */
 #define INITRD_LOAD_ADDR        0x60000000
+#define INITRD_MAX_SIZE         0x10000000    /* 256MiB */

Why not #include "qemu/units.h" and spell this:

#define INITRD_MAX_SIZE (256 * MiB)

and so on for the other values?

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org