Page MenuHomeFreeBSD

pci: Save MSIX ctrl value before pci_mask_msix call
ClosedPublic

Authored by kgalazka on Mar 24 2025, 9:51 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 4, 6:58 AM
Unknown Object (File)
Fri, Apr 3, 3:39 AM
Unknown Object (File)
Tue, Mar 31, 7:02 PM
Unknown Object (File)
Tue, Mar 31, 2:00 AM
Unknown Object (File)
Mon, Mar 23, 12:11 PM
Unknown Object (File)
Feb 28 2026, 3:27 PM
Unknown Object (File)
Feb 28 2026, 7:25 AM
Unknown Object (File)
Feb 27 2026, 7:43 AM
Subscribers

Details

Summary

Function pci_mask_msix uses cached value of MSI-X CTRL
register to verify if vector index is valid. Update
that value in pci_alloc_msix_method before it is
used to avoid kernel panic.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/dev/pci/pci.c
1930

Huh. I would maybe keep the code unchanged below and just do an extra assignment here? The normal style is a blank line before comments, but this is also part of the logical masking operation so maybe:

/*
  * Mask all vectors.  Note that the message index assertion in
  * pci_mask_msix requires msix_ctrl to be set.
  */
cfg->msix.msix_ctrl = ctrl;
for (i = 0; i < msgnum; i++)

Implement feedback from jhb.

This revision is now accepted and ready to land.Mar 28 2025, 1:04 AM

@jhb Is there anything else you'd like me to change in this patch?