995f293
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
995f293
Date: Fri, 27 Mar 2015 13:31:11 -0400
995f293
Subject: [PATCH] xen/pciback: Don't disable PCI_COMMAND on PCI device reset.
995f293
995f293
There is no need for this at all. Worst it means that if
995f293
the guest tries to write to BARs it could lead (on certain
995f293
platforms) to PCI SERR errors.
995f293
995f293
Please note that with af6fc858a35b90e89ea7a7ee58e66628c55c776b
995f293
"xen-pciback: limit guest control of command register"
995f293
a guest is still allowed to enable those control bits (safely), but
995f293
is not allowed to disable them and that therefore a well behaved
995f293
frontend which enables things before using them will still
995f293
function correctly.
995f293
995f293
This is done via an write to the configuration register 0x4 which
995f293
triggers on the backend side:
995f293
command_write
995f293
  \- pci_enable_device
995f293
     \- pci_enable_device_flags
995f293
        \- do_pci_enable_device
995f293
           \- pcibios_enable_device
995f293
              \-pci_enable_resourcess
995f293
                [which enables the PCI_COMMAND_MEMORY|PCI_COMMAND_IO]
995f293
995f293
However guests (and drivers) which don't do this could cause
995f293
problems, including the security issues which XSA-120 sought
995f293
to address.
995f293
995f293
Reported-by: Jan Beulich <jbeulich@suse.com>
995f293
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
995f293
---
995f293
 drivers/xen/xen-pciback/pciback_ops.c | 2 --
995f293
 1 file changed, 2 deletions(-)
995f293
995f293
diff --git a/drivers/xen/xen-pciback/pciback_ops.c b/drivers/xen/xen-pciback/pciback_ops.c
995f293
index c4a0666de6f5..26e651336787 100644
995f293
--- a/drivers/xen/xen-pciback/pciback_ops.c
995f293
+++ b/drivers/xen/xen-pciback/pciback_ops.c
995f293
@@ -119,8 +119,6 @@ void xen_pcibk_reset_device(struct pci_dev *dev)
995f293
 		if (pci_is_enabled(dev))
995f293
 			pci_disable_device(dev);
995f293
 
995f293
-		pci_write_config_word(dev, PCI_COMMAND, 0);
995f293
-
995f293
 		dev->is_busmaster = 0;
995f293
 	} else {
995f293
 		pci_read_config_word(dev, PCI_COMMAND, &cmd);
995f293
-- 
995f293
2.1.0
995f293