interrupts: allow guest to set/clear MSI-X mask bit
authorJoby Poriyath <joby.poriyath@citrix.com>
Tue, 20 Aug 2013 15:04:21 +0000 (17:04 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 20 Aug 2013 15:04:21 +0000 (17:04 +0200)
commit54a46bce768033b1c36e25eace15f7abde972389
treed4920e36748ea37613050e874e91ffefb05d7346
parent5263507b1b4ad5417871d8297f315d7b204426d4
interrupts: allow guest to set/clear MSI-X mask bit

Guest needs the ability to enable and disable MSI-X interrupts
by setting the MSI-X control bit, for a passed-through device.
Guest is allowed to write MSI-X mask bit only if Xen *thinks*
that mask is clear (interrupts enabled). If the mask is set by
Xen (interrupts disabled), writes to mask bit by the guest is
ignored.

Currently, a write to MSI-X mask bit by the guest is silently
ignored.

A likely scenario is where we have a 82599 SR-IOV nic passed
through to a guest. From the guest if you do

  ifconfig <ETH_DEV> down
  ifconfig <ETH_DEV> up

the interrupts remain masked. On VF reset, the mask bit is set
by the controller. At this point, Xen is not aware that mask is set.
However, interrupts are enabled by VF driver by clearing the mask
bit by writing directly to BAR3 region containing the MSI-X table.

From dom0, we can verify that
interrupts are being masked using 'xl debug-keys M'.

Initially, guest was allowed to modify MSI-X bit.
Later this behaviour was changed.
See changeset 74c213c506afcd74a8556dd092995fd4dc38b225.

Signed-off-by: Joby Poriyath <joby.poriyath@citrix.com>
[jb: add assertion to msixtbl_pt_register()]
xen/arch/x86/hvm/vmsi.c