diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2011-04-01 15:15:24 +1100 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2011-04-01 18:34:56 +0200 |
commit | 821303f59b63ab832f0921f070db55e95bb21858 (patch) | |
tree | f99ec09d0ab08e9759795be58dfda991a715f75f /hw/spapr_hcall.c | |
parent | 39ac8455106af1ed669b8e10223420cf1ac5b190 (diff) | |
download | qemu-821303f59b63ab832f0921f070db55e95bb21858.tar.gz qemu-821303f59b63ab832f0921f070db55e95bb21858.tar.bz2 qemu-821303f59b63ab832f0921f070db55e95bb21858.zip |
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>
Diffstat (limited to 'hw/spapr_hcall.c')
-rw-r--r-- | hw/spapr_hcall.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/hw/spapr_hcall.c b/hw/spapr_hcall.c index d8c721e472..a47a97ba55 100644 --- a/hw/spapr_hcall.c +++ b/hw/spapr_hcall.c @@ -248,6 +248,13 @@ static target_ulong h_protect(CPUState *env, sPAPREnvironment *spapr, return H_SUCCESS; } +static target_ulong h_set_dabr(CPUState *env, sPAPREnvironment *spapr, + target_ulong opcode, target_ulong *args) +{ + /* FIXME: actually implement this */ + return H_HARDWARE; +} + static target_ulong h_rtas(CPUState *env, sPAPREnvironment *spapr, target_ulong opcode, target_ulong *args) { @@ -317,6 +324,9 @@ static void hypercall_init(void) spapr_register_hypercall(H_REMOVE, h_remove); spapr_register_hypercall(H_PROTECT, h_protect); + /* hcall-dabr */ + spapr_register_hypercall(H_SET_DABR, h_set_dabr); + /* qemu/KVM-PPC specific hcalls */ spapr_register_hypercall(KVMPPC_H_RTAS, h_rtas); } |