From 52aed80bddd5eed94c537f2bb0b846e4b5683728 Mon Sep 17 00:00:00 2001 From: Oliver O'Halloran Date: Fri, 19 May 2017 16:16:48 +1000 Subject: [PATCH] mambo: Add a reservation for the initramfs On most systems the initramfs is loaded inside the part of memory reserved for the OS [0x0-0x30000000] and skiboot will never touch it. On mambo it's loaded at 0x80000000 and if you're unlucky skiboot can allocate over the top of it and corrupt the initramfs blob. There might be the downside that the kernel cannot re-use the initramfs memory since it's marked as reserved, but the kernel might also free it anyway. Fixes: 65612f120735 Signed-off-by: Oliver O'Halloran Tested-by: Michael Ellerman [stewart@linux.vnet.ibm.com: add Fixes] Signed-off-by: Stewart Smith --- external/mambo/skiboot.tcl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/external/mambo/skiboot.tcl b/external/mambo/skiboot.tcl index f4068fac0a20..5a5176fafe4c 100644 --- a/external/mambo/skiboot.tcl +++ b/external/mambo/skiboot.tcl @@ -222,6 +222,11 @@ mysim of addprop $reserved_memory int "#size-cells" 2 mysim of addprop $reserved_memory int "#address-cells" 2 mysim of addprop $reserved_memory empty "ranges" "" +set initramfs_res [mysim of addchild $reserved_memory "initramfs" ""] +set reg [list $cpio_start $cpio_size ] +mysim of addprop $initramfs_res array64 "reg" reg +mysim of addprop $initramfs_res empty "name" "initramfs" + set fake_nvram_node [mysim of addchild $reserved_memory "ibm,fake-nvram" ""] set reg [list $fake_nvram_start $fake_nvram_size ] mysim of addprop $fake_nvram_node array64 "reg" reg