HomeFreeBSD

x86 msi: Enable/disable IDT vectors for MSI groups all at once

Description

x86 msi: Enable/disable IDT vectors for MSI groups all at once

Unlike MSI-X, when a device uses multiple MSI interrupts, the entire
group of interrupts are enabled/disabled at once in the relevant PCI
config register. Currently, the interrupt code enables the IDT vector
for each MSI interrupt when a handler is first registered. If the PCI
device triggers an MSI interrupt which doesn't yet have a handler,
this can trigger a panic when the Xrsvd ISR executes rather than
treating it as a stray device interrupt.

To fix, enable all the IDT vectors for an MSI group when the first
interrupt handler is configured, and don't disable the IDT vectors
until the last interrupt handler for the group is torn down.

When migrating an MSI group between CPUs, enable/disable the entire
group of IDT vectors if at least one interrupt handler is configured
for the group.

Reported by: jhay
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D42232

Details

Provenance
jhbAuthored on Oct 20 2023, 9:52 PM
Reviewer
kib
Differential Revision
D42232: x86 msi: Enable/disable IDT vectors for MSI groups all at once
Parents
rG0e0c4f58370f: certctl: invoke with LOCALBASE set
Branches
Unknown
Tags
Unknown