lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090901135358.GA31282@elte.hu>
Date:	Tue, 1 Sep 2009 15:53:58 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	Jesse Barnes <jbarnes@...tuousgeek.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>
Cc:	linux-kernel@...r.kernel.org,
	Jesse Brandeburg <jesse.brandeburg@...il.com>,
	Yinghai Lu <yinghai@...nel.org>
Subject: Re: [PATCH] x86/PCI: initialize PCI bus node numbers early


* Jesse Barnes <jbarnes@...tuousgeek.org> wrote:

> The current mp_bus_to_node array is initialized only by AMD specific
> code, since AMD platforms have registers that can be used for
> determining mode numbers.  On new Intel platforms it's necessary to
> initialize this array as well though, otherwise all PCI node numbers
> will be 0, when in fact they should be -1 (indicating that I/O isn't
> tied to any particular node).
> 
> So move the mp_bus_to_node code into the common PCI code, and
> initialize it early with a default value of -1.  This may be overridden
> later by arch code (e.g. the AMD code).
> 
> With this change, PCI consistent memory and other node specific
> allocations (e.g. skbuff allocs) should occur on the "current" node.
> If, for performance reasons, applications want to be bound to specific
> nodes, they should open their devices only after being pinned to the
> CPU where they'll run, for maximum locality.
> 
> Any thoughts here Yinghai or Jesse?
> 
> 
>  include/asm/pci.h |    2 +
>  kernel/setup.c    |    2 +
>  pci/amd_bus.c     |   61 +-----------------------------------------
>  pci/common.c      |   77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 83 insertions(+), 59 deletions(-)

FYI, this commit:

  acccaba: x86/PCI: initialize PCI bus node numbers early

caused a boot crash in -tip testing:

calling  amd_init+0x0/0x16 @ 1
pata_amd 0000:00:06.0: version 0.4.1
pata_amd 0000:00:06.0: setting latency timer to 64
BUG: unable to handle kernel NULL pointer dereference at 00000e44
IP: [<c10b7db4>] __alloc_pages_nodemask+0x44/0x4e0
*pdpt = 00000000024e8001 *pde = 0000000000000000 
Oops: 0000 [#1] PREEMPT SMP 
last sysfs file: 
kthreadd_task: f68a8440

Pid: 1, comm: swapper Not tainted (2.6.31-rc2-00263-gacccaba-dirty #9102) System Product Name
EIP: 0060:[<c10b7db4>] EFLAGS: 00010246 CPU: 0
EIP is at __alloc_pages_nodemask+0x44/0x4e0
EAX: 00000000 EBX: 000080d0 ECX: 00000e40 EDX: 00000e40
ESI: f5ff923c EDI: 003fffff EBP: f689ed9c ESP: f689ed44
 DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
Process swapper (pid: 1, ti=f689e000 task=f68a8000 task.ti=f689e000)
Stack:
 00331788 00000e40 00000000 f72c1f20 00000000 c1582968 f689ed88 c10dc4a9
<0> 00000001 ffffffff 000000d0 c2421788 f5832940 f689ed98 00000000 c2421788
<0> 00000202 f689edbc c10dda24 000000ff f5ff923c 000080d0 f689edcc c102707b
Call Trace:
 [<c1582968>] ? dmam_alloc_coherent+0x28/0x120
 [<c10dc4a9>] ? __slab_alloc+0x449/0x4d0
 [<c10dda24>] ? __kmalloc_track_caller+0xc4/0x190
 [<c102707b>] ? dma_generic_alloc_coherent+0x9b/0x160
 [<c1026fe0>] ? dma_generic_alloc_coherent+0x0/0x160
 [<c1582a25>] ? dmam_alloc_coherent+0xe5/0x120
 [<c16d45a3>] ? ata_port_start+0x23/0x40
 [<c16e3e24>] ? ata_sff_port_start+0x14/0x30
 [<c16d4435>] ? ata_host_start+0xf5/0x1d0
 [<c16e33aa>] ? ata_pci_sff_activate_host+0x2a/0x1d0
 [<c16e52b0>] ? ata_sff_interrupt+0x0/0xe0
 [<c16e3a32>] ? ata_pci_sff_init_one+0xe2/0x110
 [<c16f4210>] ? amd_init_one+0xc0/0x1d0
 [<c1444773>] ? local_pci_probe+0x13/0x20
 [<c1444a01>] ? pci_device_probe+0x81/0xd0
 [<c157efb4>] ? driver_probe_device+0x84/0x240
 [<c157f1e9>] ? __driver_attach+0x79/0x80
 [<c157e430>] ? bus_for_each_dev+0x50/0x90
 [<c157edd9>] ? driver_attach+0x19/0x20
 [<c157f170>] ? __driver_attach+0x0/0x80
 [<c157eb37>] ? bus_add_driver+0x217/0x330
 [<c1444920>] ? pci_device_remove+0x0/0x40
 [<c1444980>] ? pci_device_probe+0x0/0xd0
 [<c157f4a7>] ? driver_register+0x77/0x170
 [<c246a75f>] ? amd_init+0x0/0x16
 [<c246a75f>] ? amd_init+0x0/0x16
 [<c1444e3a>] ? __pci_register_driver+0x3a/0xa0
 [<c246a75f>] ? amd_init+0x0/0x16
 [<c246a773>] ? amd_init+0x14/0x16
 [<c1001039>] ? do_one_initcall+0x29/0x130
 [<c1090f35>] ? init_irq_proc+0x65/0x80
 [<c24335e6>] ? kernel_init+0x11e/0x176
 [<c24334c8>] ? kernel_init+0x0/0x176
 [<c1023057>] ? kernel_thread_helper+0x7/0x10
Code: 08 00 3d 08 00 08 00 0f 84 da 00 00 00 8b 3d c0 36 42 c2 85 ff 0f 84 8c 00 00 00 c7 45 b8 00 00 00 00 8b 3d b4 36 42 c2 8b 55 ac <8b> 72 04 85 f6 0f 84 a1 00 00 00 89 d9 83 e1 0f 01 c9 be 21 01 
EIP: [<c10b7db4>] __alloc_pages_nodemask+0x44/0x4e0 SS:ESP 0068:f689ed44
CR2: 0000000000000e44
---[ end trace bdfad5a2d2b496c5 ]---

via the x86/mrst topic tree. Config attached.

	Ingo

View attachment "config" of type "text/plain" (77523 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ