mirror of
https://github.com/qemu/qemu.git
synced 2024-11-26 12:23:36 +08:00
4d9392be6c
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>
24 lines
807 B
Makefile
24 lines
807 B
Makefile
# shared objects
|
|
obj-y += ppc.o ppc_booke.o
|
|
# IBM pSeries (sPAPR)
|
|
obj-$(CONFIG_PSERIES) += spapr.o spapr_vio.o spapr_events.o
|
|
obj-$(CONFIG_PSERIES) += spapr_hcall.o spapr_iommu.o spapr_rtas.o
|
|
obj-$(CONFIG_PSERIES) += spapr_pci.o spapr_rtc.o spapr_drc.o spapr_rng.o
|
|
ifeq ($(CONFIG_PCI)$(CONFIG_PSERIES)$(CONFIG_LINUX), yyy)
|
|
obj-y += spapr_pci_vfio.o
|
|
endif
|
|
# PowerPC 4xx boards
|
|
obj-y += ppc405_boards.o ppc4xx_devs.o ppc405_uc.o ppc440_bamboo.o
|
|
obj-y += ppc4xx_pci.o
|
|
# PReP
|
|
obj-$(CONFIG_PREP) += prep.o
|
|
# OldWorld PowerMac
|
|
obj-$(CONFIG_MAC) += mac_oldworld.o
|
|
# NewWorld PowerMac
|
|
obj-$(CONFIG_MAC) += mac_newworld.o
|
|
# e500
|
|
obj-$(CONFIG_E500) += e500.o mpc8544ds.o e500plat.o
|
|
obj-$(CONFIG_E500) += mpc8544_guts.o ppce500_spin.o
|
|
# PowerPC 440 Xilinx ML507 reference board.
|
|
obj-$(CONFIG_XILINX) += virtex_ml507.o
|