WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] There are a couple of bugs with the current handling of

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] There are a couple of bugs with the current handling of reads and writes
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 05 Apr 2006 19:38:09 +0000
Delivery-date: Wed, 05 Apr 2006 14:28:52 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 576317252bf23e25fdb7f1c8aab3a615b2c322a1
# Parent  d1ddd7d35ed5387467cf4022e4d87b5bbca74553
There are a couple of bugs with the current handling of reads and writes
in the configuration space overlay functions. The wrong offset is passed
to the virtual field handlers. This patch uses the variable which
contains the correct offset. This patch also fixes the logic which
generates the actual value to write to a given virtual configuration
space field.

Signed-off-by: Ryan Wilson <hap9@xxxxxxxxxxxxxx>

diff -r d1ddd7d35ed5 -r 576317252bf2 
linux-2.6-xen-sparse/drivers/xen/pciback/conf_space.c
--- a/linux-2.6-xen-sparse/drivers/xen/pciback/conf_space.c     Wed Apr  5 
09:41:11 2006
+++ b/linux-2.6-xen-sparse/drivers/xen/pciback/conf_space.c     Wed Apr  5 
09:52:10 2006
@@ -106,7 +106,7 @@
 }
 
 static inline u32 merge_value(u32 val, u32 new_val, u32 new_val_mask,
-                             u32 offset)
+                             int offset)
 {
        if (offset >= 0) {
                new_val_mask <<= (offset * 8);
@@ -180,7 +180,8 @@
 
                if ((req_start >= field_start && req_start < field_end)
                    || (req_end > field_start && req_end <= field_end)) {
-                       err = conf_space_read(dev, cfg_entry, offset, &tmp_val);
+                       err = conf_space_read(dev, cfg_entry, field_start,
+                                             &tmp_val);
                        if (err)
                                goto out;
 
@@ -228,14 +229,16 @@
                    || (req_end > field_start && req_end <= field_end)) {
                        tmp_val = 0;
 
-                       err = pciback_config_read(dev, offset, size, &tmp_val);
+                       err = pciback_config_read(dev, field_start,
+                                                 field->size, &tmp_val);
                        if (err)
                                break;
 
                        tmp_val = merge_value(tmp_val, value, get_mask(size),
-                                             field_start - req_start);
-
-                       err = conf_space_write(dev, cfg_entry, offset, tmp_val);
+                                             req_start - field_start);
+
+                       err = conf_space_write(dev, cfg_entry, field_start,
+                                              tmp_val);
                        handled = 1;
                }
        }

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] There are a couple of bugs with the current handling of reads and writes, Xen patchbot -unstable <=