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