From: Alex Williamson <alex.williamson@redhat.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Thomas Gleixner <tglx@linutronix.de>,
kvm@vger.kernel.org, quic_bqiang@quicinc.com, kvalo@kernel.org,
prestwoj@gmail.com, linux-wireless@vger.kernel.org,
ath11k@lists.infradead.org, dwmw2@infradead.org,
iommu@lists.linux.dev, kernel@quicinc.com,
johannes@sipsolutions.net, jtornosm@redhat.com
Subject: Re: [PATCH RFC/RFT] vfio/pci: Create feature to disable MSI virtualization
Date: Wed, 14 Aug 2024 08:55:05 -0600 [thread overview]
Message-ID: <20240814085505.60819623.alex.williamson@redhat.com> (raw)
In-Reply-To: <20240813231642.GR1985367@ziepe.ca>
On Tue, 13 Aug 2024 20:16:42 -0300
Jason Gunthorpe <jgg@ziepe.ca> wrote:
> On Tue, Aug 13, 2024 at 03:14:01PM -0600, Alex Williamson wrote:
>
> > > Personally, I very much dislike this. Encouraging such hacky driver
> > > use of the interrupt subsystem is not a good direction. Enabling this
> > > in VMs will further complicate fixing the IRQ usages in these drivers
> > > over the long run.
> >
> > Clearly these _guest_ drivers are doing this regardless of the
> > interfaces provided by vfio, so I don't see how we're encouraging hacky
> > driver behavior, especially when it comes to Windows guest drivers.
>
> Because people will then say the Linux driver can't be fixed to
> properly use an irq_domain/etc as the only option that works in VMs
> will be the hacky copy from MSI-X approach :\
Ironically QEMU already has direct access to the MSI-X vector table in
MMIO space and could implement this type of quirk with no kernel
changes. It's MSI that is now blocked by virtualization of the address
and data registers. Note also that QEMU is still virtualizing these
registers, the values seen in the guest are unchanged. It's only the
VMM that can bypass that virtualization to see the host values.
Let's imagine the guest driver does change to implement an irq_domain.
How does that fundamentally change the problem for the VMM that guest
MSI values are being written to other portions of the device? The
guest driver can have whatever architecture it wants (we don't know
the architecture of the Windows driver) but we still need to trap
writes of the guest MSI address/data and replace it with host values.
> > > Thomas Gleixner has done alot of great work recently to clean this up.
> > >
> > > So if you imagine the driver is fixed, then this is not necessary.
> >
> > How so?
>
> Because if the driver is properly using the new irq_domain/etc
> infrastructure to model its additional interrupt source then this
> patch won't make it work in the VM anyhow, so it is not necessary..
>
> Your other patch would be the only short term answer.
The QEMU patch relies on this kernel patch in order to be able to
access the host physical MSI address and data values through the vfio
interface. Otherwise QEMU has no host values with which to patch-up
guest values. As noted above, this does not provide any visible change
to a QEMU guest, it only enables QEMU to implement the quirk in the
other patch. Thanks,
Alex
next prev parent reply other threads:[~2024-08-14 14:55 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-08 13:17 ath11k and vfio-pci support James Prestwood
2024-01-10 9:00 ` Kalle Valo
2024-01-10 13:04 ` James Prestwood
2024-01-10 13:49 ` Kalle Valo
2024-01-10 14:55 ` James Prestwood
2024-01-11 3:51 ` Baochen Qiang
2024-01-11 8:16 ` Kalle Valo
2024-01-11 12:48 ` James Prestwood
2024-01-11 13:11 ` Kalle Valo
2024-01-11 13:38 ` James Prestwood
2024-01-12 2:04 ` Baochen Qiang
2024-01-12 12:47 ` James Prestwood
2024-01-14 12:37 ` Baochen Qiang
2024-01-14 14:36 ` Kalle Valo
2024-01-15 17:46 ` Alex Williamson
2024-01-16 10:08 ` Baochen Qiang
2024-01-16 10:41 ` David Woodhouse
2024-01-16 15:29 ` Jason Gunthorpe
2024-01-16 18:28 ` Alex Williamson
2024-01-16 21:10 ` Jeff Johnson
2024-01-17 5:47 ` Baochen Qiang
2024-03-21 19:14 ` Johannes Berg
2024-01-16 13:05 ` James Prestwood
2024-01-17 5:26 ` Baochen Qiang
2024-01-17 13:20 ` James Prestwood
2024-01-17 13:43 ` Kalle Valo
2024-01-17 14:25 ` James Prestwood
2024-01-18 2:09 ` Baochen Qiang
2024-01-19 17:52 ` James Prestwood
2024-01-19 17:57 ` Kalle Valo
2024-01-19 18:07 ` James Prestwood
2024-01-26 18:20 ` James Prestwood
2024-01-27 4:31 ` Baochen Qiang
2024-08-12 16:59 ` [PATCH RFC/RFT] vfio/pci: Create feature to disable MSI virtualization Alex Williamson
2024-08-13 16:30 ` Jason Gunthorpe
2024-08-13 17:30 ` Thomas Gleixner
2024-08-13 23:39 ` Jason Gunthorpe
2024-12-13 9:10 ` David Woodhouse
2025-01-03 14:31 ` Jason Gunthorpe
2025-01-03 14:47 ` David Woodhouse
2025-01-03 15:19 ` Jason Gunthorpe
2024-08-13 21:14 ` Alex Williamson
2024-08-13 23:16 ` Jason Gunthorpe
2024-08-14 14:55 ` Alex Williamson [this message]
2024-08-14 15:20 ` Jason Gunthorpe
2024-08-12 17:00 ` [PATCH RFC/RFT] vfio/pci-quirks: Quirk for ath wireless Alex Williamson
2024-08-13 16:43 ` Jason Gunthorpe
2024-08-13 21:03 ` Alex Williamson
2024-08-13 23:37 ` Jason Gunthorpe
2024-08-15 16:59 ` Alex Williamson
2024-08-15 17:19 ` Jason Gunthorpe
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=20240814085505.60819623.alex.williamson@redhat.com \
--to=alex.williamson@redhat.com \
--cc=ath11k@lists.infradead.org \
--cc=dwmw2@infradead.org \
--cc=iommu@lists.linux.dev \
--cc=jgg@ziepe.ca \
--cc=johannes@sipsolutions.net \
--cc=jtornosm@redhat.com \
--cc=kernel@quicinc.com \
--cc=kvalo@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=prestwoj@gmail.com \
--cc=quic_bqiang@quicinc.com \
--cc=tglx@linutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).