From: Lukas Hejtmanek Subject: Re: [PATCH] Permissive devices in Xen Date: Tue, 10 Jul 2007 10:58:47 +0200 Message-ID: <20070710085847.GB3885@ics.muni.cz> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="vkogqOf2sHV7VnPd" Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --vkogqOf2sHV7VnPd Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by minas.ics.muni.cz id l6A8vjZY029269 Patch allowing drivers in DomU to restore address bars if needed. Signed-off-by: xhejtman@ics.muni.cz --=20 Luk=E1=B9 Hejtm=E1nek --vkogqOf2sHV7VnPd Content-Type: text/x-diff; charset=iso-8859-2 Content-Disposition: attachment; filename="bar-writes.patch" --- a/drivers/xen/pciback/conf_space_header.c 2007-05-18 16:45:21.000000000 +0200 +++ b/drivers/xen/pciback/conf_space_header.c 2007-07-10 01:05:57.165749185 +0200 @@ -75,8 +75,15 @@ */ if (value == ~PCI_ROM_ADDRESS_ENABLE) bar->which = 1; - else + else { + u32 tmpval; + pci_read_config_dword(dev, offset, &tmpval); + if(tmpval != bar->val && value == bar->val) { + /* We are trying to restore bar value. This should be allowed. */ + pci_write_config_dword(dev, offset, bar->val); + } bar->which = 0; + } /* Do we need to support enabling/disabling the rom address here? */ @@ -102,8 +109,15 @@ */ if (value == ~0) bar->which = 1; - else + else { + u32 tmpval; + pci_read_config_dword(dev, offset, &tmpval); + if(tmpval != bar->val && value == bar->val) { + /* We are trying to restore bar value. This should be allowed. */ + pci_write_config_dword(dev, offset, bar->val); + } bar->which = 0; + } return 0; } --vkogqOf2sHV7VnPd Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --vkogqOf2sHV7VnPd--