MSI(-X) interrupts only fire once on real hardware

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
techdude17
Member
Member
Posts: 38
Joined: Fri Dec 23, 2022 1:06 pm

MSI(-X) interrupts only fire once on real hardware

Post by techdude17 »

Hi all,

Didn't think I'd have to come back here to ask for help on something like this but have been stumped for a while, and have stumped a few friends :oops:

Anyways, on real hardware all of my drivers that use PCI interrupts (in this case, MSI and MSI-X) can receive a total of one interrupt before never getting another one (don't know if this applies to pin interrupts, don't have any hardware that uses it right now).

I immediately guessed it was an acknowledgement problem, but the local APIC gets the acknowledgement for the timer IRQ and everything else just fine. It's just this.

It's not a driver issue I think since multiple drivers failed on real hardware. I've checked my assembly stubs, they contained bugs but I fixed them.

At this point my MSI(-X), I/O APIC, and Local APIC code have been tested to my limit and every emulator I can try on has success. I don't know how to proceed or what to do to even continue. Clearly there's a problem but I have no idea :D

I'll accept any advice, including even debugging tools [-o<

Link to GitHub: https://github.com/sasdallas/Ethereal
Octocontrabass
Member
Member
Posts: 6245
Joined: Mon Mar 25, 2013 7:01 pm

Re: MSI(-X) interrupts only fire once on real hardware

Post by Octocontrabass »

techdude17 wrote: Wed Aug 06, 2025 8:27 pmcan receive a total of one interrupt before never getting another one
Do the messages use the correct trigger mode? Are you sending an EOI to the local APIC? (Set a breakpoint in your debugger and make sure it actually hits.)
techdude17 wrote: Wed Aug 06, 2025 8:27 pm(don't know if this applies to pin interrupts, don't have any hardware that uses it right now)
Have you tried ignoring the MSI/MSI-X capability and falling back to pin interrupts? (Although it looks like you need to rewrite your code for routing pin interrupts first, the Interrupt Line register doesn't do what you seem to think it does.)
techdude17 wrote: Wed Aug 06, 2025 8:27 pmthe local APIC gets the acknowledgement for the timer IRQ and everything else
Which "everything else" are you talking about here?
techdude17 wrote: Wed Aug 06, 2025 8:27 pmI/O APIC
MSI and MSI-X don't use IOAPICs...
techdude17 wrote: Wed Aug 06, 2025 8:27 pmI'll accept any advice
Are you sure you have appropriate volatile qualifiers on all pointers to MMIO?
Post Reply