xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [Xen-devel] [PATCH] pci: clear host_maskall field on assign
@ 2019-10-02 10:49 Roger Pau Monne
  2019-10-02 13:33 ` Jan Beulich
  2019-10-04 23:58 ` Chao Gao
  0 siblings, 2 replies; 13+ messages in thread
From: Roger Pau Monne @ 2019-10-02 10:49 UTC (permalink / raw)
  To: xen-devel; +Cc: Chao Gao, Spassov, Stanislav, Jan Beulich, Roger Pau Monne

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 other mask fields, like guest_masked or the entry maskbit
are already reset when the msix capability is initialized. 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>
---
Cc: Chao Gao <chao.gao@intel.com>
Cc: "Spassov, Stanislav" <stanspas@amazon.de>
Cc: Pasi Kärkkäinen <pasik@iki.fi>
---
Chao, Stanislav, can you please check if this patch fixes your
issues?
---
 xen/drivers/passthrough/pci.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 7deef2f12b..b4f1ac2dd9 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -1504,7 +1504,10 @@ static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn, u32 flag)
     }
 
     if ( pdev->msix )
+    {
         msixtbl_init(d);
+        pdev->msix->host_maskall = false;
+    }
 
     pdev->fault.count = 0;
 
-- 
2.23.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-10-08 14:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-02 10:49 [Xen-devel] [PATCH] pci: clear host_maskall field on assign Roger Pau Monne
2019-10-02 13:33 ` Jan Beulich
2019-10-08  9:23   ` Roger Pau Monné
2019-10-08  9:42     ` Jan Beulich
2019-10-08 11:09       ` Roger Pau Monné
2019-10-08 11:28         ` Jan Beulich
2019-10-08 13:14           ` Roger Pau Monné
2019-10-08 13:32             ` Jan Beulich
2019-10-08 14:16               ` Roger Pau Monné
2019-10-08 14:21                 ` Jan Beulich
2019-10-04 23:58 ` Chao Gao
2019-10-07  7:38   ` Jan Beulich
2019-10-08  6:18     ` Chao Gao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).