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

(cherry picked from commit 2d4924892144f653a7a7afba27ed1bf536dd7e51)

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
rGf19e6f56eb8e: acpi_pcib: Trust decoded bus range from _CRS over _BBN
Branches
Unknown
Tags
Unknown