All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrey Smetanin <asmetanin@virtuozzo.com>
To: Paolo Bonzini <pbonzini@redhat.com>, <kvm@vger.kernel.org>
Cc: Roman Kagan <rkagan@virtiozzo.com>,
	Gleb Natapov <gleb@kernel.org>, <qemu-devel@nongnu.org>,
	"Denis V. Lunev" <den@openvz.org>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	"K. Y. Srinivasan" <kys@microsoft.com>
Subject: Re: [PATCH v3 9/9] kvm/x86: Hyper-V kvm exit
Date: Tue, 3 Nov 2015 18:42:47 +0300	[thread overview]
Message-ID: <5638D5F7.4050805@virtuozzo.com> (raw)
In-Reply-To: <5638C9E4.2000903@redhat.com>



On 11/03/2015 05:51 PM, 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 probably found root case -
qemu reads/writes Hyper-V SynIC msrs just by check SynIC MSR's support 
in kernel. So KVM synic exits into userspace(at SynIC MSR's writes), 
while userspace Hyper-V SynIC handler doesn't expect this exit(cpu 
'hv-synic' option is not set), so handler returns -1 and qemu exits.
> Paolo
>

WARNING: multiple messages have this Message-ID (diff)
From: Andrey Smetanin <asmetanin@virtuozzo.com>
To: Paolo Bonzini <pbonzini@redhat.com>, kvm@vger.kernel.org
Cc: Gleb Natapov <gleb@kernel.org>,
	qemu-devel@nongnu.org, "Denis V. Lunev" <den@openvz.org>,
	Roman Kagan <rkagan@virtiozzo.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	"K. Y. Srinivasan" <kys@microsoft.com>
Subject: Re: [Qemu-devel] [PATCH v3 9/9] kvm/x86: Hyper-V kvm exit
Date: Tue, 3 Nov 2015 18:42:47 +0300	[thread overview]
Message-ID: <5638D5F7.4050805@virtuozzo.com> (raw)
In-Reply-To: <5638C9E4.2000903@redhat.com>



On 11/03/2015 05:51 PM, 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 probably found root case -
qemu reads/writes Hyper-V SynIC msrs just by check SynIC MSR's support 
in kernel. So KVM synic exits into userspace(at SynIC MSR's writes), 
while userspace Hyper-V SynIC handler doesn't expect this exit(cpu 
'hv-synic' option is not set), so handler returns -1 and qemu exits.
> Paolo
>

  reply	other threads:[~2015-11-03 15:43 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-16  7:07 [PATCH v2 0/9] Hyper-V synthetic interrupt controller Denis V. Lunev
2015-10-16  7:07 ` [Qemu-devel] " Denis V. Lunev
2015-10-16  7:07 ` [PATCH 1/9] kvm/eventfd: avoid loop inside irqfd_update() Denis V. Lunev
2015-10-16  7:07   ` [Qemu-devel] " Denis V. Lunev
2015-10-16  7:07 ` [PATCH 2/9] kvm/eventfd: factor out kvm_notify_acked_gsi() Denis V. Lunev
2015-10-16  7:07 ` Denis V. Lunev
2015-10-16  7:07   ` [Qemu-devel] " Denis V. Lunev
2015-10-16  7:07 ` [PATCH 3/9] kvm/eventfd: add arch-specific set_irq Denis V. Lunev
2015-10-16  7:07   ` [Qemu-devel] " Denis V. Lunev
2015-10-16  7:07 ` Denis V. Lunev
2015-10-16  7:07 ` [PATCH 4/9] kvm/irqchip: allow only multiple irqchip routes per GSI Denis V. Lunev
2015-10-16  7:07   ` [Qemu-devel] " Denis V. Lunev
2015-10-16  7:07 ` Denis V. Lunev
2015-10-16  7:07 ` [PATCH 5/9] kvm/irqchip: kvm_arch_irq_routing_update renaming split Denis V. Lunev
2015-10-16  7:07   ` [Qemu-devel] " Denis V. Lunev
2015-10-16  7:07 ` Denis V. Lunev
2015-10-16  7:07 ` [PATCH 6/9] drivers/hv: share Hyper-V SynIC constants with userspace Denis V. Lunev
2015-10-16  7:07 ` Denis V. Lunev
2015-10-16  7:07   ` [Qemu-devel] " Denis V. Lunev
2015-10-16  7:07 ` [PATCH 7/9] kvm/x86: split ioapic-handled and EOI exit bitmaps Denis V. Lunev
2015-10-16  7:07 ` Denis V. Lunev
2015-10-16  7:07   ` [Qemu-devel] " Denis V. Lunev
2015-10-16  7:07 ` [PATCH 8/9] kvm/x86: Hyper-V synthetic interrupt controller Denis V. Lunev
2015-10-16  7:07   ` [Qemu-devel] " Denis V. Lunev
2015-10-22 16:09   ` [PATCH v3 " Andrey Smetanin
2015-10-22 16:09     ` [Qemu-devel] " Andrey Smetanin
2015-10-28 17:41     ` Paolo Bonzini
2015-10-28 17:41       ` [Qemu-devel] " Paolo Bonzini
2015-10-29  8:45       ` Roman Kagan
2015-10-29  8:45         ` [Qemu-devel] " Roman Kagan
2015-10-29  9:51         ` Paolo Bonzini
2015-10-29  9:51           ` [Qemu-devel] " Paolo Bonzini
2015-10-29  8:50       ` Andrey Smetanin
2015-10-29  8:50         ` [Qemu-devel] " Andrey Smetanin
2015-10-16  7:07 ` [PATCH " Denis V. Lunev
2015-10-16  7:07 ` [PATCH 9/9] kvm/x86: Hyper-V kvm exit Denis V. Lunev
2015-10-16  7:07 ` Denis V. Lunev
2015-10-16  7:07   ` [Qemu-devel] " Denis V. Lunev
2015-10-16  7:51   ` Paolo Bonzini
2015-10-16  7:51   ` Paolo Bonzini
2015-10-16  7:51     ` [Qemu-devel] " Paolo Bonzini
2015-10-16 10:51     ` Roman Kagan
2015-10-16 10:51       ` [Qemu-devel] " Roman Kagan
2015-10-16 10:51     ` Roman Kagan
2015-10-22 16:10   ` [PATCH v3 " Andrey Smetanin
2015-10-22 16:10     ` [Qemu-devel] " Andrey Smetanin
2015-10-22 16:34     ` Paolo Bonzini
2015-10-22 16:34       ` [Qemu-devel] " Paolo Bonzini
2015-10-26 10:13       ` Denis V. Lunev
2015-10-26 10:13         ` [Qemu-devel] " Denis V. Lunev
2015-11-03 13:28     ` Paolo Bonzini
2015-11-03 13:28       ` [Qemu-devel] " Paolo Bonzini
2015-11-03 13:30       ` Andrey Smetanin
2015-11-03 13:30         ` [Qemu-devel] " Andrey Smetanin
2015-11-03 14:36       ` Andrey Smetanin
2015-11-03 14:36         ` [Qemu-devel] " Andrey Smetanin
2015-11-03 14:51         ` Paolo Bonzini
2015-11-03 14:51           ` [Qemu-devel] " Paolo Bonzini
2015-11-03 15:42           ` Andrey Smetanin [this message]
2015-11-03 15:42             ` Andrey Smetanin
2015-11-03 15:52           ` Roman Kagan
2015-11-03 15:52             ` Roman Kagan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5638D5F7.4050805@virtuozzo.com \
    --to=asmetanin@virtuozzo.com \
    --cc=den@openvz.org \
    --cc=gleb@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=kys@microsoft.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rkagan@virtiozzo.com \
    --cc=vkuznets@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.