linux/drivers/infiniband/hw/hfi1
Mike Marciniszyn 5de61a47eb IB/hfi1: Fix probe time panic when AIP is enabled with a buggy BIOS
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>
2021-04-07 15:31:59 -03:00
..
affinity.c IB/hfi1: Fix probe time panic when AIP is enabled with a buggy BIOS 2021-04-07 15:31:59 -03:00
affinity.h IB/hfi1: Add interrupt handler functions for accelerated ipoib 2020-05-21 11:23:56 -03:00
aspm.c IB/hfi1: Reduce excessive aspm inlines 2019-06-28 22:34:26 -03:00
aspm.h IB/hfi1: Reduce excessive aspm inlines 2019-06-28 22:34:26 -03:00
chip_registers.h IB/hfi1: Add RcvShortLengthErrCnt to hfi1stats 2020-01-10 10:57:17 -04:00
chip.c RDMA/hw/hfi1/chip: Fix a bunch of kernel-doc formatting and spelling issues 2021-01-22 14:37:32 -04:00
chip.h IB/hfi1: Add interrupt handler functions for accelerated ipoib 2020-05-21 11:23:56 -03:00
common.h IB/hfi1: Enable the transmit side of the datagram ipoib netdev 2020-05-21 11:23:58 -03:00
debugfs.c IB/hfi1: Fix module use count flaw due to leftover module put calls 2020-06-24 15:54:08 -03:00
debugfs.h infiniband: hfi1: drop crazy DEBUGFS_SEQ_FILE_CREATE() macro 2019-01-24 09:22:29 -07:00
device.c
device.h
driver.c IB/hfi1: switch to core handling of rx/tx byte/packet counters 2020-11-12 14:58:13 -08:00
efivar.c infiniband: hfi1: Use EFI GetVariable only when available 2020-02-23 21:59:42 +01:00
efivar.h
eprom.c
eprom.h
exp_rcv.c RDMA/hw/hfi1/exp_rcv: Fix some kernel-doc formatting issues 2021-01-22 14:37:33 -04:00
exp_rcv.h
fault.c IB/hfi1: Use scnprintf() for avoiding potential buffer overflow 2020-03-26 15:06:14 -03:00
fault.h
file_ops.c RDMA/hw/hfi1/file_ops: Fix' manage_rcvq()'s 'arg' param 2021-01-22 14:37:34 -04:00
firmware.c IB/hfi1: Use fallthrough pseudo-keyword 2020-07-24 16:59:55 -03:00
hfi.h IB/hfi1: Fix probe time panic when AIP is enabled with a buggy BIOS 2021-04-07 15:31:59 -03:00
init.c IB/hfi1: Fix probe time panic when AIP is enabled with a buggy BIOS 2021-04-07 15:31:59 -03:00
intr.c RDMA/hw/hfi1/intr: Fix some kernel-doc formatting issues 2021-01-28 15:42:25 -04:00
iowait.c RDMA/hw/hfi1/iowait: Demote half-completed kernel-doc and fix formatting issue in another 2021-01-28 15:42:26 -04:00
iowait.h RDMA/hfi1: Fix trivial mis-spelling of 'descriptor' 2020-06-15 15:56:54 -03:00
ipoib_main.c IB/hfi1: switch to core handling of rx/tx byte/packet counters 2020-11-12 14:58:13 -08:00
ipoib_rx.c IB/hfi1: Activate the dummy netdev 2020-05-21 11:23:56 -03:00
ipoib_tx.c IB/hfi1: switch to core handling of rx/tx byte/packet counters 2020-11-12 14:58:13 -08:00
ipoib.h IB/hfi1: switch to core handling of rx/tx byte/packet counters 2020-11-12 14:58:13 -08:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
mad.c RDMA/hw/hfi1/mad: Demote half-completed kernel-doc header fix another 2021-01-28 15:42:26 -04:00
mad.h RDMA: Replace zero-length array with flexible-array member 2020-02-20 13:33:51 -04:00
Makefile IB/hfi1: Add functions to receive accelerated ipoib packets 2020-05-21 11:23:56 -03:00
mmu_rb.c IB/hfi1: Ensure correct mm is used at all times 2020-11-25 20:30:46 -04:00
mmu_rb.h IB/hfi1: Ensure correct mm is used at all times 2020-11-25 20:30:46 -04:00
msix.c RDMA/hw/hfi1/msix: Add description for 'name' and remove superfluous param 'idx' 2021-01-28 15:42:27 -04:00
msix.h IB/hfi1: Activate the dummy netdev 2020-05-21 11:23:56 -03:00
netdev_rx.c IB/hfi1: Fix probe time panic when AIP is enabled with a buggy BIOS 2021-04-07 15:31:59 -03:00
netdev.h IB/hfi1: Activate the dummy netdev 2020-05-21 11:23:56 -03:00
opa_compat.h
opfn.c IB/hfi1: Add TID RDMA retry timer 2019-02-05 18:07:43 -05:00
opfn.h IB/hfi1: Make opfn.h self sufficient 2019-04-24 11:31:49 -03:00
pcie.c RDMA/hw/hfi1/pcie: Demote kernel-doc abuses 2021-01-28 15:42:28 -04:00
pio_copy.c RDMA/hw/hfi1/pio_copy: Provide entry for 'pio_copy()'s 'dd' param 2021-01-28 15:42:28 -04:00
pio.c IB/hfi1: Use fallthrough pseudo-keyword 2020-07-24 16:59:55 -03:00
pio.h RDMA: Replace zero-length array with flexible-array member 2020-02-20 13:33:51 -04:00
platform.c IB/hfi1: Use fallthrough pseudo-keyword 2020-07-24 16:59:55 -03:00
platform.h
qp.c RDMA/hw/hfi1/qp: Fix some formatting issues and demote kernel-doc abuse 2021-01-28 15:42:28 -04:00
qp.h RDMA/hfi1: Remove hfi1_create_qp declaration 2020-06-22 14:49:27 -03:00
qsfp.c RDMA: Convert comma to semicolon 2021-01-07 13:53:41 -04:00
qsfp.h
rc.c RDMA/hw/hfi1/rc: Demote incorrectly populated kernel-doc header 2021-01-28 15:42:30 -04:00
rc.h IB/hfi1: Delay the release of destination mr for TID RDMA WRITE DATA 2019-04-03 15:27:30 -03:00
ruc.c RDMA/hw/hfi1/ruc: Fix a small formatting and description issues 2021-01-28 15:42:28 -04:00
sdma_txreq.h IB/hfi1: Prioritize the sending of ACK packets 2019-02-05 18:07:44 -05:00
sdma.c RDMA/hw/hfi1/sdma: Fix misnaming of 'sdma_send_txlist()'s 'count_out' param 2021-01-28 15:42:29 -04:00
sdma.h RDMA: Replace zero-length array with flexible-array member 2020-02-20 13:33:51 -04:00
sysfs.c RDMA: Convert various random sprintf sysfs _show uses to sysfs_emit 2020-10-30 21:03:52 -03:00
tid_rdma.c RDMA/hw/hfi1/tid_rdma: Fix a plethora of kernel-doc issues 2021-01-28 15:42:29 -04:00
tid_rdma.h IB/hfi1: Calculate flow weight based on QP MTU for TID RDMA 2019-11-06 13:15:36 -04:00
trace_ctxts.h IB/hfi1: Add packet histogram trace event 2020-05-21 11:23:57 -03:00
trace_dbg.h IB/hfi1: Fix two format strings 2019-03-28 11:03:49 -03:00
trace_ibhdrs.h IB/hfi1: Add missing INVALIDATE opcodes for trace 2019-06-28 22:34:26 -03:00
trace_iowait.h
trace_misc.h
trace_mmu.h
trace_rc.h IB/hfi1: Add static trace for TID RDMA READ protocol 2019-02-05 17:53:56 -05:00
trace_rx.h IB/hfi1: Add fast and slow handlers for receive context 2020-01-10 10:57:16 -04:00
trace_tid.h ftrace: Rework event_create_dir() 2019-11-27 07:44:25 +01:00
trace_tx.h ftrace: Rework event_create_dir() 2019-11-27 07:44:25 +01:00
trace.c IB/hfi1: Add packet histogram trace event 2020-05-21 11:23:57 -03:00
trace.h IB/hfi1: Add static trace for OPFN 2019-01-31 11:37:40 -05:00
uc.c RDMA/hw/hfi1/uc: Fix a little doc-rot 2021-01-28 15:42:29 -04:00
ud.c RDMA/hw/hfi1/ud: Fix a little more doc-rot 2021-01-28 15:42:29 -04:00
user_exp_rcv.c RDMA/hw/hfi1/user_exp_rcv: Demote half-documented and kernel-doc abuses 2021-01-28 15:42:30 -04:00
user_exp_rcv.h IB/hfi1: Ensure correct mm is used at all times 2020-11-25 20:30:46 -04:00
user_pages.c mm, tree-wide: rename put_user_page*() to unpin_user_page*() 2020-01-31 10:30:38 -08:00
user_sdma.c IB/hfi1: Ensure correct mm is used at all times 2020-11-25 20:30:46 -04:00
user_sdma.h IB/hfi1: Ensure correct mm is used at all times 2020-11-25 20:30:46 -04:00
verbs_txreq.c IB/hfi1: Silence txreq allocation warnings 2019-06-17 21:15:40 -04:00
verbs_txreq.h RDMA/hfi1: Fix trivial mis-spelling of 'descriptor' 2020-06-15 15:56:54 -03:00
verbs.c RDMA/hw/hfi1/verbs: Demote non-conforming doc header and fix a misspelling 2021-01-28 15:42:30 -04:00
verbs.h treewide: Use sizeof_field() macro 2019-12-09 10:36:44 -08:00
vnic_main.c IB/hfi1: Fix hfi1_netdev_rx_init() error handling 2020-06-02 20:32:54 -03:00
vnic_sdma.c net: Use skb_frag_off accessors 2019-07-30 14:21:32 -07:00
vnic.h IB/hfi1: Activate the dummy netdev 2020-05-21 11:23:56 -03:00