linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Regression] [2.6.37-rc2] WARNING: at drivers/pci/pci-sysfs.c:758 pci_mmap_resource+0x133/0x190()
@ 2010-11-17 20:53 Maciej Rutecki
  2010-11-17 21:00 ` Jesse Barnes
  0 siblings, 1 reply; 5+ messages in thread
From: Maciej Rutecki @ 2010-11-17 20:53 UTC (permalink / raw)
  To: linux-kernel, Rafael J. Wysocki, martin.wilck, jbarnes

Last known good: 2.6.37-rc1
Bad kernel: 2.6.37-rc2
Hardware: VirtualBox

Description: cannot run Xwindow, booting hangs on this kernel message:
[  143.502215] ------------[ cut here ]------------                                                              
[  143.503050] WARNING: at drivers/pci/pci-sysfs.c:758 
pci_mmap_resource+0x133/0x190()                           
[  143.523361] Hardware name: VirtualBox                                                                         
[  143.523387] process "Xorg" tried to map 0x02000000 bytes at page 0x00000000 
on 0000:00:02.0 BAR 0 (start 0x   
[  143.523408] Modules linked in: fuse loop sha256_generic aes_i586 
aes_generic cbc dm_crypt dm_mod ohci_hcd ehci
[  143.523823] Pid: 1665, comm: Xorg Not tainted 2.6.37-rc2 #1                                                   
[  143.523843] Call Trace:                                                                                       
[  143.523878]  [<c0137f9d>] warn_slowpath_common+0x6d/0xa0                                                      
[  143.523898]  [<c0281c83>] ? pci_mmap_resource+0x133/0x190                                                     
[  143.523916]  [<c0281c83>] ? pci_mmap_resource+0x133/0x190                                                     
[  143.523935]  [<c013804e>] warn_slowpath_fmt+0x2e/0x30                                                         
[  143.523953]  [<c0281c83>] pci_mmap_resource+0x133/0x190                                                       
[  143.523972]  [<c0281ce0>] ? pci_mmap_resource_uc+0x0/0x20                                                     
[  143.524000]  [<c0281cf9>] pci_mmap_resource_uc+0x19/0x20                                                      
[  143.526472]  [<c020eba2>] mmap+0x62/0x100                                                                     
[  143.526501]  [<c01ac52f>] mmap_region+0x2bf/0x410                                                             
[  143.526522]  [<c01ac8dc>] do_mmap_pgoff+0x25c/0x300                                                           
[  143.526541]  [<c01aca17>] sys_mmap_pgoff+0x97/0x130                                                           
[  143.526569]  [<c03dbd11>] syscall_call+0x7/0xb                                                                
[  143.526584] ---[ end trace 57cafb32c03e0f5f ]---

Bisection shows:
3b519e4ea618b6943a82931630872907f9ac2c2b is the first bad commit                                                 
commit 3b519e4ea618b6943a82931630872907f9ac2c2b                                                                  
Author: Martin Wilck <martin.wilck@ts.fujitsu.com>                                                               
Date:   Wed Nov 10 11:03:21 2010 +0100                                                                           
                                                                                                                 
    PCI: fix size checks for mmap() on /proc/bus/pci files                                                       
                                                                                                                 
    The checks for valid mmaps of PCI resources made through /proc/bus/pci 
files                                 
    that were introduced in 9eff02e2042f96fb2aedd02e032eca1c5333d767 have 
several                                
    problems:                                                                                                    
                                                                                                                 
    1. mmap() calls on /proc/bus/pci files are made with real file offsets > 
0,                                  
    whereas under /sys/bus/pci/devices, the start of the resource corresponds                                    
    to offset 0. This may lead to false negatives in pci_mmap_fits(), which                                      
    implicitly assumes the /sys/bus/pci/devices layout.                                                          
                                                                                                                 
    2. The loop in proc_bus_pci_mmap doesn't skip empty resouces. This leads                                     
    to false positives, because pci_mmap_fits() doesn't treat empty resources                                    
    correctly (the calculated size is 1 << (8*sizeof(resource_size_t)-
PAGE_SHIFT)                                
    in this case!).                                                                                              
                                                                                                                 
    3. If a user maps resources with BAR > 0, pci_mmap_fits will emit bogus                                      
    WARNINGS for the first resources that don't fit until the correct one is 
found.                              
                                                                                                                 
    On many controllers the first 2-4 BARs are used, and the others are empty.                                   
    In this case, an mmap attempt will first fail on the non-empty BARs                                          
    (including the "right" BAR because of 1.) and emit bogus WARNINGS because                                    
    of 3., and finally succeed on the first empty BAR because of 2.                                              
    This is certainly not the intended behaviour.

   This patch addresses all 3 issues.                                                                            
   Updated with an enum type for the additional parameter for pci_mmap_fits().                                   
                                                                                                                 
   Cc: stable@kernel.org                                                                                         
   Signed-off-by: Martin Wilck <martin.wilck@ts.fujitsu.com>                                                     
   Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>                                                        
                                                                                                                 
040000 040000 73eda4a589e4b0da691202a36ec4b7e38f635c64 
2dd7820cdcff8b2d1e23d990eee7a5832a356c38 M      drivers

Full dmesg:
http://unixy.pl/maciek/download/kernel/2.6.37-rc2/vbox/dmesg-2.6.37-rc2.txt

Config:
http://unixy.pl/maciek/download/kernel/2.6.37-rc2/vbox/config-2.6.37-rc2

lspci:
http://unixy.pl/maciek/download/kernel/2.6.37-rc2/vbox/lspci.txt

Regards
-- 
Maciej Rutecki
http://www.maciek.unixy.pl

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Regression] [2.6.37-rc2] WARNING: at drivers/pci/pci-sysfs.c:758 pci_mmap_resource+0x133/0x190()
  2010-11-17 20:53 [Regression] [2.6.37-rc2] WARNING: at drivers/pci/pci-sysfs.c:758 pci_mmap_resource+0x133/0x190() Maciej Rutecki
@ 2010-11-17 21:00 ` Jesse Barnes
  2010-11-18 15:30   ` Andy Whitcroft
  2010-11-18 17:28   ` Maciej Rutecki
  0 siblings, 2 replies; 5+ messages in thread
From: Jesse Barnes @ 2010-11-17 21:00 UTC (permalink / raw)
  To: maciej.rutecki; +Cc: linux-kernel, Rafael J. Wysocki, martin.wilck

On Wed, 17 Nov 2010 21:53:10 +0100
Maciej Rutecki <maciej.rutecki@gmail.com> wrote:

> Last known good: 2.6.37-rc1
> Bad kernel: 2.6.37-rc2
> Hardware: VirtualBox

Should be fixed in master now, please re-test.

-- 
Jesse Barnes, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Regression] [2.6.37-rc2] WARNING: at drivers/pci/pci-sysfs.c:758 pci_mmap_resource+0x133/0x190()
  2010-11-17 21:00 ` Jesse Barnes
@ 2010-11-18 15:30   ` Andy Whitcroft
  2010-11-18 17:28   ` Maciej Rutecki
  1 sibling, 0 replies; 5+ messages in thread
From: Andy Whitcroft @ 2010-11-18 15:30 UTC (permalink / raw)
  To: Jesse Barnes
  Cc: maciej.rutecki, linux-kernel, Rafael J. Wysocki, martin.wilck,
	Andy Whitcroft

On Wed, Nov 17, 2010 at 9:00 PM, Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
> On Wed, 17 Nov 2010 21:53:10 +0100
> Maciej Rutecki <maciej.rutecki@gmail.com> wrote:
>
>> Last known good: 2.6.37-rc1
>> Bad kernel: 2.6.37-rc2
>> Hardware: VirtualBox
>
> Should be fixed in master now, please re-test.

We also had this reported in Ubuntu[1], I have applied the commit you
suggested to the Ubuntu kernel and have confirmed that this is
resolved for my reporters:

  commit 8c05cd08a7504b855c265263e84af61aabafa329
  Author: Darrick J. Wong <djwong@us.ibm.com>
  Date:   Tue Nov 16 09:13:41 2010 -0800

    PCI: fix offset check for sysfs mmapped files

-apw

[1] http://bugs.launchpad.net/bugs/676963

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Regression] [2.6.37-rc2] WARNING: at drivers/pci/pci-sysfs.c:758 pci_mmap_resource+0x133/0x190()
  2010-11-17 21:00 ` Jesse Barnes
  2010-11-18 15:30   ` Andy Whitcroft
@ 2010-11-18 17:28   ` Maciej Rutecki
  2010-11-18 17:52     ` Jesse Barnes
  1 sibling, 1 reply; 5+ messages in thread
From: Maciej Rutecki @ 2010-11-18 17:28 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: linux-kernel, Rafael J. Wysocki, martin.wilck

On środa, 17 listopada 2010 o 22:00:18 Jesse Barnes wrote:
> On Wed, 17 Nov 2010 21:53:10 +0100
> 
> Maciej Rutecki <maciej.rutecki@gmail.com> wrote:
> > Last known good: 2.6.37-rc1
> > Bad kernel: 2.6.37-rc2
> > Hardware: VirtualBox
> 
> Should be fixed in master now, please re-test.

Yes, update to latest kernel tree, and kernel works OK.

Thanks
-- 
Maciej Rutecki
http://www.maciek.unixy.pl

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Regression] [2.6.37-rc2] WARNING: at drivers/pci/pci-sysfs.c:758 pci_mmap_resource+0x133/0x190()
  2010-11-18 17:28   ` Maciej Rutecki
@ 2010-11-18 17:52     ` Jesse Barnes
  0 siblings, 0 replies; 5+ messages in thread
From: Jesse Barnes @ 2010-11-18 17:52 UTC (permalink / raw)
  To: maciej.rutecki; +Cc: linux-kernel, Rafael J. Wysocki, martin.wilck

On Thu, 18 Nov 2010 18:28:11 +0100
Maciej Rutecki <maciej.rutecki@gmail.com> wrote:

> On środa, 17 listopada 2010 o 22:00:18 Jesse Barnes wrote:
> > On Wed, 17 Nov 2010 21:53:10 +0100
> > 
> > Maciej Rutecki <maciej.rutecki@gmail.com> wrote:
> > > Last known good: 2.6.37-rc1
> > > Bad kernel: 2.6.37-rc2
> > > Hardware: VirtualBox
> > 
> > Should be fixed in master now, please re-test.
> 
> Yes, update to latest kernel tree, and kernel works OK.

Great, thanks for confirming.

-- 
Jesse Barnes, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-11-18 17:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-17 20:53 [Regression] [2.6.37-rc2] WARNING: at drivers/pci/pci-sysfs.c:758 pci_mmap_resource+0x133/0x190() Maciej Rutecki
2010-11-17 21:00 ` Jesse Barnes
2010-11-18 15:30   ` Andy Whitcroft
2010-11-18 17:28   ` Maciej Rutecki
2010-11-18 17:52     ` Jesse Barnes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).