qemu-patch-raspberry4/include/hw/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
..
mac_dbdma.h macio: remove remainder_len DBDMA_io property 2015-06-04 20:25:39 -04:00
openpic.h intc/openpic_kvm: Fix QOM and build issues 2013-07-01 01:11:15 +02:00
ppc.h PPC: mac99: Move NVRAM to page boundary when necessary 2014-09-08 12:50:47 +02:00
ppc4xx.h hw: move headers to include/ 2013-04-08 18:13:10 +02:00
ppc_e500.h intc/openpic: Build openpic only once 2013-07-09 21:33:02 +02:00
spapr.h ppc/spapr: Implement H_RANDOM hypercall in QEMU 2015-09-23 10:51:11 +10:00
spapr_drc.h spapr_drc: use RTAS return codes for methods called by RTAS 2015-09-23 10:51:10 +10:00
spapr_vio.h spapr: Merge sPAPREnvironment into sPAPRMachineState 2015-07-07 17:44:50 +02:00
xics.h xics_kvm: Don't enable KVM_CAP_IRQ_XICS if already enabled 2015-07-07 17:44:52 +02:00