• Sean Christopherson's avatar
    KVM: nVMX: Refactor PMU refresh to avoid referencing kvm_x86_ops.pmu_ops · 0bcd556e
    Sean Christopherson authored
    Refactor the nested VMX PMU refresh helper to pass it a flag stating
    whether or not the vCPU has PERF_GLOBAL_CTRL instead of having the nVMX
    helper query the information by bouncing through kvm_x86_ops.pmu_ops.
    This will allow a future patch to use static_call() for the PMU ops
    without having to export any static call definitions from common x86, and
    it is also a step toward unexported kvm_x86_ops.
    
    Alternatively, nVMX could call kvm_pmu_is_valid_msr() to indirectly use
    kvm_x86_ops.pmu_ops, but that would incur an extra layer of indirection
    and would require exporting kvm_pmu_is_valid_msr().
    
    Opportunistically rename the helper to keep line lengths somewhat
    reasonable, and to better capture its high-level role.
    
    No functional change intended.
    
    Cc: Like Xu <like.xu.linux@gmail.com>
    Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
    Message-Id: <20220128005208.4008533-9-seanjc@google.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    0bcd556e
nested.h 8.76 KB