summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/kvm/lib/x86/processor.c
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2025-05-16 14:59:06 -0700
committerSean Christopherson <seanjc@google.com>2025-06-20 13:39:10 -0700
commitfcab107abe1ab5be9dbe874baa722372da8f4f73 (patch)
tree112949460c1fbccd780424247c1d70e0b80dac35 /tools/testing/selftests/kvm/lib/x86/processor.c
parent30142a93b1641b19bf4ba2cd6beb5814adc5b746 (diff)
KVM: selftests: Verify KVM is loaded when getting a KVM module param
Probe /dev/kvm when getting a KVM module param so that attempting to load a module param super early in a selftest generates a SKIP message about KVM not being loaded/enabled, versus some random parameter not existing. E.g. KVM x86's unconditional retrieval of force_emulation_prefix during kvm_selftest_arch_init() generates a rather confusing error message that takes far too much triage to understand. Link: https://lore.kernel.org/r/20250516215909.2551628-2-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/testing/selftests/kvm/lib/x86/processor.c')
-rw-r--r--tools/testing/selftests/kvm/lib/x86/processor.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/tools/testing/selftests/kvm/lib/x86/processor.c b/tools/testing/selftests/kvm/lib/x86/processor.c
index a92dc1dad085..d4c19ac885a9 100644
--- a/tools/testing/selftests/kvm/lib/x86/processor.c
+++ b/tools/testing/selftests/kvm/lib/x86/processor.c
@@ -1264,16 +1264,6 @@ done:
return min(max_gfn, ht_gfn - 1);
}
-/* Returns true if kvm_intel was loaded with unrestricted_guest=1. */
-bool vm_is_unrestricted_guest(struct kvm_vm *vm)
-{
- /* Ensure that a KVM vendor-specific module is loaded. */
- if (vm == NULL)
- close(open_kvm_dev_path_or_exit());
-
- return get_kvm_intel_param_bool("unrestricted_guest");
-}
-
void kvm_selftest_arch_init(void)
{
host_cpu_is_intel = this_cpu_is_intel();