From: "Michael S. Tsirkin" <mst@redhat.com>
To: Laszlo Ersek <lersek@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 repost 5/9] i386: add bios linker/loader
Date: Mon, 15 Jul 2013 12:01:28 +0300 [thread overview]
Message-ID: <20130715090128.GA677@redhat.com> (raw)
In-Reply-To: <51E3A5C5.6080804@redhat.com>
On Mon, Jul 15, 2013 at 09:33:25AM +0200, Laszlo Ersek wrote:
> On 07/14/13 13:41, Michael S. Tsirkin wrote:
> > On Fri, Jul 12, 2013 at 04:17:28PM +0200, Laszlo Ersek wrote:
> >> On 07/10/13 15:51, Michael S. Tsirkin wrote:
>
> >>> +struct BiosLinkerLoaderEntry {
> >>> + uint32_t command;
> >>> + union {
> >>> + /*
> >>> + * COMMAND_ALLOCATE - allocate a table from @alloc_file
> >>> + * subject to @alloc_align alignment (must be power of 2)
> >>> + * and @alloc_zone (can be HIGH or FSEG) requirements.
> >>> + *
> >>> + * Must appear exactly once for each file, and before
> >>> + * this file is referenced by any other command.
> >>> + */
> >>> + struct {
> >>> + char alloc_file[BIOS_LINKER_LOADER_FILESZ];
> >>> + uint32_t alloc_align;
> >>> + uint8_t alloc_zone;
> >>> + };
> >>
> >> I think in OVMF we won't rely on the alloc_zone / alloc_align members,
> >> but that's OVMF's private business.
> >
> > RSDP must be in FSEG though
>
> I didn't express myself clearly, sorry. The default edk2 ACPI table
> protocol that OVMF uses should allocate RSDP and the like automatically
> in correct regions. (Allocating reserved memory for
> External(XXXX,OpRegionObj) needs a different call though.)
>
> >>> +
> >>> + /* padding */
> >>> + char pad[124];
> >>> + };
> >>
> >> The unnamed union member is a gcc-ism. I'd give it a short name (like
> >> "u"), but feel free to ignore this.
> >>
> >
> > This isn't a gcc-ism. It's in C1x:
> >
> > An unnamed member whose type specifier is a structure specifier with no
> > tag is called an anonymous structure; an unnamed member whose type
> > specifier is a union specifier with no tag is called an anonymous union.
> > The members of an anonymous structure or union are considered to be
> > members of the containing structure or union. This applies recursively
> > if the containing structure or union is also anonymous.
>
> This part of the discussion is academic, but the unnamed union member is
> a gcc-ism in the qemu source, because AFAIK qemu uses the gnu89 dialect
> by default, and gnu99 on Solaris.
>
The important thing is that it's part of the standard now,
so won't go away or interfere with porting to a new compiler
if we ever try to do it.
> >>> +};
> >>> +typedef struct BiosLinkerLoaderEntry BiosLinkerLoaderEntry;
> >>
> >> Probably not needed in practice, but for documentation purposes I
> >> suggest QEMU_PACKED from "include/qemu/compiler.h".
> >
> > It's not required in practice but I can add this though I'm not sure -
> > what does this document?
>
> To me it documents that we rely on the absence of inter-member padding.
>
> Thanks
> Laszlo
next prev parent reply other threads:[~2013-07-15 9:00 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-10 13:51 [Qemu-devel] [PATCH v2 repost 0/9] qemu: generate acpi tables for the guest Michael S. Tsirkin
2013-07-10 13:51 ` [Qemu-devel] [PATCH v2 repost 1/9] hw/i386/pc.c: move IO_APIC_DEFAULT_ADDRESS to include/hw/i386/apic.h Michael S. Tsirkin
2013-07-11 16:57 ` Laszlo Ersek
2013-07-15 7:11 ` Hu Tao
2013-07-10 13:51 ` [Qemu-devel] [PATCH v2 repost 2/9] i386: add ACPI table files from seabios Michael S. Tsirkin
2013-07-11 16:57 ` Laszlo Ersek
2013-07-15 7:49 ` Hu Tao
2013-07-15 10:14 ` Michael S. Tsirkin
2013-07-10 13:51 ` [Qemu-devel] [PATCH v2 repost 3/9] acpi: add rules to compile ASL source Michael S. Tsirkin
2013-07-11 16:55 ` Laszlo Ersek
2013-07-11 16:58 ` Laszlo Ersek
2013-07-11 17:10 ` Michael S. Tsirkin
2013-07-15 8:00 ` Hu Tao
2013-07-15 8:19 ` Michael S. Tsirkin
2013-07-10 13:51 ` [Qemu-devel] [PATCH v2 repost 4/9] acpi: pre-compiled ASL files Michael S. Tsirkin
2013-07-11 16:59 ` Laszlo Ersek
2013-07-10 13:51 ` [Qemu-devel] [PATCH v2 repost 5/9] i386: add bios linker/loader Michael S. Tsirkin
2013-07-12 14:17 ` Laszlo Ersek
2013-07-14 11:41 ` Michael S. Tsirkin
2013-07-15 7:33 ` Laszlo Ersek
2013-07-15 9:01 ` Michael S. Tsirkin [this message]
2013-07-10 13:51 ` [Qemu-devel] [PATCH v2 repost 6/9] loader: support for unmapped ROM blobs Michael S. Tsirkin
2013-07-15 13:22 ` Laszlo Ersek
2013-07-15 16:03 ` Michael S. Tsirkin
2013-07-15 18:30 ` Laszlo Ersek
2013-07-17 12:20 ` Laszlo Ersek
2013-07-10 13:51 ` [Qemu-devel] [PATCH v2 repost 7/9] loader: allow adding ROMs in done callbacks Michael S. Tsirkin
2013-07-17 12:23 ` Laszlo Ersek
2013-07-10 13:51 ` [Qemu-devel] [PATCH v2 repost 8/9] i386: generate pc guest info Michael S. Tsirkin
2013-07-17 15:07 ` Laszlo Ersek
2013-07-24 15:36 ` Laszlo Ersek
2013-07-24 15:47 ` Michael S. Tsirkin
2013-07-19 3:55 ` Hu Tao
2013-07-10 13:51 ` [Qemu-devel] [PATCH v2 repost 9/9] i386: ACPI table generation code from seabios Michael S. Tsirkin
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=20130715090128.GA677@redhat.com \
--to=mst@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).