pci-assign: Update MSI-X config based on table writes
commita6b402c989cc83e38bdbccf570296eb8d64fe5af
authorAlex Williamson <alex.williamson@redhat.com>
Wed, 1 Feb 2012 05:33:14 +0000 (31 22:33 -0700)
committerMarcelo Tosatti <mtosatti@redhat.com>
Tue, 7 Feb 2012 20:03:46 +0000 (7 18:03 -0200)
tree4da9b2f28664556920a928ceb43577aec30b692b
parent09f4e0bdad19de85a1470badaa019833a90f0698
pci-assign: Update MSI-X config based on table writes

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@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
hw/device-assignment.c