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>