[Devel] [PATCH v2 1/4] Revert "kvm/x86: clear hyperv synic pages only when guest modifies MSRs"

2017-10-10 Thread Roman Kagan
This reverts commit d385b9f5e7a4c225b1463655484daeebb1ca79dd. It will be replaced by a backported mainstream commit with different behavior. Signed-off-by: Roman Kagan --- arch/x86/kvm/hyperv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/hyperv.c b/arch/x

[Devel] [PATCH v2 3/4] kvm: x86: hyperv: add KVM_CAP_HYPERV_SYNIC2

2017-10-10 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. T

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

2017-10-10 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 use

[Devel] [PATCH v2 2/4] KVM: x86: fix NULL deref in vcpu_scan_ioapic

2017-10-10 Thread Roman Kagan
From: Wanpeng Li Reported by syzkaller: BUG: unable to handle kernel NULL pointer dereference at 01b0 IP: _raw_spin_lock+0xc/0x30 PGD 3e28eb067 PUD 3f0ac6067 PMD 0 Oops: 0002 [#1] SMP CPU: 0 PID: 2431 Comm: test Tainted: G OE 4.10.0-rc1+ #3

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

2017-10-10 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. v1 -> v2: - replace incremental patch with a revert and a fresh backport - pull in an inter