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
There is a flaw in the Hyper-V SynIC implementation in KVM: when message
page or event flags page is enabled by setting the corresponding msr,
KVM zeroes it out. This is problematic because on migration the
corresponding MSRs are loaded on the destination, so the content of
those pages is lost.
These are backports of the latest commits to hyperv subsystem in
mainsteram KVM (as of 4.13). They address a couple of design flaws, and
are necessary for the latest hyperv code in QEMU to work properly.
Note that the first commit is done as an incremental patch on top of the
ones currently