x86/vPCI: tolerate (un)masking a disabled MSI-X entry
authorJan Beulich <jbeulich@suse.com>
Tue, 5 Jan 2021 12:17:54 +0000 (13:17 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 5 Jan 2021 12:17:54 +0000 (13:17 +0100)
commit04b090366ca59e8a75837c822df261a8d0bd1a30
tree367b6fb21ad8f41b28aebffdd89a3d6d8d77c619
parentb06ffca9e7c9a6088e98a8d72e905c03dc585225
x86/vPCI: tolerate (un)masking a disabled MSI-X entry

None of the four reasons causing vpci_msix_arch_mask_entry() to get
called (there's just a single call site) are impossible or illegal prior
to an entry actually having got set up:
- the entry may remain masked (in this case, however, a prior masked ->
  unmasked transition would already not have worked),
- MSI-X may not be enabled,
- the global mask bit may be set,
- the entry may not otherwise have been updated.
Hence the function asserting that the entry was previously set up was
simply wrong. Since the caller tracks the masked state (and setting up
of an entry would only be effected when that software bit is clear),
it's okay to skip both masking and unmasking requests in this case.

Fixes: d6281be9d0145 ('vpci/msix: add MSI-X handlers')
Reported-by: Manuel Bouyer <bouyer@antioche.eu.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Tested-by: Manuel Bouyer <bouyer@antioche.eu.org>
xen/arch/x86/hvm/vmsi.c