From: Alex Williamson <alex.williamson@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Micah Morton <mortonm@chromium.org>,
Auger Eric <eric.auger@redhat.com>,
kvm@vger.kernel.org, jmattson@google.com
Subject: Re: [RFC PATCH] KVM: Add module for IRQ forwarding
Date: Thu, 14 May 2020 16:43:27 -0600 [thread overview]
Message-ID: <20200514164327.72734a77@w520.home> (raw)
In-Reply-To: <9d5d7eec-77dd-bca9-949f-8f39fcd7d8d7@redhat.com>
On Thu, 14 May 2020 23:17:29 +0200
Paolo Bonzini <pbonzini@redhat.com> wrote:
> On 14/05/20 19:44, Micah Morton wrote:
> > I realize this may seem like an over-use of VFIO, but I'm actually
> > coming from the angle of wanting to assign _most_ of the important
> > hardware on my device to a VM guest, and I'm looking to avoid
> > emulation wherever possible. Of course there will be devices like the
> > IOAPIC for which emulation is unavoidable, but I think emulation is
> > avoidable here for the busses we've mentioned if there is a way to
> > forward arbitrary interrupts into the guest.
> >
> > Since all these use cases are so close to working with vfio-pci right
> > out of the box, I was really hoping to come up with a simple and
> > generic solution to the arbitrary interrupt problem that can be used
> > for multiple bus types.
>
> I shall defer to Alex on this, but I think the main issue here is that
> these interrupts are not visible to Linux as pertaining to the pci-stub
> device. Is this correct?
Yes. Allowing a user to grant themselves access to an arbitrary
interrupt is a non-starter, vfio-pci needs to somehow know that the
user is entitled to that interrupt. If we could do that, then we could
just add it as a device specific interrupt. But how do we do that?
The quirk method to this might be to key off of the PCI vendor and
device ID of the PCI i2c controller, lookup DMI information to know if
we're on the platform that has this fixed association, and setup the
extra interrupt. The more extensible, but potentially bloated solution
might be for vfio-pci to recognize the class code for a i2c controller
and implement a very simple bus walk at device probe time that collects
external dependencies. I don't really know how the jump is made from
that bus walk to digging the interrupt resource out of ACPI though or
how many LoC would be required to perform the minimum possible
discovery to collect this association.
I notice in this RFC patch that you're using an exclusive interrupt for
level triggered interrupts and therefore masking at the APIC.
Requiring an exclusive interrupt is often a usability issue for PCI
devices that don't support DisINTx and obviously we don't have that for
non-PCI sub-devices. What type of interrupt do you actually need for
this device? Thanks,
Alex
next prev parent reply other threads:[~2020-05-14 22:43 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-11 22:00 [RFC PATCH] KVM: Add module for IRQ forwarding Micah Morton
2020-05-12 17:14 ` Alex Williamson
2020-05-13 7:02 ` Paolo Bonzini
2020-05-13 14:34 ` Alex Williamson
2020-05-13 15:23 ` Paolo Bonzini
2020-05-13 19:10 ` Micah Morton
2020-05-13 22:05 ` Paolo Bonzini
2020-05-14 17:44 ` Micah Morton
2020-05-14 21:17 ` Paolo Bonzini
2020-05-14 22:43 ` Alex Williamson [this message]
2020-05-15 20:30 ` Micah Morton
2020-06-03 18:23 ` [PATCH] vfio: PoC patch for printing IRQs used by i2c devices Micah Morton
2020-06-09 20:19 ` Micah Morton
2020-06-19 18:51 ` Alex Williamson
2020-06-19 20:00 ` Micah Morton
2020-06-22 21:59 ` Micah Morton
2020-05-15 10:11 ` [RFC PATCH] KVM: Add module for IRQ forwarding Auger Eric
2020-05-15 16:39 ` Micah Morton
2020-05-13 21:52 ` Micah Morton
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=20200514164327.72734a77@w520.home \
--to=alex.williamson@redhat.com \
--cc=eric.auger@redhat.com \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=mortonm@chromium.org \
--cc=pbonzini@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