[Skiboot] [PATCH 1/2] Add opal_boot_complete to debug descriptor

Stewart Smith stewart at linux.vnet.ibm.com
Wed Sep 16 13:57:43 AEST 2015


Joel Stanley <joel at jms.id.au> writes:
> This tells us when we've entered the host. First use case is knowing if
> we can can rely on host communication working, such as receiving and
> acting on an opal_msg.
>
> Signed-off-by: Joel Stanley <joel at jms.id.au>
> ---
>  core/init.c       | 3 +++
>  include/skiboot.h | 2 +-
>  2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/core/init.c b/core/init.c
> index 7baca0d..d5c1779 100644
> --- a/core/init.c
> +++ b/core/init.c
> @@ -60,6 +60,7 @@ struct debug_descriptor debug_descriptor = {
>  	.memcons_phys	= (uint64_t)&memcons,
>  	.trace_mask	= 0, /* All traces disabled by default */
>  	.console_log_levels = (PR_DEBUG << 4) | PR_NOTICE,
> +	.opal_boot_complete = false,
>  };
>  
>  static bool try_load_elf64_le(struct elf_hdr *header)
> @@ -454,6 +455,8 @@ void __noreturn load_and_boot_kernel(bool is_reboot)
>  	printf("INIT: Starting kernel at 0x%llx, fdt at %p (size 0x%x)\n",
>  	       kernel_entry, fdt, fdt_totalsize(fdt));
>  
> +	debug_descriptor.opal_boot_complete = true;
> +
>  	fdt_set_boot_cpuid_phys(fdt, this_cpu()->pir);
>  	if (kernel_32bit)
>  		start_kernel32(kernel_entry, fdt, mem_top);
> diff --git a/include/skiboot.h b/include/skiboot.h
> index 4b58597..c12fa67 100644
> --- a/include/skiboot.h
> +++ b/include/skiboot.h
> @@ -65,7 +65,7 @@ struct debug_descriptor {
>  	u32	version;
>  	u8	console_log_levels;	/* high 4 bits in memory,
>  					 * low 4 bits driver (e.g. uart). */
> -	u8	reserved1;
> +	bool	opal_boot_complete : 1;	/* True as we jump to host OS */
>  	u16	reserved2;
>  	u32	reserved[2];

I think this is my fault for not saying on IRC properly - using
bitflag=win, C bitfields not so much. Mainly because compiler can do
basically whatever it wants with them, which is fine everywhere probably
except debug_descriptor.

Maybe grab the 8 bits as opal_state and we can use a bit for
boot_complete, maybe another for assert etc?



More information about the Skiboot mailing list