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-devel

RE: [Xen-devel] [PATCH][VTD] pci mmcfg patch for x86-64 - version 3

To: Espen Skoglund <espen.skoglund@xxxxxxxxxxxxx>
Subject: RE: [Xen-devel] [PATCH][VTD] pci mmcfg patch for x86-64 - version 3
From: "Kay, Allen M" <allen.m.kay@xxxxxxxxx>
Date: Fri, 19 Dec 2008 18:27:38 -0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "Han, Weidong" <weidong.han@xxxxxxxxx>, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Delivery-date: Fri, 19 Dec 2008 18:28:10 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <18751.44861.303651.262311@xxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <57C9024A16AD2D4C97DC78E552063EA35C7EF156@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <18751.44861.303651.262311@xxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Aclavu2HCCEcM2zdTKSmkfCRAFYD9AHivXsQ
Thread-topic: [Xen-devel] [PATCH][VTD] pci mmcfg patch for x86-64 - version 3
 
>> +int __init pci_mmcfg_arch_init(void)
>> +{
>> +    return 1;
>> +}
>
>Should return 0.  And add a dummy pci_dev_base() function.
>
>

Done.  Added pci_dev_base() returning 0 in x86_32 version of mmconfig.c.


>> diff -r 6595393a3d28 xen/arch/x86/mmconfig_64.c
>> --- /dev/null        Thu Jan 01 00:00:00 1970 +0000
>> +++ b/xen/arch/x86/mmconfig_64.c     Tue Dec 09 06:42:13 2008 -0800
>
>Put following two functions in generic x86.
>
>> +int pci_mmcfg_read(unsigned int seg, unsigned int bus,
>> +                      unsigned int devfn, int reg, int len, 
>u32 *value)
>> +{
>> +    char __iomem *addr;
>> +
>> +    /* Why do we have this when nobody checks it. How about 
>a BUG()!? -AK */
>> +    if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) {
>> +err:                *value = -1;
>> +            return -EINVAL;
>> +    }
>
>Also fail if (pci_probe & PCI_PROBE_MMCONF) == 0.  Or alternatively do
>this check in pci_dev_base().
>

I added the check in both read/write functions instead of pci_dev_base().  It 
is probably better from maintainence point as it is more straight forward.

Allen

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