diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2015-03-20 05:39:41 -0400 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2015-04-21 09:21:29 -0400 |
commit | e928e9cb3601ce240189bfea05b67ebd391c85ae (patch) | |
tree | d76d6501bea8ffe04a448e5a5660d8926f22b3b4 /Documentation/virtual | |
parent | 99342cf8044420eebdf9297ca03a14cb6a7085a1 (diff) |
KVM: PPC: Book3S HV: Add fast real-mode H_RANDOM implementation.
Some PowerNV systems include a hardware random-number generator.
This HWRNG is present on POWER7+ and POWER8 chips and is capable of
generating one 64-bit random number every microsecond. The random
numbers are produced by sampling a set of 64 unstable high-frequency
oscillators and are almost completely entropic.
PAPR defines an H_RANDOM hypercall which guests can use to obtain one
64-bit random sample from the HWRNG. This adds a real-mode
implementation of the H_RANDOM hypercall. This hypercall was
implemented in real mode because the latency of reading the HWRNG is
generally small compared to the latency of a guest exit and entry for
all the threads in the same virtual core.
Userspace can detect the presence of the HWRNG and the H_RANDOM
implementation by querying the KVM_CAP_PPC_HWRNG capability. The
H_RANDOM hypercall implementation will only be invoked when the guest
does an H_RANDOM hypercall if userspace first enables the in-kernel
H_RANDOM implementation using the KVM_CAP_PPC_ENABLE_HCALL capability.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'Documentation/virtual')
-rw-r--r-- | Documentation/virtual/kvm/api.txt | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index bc9f6fe44e27..9fa2bf8c3f6f 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt | |||
@@ -3573,3 +3573,20 @@ struct { | |||
3573 | @ar - access register number | 3573 | @ar - access register number |
3574 | 3574 | ||
3575 | KVM handlers should exit to userspace with rc = -EREMOTE. | 3575 | KVM handlers should exit to userspace with rc = -EREMOTE. |
3576 | |||
3577 | |||
3578 | 8. Other capabilities. | ||
3579 | ---------------------- | ||
3580 | |||
3581 | This section lists capabilities that give information about other | ||
3582 | features of the KVM implementation. | ||
3583 | |||
3584 | 8.1 KVM_CAP_PPC_HWRNG | ||
3585 | |||
3586 | Architectures: ppc | ||
3587 | |||
3588 | This capability, if KVM_CHECK_EXTENSION indicates that it is | ||
3589 | available, means that that the kernel has an implementation of the | ||
3590 | H_RANDOM hypercall backed by a hardware random-number generator. | ||
3591 | If present, the kernel H_RANDOM handler can be enabled for guest use | ||
3592 | with the KVM_CAP_PPC_ENABLE_HCALL capability. | ||