From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org,
Peter Crosthwaite <peter.crosthwaite@xilinx.com>,
kraxel@redhat.com
Subject: [Qemu-devel] [RFC PATCH v1 0/4] Data Driven device registers & Zynq DEVCFG
Date: Sun, 3 Mar 2013 16:13:00 +1000 [thread overview]
Message-ID: <cover.1362290776.git.peter.crosthwaite@xilinx.com> (raw)
Hi All. This is a new scheme i've come up with handling device registers in a
data driven way. My motivation for this is to factor out a lot of the access
checking that seems to be replicated in every device. See P2 commit message for
further discussion.
P1 is an extension of qemu_log to query what features are and are not enabled.
P2 is the main patch, adds the register definition functionality
P3 is an example new device (the Xilinx Zynq devcfg) that uses this scheme.
P4 adds devcfg to the Zynq machine model
This devcfg device was particularly finnicky with per-bit restrictions which
prompted all this. Im also looking for a higher-than-usual modelling fidelity
on the register space, with semantics defined for random reserved bits
in-between otherwise consistent fields.
Heres an example of the qemu_log output for the devcfg device. This is produced
by now generic sharable code:
/machine/unattached/device[44]:Addr 0x000008:CFG: write of value 00000508
/machine/unattached/device[44]:Addr 0x000080:MCTRL: write of value 00800010
/machine/unattached/device[44]:Addr 0x000010:INT_MASK: write of value ffffffff
/machine/unattached/device[44]:Addr 00000000:CTRL: write of value 0c00607f
And an example of a rogue guest banging on a bad bit:
/machine/unattached/device[44]:Addr 0x000014:STATUS bits 0x000001 may not be \
written to 1
Future work: Theres a lot of overlap here with what Peter did with the ARM
coprocessor definitions. We could go further and generalise ARM CP to use this
or some further evolution of it. That and converting existing models to this
scheme. Some device models will lose a lot of weight.
Peter A. G. Crosthwaite (2):
xilinx_zynq: devcfg device model
zynq: added devcfg to machine model
Peter Crosthwaite (2):
qemu-log: Allow checking of the current mask
bitops: Add UInt32StateInfo and helper functions
hw/arm/Makefile.objs | 2 +-
hw/xilinx_devcfg.c | 443 +++++++++++++++++++++++++++++++++++++++++++++++++
hw/xilinx_zynq.c | 6 +
include/qemu/bitops.h | 59 +++++++
include/qemu/log.h | 2 +
qemu-log.c | 5 +
util/bitops.c | 71 ++++++++
7 files changed, 587 insertions(+), 1 deletions(-)
create mode 100644 hw/xilinx_devcfg.c
next reply other threads:[~2013-03-03 6:13 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-03 6:13 Peter Crosthwaite [this message]
2013-03-03 6:13 ` [Qemu-devel] [RFC PATCH v1 1/4] qemu-log: Allow checking of the current mask Peter Crosthwaite
2013-03-03 10:32 ` Peter Maydell
2013-03-03 6:13 ` [Qemu-devel] [RFC PATCH v1 2/4] bitops: Add UInt32StateInfo and helper functions Peter Crosthwaite
2013-03-03 9:01 ` Blue Swirl
2013-03-04 1:37 ` Peter Crosthwaite
2013-03-04 7:28 ` Gerd Hoffmann
2013-03-04 20:44 ` Blue Swirl
2013-03-04 9:44 ` Michael S. Tsirkin
2013-03-04 20:52 ` Blue Swirl
2013-03-05 13:34 ` Michael S. Tsirkin
2013-03-05 14:17 ` Gerd Hoffmann
2013-03-05 14:32 ` Michael S. Tsirkin
2013-03-07 2:00 ` Peter Crosthwaite
2013-03-07 2:26 ` Peter Maydell
2013-03-09 9:41 ` Blue Swirl
2013-03-04 6:55 ` Gerd Hoffmann
2013-03-04 7:20 ` Peter Crosthwaite
2013-03-04 7:30 ` Gerd Hoffmann
2013-03-03 6:13 ` [Qemu-devel] [RFC PATCH v1 3/4] xilinx_zynq: devcfg device model Peter Crosthwaite
2013-03-03 6:13 ` [Qemu-devel] [RFC PATCH v1 4/4] zynq: added devcfg to machine model Peter Crosthwaite
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=cover.1362290776.git.peter.crosthwaite@xilinx.com \
--to=peter.crosthwaite@xilinx.com \
--cc=kraxel@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).