xen/pt: allow QEMU to request MSI unmasking at bind time
commita8036336609d2e184fc3543a4c439c0ba7d7f3a2
authorRoger Pau Monne <roger.pau@citrix.com>
Thu, 24 Aug 2017 15:07:03 +0000 (24 16:07 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Thu, 21 Sep 2017 02:05:27 +0000 (20 19:05 -0700)
tree7d7d312ebc27ee49c12cc0411ac22e4034c74db4
parenta3fd781f653db4dc76635715207c9029208634bd
xen/pt: allow QEMU to request MSI unmasking at bind time

When a MSI interrupt is bound to a guest using
xc_domain_update_msi_irq (XEN_DOMCTL_bind_pt_irq) the interrupt is
left masked by default.

This causes problems with guests that first configure interrupts and
clean the per-entry MSIX table mask bit and afterwards enable MSIX
globally. In such scenario the Xen internal msixtbl handlers would not
detect the unmasking of MSIX entries because vectors are not yet
registered since MSIX is not enabled, and vectors would be left
masked.

Introduce a new flag in the gflags field to signal Xen whether a MSI
interrupt should be unmasked after being bound.

This also requires to track the mask register for MSI interrupts, so
QEMU can also notify to Xen whether the MSI interrupt should be bound
masked or unmasked

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reported-by: Andreas Kinzler <hfp@posteo.de>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
hw/xen/xen_pt.h
hw/xen/xen_pt_config_init.c
hw/xen/xen_pt_msi.c