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