mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 09:41:03 +02:00
KVM: selftests: Add a helper to query enable_mediated_pmu module param
Add a utility to check whether or not the mediated PMU is enabled, pivoting on Intel vs. AMD since the module param is defined by vendor code. Link: https://patch.msgid.link/20260610003030.2957261-5-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
This commit is contained in:
parent
4c396f19de
commit
0c277410f5
|
|
@ -1394,6 +1394,14 @@ static inline bool kvm_is_pmu_enabled(void)
|
|||
return get_kvm_param_bool("enable_pmu");
|
||||
}
|
||||
|
||||
static inline bool kvm_is_mediated_pmu_enabled(void)
|
||||
{
|
||||
if (host_cpu_is_intel)
|
||||
return get_kvm_intel_param_bool("enable_mediated_pmu");
|
||||
|
||||
return get_kvm_amd_param_bool("enable_mediated_pmu");
|
||||
}
|
||||
|
||||
static inline bool kvm_is_forced_emulation_enabled(void)
|
||||
{
|
||||
return !!get_kvm_param_integer("force_emulation_prefix");
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user