[Skiboot] [PATCH 2/4] Start preload of kernel and initramfs early in boot
Joel Stanley
joel at jms.id.au
Thu May 7 16:31:01 AEST 2015
On Fri, May 1, 2015 at 5:26 PM, Stewart Smith
<stewart at linux.vnet.ibm.com> wrote:
> This means we will load kernel and initramfs LIDs from FSP/flash
> as we init PCI, hopefully reducing boot time.
In the case of no initramfs (all current BMC machines) it looks like
we'll print an error. Aside from that it looks good.
>
> Signed-off-by: Stewart Smith <stewart at linux.vnet.ibm.com>
Reviewed-by: Joel Stanley <joel at jms.id.au>
> ---
> core/init.c | 80 +++++++++++++++++++++++++++++++++++++----------------------
> 1 file changed, 50 insertions(+), 30 deletions(-)
>
> diff --git a/core/init.c b/core/init.c
> /* Try to load an external kernel payload through the platform hooks */
> - ksize = KERNEL_LOAD_SIZE;
> + kernel_size = KERNEL_LOAD_SIZE;
> loaded = start_preload_resource(RESOURCE_ID_KERNEL,
> RESOURCE_SUBID_NONE,
> KERNEL_LOAD_BASE,
> - &ksize);
> - if (loaded == OPAL_SUCCESS)
> - loaded = wait_for_resource_loaded(RESOURCE_ID_KERNEL,
> - RESOURCE_SUBID_NONE);
> + &kernel_size);
> + if (loaded != OPAL_SUCCESS) {
> + printf("INIT: platform start load kernel failed\n");
> + kernel_size = 0;
> + return false;
> + }
>
> + initramfs_size = INITRAMFS_LOAD_SIZE;
> + loaded = start_preload_resource(RESOURCE_ID_INITRAMFS,
> + RESOURCE_SUBID_NONE,
> + INITRAMFS_LOAD_BASE, &initramfs_size);
> if (loaded != OPAL_SUCCESS) {
> - printf("INIT: platform kernel load failed\n");
> - ksize = 0;
> + printf("INIT: platform start load initramfs failed\n");
We will get that message on BMC machines when nothing has gone wrong.
> + initramfs_size = 0;
> + return false;
And we will return false from here. How does this work on a BMC machine?
> void __noreturn load_and_boot_kernel(bool is_reboot)
> @@ -696,6 +714,8 @@ void __noreturn main_cpu_entry(const void *fdt, u32 master_cpu)
> /* Probe PHB3 on P8 */
> probe_phb3();
>
> + start_preload_kernel();
> +
> /* Initialize PCI */
> pci_init_slots();
Ah, this works on a BMC machine as we don't check to see if
start_preload_kernel succeeded or not.
More information about the Skiboot
mailing list