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] PCI Passthru: fn0 exported but not fn1

To: Keir Fraser <keir@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] PCI Passthru: fn0 exported but not fn1
From: Jambunathan K <jambunathan@xxxxxxxxxx>
Date: Thu, 30 Aug 2007 15:41:06 +0530
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Stefan Neuwirth <neuwirt-xen-devel@xxxxxxxxxxxxxxxxxxxxxx>, Sanjeev Jorapur <sanjeev@xxxxxxxxxx>
Delivery-date: Thu, 30 Aug 2007 03:11:54 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C2FB40B1.14FF5%keir@xxxxxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <C2FB40B1.14FF5%keir@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.6 (Windows/20070728)
>> Very odd. The tracing you provide clearly shows that the kernel is *not*
>> scanning every fn. It is only scanning every fn==0.
>> 
>> The function of interest here is, I think,
>> linux/drivers/pci/probe.c:pci_scan_slot(). Notice how it iterates on every
>> fn but bails early if no device is found at fn 0 and !scan_all_fns. I
>> suggest you add some tracing to that function to check that:
>>  A. It is being called; and
>>  B. Exactly how it is bailing without checking fns != 0, if it ireally is
>> the case that scan_all_fns==1.


This is the broad outline of a fix.

--- ws1/xen-3.1.0-src/linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/pci.h
2007-08-29 07:22:52.000000000 -0400
+++ ws/xen-3.1.0-src/linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/pci.h
2007-08-30 05:37:46.000000000 -0400
@@ -16,7 +16,9 @@
 #else
 #define pcibios_assign_all_busses()    0
 #endif
+
 #define pcibios_scan_all_fns(a, b)     1
+#define HAVE_PCIBIOS_SCAN_ALL_FNS

 extern unsigned long pci_mem_start;
 #define PCIBIOS_MIN_IO         0x1000
--- ws1/xen-3.1.0-src/linux-2.6.18-xen/include/asm-generic/pci.h        
2006-09-19
23:42:06.000000000 -0400
+++ ws/xen-3.1.0-src/linux-2.6.18-xen/include/asm-generic/pci.h 2007-08-30
05:37:03.000000000 -0400
@@ -43,7 +43,11 @@
        return root;
 }

+
+#ifndef HAVE_PCIBIOS_SCAN_ALL_FNS
+#error "Fix not OK"
 #define pcibios_scan_all_fns(a, b)     0
+#endif

 #ifndef HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ
 static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)



Compiler log below justifies the above fix.

In file included from
/root/src/ws/xen-3.1.0-src/linux-2.6.18-xen/include/linux/pci.h:691,
                 from
/root/src/ws/xen-3.1.0-src/linux-2.6.18-xen/arch/x86_64/kernel/../../i386/kernel/pci-dma-xen.c:13:
include2/asm/mach-xen/asm/pci.h:21:2: error: #error "Including this definition"
In file included from include2/asm/mach-xen/asm/pci.h:167,
                 from
/root/src/ws/xen-3.1.0-src/linux-2.6.18-xen/include/linux/pci.h:691,
                 from
/root/src/ws/xen-3.1.0-src/linux-2.6.18-xen/arch/x86_64/kernel/../../i386/kernel/pci-dma-xen.c:13:
/root/src/ws/xen-3.1.0-src/linux-2.6.18-xen/include/asm-generic/pci.h:46:1:
warning: "pcibios_scan_all_fns" redefined
In file included from
/root/src/ws/xen-3.1.0-src/linux-2.6.18-xen/include/linux/pci.h:691,
                 from
/root/src/ws/xen-3.1.0-src/linux-2.6.18-xen/arch/x86_64/kernel/../../i386/kernel/pci-dma-xen.c:13:
include2/asm/mach-xen/asm/pci.h:22:1: warning: this is the location of the
previous definition

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