All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Daniel Kiper <daniel.kiper@oracle.com>
Cc: <grub-devel@gnu.org>, <linux-kernel@vger.kernel.org>,
	<trenchboot-devel@googlegroups.com>, <x86@kernel.org>,
	<xen-devel@lists.xenproject.org>, <michal.zygowski@3mdeb.com>,
	<eric.snowberg@oracle.com>, <mtottenh@akamai.com>,
	<ard.biesheuvel@linaro.org>, <dpsmith@apertussolutions.com>,
	<andrew.cooper3@citrix.com>, <konrad.wilk@oracle.com>,
	<phcoder@gmail.com>, <javierm@redhat.com>, <mjg59@google.com>,
	<alexander.burmashev@oracle.com>, <krystian.hebel@3mdeb.com>,
	<kanth.ghatraju@oracle.com>, <lukasz.hawrylko@linux.intel.com>,
	<ross.philipson@oracle.com>, <hpa@zytor.com>, <leif@nuviainc.com>,
	<pjones@redhat.com>, <alec.brown@oracle.com>,
	<piotr.krol@3mdeb.com>
Subject: Re: [BOOTLOADER SPECIFICATION RFC] The bootloader log format for TrenchBoot and others
Date: Mon, 1 Jun 2020 12:54:37 +0200	[thread overview]
Message-ID: <20200601105437.GS1195@Air-de-Roger> (raw)
In-Reply-To: <20200529112735.qln44ds6z7djheof@tomti.i.net-space.pl>

On Fri, May 29, 2020 at 01:27:35PM +0200, Daniel Kiper wrote:
> Hey,
> 
> Below you can find my rough idea of the bootloader log format which is
> generic thing but initially will be used for TrenchBoot work. I discussed
> this proposal with Ross and Daniel S. So, the idea went through initial
> sanitization. Now I would like to take feedback from other folks too.
> So, please take a look and complain...
> 
> In general we want to pass the messages produced by the bootloader to the OS
> kernel and finally to the userspace for further processing and analysis. Below
> is the description of the structures which will be used for this thing.
> 
>   struct bootloader_log_msgs
>   {
>     grub_uint32_t level;
>     grub_uint32_t facility;

Nit: if this is aimed at cross-OS and cross-bootloader compatibility
uint32_t should be used here instead of a grub specific alias.

>     char type[];
>     char msg[];

I think you want char * here instead? Or are the above arrays expected
to have a fixed size in the final spec?

>   }
> 
>   struct bootloader_log
>   {
>     grub_uint32_t version;
>     grub_uint32_t producer;
>     grub_uint32_t size;
>     grub_uint32_t next_off;
>     bootloader_log_msgs msgs[];

As I understand it this is not a pointer to an array of
bootloader_log_msgs but rather in-place?

>   }
> 
> The members of struct bootloader_log:
>   - version: the bootloader log format version number, 1 for now,
>   - producer: the producer/bootloader type; we can steal some values from
>     linux/Documentation/x86/boot.rst:type_of_loader,
>   - size: total size of the log buffer including the bootloader_log struct,
>   - next_off: offset in bytes, from start of the bootloader_log struct,
>     of the next byte after the last log message in the msgs[];
>     i.e. the offset of the next available log message slot,

So this will be a memory area that's shared between the OS and the
bootloader and needs to be updated at runtime?

If this is something that's created by the bootloader during loading
and passed to the OS for consumption (but it's not further updated), I
don't see much point in the next_off field. The size field could be
updated to reflect the actual size of the produced messages?

Roger.

WARNING: multiple messages have this Message-ID (diff)
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Daniel Kiper <daniel.kiper@oracle.com>
Cc: dpsmith@apertussolutions.com, alexander.burmashev@oracle.com,
	krystian.hebel@3mdeb.com, hpa@zytor.com,
	michal.zygowski@3mdeb.com, grub-devel@gnu.org, x86@kernel.org,
	javierm@redhat.com, kanth.ghatraju@oracle.com, phcoder@gmail.com,
	xen-devel@lists.xenproject.org, leif@nuviainc.com,
	trenchboot-devel@googlegroups.com, alec.brown@oracle.com,
	mtottenh@akamai.com, konrad.wilk@oracle.com,
	ross.philipson@oracle.com, piotr.krol@3mdeb.com,
	ard.biesheuvel@linaro.org, andrew.cooper3@citrix.com,
	linux-kernel@vger.kernel.org, mjg59@google.com,
	eric.snowberg@oracle.com, pjones@redhat.com,
	lukasz.hawrylko@linux.intel.com
Subject: Re: [BOOTLOADER SPECIFICATION RFC] The bootloader log format for TrenchBoot and others
Date: Mon, 1 Jun 2020 12:54:37 +0200	[thread overview]
Message-ID: <20200601105437.GS1195@Air-de-Roger> (raw)
In-Reply-To: <20200529112735.qln44ds6z7djheof@tomti.i.net-space.pl>

On Fri, May 29, 2020 at 01:27:35PM +0200, Daniel Kiper wrote:
> Hey,
> 
> Below you can find my rough idea of the bootloader log format which is
> generic thing but initially will be used for TrenchBoot work. I discussed
> this proposal with Ross and Daniel S. So, the idea went through initial
> sanitization. Now I would like to take feedback from other folks too.
> So, please take a look and complain...
> 
> In general we want to pass the messages produced by the bootloader to the OS
> kernel and finally to the userspace for further processing and analysis. Below
> is the description of the structures which will be used for this thing.
> 
>   struct bootloader_log_msgs
>   {
>     grub_uint32_t level;
>     grub_uint32_t facility;

Nit: if this is aimed at cross-OS and cross-bootloader compatibility
uint32_t should be used here instead of a grub specific alias.

>     char type[];
>     char msg[];

I think you want char * here instead? Or are the above arrays expected
to have a fixed size in the final spec?

>   }
> 
>   struct bootloader_log
>   {
>     grub_uint32_t version;
>     grub_uint32_t producer;
>     grub_uint32_t size;
>     grub_uint32_t next_off;
>     bootloader_log_msgs msgs[];

As I understand it this is not a pointer to an array of
bootloader_log_msgs but rather in-place?

>   }
> 
> The members of struct bootloader_log:
>   - version: the bootloader log format version number, 1 for now,
>   - producer: the producer/bootloader type; we can steal some values from
>     linux/Documentation/x86/boot.rst:type_of_loader,
>   - size: total size of the log buffer including the bootloader_log struct,
>   - next_off: offset in bytes, from start of the bootloader_log struct,
>     of the next byte after the last log message in the msgs[];
>     i.e. the offset of the next available log message slot,

So this will be a memory area that's shared between the OS and the
bootloader and needs to be updated at runtime?

If this is something that's created by the bootloader during loading
and passed to the OS for consumption (but it's not further updated), I
don't see much point in the next_off field. The size field could be
updated to reflect the actual size of the produced messages?

Roger.


  parent reply	other threads:[~2020-06-01 11:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-29 11:27 [BOOTLOADER SPECIFICATION RFC] The bootloader log format for TrenchBoot and others Daniel Kiper
2020-05-29 11:27 ` Daniel Kiper
2020-05-29 17:11 ` Andy Lutomirski
2020-05-29 17:11   ` Andy Lutomirski
2020-06-01  9:56   ` Daniel Kiper
2020-06-01  9:56     ` Daniel Kiper
2020-06-01 10:54 ` Roger Pau Monné [this message]
2020-06-01 10:54   ` Roger Pau Monné
2020-06-01 18:25 ` Hans Ulrich Niedermann
2020-06-01 18:25   ` Hans Ulrich Niedermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200601105437.GS1195@Air-de-Roger \
    --to=roger.pau@citrix.com \
    --cc=alec.brown@oracle.com \
    --cc=alexander.burmashev@oracle.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=daniel.kiper@oracle.com \
    --cc=dpsmith@apertussolutions.com \
    --cc=eric.snowberg@oracle.com \
    --cc=grub-devel@gnu.org \
    --cc=hpa@zytor.com \
    --cc=javierm@redhat.com \
    --cc=kanth.ghatraju@oracle.com \
    --cc=konrad.wilk@oracle.com \
    --cc=krystian.hebel@3mdeb.com \
    --cc=leif@nuviainc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukasz.hawrylko@linux.intel.com \
    --cc=michal.zygowski@3mdeb.com \
    --cc=mjg59@google.com \
    --cc=mtottenh@akamai.com \
    --cc=phcoder@gmail.com \
    --cc=piotr.krol@3mdeb.com \
    --cc=pjones@redhat.com \
    --cc=ross.philipson@oracle.com \
    --cc=trenchboot-devel@googlegroups.com \
    --cc=x86@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.