The branch main has been updated by kgalazka: URL: https://cgit.FreeBSD.org/src/commit/?id=7ffe1a1f6318bb0116900114950114e5f81418fd
commit 7ffe1a1f6318bb0116900114950114e5f81418fd Author: Krzysztof Galazka <kgala...@freebsd.org> AuthorDate: 2025-06-17 19:17:02 +0000 Commit: Krzysztof Galazka <kgala...@freebsd.org> CommitDate: 2025-06-17 19:17:21 +0000 pci: Save MSIX ctrl value before pci_mask_msix call 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.gala...@intel.com> Reviewed by: jhb Approved by: kbowling (mentor) Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D49484 --- sys/dev/pci/pci.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 27355c335915..f94438cda041 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -1927,7 +1927,11 @@ pci_alloc_msix_method(device_t dev, device_t child, int *count) } } - /* Mask all vectors. */ + /* + * 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++) pci_mask_msix(child, i);