On Wed, Aug 28, 2019 at 4:41 PM Oliver Upton <oupton@xxxxxxxxxx> wrote: > > The "load IA32_PERF_GLOBAL_CTRL" high bit for VM-entry and VM-exit should only > be set and made available to the guest iff IA32_PERF_GLOBAL_CTRL is a valid > MSR. Otherwise, the high bit should be cleared. > > Creating a new helper function in vmx.c to allow the pmu_refresh code to > update the VM-entry and VM-exit controls. This was done instead of > adding to 'nested_vmx_entry_exit_ctls_update' as the PMU isn't yet > initialized with its values at the time it is called, causing the > 'is_valid_msr(vcpu, MSR_CORE_PERF_GLOBAL_CTRL)' check to fail > unconditionally. > > Suggested-by: Jim Mattson <jmattson@xxxxxxxxxx> > Signed-off-by: Oliver Upton <oupton@xxxxxxxxxx> One thing that's clear from this change (though it's not anything new) is that KVM_SET_CPUID should be called before KVM_SET_MSRS, or unexpected things might happen. Perhaps it's worth adding a note to api.txt?