[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] pciback: fix conf_space read/write overlap check


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-linux-2.6.18-xen <patchbot@xxxxxxx>
  • Date: Fri, 24 Jun 2016 09:00:02 +0000
  • Delivery-date: Fri, 24 Jun 2016 09:00:10 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Andrey Grodzovsky <andrey2805@xxxxxxxxx>
# Date 1466758679 -7200
#      Fri Jun 24 10:57:59 2016 +0200
# Node ID 200d580e141c1dc8bc4436073f54be7f50393acd
# Parent  7b1fb51f18e393f89fa752ca9eefb3084d40e73d
pciback: fix conf_space read/write overlap check

Current overlap check is evaluating to false a case where a filter field
is fully contained (proper subset) of a r/w request.
This change applies classical overlap check instead to include
all the scenarios.

More specifically, for (Hilscher GmbH CIFX 50E-DP(M/S)) device
driver the logic is such that the entire confspace is read and
written in 4 byte chunks.In this case as an example, CACHE_LINE_SIZE,
LATENCY_TIMER and PCI_BIST are arriving together in one call to
xen_pcibk_config_write with offset == 0xc and size == 4.
With the existing overlap check LATENCY_TIMER field
(offset == 0xd, length == 1) is fully contained in the write request
and hence is excluded from write, which is incorrect.

Related to https://www.mail-archive.com/xen-devel@xxxxxxxxxxxxx/msg72174.html

Signed-off-by: Andrey Grodzovsky <andrey2805@xxxxxxxxx>
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
Reviewed-by: David Vrabel <david.vrabel@xxxxxxxxxx>
Acked-by: Juergen Gross <jgross@xxxxxxxx>
Committed-by: Jan Beulich <jbeulich@xxxxxxxx>
---


diff -r 7b1fb51f18e3 -r 200d580e141c drivers/xen/pciback/conf_space.c
--- a/drivers/xen/pciback/conf_space.c  Fri Jun 24 10:54:36 2016 +0200
+++ b/drivers/xen/pciback/conf_space.c  Fri Jun 24 10:57:59 2016 +0200
@@ -179,8 +179,7 @@ int pciback_config_read(struct pci_dev *
                field_start = OFFSET(cfg_entry);
                field_end = OFFSET(cfg_entry) + field->size;
 
-               if ((req_start >= field_start && req_start < field_end)
-                   || (req_end > field_start && req_end <= field_end)) {
+               if (req_end > field_start && field_end > req_start) {
                        err = conf_space_read(dev, cfg_entry, field_start,
                                              &tmp_val);
                        if (err)
@@ -226,8 +225,7 @@ int pciback_config_write(struct pci_dev 
                field_start = OFFSET(cfg_entry);
                field_end = OFFSET(cfg_entry) + field->size;
 
-               if ((req_start >= field_start && req_start < field_end)
-                   || (req_end > field_start && req_end <= field_end)) {
+               if (req_end > field_start && field_end > req_start) {
                        tmp_val = 0;
 
                        err = pciback_config_read(dev, field_start,

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.