qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 0/3] "unimplemented" device for debug logging


From: Peter Maydell
Subject: [Qemu-devel] [PATCH 0/3] "unimplemented" device for debug logging
Date: Thu, 12 Jan 2017 19:03:32 +0000

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]