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