Implement assorted pSeries hcalls and RTAS methods
authorDavid Gibson <david@gibson.dropbear.id.au>
Fri, 1 Apr 2011 04:15:24 +0000 (15:15 +1100)
committerAlexander Graf <agraf@suse.de>
Fri, 1 Apr 2011 16:34:56 +0000 (18:34 +0200)
commit96c4c14c73def37ee88f2fbb77f31fe8105d8911
treef99ec09d0ab08e9759795be58dfda991a715f75f
parenteed9e74e4760458e5369192e78a32afc98cfacc0
Implement assorted pSeries hcalls and RTAS methods

This patch adds several small utility hypercalls and RTAS methods to
the pSeries platform emulation.  Specifically:

* 'display-character' rtas call

This just prints a character to the console, it's occasionally used
for early debug of the OS.  The support includes a hack to make this
RTAS call respond on the normal token value present on real hardware,
since some early debugging tools just assume this value without
checking the device tree.

* 'get-time-of-day' rtas call

This one just takes the host real time, converts to the PAPR described
format and returns it to the guest.

* 'power-off' rtas call

This one shuts down the emulated system.

* H_DABR hypercall

On pSeries, the DABR debug register is usually a hypervisor resource
and virtualized through this hypercall.  If the hypercall is not
present, Linux will under some circumstances attempt to manipulate the
DABR directly which will fail on this emulated machine.

This stub implementation is enough to stop that behaviour, although it
doesn't actually implement the requested DABR operations as yet.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
hw/spapr.c
hw/spapr_hcall.c
hw/spapr_rtas.c