From d92f339a0d48fe90db1acee520471ff249453116 Mon Sep 17 00:00:00 2001 From: kaleb-himes Date: Thu, 15 Oct 2026 08:30:40 -0600 Subject: [PATCH] Say in entropy-timers.c that the AMD APERF timer is for bare metal only --- wolfcrypt/src/entropy-timers.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/entropy-timers.c b/wolfcrypt/src/entropy-timers.c index d2b84abcce..0d80349446 100644 --- a/wolfcrypt/src/entropy-timers.c +++ b/wolfcrypt/src/entropy-timers.c @@ -28,8 +28,12 @@ #include #include +/* Bare metal only: hypervisors trap RDPRU (AWS c7a: 881 ns a read, not 5 ns), + * so a seed takes ~1.2 s in a VM; use --enable-amdrdseed there. Details: fips + * repo entropy/portable-timer-callbacks/README.md. */ + /* AMD64 APM vol. 3: RDPRU is CPUID Fn8000_0008 EBX bit 4 and RDTSCP is - * Fn8000_0001 EDX bit 27. Those leaves are vendor defined, so check AMD first. */ + * Fn8000_0001 EDX bit 27. Those leaves are vendor defined: check AMD first. */ static int Entropy_AmdRdpruPresent(void) { unsigned int eax = 0, ebx = 0, ecx = 0, edx = 0;