Re: [PATCH v2 8/8] pci-assign: Update MSI-X config based on table writes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2012-02-01 14:48, Alex Williamson wrote:
> On Wed, 2012-02-01 at 09:22 +0200, Michael S. Tsirkin wrote:
>> On Tue, Jan 31, 2012 at 10:33:14PM -0700, Alex Williamson wrote:
>>> When a guest enables MSI-X in PCI configuration space we walk
>>> through the MSI-X vector table trying to guess what might get
>>> used.  We have to guess because we don't do anything with
>>> writes to the vector table, so we look for clues ahead of time
>>> to pre-enable the vectors we think will be used.  This means
>>> that instead of doing the sane thing and test the mask bit, we
>>> test whether the data field contains a non-zero value.  It's
>>> amazing this works as well as it does.
>>>
>>> However, two key things missed by doing this is that we don't
>>> catch vector changes after enabling (ex. setting smp_affinity
>>> on an irq) and we don't support guests that don't touch the
>>> vector table prior to enabling the MSI-X capability (ex.
>>> freebsd).  This patch fixes both of these problems.
>>>
>>> NB we're not actually masking vectors yet with this patch as
>>> it's unclear whether we really have the ability to do this
>>> without losing interrupts.
>>>
>>> Signed-off-by: Alex Williamson <alex.williamson@xxxxxxxxxx>
>>
>> Overall I think this is better than what we have now.
>> One question though: would it make sense to use msix mask notifiers
>> instead of parsing msix tables on your own?
> 
> Based on vfio, I think some minor changes would be necessary to the msix
> core to port to that infrastructure.

The core will require more changes as the current way of dealing with
KVM support for MSI[-X] is not upstreamable. This will affect the mask
notifier concept more or less as well.

>  I don't think I'd want to use this
> code to push those changes since it likely won't get ported to qemu.git.

I'm pretty sure we will have pci assignment based on the KVM kernel
support upstream as well, simply because VFIO will take a while to show
up fully functional in distro kernels and because there is not that much
work required in addition to the core refactoring that we need to do anyway.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux