KVM: selftests: Add a helper to query if the PMU module param is enabled
Add a helper to probe KVM's "enable_pmu" param, open coding strings in multiple places is just asking for false negatives and/or runtime errors due to typos. Reviewed-by: Dapeng Mi <dapeng1.mi@linux.intel.com> Tested-by: Dapeng Mi <dapeng1.mi@linux.intel.com> Link: https://lore.kernel.org/r/20240109230250.424295-23-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
This commit is contained in:
@@ -1217,6 +1217,11 @@ static inline uint8_t xsetbv_safe(uint32_t index, uint64_t value)
|
||||
|
||||
bool kvm_is_tdp_enabled(void);
|
||||
|
||||
static inline bool kvm_is_pmu_enabled(void)
|
||||
{
|
||||
return get_kvm_param_bool("enable_pmu");
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user