diff options
author | Sean Christopherson <seanjc@google.com> | 2024-01-10 02:02:44 +0300 |
---|---|---|
committer | Sean Christopherson <seanjc@google.com> | 2024-01-31 02:29:42 +0300 |
commit | 0326cc6b02c8e099bb6631168791924be097e1d9 (patch) | |
tree | c8b98f3eb10ca12e5546d1727ae97429d3d0e399 /tools/testing/selftests/kvm/include/x86_64 | |
parent | 45e4755c39fc2df55f58ea893615a7d45a0fbcc8 (diff) | |
download | linux-0326cc6b02c8e099bb6631168791924be097e1d9.tar.xz |
KVM: selftests: Query module param to detect FEP in MSR filtering test
Add a helper to detect KVM support for forced emulation by querying the
module param, and use the helper to detect support for the MSR filtering
test instead of throwing a noodle/NOP at KVM to see if it sticks.
Cc: Aaron Lewis <aaronlewis@google.com>
Tested-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Link: https://lore.kernel.org/r/20240109230250.424295-25-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/testing/selftests/kvm/include/x86_64')
-rw-r--r-- | tools/testing/selftests/kvm/include/x86_64/processor.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/testing/selftests/kvm/include/x86_64/processor.h b/tools/testing/selftests/kvm/include/x86_64/processor.h index ee082ae58f40..d211cea188be 100644 --- a/tools/testing/selftests/kvm/include/x86_64/processor.h +++ b/tools/testing/selftests/kvm/include/x86_64/processor.h @@ -1222,6 +1222,11 @@ static inline bool kvm_is_pmu_enabled(void) return get_kvm_param_bool("enable_pmu"); } +static inline bool kvm_is_forced_emulation_enabled(void) +{ + return !!get_kvm_param_integer("force_emulation_prefix"); +} + uint64_t *__vm_get_page_table_entry(struct kvm_vm *vm, uint64_t vaddr, int *level); uint64_t *vm_get_page_table_entry(struct kvm_vm *vm, uint64_t vaddr); |