qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH RFC] vfio-pci: put device in INTx disable state in pre_reset
@ 2016-10-10  9:12 Cao jin
  2016-10-12  2:25 ` Alex Williamson
  0 siblings, 1 reply; 3+ messages in thread
From: Cao jin @ 2016-10-10  9:12 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.williamson

Current code cleared the PCI_COMMAND_INTX_DISABLE, which indicates
device/function could asserts its INTx# signal.

PCI local spec says:
A value of 0 enables the assertion of its INTx# signal.
A value of 1 disables the assertion of its INTx# signal.

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
---
I guess it is a mistake, clearing the bit to enable INTx violate
the intention of vfio_disable_interrupts above.

 hw/vfio/pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index a5a620a..cce3024 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -1898,8 +1898,8 @@ static void vfio_pci_pre_reset(VFIOPCIDevice *vdev)
      * Also put INTx Disable in known state.
      */
     cmd = vfio_pci_read_config(pdev, PCI_COMMAND, 2);
-    cmd &= ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER |
-             PCI_COMMAND_INTX_DISABLE);
+    cmd &= ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER) |
+             PCI_COMMAND_INTX_DISABLE;
     vfio_pci_write_config(pdev, PCI_COMMAND, cmd, 2);
 }
 
-- 
2.1.0

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

end of thread, other threads:[~2016-10-12  4:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-10  9:12 [Qemu-devel] [PATCH RFC] vfio-pci: put device in INTx disable state in pre_reset Cao jin
2016-10-12  2:25 ` Alex Williamson
2016-10-12  4:02   ` Cao jin

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).