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
F120773767: D49484.diff
Fri, Jun 20, 11:50 PM
F120695058: D49484.id152611.diff
Fri, Jun 20, 6:53 AM
Unknown Object (File)
Thu, Jun 19, 2:42 PM
Unknown Object (File)
Wed, Jun 18, 11:18 AM
Unknown Object (File)
Tue, Jun 17, 7:29 PM
Unknown Object (File)
Tue, Jun 17, 5:24 AM
Unknown Object (File)
Sun, Jun 15, 6:12 AM
Unknown Object (File)
Sun, Jun 8, 7:50 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 Passed
Unit
No Test Coverage
Build Status
Buildable 63112
Build 59996: arc lint + arc unit

Event Timeline

sys/dev/pci/pci.c
1931

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?