2017-06-16 18:16+0300, Roman Kagan: > Hyper-V identifies vCPUs by Virtual Processor Index, which can be > queried via HV_X64_MSR_VP_INDEX msr. It is defined by the spec as a > sequential number which can't exceed the maximum number of vCPUs per VM. > APIC ids can be sparse and thus aren't a valid replacement for VP > indices. > > Current KVM uses its internal vcpu index as VP_INDEX. However, to make > it predictable and persistent across VM migrations, the userspace has to > control the value of VP_INDEX. > > This patch achieves that, by storing vp_index explicitly on vcpu, and > allowing HV_X64_MSR_VP_INDEX to be set from the host side. For > compatibility it's initialized to KVM vcpu index. Also a few variables > are renamed to make clear distinction betweed this Hyper-V vp_index and > KVM vcpu_id (== APIC id). > > Signed-off-by: Roman Kagan <rkagan@xxxxxxxxxxxxx> > --- Please add a kvm capability, so userspace doesn't trigger the unhandled wrmsr messages when detecting this feature. Thanks.