]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: selftests: Add struct and helpers to wrap binary stats cache
authorSean Christopherson <seanjc@google.com>
Sat, 11 Jan 2025 00:50:45 +0000 (16:50 -0800)
committerSean Christopherson <seanjc@google.com>
Fri, 14 Feb 2025 15:02:09 +0000 (07:02 -0800)
commite65faf71bd54ac957aed3c2e81a964fea63f3e82
treefc73eefd030e0bb1b9ab08651619a6f199d91064
parentb0c3f5df92913de6b9936cb0707cf1c8cdad66a2
KVM: selftests: Add struct and helpers to wrap binary stats cache

Add a struct and helpers to manage the binary stats cache, which is
currently used only for VM-scoped stats.  This will allow expanding the
selftests infrastructure to provide support for vCPU-scoped binary stats,
which, except for the ioctl to get the stats FD are identical to VM-scoped
stats.

Defer converting __vm_get_stat() to a scope-agnostic helper to a future
patch, as getting the stats FD from KVM needs to be moved elsewhere
before it can be made completely scope-agnostic.

Link: https://lore.kernel.org/r/20250111005049.1247555-6-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/include/kvm_util.h
tools/testing/selftests/kvm/lib/kvm_util.c