Re: [PATCH] xen-pciback: Consider MSI-X enabled only when MASKALL bit is cleared

From: Andrew Cooper
Date: Thu Nov 17 2022 - 07:30:04 EST


On 17/11/2022 11:41, Marek Marczykowski-Górecki wrote:
> Linux enables MSI-X before disabling INTx, but keeps MSI-X masked until
> the table is filled. Then it disables INTx just before clearing MASKALL
> bit. Currently this approach is rejected by xen-pciback.
> Allow setting PCI_MSIX_FLAGS_ENABLE while INTx is still enabled as long
> as PCI_MSIX_FLAGS_MASKALL is set too.
>
> Fixes: 5e29500eba2a ("xen-pciback: Allow setting PCI_MSIX_FLAGS_MASKALL too")
> Signed-off-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>

The PCI spec states that devices are not permitted to use INTx when MSI
or MSI-X is enabled.  The mask status has no legitimate bearing on irq type.

INTx_DISABLE exists as a bodge to mean "INTx not permitted even when
neither MSI nor MSI-X are enabled", and exists because in some case,
transiently disabling MSI is the only safe way to update the descriptor.


I can believe that this change fixes a an issue, but the logic surely
cannot be correct overall.

~Andrew