From: Alex Williamson <alex.williamson@redhat.com>
To: Tom Lyon <pugs@cisco.com>
Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
kvm@vger.kernel.org
Subject: Re: [PATCH 0/2] vfio: virtualize INTX_DISABLE
Date: Tue, 09 Nov 2010 20:07:33 -0700 [thread overview]
Message-ID: <1289358453.14321.88.camel@x201> (raw)
In-Reply-To: <201011091659.04480.pugs@cisco.com>
On Tue, 2010-11-09 at 16:59 -0800, Tom Lyon wrote:
> Alex - I am rejecting these 2 patches.
>
> For patch 1/2, I started with yours and found a couple of problems, but then I
> got into the spirit and did a buinch more cleaning up. My patch to follow.
Great, I'll take a look.
> For patch 2/2, the INTX stuff, I don't really see the problem. If the user
> turns on the bit, it'll result in at most one more interrupt, right? If he
> turns off the bit, then he doesn't want interrupts.
The scenario I'm thinking of is that an interrupt comes in, VFIO sets
INTX_DISABLE, signals eventfd. We're already in a little bit of a weird
state for a VM because INTX_DISABLE just changed on it's own. The guest
interrupt handler blindly sets INTX_DISABLE again, and services the
interrupt. This has the side effect of sending the emulated APIC EOI,
which ends with VFIO clearing INTX_DISABLE, and now the guest is getting
interrupts it's not expecting.
Another aspect of it is that since the non-PCI-2.3/EOI patches, the VFIO
interrupt handler is wrapped around an irq_disabled check, where
irq_disabled only gets cleared by the EOI interfaces. So userspace
might clear INTX_DISABLE and expect new INTx eventfds, but it won't
happen without an EOI call. If we virtualize INTX_DISABLE, we can allow
userspace to use either the EOI interfaces or (in)directly manipulate
INTX_DISABLE from config space.
I could also virtualize the INTX_DISABLE bit in the qemu VFIO driver but
it gets a little bit tricky that I need to disable the EOI_EVENTFD to be
sure to catch all the EOIs in userspace. Emulating INTX_DISABLE for
non-PCI 2.3 devices is also a little more cumbersome from userspace, but
ultimately I'm not sure how valuable that is anyway. Overall, I figured
the above behavior issues were probably sufficient to implement it for
everyone in the VFIO driver.
Alex
prev parent reply other threads:[~2010-11-10 3:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-05 17:30 [PATCH 0/2] vfio: virtualize INTX_DISABLE Alex Williamson
2010-11-05 17:30 ` [PATCH 1/2] vfio: Fix config space virtualization Alex Williamson
2010-11-05 17:31 ` [PATCH 2/2] vfio: Virtualize PCI_COMMAND_INTX_DISABLE Alex Williamson
2010-11-10 0:59 ` [PATCH 0/2] vfio: virtualize INTX_DISABLE Tom Lyon
2010-11-10 3:07 ` Alex Williamson [this message]
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=1289358453.14321.88.camel@x201 \
--to=alex.williamson@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=pugs@cisco.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.