Mike Marciniszyn
de427b662b
IB/hfi1: Fix probe time panic when AIP is enabled with a buggy BIOS
commit 5de61a47eb upstream.
A panic can result when AIP is enabled:
BUG: unable to handle kernel NULL pointer dereference at 000000000000000
PGD 0 P4D 0
Oops: 0000 1 SMP PTI
CPU: 70 PID: 981 Comm: systemd-udevd Tainted: G OE --------- - - 4.18.0-240.el8.x86_64 #1
Hardware name: Intel Corporation S2600KP/S2600KP, BIOS SE5C610.86B.01.01.0005.101720141054 10/17/2014
RIP: 0010:__bitmap_and+0x1b/0x70
RSP: 0018:ffff99aa0845f9f0 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff8d5a6fc18000 RCX: 0000000000000048
RDX: 0000000000000000 RSI: ffffffffc06336f0 RDI: ffff8d5a8fa67750
RBP: 0000000000000079 R08: 0000000fffffffff R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000001 R12: ffffffffc06336f0
R13: 00000000000000a0 R14: ffff8d5a6fc18000 R15: 0000000000000003
FS: 00007fec137a5980(0000) GS:ffff8d5a9fa80000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000000a04b48002 CR4: 00000000001606e0
Call Trace:
hfi1_num_netdev_contexts+0x7c/0x110 [hfi1]
hfi1_init_dd+0xd7f/0x1a90 [hfi1]
? pci_bus_read_config_dword+0x49/0x70
? pci_mmcfg_read+0x3e/0xe0
do_init_one.isra.18+0x336/0x640 [hfi1]
local_pci_probe+0x41/0x90
pci_device_probe+0x105/0x1c0
really_probe+0x212/0x440
driver_probe_device+0x49/0xc0
device_driver_attach+0x50/0x60
__driver_attach+0x61/0x130
? device_driver_attach+0x60/0x60
bus_for_each_dev+0x77/0xc0
? klist_add_tail+0x3b/0x70
bus_add_driver+0x14d/0x1e0
? dev_init+0x10b/0x10b [hfi1]
driver_register+0x6b/0xb0
? dev_init+0x10b/0x10b [hfi1]
hfi1_mod_init+0x1e6/0x20a [hfi1]
do_one_initcall+0x46/0x1c3
? free_unref_page_commit+0x91/0x100
? _cond_resched+0x15/0x30
? kmem_cache_alloc_trace+0x140/0x1c0
do_init_module+0x5a/0x220
load_module+0x14b4/0x17e0
? __do_sys_finit_module+0xa8/0x110
__do_sys_finit_module+0xa8/0x110
do_syscall_64+0x5b/0x1a0
The issue happens when pcibus_to_node() returns NO_NUMA_NODE.
Fix this issue by moving the initialization of dd->node to hfi1_devdata
allocation and remove the other pcibus_to_node() calls in the probe path
and use dd->node instead.
Affinity logic is adjusted to use a new field dd->affinity_entry as a
guard instead of dd->node.
Fixes: 4730f4a6c6 ("IB/hfi1: Activate the dummy netdev")
Link: https://lore.kernel.org/r/1617025700-31865-4-git-send-email-dennis.dalessandro@cornelisnetworks.com
Cc: stable@vger.kernel.org
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@cornelisnetworks.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-14 08:41:58 +02:00
..
2020-12-30 11:53:44 +01:00
2021-04-14 08:41:58 +02:00
2021-03-04 11:38:02 +01:00
2020-12-30 11:54:09 +01:00
2021-03-04 11:37:45 +01:00
2021-03-30 14:31:50 +02:00
2021-03-04 11:38:00 +01:00
2021-04-07 15:00:13 +02:00
2020-10-01 16:23:50 +03:00
2021-03-30 14:32:09 +02:00
2021-03-11 14:17:22 +01:00
2021-04-10 13:36:07 +02:00
2021-03-09 11:11:10 +01:00
2021-03-30 14:31:58 +02:00
2021-03-04 11:37:57 +01:00
2021-03-25 09:04:16 +01:00
2021-03-30 14:31:49 +02:00
2020-11-16 13:24:32 +01:00
2021-03-04 11:38:32 +01:00
2021-03-04 11:38:15 +01:00
2021-03-04 11:37:57 +01:00
2021-01-12 20:18:24 +01:00
2021-03-07 12:34:08 +01:00
2021-04-07 15:00:11 +02:00
2021-04-07 15:00:11 +02:00
2021-03-25 09:04:18 +01:00
2020-12-01 18:46:24 +01:00
2020-12-30 11:53:46 +01:00
2021-03-30 14:31:49 +02:00
2021-04-14 08:41:58 +02:00
2021-03-17 17:06:24 +01:00
2021-03-04 11:37:52 +01:00
2021-03-04 11:37:46 +01:00
2021-02-26 10:13:00 +01:00
2021-03-04 11:38:37 +01:00
2021-03-17 17:06:22 +01:00
2021-01-06 14:56:53 +01:00
2021-03-04 11:38:21 +01:00
2020-12-03 10:00:23 +01:00
2021-03-25 09:04:16 +01:00
2021-04-14 08:41:58 +02:00
2021-03-17 17:06:24 +01:00
2021-01-27 11:55:29 +01:00
2021-03-17 17:06:24 +01:00
2021-03-30 14:31:50 +02:00
2021-04-10 13:36:08 +02:00
2021-02-03 23:28:41 +01:00
2021-01-27 11:55:22 +01:00
2021-03-04 11:37:42 +01:00
2021-03-04 11:38:15 +01:00
2021-03-30 14:32:06 +02:00
2021-03-17 17:06:20 +01:00
2021-03-04 11:37:25 +01:00
2020-12-30 11:53:34 +01:00
2020-10-26 16:57:18 -04:00
2021-03-04 11:38:40 +01:00
2021-03-30 14:31:50 +02:00
2021-03-17 17:06:28 +01:00
2021-03-04 11:38:37 +01:00
2021-04-14 08:41:57 +02:00
2020-12-30 11:53:53 +01:00
2020-10-25 11:12:31 -07:00
2021-02-10 09:29:17 +01:00
2021-04-07 15:00:06 +02:00
2021-03-04 11:38:39 +01:00
2021-03-09 11:11:15 +01:00
2021-03-04 11:37:27 +01:00
2020-10-06 07:07:03 +02:00
2021-03-25 09:04:16 +01:00
2021-03-04 11:37:44 +01:00
2021-03-04 11:38:24 +01:00
2021-04-07 15:00:11 +02:00
2021-04-10 13:36:09 +02:00
2020-10-27 19:23:04 +01:00
2021-03-04 11:37:59 +01:00
2020-11-10 10:02:31 -08:00
2020-12-30 11:53:53 +01:00
2021-04-10 13:36:09 +02:00
2021-03-04 11:38:17 +01:00
2020-10-16 11:11:22 -07:00
2021-03-30 14:31:51 +02:00
2021-03-07 12:34:15 +01:00
2020-10-24 10:39:22 -07:00
2020-10-22 12:58:21 -07:00
2021-03-04 11:38:03 +01:00
2021-03-25 09:04:13 +01:00
2021-04-07 15:00:05 +02:00
2020-12-30 11:53:47 +01:00
2021-04-07 15:00:13 +02:00
2021-03-04 11:38:22 +01:00
2021-03-25 09:04:04 +01:00
2021-03-04 11:38:40 +01:00
2021-04-07 15:00:13 +02:00
2021-04-10 13:36:09 +02:00
2021-03-04 11:37:28 +01:00
2021-04-07 15:00:06 +02:00
2021-03-25 09:04:15 +01:00
2021-04-07 15:00:13 +02:00
2020-11-09 18:54:30 +01:00
2021-04-07 15:00:13 +02:00
2021-03-04 11:37:17 +01:00
2021-04-07 15:00:11 +02:00
2021-04-07 15:00:05 +02:00
2021-04-07 15:00:13 +02:00
2021-03-04 11:37:18 +01:00
2020-12-30 11:54:00 +01:00
2021-03-04 11:37:18 +01:00
2021-03-04 11:38:36 +01:00
2021-04-14 08:41:57 +02:00
2020-12-02 04:09:56 -05:00