From: Eric Auger <eric.auger@linaro.org>
To: qemu list <qemu-devel@nongnu.org>, Alexander Graf <agraf@suse.de>,
Paolo Bonzini <pbonzini@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
Christoffer Dall <christoffer.dall@linaro.org>Peter Maydell
<peter.maydell@linaro.org>,
Ard Biesheuvel <ard.biesheuvel@linaro.org>,
Alex Williamson <alex.williamson@redhat.com>,
Antonios Motakis <a.motakis@virtualopensystems.com>
Subject: [Qemu-devel] dynamic sysbus instantiation and load_dtb implementation
Date: Thu, 23 Oct 2014 12:10:08 +0200 [thread overview]
Message-ID: <5448D400.6010503@linaro.org> (raw)
Dear all,
The goal of this mail is to summarize how dynamic sysbus device tree
nodes were created on ARM with "machvirt dynamic sysbus device
instantiation",
https://lists.gnu.org/archive/html/qemu-devel/2014-09/msg01626.html
and request some advises after commit "hw/arm/boot: load DTB as a ROM
image", which puts into question the current implementation.
When dynamically instantiating sysbus devices from qemu command line,
the complete device tree cannot be built at machine init. At time we
miss key information about those devices (base address, IRQ binding, ...)
dynamic sysbus devices are "realized" after the machine init when
parsing "-device" option line. This is at that time the information
about the device are collected.
The QEMU binding of the devices is performed in the platform_bus
machine_init_done_notifier. Only at that time the base address of the
device and IRQ number are chosen.
The original idea was to create the dynamic sysbus device tree nodes in
a reset callback (registered through qemu_register_reset). device tree
was fully re-created at that time and new sysbus device nodes were added
too. Finally archi specific load_dtb was called.
On ppc/e500 this works since load_dtb uses cpu_physical_memory_write.
it was the case on ARM too until recently but commit "hw/arm/boot: load
DTB as a ROM image" changed the arm load_dtb implementation. It now uses
rom_add_blob_fixed. when the reset callback is called rom_load_done()
was called by vl.c and prevents from changing the rom content. Hence
current callback mechanism does not work anymore.
A solution I foresee to fix the issue:
construct the device tree nodes in one machine_init_done_notifier,
before the rom_load_done is called. I would propose the platform bus
device (hw/core/platform-bus.c in [PATCH v3 0/7] Dynamic sysbus device
allocation support,
http://lists.nongnu.org/archive/html/qemu-devel/2014-09/msg04833.html)
to register another machine_init_done_notifier whose role would be to
initiate the dt upgrade. I would add a function to the platform bus to
pass an opaque data that allows calling architecture specific dt
implementation in the notifier, if needed (on ARM only).
I understand reverting to previous cpu_physical_memory_write
implementation on ARM is not the good direction.
Do you have any comments about the proposed solution, any other suggestion?
Thanks in advance
Best Regards
Eric
next reply other threads:[~2014-10-23 10:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-23 10:10 Eric Auger [this message]
2014-10-23 10:14 ` [Qemu-devel] dynamic sysbus instantiation and load_dtb implementation Alexander Graf
2014-10-23 10:19 ` Ard Biesheuvel
2014-10-23 11:23 ` Alexander Graf
2014-10-23 11:24 ` Peter Maydell
2014-10-23 11:26 ` Alexander Graf
2014-10-23 11:41 ` Eric Auger
2014-10-23 12:41 ` Eric Auger
2014-10-24 12:38 ` David Gibson
2014-11-13 4:02 ` David Gibson
2014-11-13 13:06 ` Eric Auger
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=5448D400.6010503@linaro.org \
--to=eric.auger@linaro.org \
--cc=agraf@suse.de \
--cc=christoffer.dall@linaro.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--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).