Skip to contentSkip to conversation

PPC: e500: increase DTC_LOAD_PAD

PATCH Applied Scott Wood 3 participants 7 messages Aug 23, 2012 – Sep 29, 2012

lore
Share & tools
lore

Scott Wood

author
#0 lore raw

PATCH 1/2 PPC: e500: increase DTC_LOAD_PAD

An allowance of 5 MiB for BSS is not enough for Linux kernels with certain debug options enabled (not sure exactly which one caused it, but I'd guess lockdep). The kernel I ran into this with had a BSS of around 6.4 MB.

Unfortunately, uImage does not give us enough information to determine the actual BSS size. Increase the allowance to 18 MiB to give us plenty of room. Eventually this should be more intelligent, possibly packing initrd+dtb at the end of guest RAM.

---
 hw/ppc/e500.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ppc/e500.c +1 -1
index 6f0de6d..1ccfd7c 100644
@@ -36,7 +36,7 @@
 
 #define BINARY_DEVICE_TREE_FILE    "mpc8544ds.dtb"
 #define UIMAGE_LOAD_BASE           0
-#define DTC_LOAD_PAD               0x500000
+#define DTC_LOAD_PAD               0x1800000
 #define DTC_PAD_MASK               0xFFFFF
 #define INITRD_LOAD_PAD            0x2000000
 #define INITRD_PAD_MASK            0xFFFFFF
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH 2/2 PPC: e500: calculate initrd_base like dt_base

While investigating dtb pad issues, I noticed that initrd_base wasn't taking loadaddr into account the way dt_base was. This seems wrong.

---
 hw/ppc/e500.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/ppc/e500.c +2 -1
index 1ccfd7c..60ddd85 100644
@@ -553,7 +553,8 @@ void ppce500_init(PPCE500Params *params)
 
     /* Load initrd. */
     if (params->initrd_filename) {
-        initrd_base = (kernel_size + INITRD_LOAD_PAD) & ~INITRD_PAD_MASK;
+        initrd_base = (loadaddr + kernel_size + INITRD_LOAD_PAD) &
+            ~INITRD_PAD_MASK;
         initrd_size = load_image_targphys(params->initrd_filename, initrd_base,
                                           ram_size - initrd_base);
 
Signature · 1 line
1.7.9.5
#2 lore raw

Re: [Qemu-devel] [PATCH 2/2] PPC: e500: calculate initrd_base like dt_base

Quoted 4 lines · Scott Wood

While investigating dtb pad issues, I noticed that initrd_base wasn't taking loadaddr into account the way dt_base was. This seems wrong.

Ah, all the images I tested start off from address 0. But yes, we should add the kernel load offset as well.

Thanks, applied to ppc-next.

Alex

Quoted 22 lines

---
hw/ppc/e500.c | 3 ++-

1 file changed, 2 insertions(+), 1 deletion(-)
hw/ppc/e500.c +2 -1
index 1ccfd7c..60ddd85 100644
@@ -553,7 +553,8 @@ void ppce500_init(PPCE500Params *params)
 
    /* Load initrd. */
    if (params->initrd_filename) {
-        initrd_base = (kernel_size + INITRD_LOAD_PAD) & ~INITRD_PAD_MASK;
+        initrd_base = (loadaddr + kernel_size + INITRD_LOAD_PAD) &
+            ~INITRD_PAD_MASK;
        initrd_size = load_image_targphys(params->initrd_filename, initrd_base,
                                          ram_size - initrd_base);
 
Signature · 1 line
1.7.9.5
#3 lore raw

Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/2] PPC: e500: calculate initrd_base like dt_base

Quoted 7 lines · Alexander Graf
Quoted 4 lines

While investigating dtb pad issues, I noticed that initrd_base wasn't taking loadaddr into account the way dt_base was. This seems wrong.

Ah, all the images I tested start off from address 0. But yes, we should add the kernel load offset as well. Thanks, applied to ppc-next.

Isn't the aix kernel starting at offset 16384?

Folkert van Heusden

Signature · 6 lines
MultiTail na wan makriki wrokosani fu tan luku den logfile nanga san
den commando spiti puru. Piki puru spesrutu sani, wroko nanga difrenti
kroru, tya kon makandra, nanga wan lo moro.
http://www.vanheusden.com/multitail/
----------------------------------------------------------------------
Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com
author
#4 lore raw

Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/2] PPC: e500: calculate initrd_base like dt_base

Quoted 5 lines · folkert
Quoted 1 line · Alexander Graf
Quoted 1 line

While investigating dtb pad issues, I noticed that initrd_base

wasn't taking

Quoted 2 lines
Quoted 2 lines

loadaddr into account the way dt_base was. This seems wrong.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Ah, all the images I tested start off from address 0. But yes, we

should add the kernel load offset as well.

Quoted 1 line

Thanks, applied to ppc-next.

Isn't the aix kernel starting at offset 16384?

I doubt the AIX kernel will run on e500. :-)

-Scott

#5 lore raw

Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/2] PPC: e500: calculate initrd_base like dt_base

In reply to folkert
Quoted 10 lines · folkert
Quoted 7 lines · Alexander Graf
Quoted 4 lines

While investigating dtb pad issues, I noticed that initrd_base wasn't taking loadaddr into account the way dt_base was. This seems wrong.

Ah, all the images I tested start off from address 0. But yes, we should add the kernel load offset as well. Thanks, applied to ppc-next.

Isn't the aix kernel starting at offset 16384?

AIX does not run on e500 style cores :)

Alex

Quoted 11 lines

Folkert van Heusden

Signature · 6 lines
MultiTail na wan makriki wrokosani fu tan luku den logfile nanga san
den commando spiti puru. Piki puru spesrutu sani, wroko nanga difrenti
kroru, tya kon makandra, nanga wan lo moro.
http://www.vanheusden.com/multitail/
----------------------------------------------------------------------
Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com
#6 lore raw
In reply to Scott Wood
Quoted 10 lines · Scott Wood

An allowance of 5 MiB for BSS is not enough for Linux kernels with certain debug options enabled (not sure exactly which one caused it, but I'd guess lockdep). The kernel I ran into this with had a BSS of around 6.4 MB.

Unfortunately, uImage does not give us enough information to determine the actual BSS size. Increase the allowance to 18 MiB to give us plenty of room. Eventually this should be more intelligent, possibly packing initrd+dtb at the end of guest RAM.

Thanks, applied to ppc-next.

Alex

Quoted 21 lines

---
hw/ppc/e500.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
hw/ppc/e500.c +1 -1
index 6f0de6d..1ccfd7c 100644
@@ -36,7 +36,7 @@
 
 #define BINARY_DEVICE_TREE_FILE    "mpc8544ds.dtb"
 #define UIMAGE_LOAD_BASE           0
-#define DTC_LOAD_PAD               0x500000
+#define DTC_LOAD_PAD               0x1800000
 #define DTC_PAD_MASK               0xFFFFF
 #define INITRD_LOAD_PAD            0x2000000
 #define INITRD_PAD_MASK            0xFFFFFF
Signature · 1 line
1.7.9.5