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] Allow pciback to be placed into a permissive mode of ope

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Allow pciback to be placed into a permissive mode of operation whereby it allows
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 08 Mar 2006 18:28:08 +0000
Delivery-date: Wed, 08 Mar 2006 18:28:50 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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 42a1f6ffd0e9567a04175f1899c033f6e1d4d2df
# Parent  aae274b4c1a739f70abf2dd1f3d7629bc37ccc6c
Allow pciback to be placed into a permissive mode of operation whereby it allows
PCI config writes to succeed by default. Currently this is the only way to allow
control of a device that has device-specific registers in the config space from
a driver domain.

echo Y >/sys/module/pciback/parameters/permissive

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r aae274b4c1a7 -r 42a1f6ffd0e9 
linux-2.6-xen-sparse/drivers/xen/pciback/conf_space.c
--- a/linux-2.6-xen-sparse/drivers/xen/pciback/conf_space.c     Wed Mar  8 
14:51:28 2006
+++ b/linux-2.6-xen-sparse/drivers/xen/pciback/conf_space.c     Wed Mar  8 
16:32:36 2006
@@ -13,6 +13,9 @@
 #include <linux/pci.h>
 #include "pciback.h"
 #include "conf_space.h"
+
+static int permissive = 0;
+module_param(permissive, bool, 0644);
 
 #define DEFINE_PCI_CONFIG(op,size,type)                                        
\
 int pciback_##op##_config_##size                                               
        \
@@ -198,7 +201,7 @@
 
 int pciback_config_write(struct pci_dev *dev, int offset, int size, u32 value)
 {
-       int err = 0;
+       int err = 0, handled = 0;
        struct pciback_dev_data *dev_data = pci_get_drvdata(dev);
        struct config_field_entry *cfg_entry;
        struct config_field *field;
@@ -233,6 +236,21 @@
                                              field_start - req_start);
 
                        err = conf_space_write(dev, cfg_entry, offset, tmp_val);
+                       handled = 1;
+               }
+       }
+
+       if (!handled && !err && permissive) {
+               switch (size) {
+               case 1:
+                       err = pci_write_config_byte(dev, offset, (u8)value);
+                       break;
+               case 2:
+                       err = pci_write_config_word(dev, offset, (u16)value);
+                       break;
+               case 4:
+                       err = pci_write_config_dword(dev, offset, (u32)value);
+                       break;
                }
        }
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Allow pciback to be placed into a permissive mode of operation whereby it allows, Xen patchbot -unstable <=