hitmoon / rpms / kernel

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