qemu/target-ppc
Thomas Huth 4d9392be6c ppc/spapr: Implement H_RANDOM hypercall in QEMU
The PAPR interface defines a hypercall to pass high-quality
hardware generated random numbers to guests. Recent kernels can
already provide this hypercall to the guest if the right hardware
random number generator is available. But in case the user wants
to use another source like EGD, or QEMU is running with an older
kernel, we should also have this call in QEMU, so that guests that
do not support virtio-rng yet can get good random numbers, too.

This patch now adds a new pseudo-device to QEMU that either
directly provides this hypercall to the guest or is able to
enable the in-kernel hypercall if available. The in-kernel
hypercall can be enabled with the use-kvm property, e.g.:

 qemu-system-ppc64 -device spapr-rng,use-kvm=true

For handling the hypercall in QEMU instead, a "RngBackend" is
required since the hypercall should provide "good" random data
instead of pseudo-random (like from a "simple" library function
like rand() or g_random_int()). Since there are multiple RngBackends
available, the user must select an appropriate back-end via the
"rng" property of the device, e.g.:

 qemu-system-ppc64 -object rng-random,filename=/dev/hwrng,id=gid0 \
                   -device spapr-rng,rng=gid0 ...

See http://wiki.qemu-project.org/Features-Done/VirtIORNG for
other example of specifying RngBackends.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-09-23 10:51:11 +10:00
..
arch_dump.c target-ppc: Set the correct endianness in ELF dump header 2014-06-16 13:24:36 +02:00
cpu-models.c target-ppc: Remove POWER5+ v0.0 that never existed 2015-03-25 22:49:46 +01:00
cpu-models.h target-ppc: Remove POWER5+ v0.0 that never existed 2015-03-25 22:49:46 +01:00
cpu-qom.h target-ppc: Use cpu_exec_interrupt qom hook 2014-09-25 18:54:22 +01:00
cpu.h tlb: Add "ifetch" argument to cpu_mmu_index() 2015-09-11 08:15:28 -07:00
dfp_helper.c target-ppc: Fix compiler warning 2014-06-24 20:01:24 +04:00
excp_helper.c target-ppc: Fix SRR0 when taking unaligned exceptions 2015-09-20 22:48:39 +02:00
fpu_helper.c target-ppc: Eliminate set_fprf Argument From helper_compute_fprf 2015-01-07 16:16:25 +01:00
gdbstub.c target-ppc: Fix gdbstub for ppc64le-linux-user 2014-07-08 12:10:36 +02:00
helper_regs.h PPC: Only enter MSR_POW when no interrupts pending 2014-04-08 11:20:05 +02:00
helper.h target-ppc: Introduce tbegin 2015-01-07 16:16:27 +01:00
int_helper.c target-ppc: fix vcipher, vcipherlast, vncipherlast and vpermxor 2015-09-20 22:48:39 +02:00
kvm_ppc.h ppc/spapr: Implement H_RANDOM hypercall in QEMU 2015-09-23 10:51:11 +10:00
kvm-stub.c kvm/openpic: in-kernel mpic support 2013-07-01 01:11:14 +02:00
kvm.c ppc/spapr: Implement H_RANDOM hypercall in QEMU 2015-09-23 10:51:11 +10:00
machine.c migration: Use normal VMStateDescriptions for Subsections 2015-06-12 06:53:57 +02:00
Makefile.objs kvm_ppc: remove kvmppc_timer_hack 2015-09-20 22:48:38 +02:00
mem_helper.c target-ppc: Introduce tbegin 2015-01-07 16:16:27 +01:00
mfrom_table_gen.c fix spelling in target sub directory 2011-12-02 10:50:57 +00:00
mfrom_table.c
misc_helper.c target-ppc: move sdr1 value change detection logic to helper_store_sdr1() 2015-03-09 15:00:05 +01:00
mmu_helper.c target-ppc: move sdr1 value change detection logic to helper_store_sdr1() 2015-03-09 15:00:05 +01:00
mmu-hash32.c qemu-log: add log category for MMU info 2014-12-16 18:43:19 +00:00
mmu-hash32.h target-ppc: Use PowerPCCPU in PowerPCCPUClass::handle_mmu_fault hook 2014-03-13 19:20:48 +01:00
mmu-hash64.c target-ppc: Fix warnings from Sparse 2015-03-09 15:00:08 +01:00
mmu-hash64.h target-ppc: Use right page size with hash table lookup 2015-03-09 14:59:53 +01:00
monitor.c monitor: remove target-specific code from monitor.c 2015-09-16 17:33:32 +02:00
STATUS target-ppc: remove powerpc 970gx 2014-03-05 03:06:23 +01:00
timebase_helper.c tcg: Invert the inclusion of helper.h 2014-05-28 09:33:54 -07:00
translate_init.c Target-ppc: Remove unnecessary variable 2015-09-11 10:21:38 +03:00
translate.c target-ppc: fix xscmpodp and xscmpudp decoding 2015-09-20 22:48:39 +02:00
user_only_helper.c cpu: Move exception_index field from CPU_COMMON to CPUState 2014-03-13 19:20:46 +01:00