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