[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 03/10] hyperv: only add SynIC in compatible conf
From: |
Roman Kagan |
Subject: |
Re: [Qemu-devel] [PATCH 03/10] hyperv: only add SynIC in compatible configurations |
Date: |
Mon, 26 Nov 2018 15:17:15 +0000 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Mon, Nov 26, 2018 at 03:45:03PM +0100, Igor Mammedov wrote:
> On Fri, 21 Sep 2018 11:22:10 +0300
> Roman Kagan <address@hidden> wrote:
>
> > Certain configurations do not allow SynIC to be used in QEMU. In
> > particular,
> >
> > - when hyperv_vpindex is off, SINT routes can't be used as they refer to
> > the destination vCPU by vp_index
> >
> > - older KVM (which doesn't expose KVM_CAP_HYPERV_SYNIC2) zeroes out
> > SynIC message and event pages on every msr load, breaking migration
> >
> > OTOH in-KVM users of SynIC -- SynIC timers -- do work in those
> > configurations, and we shouldn't stop the guest from using them.
> >
> > To cover both scenarios, introduce an X86CPU property that makes CPU
> > init code to skip creation of the SynIC object (and thus disables any
> > SynIC use in QEMU) but keeps the KVM part of the SynIC working.
> > The property is clear by default but is set via compat logic for older
> > machine types.
> >
> > As a result, when hv_synic and a modern machine type are specified, QEMU
> > will refuse to run unless vp_index is on and the kernel is recent
> > enough. OTOH with an older machine type QEMU will run fine with
> > hv_synic=on against an older kernel and/or without vp_index enabled but
> > will disallow the in-QEMU uses of SynIC (in e.g. VMBus).
> >
> > Signed-off-by: Roman Kagan <address@hidden>
>
> With current upstream and x-hv-synic-kvm-only=on QEMU will SIGSEGV.
> Problem was unnoticed since added compat property wasn't actually used
> until much later commit
> 4a93722f9c hw/i386: add pc-i440fx-3.1 & pc-q35-3.1
> which put compat property in use.
>
> qemu-system-x86_64 -machine pc-i440fx-2.10,accel=kvm \
> -cpu host,-vmx,hv-relaxed,hv_spinlocks=0x1fff,hv-vpindex,hv-synic
>
> simpler reproducer:
> qemu-system-x86_64 -enable-kvm -cpu host,hv-synic,x-hv-synic-kvm-only=on
>
> Reported-by: Vitaly Kuznetsov <address@hidden>
Thanks for the report, fix is on the way to ML.
Roman.