MEMORY BASED INTERRUPTS PAGE LAYOUT(9)
π Memory Based Interrupts Page Layout π
okay bestie, this one is straight from the Kernel API Manual, section 9, and the page is literally called Memory Based Interrupts Page Layout. It says Memory Based Interrupts requires three different objects β and yes, the specs call them "page" even though they are not page-sized or aligned. π
To simplify the code we allocate a single page size object and then use offsets to embedded "pages". The address of those "pages" are then programmed in the HW via LRI and LRM in the context image.
Interrupt Status Report Pageβ this page contains the interrupt status vectors for each unit. Each bit in the interrupt vectors is converted to a byte, with the byte being set to0xFFwhen an interrupt is triggered; interrupt vectors are16bbig so each unit gets16B. One space is reserved for each bit in one of theGT_INTR_DWxregisters, so this object needs a total of1024B. This object needs to be4KiBaligned. β¨Interrupt Source Report Pageβ this is the equivalent of theGT_INTR_DWxregisters, with each bit in those registers being mapped to a byte here. The offsets are the same, just bytes instead of bits. This object needs to be cacheline aligned. π- Interrupt Mask β the HW needs a location to fetch the interrupt mask vector to be used by the
LRMin the context, so we just use the next available space in the interrupt page. π
Hereβs the layout, look at her:
0x0000 +===========+ <== Interrupt Status Report Page
| |
| | ____ +----+----------------+
| | / | 0 | USER INTERRUPT |
+-----------+ __/ | 1 | |
| HWE(n) | __ | | CTX SWITCH |
+-----------+ | | WAIT SEMAPHORE |
| | ____ | 15 | |
| | +----+----------------+
| |
0x0400 +===========+ <== Interrupt Source Report Page
| HWE(0) |
| HWE(1) |
| |
| HWE(x) |
0x0440 +===========+ <== Interrupt Enable Mask
| |
| |
+-----------+
π MSI-X use case π
When using MSI-X, hw engines report interrupt status and source to engine instance 0. For this scenario, in order to differentiate between the engines, we need to pass different status/source pointers in the LRC.
The requirements on those pointers are:
- Interrupt status should be
4KiBaligned - Interrupt source should be
64 bytesaligned
To accommodate this, we duplicate the memirq page layout above β allocating a page for each engine instance and pass this page in the LRC.
Note that the same page can be reused for different engine types. For example, anLRCexecuting onCCS #xwill have pointers to page#x, and anLRCexecuting onBCS #xwill have the same pointers.
0x0000 +==============================+ <== page for instance 0 (BCS0, CCS0, etc.)
| Interrupt Status Report Page |
0x0400 +==============================+
| Interrupt Source Report Page |
0x0440 +==============================+
| Interrupt Enable Mask |
+==============================+
| Not used |
0x1000 +==============================+ <== page for instance 1 (BCS1, CCS1, etc.)
| Interrupt Status Report Page |
0x1400 +==============================+
| Interrupt Source Report Page |
0x1440 +==============================+
| Not used |
0x2000 +==============================+ <== page for instance 2 (BCS2, CCS2, etc.)
| ... |
+==============================+
π SEE ALSO π
- Kernel file
./drivers/gpu/drm/xe/xe_memirq.cβ plusMemory Based Interrupts(9),xe_memirq_init(9),xe_memirq_source_ptr(9),xe_memirq_status_ptr(9),xe_memirq_enable_ptr(9),xe_memirq_init_guc(9),xe_memirq_reset(9),xe_memirq_postinstall(9),xe_memirq_hwe_handler(9),xe_memirq_guc_sw_int_0_irq_pending(9),xe_memirq_handler(9)
π thatβs the whole page, bestie β source/version ./drivers/gpu/drm/xe, dated October 2026, from the Memory Base... Page Layout(9) footer. slay π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms