Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: kvm@vger.kernel.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"Alex Williamson" <alex.williamson@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>
Subject: Re: [PATCH] kvm: Check irqchip mode before assign irqfd
Date: Fri, 17 May 2019 10:23:54 +0800	[thread overview]
Message-ID: <20190517022354.GM16681@xz-x1> (raw)
In-Reply-To: <20190505092022.GL29750@xz-x1>

On Sun, May 05, 2019 at 05:20:22PM +0800, Peter Xu wrote:
> On Sun, May 05, 2019 at 04:56:42PM +0800, Peter Xu wrote:
> > When assigning kvm irqfd we didn't check the irqchip mode but we allow
> > KVM_IRQFD to succeed with all the irqchip modes.  However it does not
> > make much sense to create irqfd even without the kernel chips.  Let's
> > provide a arch-dependent helper to check whether a specific irqfd is
> > allowed by the arch.  At least for x86, it should make sense to check:
> > 
> > - when irqchip mode is NONE, all irqfds should be disallowed, and,
> > 
> > - when irqchip mode is SPLIT, irqfds that are with resamplefd should
> >   be disallowed.
> > 
> > For either of the case, previously we'll silently ignore the irq or
> > the irq ack event if the irqchip mode is incorrect.  However that can
> > cause misterious guest behaviors and it can be hard to triage.  Let's
> > fail KVM_IRQFD even earlier to detect these incorrect configurations.
> > 
> > CC: Paolo Bonzini <pbonzini@redhat.com>
> > CC: Radim Krčmář <rkrcmar@redhat.com>
> > CC: Alex Williamson <alex.williamson@redhat.com>
> > CC: Eduardo Habkost <ehabkost@redhat.com>
> > Signed-off-by: Peter Xu <peterx@redhat.com>
> 
> Note: haven't tested, but IIUC QEMU's vfio will naturally fall back to
> no-irqfd mode (actually virtio seems to also have this but virtio
> should not be affected after all) if the KVM_IRQFD ioctl failed so I
> feel like this patch could also at least fix the broken guests
> reported besides any future fixes from QEMU side on the issue:
> 
> https://bugs.launchpad.net/qemu/+bug/1826422

Ping - Paolo, should patch still worth to have before the complete fix
between split irqchip & resamplefds?

Thanks,

-- 
Peter Xu

  reply	other threads:[~2019-05-17  2:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-05  8:56 [PATCH] kvm: Check irqchip mode before assign irqfd Peter Xu
2019-05-05  9:20 ` Peter Xu
2019-05-17  2:23   ` Peter Xu [this message]
2019-05-20 12:54 ` Paolo Bonzini

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=20190517022354.GM16681@xz-x1 \
    --to=peterx@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox