]> xenbits.xensource.com Git - xen.git/commit
pci: clear {host/guest}_maskall field on assign
authorRoger Pau Monné <roger.pau@citrix.com>
Thu, 10 Oct 2019 08:59:27 +0000 (10:59 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 10 Oct 2019 08:59:27 +0000 (10:59 +0200)
commit575e18d54d19eda787f6477a4acd3c50f72751a9
tree3e7383e5057930767d16eedbb72589a776d45ce3
parentaf9f357fb8dbceb9c5dd1c5cb8b4e198f6149456
pci: clear {host/guest}_maskall field on assign

The current implementation of host_maskall makes it sticky across
assign and deassign calls, which means that once a guest forces Xen to
set host_maskall the maskall bit is not going to be cleared until a
call to PHYSDEVOP_prepare_msix is performed. Such call however
shouldn't be part of the normal flow when doing PCI passthrough, and
hence the flag needs to be cleared when assigning in order to prevent
host_maskall being carried over from previous assignations.

Note that the entry maskbit is reset when the msix capability is
initialized, and the guest_maskall field is also cleared so that the
hardware value matches Xen's internal state (hardware maskall =
host_maskall | guest_maskall).

Also note that doing the reset of host_maskall there would allow the
guest to reset such field by enabling and disabling MSIX, which is not
intended.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Chao Gao <chao.gao@intel.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/arch/x86/msi.c
xen/drivers/passthrough/pci.c
xen/include/asm-x86/msi.h