zwp10758 / rpms / kernel

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