I'm currently writing a custom driver for Intel Processor Trace (PT).
According to Intel's Software Developers Manual Vol. 3C 36-13, the CPU "will attempt to signal a ToPA PMI interrupt before the output wraps and overwrites the top of the buffer."
I am struggling to find out how to get notified by the kernel when this PMI occurs. I have various resources about writing generic IRQ handlers (in particular LDD3 Ch. 10), but was not able to figure out the IRQ number of the PT interrupt - or if it even has one.
I also looked at the code that handles PT in the Linux kernel, but couldn't figure out where or how the interrupt handler is registered: https://elixir.bootlin.com/linux/v4.17.2/source/arch/x86/events/intel/pt.c#L1245
Any pointers, resources or even references to code are greatly appreciated.