qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/2] ppc/spapr_hcall: Implement H_RANDOM hypercall
@ 2015-08-31 18:46 Thomas Huth
  2015-08-31 18:46 ` [Qemu-devel] [PATCH v2 1/2] spapr: Add support for hwrng when available Thomas Huth
  2015-08-31 18:46 ` [Qemu-devel] [PATCH v2 2/2] ppc/spapr_hcall: Implement H_RANDOM hypercall in QEMU Thomas Huth
  0 siblings, 2 replies; 34+ messages in thread
From: Thomas Huth @ 2015-08-31 18:46 UTC (permalink / raw)
  To: qemu-ppc, agraf, david; +Cc: michael, amit.shah, qemu-devel, armbru

The H_RANDOM sPAPR hypercall is used to pass high-quality random
numbers to guests (similar to virtio-rnd). Since the Linux guest
kernels already support this hypercall, we should provide this
interface in QEMU, too, in case virtio-rnd is not available in
the guest yet.

First patch is an older patch by Michael Ellerman which sets up
the device tree for this interface (which is already used when
KVM in the host kernel supports the H_RANDOM hypercall). The
second patch then implements the hypercall for plain QEMU, too,
by using the RngBackends of QEMU.

Note: Since I do not have access to the SPAPR spec, I figured out
the calling conventions of the hypercall by looking at the way
the Linux kernel is using this call to retriev random data. So
there might be some bugs or missing pieces here... - if you spot
something, please tell me!

v2:
- Added Michael's patch for setting up the device tree information
- After discussing this hypercall with some people at KVM
  forum 2015, I've now reworked the code to use the RngBackend
  of QEMU instead of using /dev/random directly.

Michael Ellerman (1):
  spapr: Add support for hwrng when available

Thomas Huth (1):
  ppc/spapr_hcall: Implement H_RANDOM hypercall in QEMU

 hw/ppc/spapr.c         | 50 +++++++++++++++++++++++++++++++--
 hw/ppc/spapr_hcall.c   | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++
 include/hw/ppc/spapr.h |  3 ++
 target-ppc/kvm.c       |  5 ++++
 target-ppc/kvm_ppc.h   |  5 ++++
 5 files changed, 135 insertions(+), 3 deletions(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2015-09-14  7:36 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-31 18:46 [Qemu-devel] [PATCH v2 0/2] ppc/spapr_hcall: Implement H_RANDOM hypercall Thomas Huth
2015-08-31 18:46 ` [Qemu-devel] [PATCH v2 1/2] spapr: Add support for hwrng when available Thomas Huth
2015-09-01  0:38   ` David Gibson
2015-09-01 10:53     ` Thomas Huth
2015-09-08  5:03       ` [Qemu-devel] [Qemu-ppc] " Sam Bobroff
2015-09-08  5:15         ` David Gibson
2015-09-09 21:10           ` Thomas Huth
2015-09-10  7:33             ` Thomas Huth
2015-09-10 10:40               ` David Gibson
2015-09-10 12:03                 ` Thomas Huth
2015-09-10 12:13                   ` Alexander Graf
2015-09-11  0:46                     ` David Gibson
2015-09-11  9:43                       ` Alexander Graf
2015-09-14  2:27                         ` David Gibson
2015-09-14  7:36                           ` Alexander Graf
2015-09-11  0:45                   ` David Gibson
2015-09-11  7:30                     ` Thomas Huth
2015-09-14  2:25                       ` David Gibson
2015-09-08  5:38         ` Thomas Huth
2015-09-09  0:54           ` Sam Bobroff
2015-09-10 12:06             ` Greg Kurz
2015-09-09 14:09   ` [Qemu-devel] " Greg Kurz
2015-08-31 18:46 ` [Qemu-devel] [PATCH v2 2/2] ppc/spapr_hcall: Implement H_RANDOM hypercall in QEMU Thomas Huth
2015-09-01  0:47   ` David Gibson
2015-09-01 11:03     ` Thomas Huth
2015-09-07 15:05     ` Thomas Huth
2015-09-08  1:14       ` David Gibson
2015-09-02  5:34   ` Amit Shah
2015-09-02  7:48     ` David Gibson
2015-09-02  8:58       ` Thomas Huth
2015-09-02 10:06         ` Amit Shah
2015-09-02 10:02       ` Amit Shah
2015-09-03  1:21       ` Michael Ellerman
2015-09-03  2:17         ` David Gibson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).