]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.9/xen-pciback-don-t-disable-pci_command-on-pci-device-reset.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / queue-4.9 / xen-pciback-don-t-disable-pci_command-on-pci-device-reset.patch
1 From 7681f31ec9cdacab4fd10570be924f2cef6669ba Mon Sep 17 00:00:00 2001
2 From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
3 Date: Wed, 13 Feb 2019 18:21:31 -0500
4 Subject: xen/pciback: Don't disable PCI_COMMAND on PCI device reset.
5
6 From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
7
8 commit 7681f31ec9cdacab4fd10570be924f2cef6669ba upstream.
9
10 There is no need for this at all. Worst it means that if
11 the guest tries to write to BARs it could lead (on certain
12 platforms) to PCI SERR errors.
13
14 Please note that with af6fc858a35b90e89ea7a7ee58e66628c55c776b
15 "xen-pciback: limit guest control of command register"
16 a guest is still allowed to enable those control bits (safely), but
17 is not allowed to disable them and that therefore a well behaved
18 frontend which enables things before using them will still
19 function correctly.
20
21 This is done via an write to the configuration register 0x4 which
22 triggers on the backend side:
23 command_write
24 \- pci_enable_device
25 \- pci_enable_device_flags
26 \- do_pci_enable_device
27 \- pcibios_enable_device
28 \-pci_enable_resourcess
29 [which enables the PCI_COMMAND_MEMORY|PCI_COMMAND_IO]
30
31 However guests (and drivers) which don't do this could cause
32 problems, including the security issues which XSA-120 sought
33 to address.
34
35 Reported-by: Jan Beulich <jbeulich@suse.com>
36 Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
37 Reviewed-by: Prarit Bhargava <prarit@redhat.com>
38 Signed-off-by: Juergen Gross <jgross@suse.com>
39 Cc: Ben Hutchings <ben.hutchings@codethink.co.uk>
40 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
41
42 ---
43 drivers/xen/xen-pciback/pciback_ops.c | 2 --
44 1 file changed, 2 deletions(-)
45
46 --- a/drivers/xen/xen-pciback/pciback_ops.c
47 +++ b/drivers/xen/xen-pciback/pciback_ops.c
48 @@ -126,8 +126,6 @@ void xen_pcibk_reset_device(struct pci_d
49 if (pci_is_enabled(dev))
50 pci_disable_device(dev);
51
52 - pci_write_config_word(dev, PCI_COMMAND, 0);
53 -
54 dev->is_busmaster = 0;
55 } else {
56 pci_read_config_word(dev, PCI_COMMAND, &cmd);