summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/kvm/include/x86/kvm_util_arch.h
diff options
context:
space:
mode:
authorJosh Hilke <jrhilke@google.com>2026-06-26 14:35:16 -0700
committerSean Christopherson <seanjc@google.com>2026-07-07 11:24:43 -0700
commite0bd29eddf7ecdd67f28f3c44ad89b02a08f245c (patch)
tree39a5d4f48e3474642dbe98efa421546a2a2a6a5e /tools/testing/selftests/kvm/include/x86/kvm_util_arch.h
parentac050f2adcdfca6aca3c79c802c21245fab0b6d8 (diff)
downloadlinux-next-e0bd29eddf7ecdd67f28f3c44ad89b02a08f245c.tar.gz
linux-next-e0bd29eddf7ecdd67f28f3c44ad89b02a08f245c.zip
KVM: selftests: Rename guest_rng to kvm_rng
Rename functions prefixed with 'guest_random_' to 'kvm_random_' and the global random state variable 'guest_rng' to 'kvm_rng', as the pRNG isn't strictly limited to guest code. This will allow using the pRNG in host code without creating confusing/misleading function calls. No functional changes are intended. Suggested-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Josh Hilke <jrhilke@google.com> [sean: massage changelog] Link: https://patch.msgid.link/20260626213534.3866178-4-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/testing/selftests/kvm/include/x86/kvm_util_arch.h')
-rw-r--r--tools/testing/selftests/kvm/include/x86/kvm_util_arch.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/kvm/include/x86/kvm_util_arch.h b/tools/testing/selftests/kvm/include/x86/kvm_util_arch.h
index c33ab6e04171..6904dbda79f9 100644
--- a/tools/testing/selftests/kvm/include/x86/kvm_util_arch.h
+++ b/tools/testing/selftests/kvm/include/x86/kvm_util_arch.h
@@ -55,9 +55,9 @@ static inline bool __vm_arch_has_protected_memory(struct kvm_vm_arch *arch)
do { \
const typeof(mem) val = (__val); \
\
- if (!is_forced_emulation_enabled || guest_random_bool(&guest_rng)) { \
+ if (!is_forced_emulation_enabled || kvm_random_bool(&kvm_rng)) { \
(mem) = val; \
- } else if (guest_random_bool(&guest_rng)) { \
+ } else if (kvm_random_bool(&kvm_rng)) { \
__asm__ __volatile__(KVM_FEP "mov %1, %0" \
: "+m" (mem) \
: "r" (val) : "memory"); \