[Devel] [PATCH 2/2] kvm: x86: hyperv: make VP_INDEX managed by userspace

2017-10-03 Thread 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

[Devel] [PATCH 1/2] kvm: x86: hyperv: add KVM_CAP_HYPERV_SYNIC2

2017-10-03 Thread Roman Kagan
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.

[Devel] [PATCH 0/2] kvm: hyperv: backport latest stuff from mainstream

2017-10-03 Thread Roman Kagan
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