[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v7 17/24] hw/misc/nrf51_rng: Use qemu_guest_getrando
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH v7 17/24] hw/misc/nrf51_rng: Use qemu_guest_getrandom_nofail |
Date: |
Tue, 14 May 2019 12:16:46 -0700 |
The random number is intended for use by the guest. As such, we should
honor the -seed argument for reproducibility. Use the *_nofail routine
instead of error_abort directly.
Reviewed-by: Laurent Vivier <address@hidden>
Reviewed-by: Joel Stanley <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
hw/misc/nrf51_rng.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/misc/nrf51_rng.c b/hw/misc/nrf51_rng.c
index d188f044f4..3400e90a9b 100644
--- a/hw/misc/nrf51_rng.c
+++ b/hw/misc/nrf51_rng.c
@@ -14,7 +14,7 @@
#include "qapi/error.h"
#include "hw/arm/nrf51.h"
#include "hw/misc/nrf51_rng.h"
-#include "crypto/random.h"
+#include "qemu/guest-random.h"
static void update_irq(NRF51RNGState *s)
{
@@ -145,7 +145,7 @@ static void nrf51_rng_timer_expire(void *opaque)
{
NRF51RNGState *s = NRF51_RNG(opaque);
- qcrypto_random_bytes(&s->value, 1, &error_abort);
+ qemu_guest_getrandom_nofail(&s->value, 1);
s->event_valrdy = 1;
qemu_set_irq(s->eep_valrdy, 1);
--
2.17.1
- [Qemu-devel] [PATCH v7 07/24] ui/vnc: Split out authentication_failed, (continued)
- [Qemu-devel] [PATCH v7 07/24] ui/vnc: Split out authentication_failed, Richard Henderson, 2019/05/14
- [Qemu-devel] [PATCH v7 06/24] crypto: Change the qcrypto_random_bytes buffer type to void*, Richard Henderson, 2019/05/14
- [Qemu-devel] [PATCH v7 09/24] util: Add qemu_guest_getrandom and associated routines, Richard Henderson, 2019/05/14
- [Qemu-devel] [PATCH v7 08/24] ui/vnc: Use gcrypto_random_bytes for start_auth_vnc, Richard Henderson, 2019/05/14
- [Qemu-devel] [PATCH v7 12/24] linux-user: Call qcrypto_random_init if not using -seed, Richard Henderson, 2019/05/14
- [Qemu-devel] [PATCH v7 10/24] cpus: Initialize pseudo-random seeds for all guest cpus, Richard Henderson, 2019/05/14
- [Qemu-devel] [PATCH v7 13/24] linux-user: Use qemu_guest_getrandom_nofail for AT_RANDOM, Richard Henderson, 2019/05/14
- [Qemu-devel] [PATCH v7 11/24] linux-user: Initialize pseudo-random seeds for all guest cpus, Richard Henderson, 2019/05/14
- [Qemu-devel] [PATCH v7 15/24] linux-user: Remove srand call, Richard Henderson, 2019/05/14
- [Qemu-devel] [PATCH v7 14/24] linux-user/aarch64: Use qemu_guest_getrandom for PAUTH keys, Richard Henderson, 2019/05/14
- [Qemu-devel] [PATCH v7 17/24] hw/misc/nrf51_rng: Use qemu_guest_getrandom_nofail,
Richard Henderson <=
- [Qemu-devel] [PATCH v7 16/24] aspeed/scu: Use qemu_guest_getrandom_nofail, Richard Henderson, 2019/05/14
- [Qemu-devel] [PATCH v7 18/24] hw/misc/bcm2835_rng: Use qemu_guest_getrandom_nofail, Richard Henderson, 2019/05/14
- [Qemu-devel] [PATCH v7 19/24] hw/misc/exynos4210_rng: Use qemu_guest_getrandom, Richard Henderson, 2019/05/14
- [Qemu-devel] [PATCH v7 20/24] target/arm: Put all PAC keys into a structure, Richard Henderson, 2019/05/14
- [Qemu-devel] [PATCH v7 21/24] target/arm: Implement ARMv8.5-RNG, Richard Henderson, 2019/05/14
- [Qemu-devel] [PATCH v7 23/24] target/ppc: Use gen_io_start/end around DARN, Richard Henderson, 2019/05/14
- [Qemu-devel] [PATCH v7 22/24] target/ppc: Use qemu_guest_getrandom for DARN, Richard Henderson, 2019/05/14
- [Qemu-devel] [PATCH v7 24/24] target/i386: Implement CPUID_EXT_RDRAND, Richard Henderson, 2019/05/14
- Re: [Qemu-devel] [PATCH v7 00/24] Add qemu_getrandom and ARMv8.5-RNG etc, Markus Armbruster, 2019/05/15