All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: Laszlo Ersek <lersek@redhat.com>,
	qemu-devel@nongnu.org, ben@skyportsystems.com
Subject: Re: [Qemu-devel] [PATCH v6 1/7] linker-loader: Add new 'write pointer' command
Date: Wed, 15 Feb 2017 21:34:45 +0200	[thread overview]
Message-ID: <20170215211910-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20170215192436.2695b9f6@nial.brq.redhat.com>

On Wed, Feb 15, 2017 at 07:24:36PM +0100, Igor Mammedov wrote:
> > As long as all users pass in 0 though there's a real possibility guests
> > will implement this incorrectly.
> We are here to ensure that at least Seabios (I'll review it)
> and OVMF (Laszlo would take care of it I suppose) do it right,
> and if there are other firmwares, they should do it correctly
> as described fix their own bugs later wrt randomly written
> implementation.

As long as it's untested, it can always do the wrong thing
even if it looks right, or it can bitrot.

> > I guess we can put in the offset just
> > behind the zero-filled padding we have there.
> I've assumed padding was there to make commands fixed size and give
> a room for future extensions

you mean
        char pad[124];
?

Right. So you can easily add fields, but if you do firmware
will just assume it does not know how to handle these
commands and skip them.

> so hunk changing BiosLinkerLoaderEntry
> would look like:
> 
> diff --git a/hw/acpi/bios-linker-loader.c b/hw/acpi/bios-linker-loader.c
> index d963ebe..6983713 100644
> --- a/hw/acpi/bios-linker-loader.c
> +++ b/hw/acpi/bios-linker-loader.c
> @@ -49,6 +49,7 @@ struct BiosLinkerLoaderEntry {
>              char file[BIOS_LINKER_LOADER_FILESZ];
>              uint32_t align;
>              uint8_t zone;
> +            uint32_t padding;
>          } alloc;
>  
>          /*
> @@ -62,6 +63,7 @@ struct BiosLinkerLoaderEntry {
>              char src_file[BIOS_LINKER_LOADER_FILESZ];
>              uint32_t offset;
>              uint8_t size;
> +            uint32_t padding;
>          } pointer;
>  
>          /*
> @@ -76,10 +78,25 @@ struct BiosLinkerLoaderEntry {
>              uint32_t offset;
>              uint32_t start;
>              uint32_t length;
> +            uint32_t padding;
>          } cksum;

why is this necessary?

> +        /*
> +         * COMMAND_WRITE_POINTER - write the fw_cfg file (originating from
> +         * @dest_file) at @wr_pointer.offset, by writing a pointer to @src_offset
> +         * within the table originating from @src_file. 1,2,4 or 8 byte unsigned
> +         * addition is used depending on @wr_pointer.size.
> +         */
> +         struct {
> +             char dest_file[BIOS_LINKER_LOADER_FILESZ];
> +             char src_file[BIOS_LINKER_LOADER_FILESZ];
> +             uint32_t dst_offset;
> +             uint32_t src_offset;
> +             uint8_t size;
> +        } wr_pointer;
> +
>          /* padding */
> -        char pad[124];
> +        char pad[120];

and this shrinks entry size by 4 bytes. Why?

>      };
>  } QEMU_PACKED;
>  typedef struct BiosLinkerLoaderEntry BiosLinkerLoaderEntry;
> 
>  
> > I'm mostly concerned we are adding new features to something
> > that has been through 25 revisions already.
> It's ABI so it's worth extra effort,

There's always yet another possible enhancement you can add.
I see it as a bit of a feature creep frankly.

> it looks like only one more revision is left and there is
> about a week left to post and merge it.

If we can do it quickly, fine, but I think we should merge ASAP.

-- 
MST

  parent reply	other threads:[~2017-02-15 19:34 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-15  6:15 [Qemu-devel] [PATCH v6 0/7] Add support for VM Generation ID ben
2017-02-15  6:15 ` [Qemu-devel] [PATCH v6 1/7] linker-loader: Add new 'write pointer' command ben
2017-02-15 10:57   ` Igor Mammedov
2017-02-15 14:13     ` Laszlo Ersek
2017-02-15 14:17       ` Laszlo Ersek
2017-02-15 15:22       ` Igor Mammedov
2017-02-15 15:30         ` Michael S. Tsirkin
2017-02-15 15:56           ` Igor Mammedov
2017-02-15 16:39             ` Michael S. Tsirkin
2017-02-15 17:19               ` Laszlo Ersek
2017-02-15 17:43               ` Igor Mammedov
2017-02-15 17:54                 ` Ben Warren
2017-02-15 18:06                   ` Michael S. Tsirkin
2017-02-15 18:14                     ` Ben Warren
2017-02-15 18:35                       ` Igor Mammedov
2017-02-15 18:44                         ` Ben Warren
2017-02-15 21:09                           ` Michael S. Tsirkin
2017-02-15 18:04                 ` Michael S. Tsirkin
2017-02-15 18:24                   ` Igor Mammedov
2017-02-15 19:14                     ` Ben Warren
2017-02-15 19:19                       ` Ben Warren
2017-02-16 11:10                         ` Igor Mammedov
2017-02-16 15:38                           ` Eric Blake
2017-02-15 19:34                     ` Michael S. Tsirkin [this message]
2017-02-16  8:25                       ` Igor Mammedov
2017-02-16  9:49                         ` Laszlo Ersek
2017-02-15  6:15 ` [Qemu-devel] [PATCH v6 2/7] docs: VM Generation ID device description ben
2017-02-15 11:07   ` Igor Mammedov
2017-02-15 14:26     ` Laszlo Ersek
2017-02-15  6:15 ` [Qemu-devel] [PATCH v6 3/7] ACPI: Add vmgenid blob storage to the build tables ben
2017-02-15 11:15   ` Igor Mammedov
2017-02-15 14:30   ` Laszlo Ersek
2017-02-16  6:11     ` Ben Warren
2017-02-15  6:15 ` [Qemu-devel] [PATCH v6 4/7] ACPI: Add Virtual Machine Generation ID support ben
2017-02-15 12:19   ` Igor Mammedov
2017-02-15 15:24     ` Laszlo Ersek
2017-02-15 16:07       ` Igor Mammedov
2017-02-15 16:40         ` Michael S. Tsirkin
2017-02-15 17:12           ` Ben Warren
2017-02-16  6:13       ` Ben Warren
2017-02-15 17:11     ` Ben Warren
2017-02-15  6:15 ` [Qemu-devel] [PATCH v6 5/7] qmp/hmp: add query-vm-generation-id and 'info vm-generation-id' commands ben
2017-02-15 15:36   ` Laszlo Ersek
2017-02-16  6:13     ` Ben Warren
2017-02-15  6:15 ` [Qemu-devel] [PATCH v6 6/7] tests: Move reusable ACPI macros into a new header file ben
2017-02-15 12:54   ` Igor Mammedov
2017-02-15 21:35   ` Eric Blake
2017-02-15 21:58     ` Ben Warren
2017-02-15 22:56       ` Eric Blake
2017-02-15 23:05         ` Ben Warren
2017-02-15  6:15 ` [Qemu-devel] [PATCH v6 7/7] tests: Add unit tests for the VM Generation ID feature ben
2017-02-15 13:13   ` Igor Mammedov
2017-02-16  6:15     ` Ben Warren
2017-02-15 19:47 ` [Qemu-devel] [PATCH v6 0/7] Add support for VM Generation ID Laszlo Ersek
2017-02-15 20:09   ` Michael S. Tsirkin
2017-02-15 20:15     ` Ben Warren
2017-02-15 20:52     ` Laszlo Ersek
2017-02-16  6:10       ` Ben Warren
2017-02-16  9:36         ` Laszlo Ersek
2017-02-16 12:08       ` Igor Mammedov
2017-02-16 13:29         ` Laszlo Ersek
2017-02-16 14:27           ` Igor Mammedov

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=20170215211910-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=ben@skyportsystems.com \
    --cc=imammedo@redhat.com \
    --cc=lersek@redhat.com \
    --cc=qemu-devel@nongnu.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.