On Tue, Nov 03, 2015 at 03:51:16PM +0100, Paolo Bonzini wrote: > > > On 03/11/2015 15:36, Andrey Smetanin wrote: > >> > >> > >> if I run a patched QEMU but I *do not* enable the synthetic interrupt > >> controller. I can fix it by wrapping the calls to synic_exit with "if > >> (!host)", but I haven't checked yet the source---so that may not be the > >> proper fix. Sorry for not having looked more in detail. > >> > > Could you please specify test case(kvm unit tests ?) and kernel/qemu(if > > it's not standard)? > > It happens just by starting QEMU. > > Kernel: kvm/queue > + kvm/irqchip: kvm_arch_irq_routing_update renaming split > + kvm/x86: split ioapic-handled and EOI exit bitmaps > + kvm/x86: Hyper-V synthetic interrupt controller > + kvm/x86: Hyper-V kvm exit > > QEMU: 3a958f559ecd > + standard-headers/x86: add Hyper-V SynIC constants > + target-i386/kvm: Hyper-V SynIC MSR's support > + linux-headers/kvm: add Hyper-V SynIC irq routing type and struct > + kvm: Hyper-V SynIC irq routing support > + linux-headers/kvm: KVM_EXIT_HYPERV type and struct > + target-i386/hyperv: Hyper-V SynIC SINT routing and vCPU exit > + hw/misc: Hyper-V test device 'hyperv-testdev' > > Can be reproduced just with > "../qemu/+build/x86_64-softmmu/qemu-system-x86_64 --enable-kvm -cpu > kvm64 -display none". Thanks! We've figured it out: qemu initializes the MSRs if has_msr_hv_synic is set, which depends only on whether the kernel supports the MSRs and ignores the cpu property. OTOH setting those MSRs (on the host side) triggers a vcpu exit which checks the cpu property and aborts if it's unset. Voila. This way we also discovered that no error was triggered when the cpu property was set but the kernel didn't support it (and this problem was also present in other hyperv-related features). The solution appears to be to bail out when a hyperv property is requested but the host doesn't support it, and then check for the property only when deciding if the relevant actions need to be taken. Protecting vcpu exits with !host in the kernel seems to make sense, too. We're in progress of preparing the updated patches. Thanks, Roman. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html