qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] "unimplemented" device for debug logging
@ 2017-01-12 19:03 Peter Maydell
  2017-01-12 19:03 ` [Qemu-devel] [PATCH 1/3] stellaris: Document memory map and which SoC devices are unimplemented Peter Maydell
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Peter Maydell @ 2017-01-12 19:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

This patchset implements an "unimplemented" sysbus device,
which is a dummy device which accepts and logs all accesses.
It's useful for stubbing out regions of an SoC or board
map which correspond to devices that have not yet been
implemented. This is often sufficient to placate initial
guest device driver probing such that the system will come up.

Since QEMU's default behaviour for accesses to bits of the
memory map with nothing there is to RAZ/WI them, instantiating
this device somewhere doesn't actually change behaviour,
and so the benefits here are really:
 * provide helpful debug logging of which things the guest
   is actually trying to talk to, so we know which things
   are most useful to implement next
 * allow stubbing out of devices on architectures which
   implement the CPU unassigned_access hook to actually
   throw a guest exception like real hardware does
 * allow somebody reading board model code to easily see
   that some things have not yet been implemented

Patch 2 is the actual "unimp" device; patches 1 and 3
are to the stellaris board as an example of usage, but the
short usage example is that you can just do:

   create_unimplemented_device("PWM", 0x40028000, 0x1000);

in your board model. If you're writing an SoC container
object that maps things into another memory region rather
than doing direct mapping into the system memory address
space, you can create, configure, instantiate and map the
thing by hand (as with all the other devices you're creating).

Resulting debug trace looks like this if you turn on -d unimp:

PWM: unimplemented device read (size 4, offset 0x40)
PWM: unimplemented device write (size 4, value 0x316a, offset 0x50)

thanks
-- PMM

Peter Maydell (3):
  stellaris: Document memory map and which SoC devices are unimplemented
  hw/misc: New "unimplemented" sysbus device
  stellaris: Use the 'unimplemented' device for parts we don't implement

 hw/misc/Makefile.objs   |   2 +
 include/hw/misc/unimp.h |  39 ++++++++++++++++++
 hw/arm/stellaris.c      |  45 ++++++++++++++++++++
 hw/misc/unimp.c         | 107 ++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 193 insertions(+)
 create mode 100644 include/hw/misc/unimp.h
 create mode 100644 hw/misc/unimp.c

-- 
2.7.4

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-02-07 17:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-12 19:03 [Qemu-devel] [PATCH 0/3] "unimplemented" device for debug logging Peter Maydell
2017-01-12 19:03 ` [Qemu-devel] [PATCH 1/3] stellaris: Document memory map and which SoC devices are unimplemented Peter Maydell
2017-01-27 14:11   ` Alex Bennée
2017-01-27 14:17     ` Peter Maydell
2017-02-07 17:38       ` Peter Maydell
2017-01-12 19:03 ` [Qemu-devel] [PATCH 2/3] hw/misc: New "unimplemented" sysbus device Peter Maydell
2017-01-27 14:33   ` Alex Bennée
2017-01-27 14:45     ` Peter Maydell
2017-01-12 19:03 ` [Qemu-devel] [PATCH 3/3] stellaris: Use the 'unimplemented' device for parts we don't implement Peter Maydell
2017-01-27 14:45   ` Alex Bennée

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).