From: Gerd Hoffmann <kraxel@redhat.com>
To: Laszlo Ersek <lersek@redhat.com>
Cc: jordan.l.justen@intel.com, "Gabriel L. Somlo" <gsomlo@gmail.com>,
qemu-devel@nongnu.org, gleb@cloudius-systems.com
Subject: Re: [Qemu-devel] fw_cfg specification ?
Date: Thu, 12 Mar 2015 08:47:44 +0100 [thread overview]
Message-ID: <1426146464.1722.11.camel@nilsson.home.kraxel.org> (raw)
In-Reply-To: <5500B3E1.8020402@redhat.com>
Hi,
> >> I won't say "better", but it is "committed": check
> >> "Documentation/devicetree/bindings/arm/fw-cfg.txt" in the kernel tree.
> >> It is intentionally vague on the set of keys and fw_cfg files that qemu
> >> provides, because that's a moving target. You can only rely on the qemu
> >> source for those.
> >
> > The fw_cfg interface from the guest's perspective is pretty
> > straightforward: select something on the control port, read a blob
> > from the data port.
I think just commiting Jordan's patch as-is would be a good start.
Then we can go from there adding missing bits.
It's also easier to refuse patches without doc updates if there actually
is documentation in the first place ;)
> > For instance, I get there's a total of 0x30 entries
> > (FWCfgEntry entries), the last 0x10 of which have
> > "file names" and are referenced from the "FWCfgFiles *files"
> > structure.
That's basically referencing stuff by name rather than magic numbers.
It's used for all new stuff. There is a simliar interface named 'cbfs'
between coreboot and seabios.
> No. Please see the fw_cfg_write() function. Only the same size can be
> written, and the write callback runs when that's completed.
>
> In any case, I'm unaware of *any* instance when an fw_cfg blob is
> rewritten by the guest.
> In fact, such *write* callbacks are registered in qemu with
> fw_cfg_add_callback(), and I can't see any calls to that function. It's
> dead code, apparently.
Guess we should just drop the code then.
> There is though a bit more to the story: the (recent) read callbacks.
> Qemu sometimes decides to re-generate a "bunch of stuff" in the fw_cfg
> blobs. See the commit message here:
That is used for acpi. acpi initialization goes like this:
(1) firmware initializes the hardware as it pleases.
(2) firmware fetches acpi tables from qemu, and the read callback
is used to update the addresses in the acpi tables according
to the initialization done by the firmware (acpi pci device,
mmconfig xbar, ...)
Main reason to do it this way is we don't need paravirtual interfaces to
pass around those addresses.
> > Once I start getting what's going on (e.g., w.r.t. the questions above)
> > I wouldn't mind just adding *comments* to the source, for the next guy
> > who, like me, is trying to get the lay of the land, but I'm not there
> > yet...
I'd suggest to update the doc file created by the old patch instead.
cheers,
Gerd
next prev parent reply other threads:[~2015-03-12 7:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-11 15:27 [Qemu-devel] fw_cfg specification ? Gabriel L. Somlo
2015-03-11 18:50 ` Laszlo Ersek
2015-03-11 20:45 ` Gabriel L. Somlo
2015-03-11 21:30 ` Laszlo Ersek
2015-03-12 7:47 ` Gerd Hoffmann [this message]
2015-03-12 14:17 ` Paolo Bonzini
2015-03-12 15:42 ` Laszlo Ersek
2015-03-12 16:16 ` Gabriel L. Somlo
2015-03-12 16:35 ` Paolo Bonzini
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=1426146464.1722.11.camel@nilsson.home.kraxel.org \
--to=kraxel@redhat.com \
--cc=gleb@cloudius-systems.com \
--cc=gsomlo@gmail.com \
--cc=jordan.l.justen@intel.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).