STRUCT XE_PAGEFAULT(9)
β¨ struct xe_pagefault (kernel API manual energy) β¨
okay bestie, so this page is literally from the Kernel API Manual β it's the struct xe_pagefault(9) entry β and it's the whole "xe page fault" situation, which sounds scary but is actually so well organized. let's get into it π
πΈ NAME πΈ
struct xe_pagefault β Xe page fault. that's it, that's the vibe. it's the struct. it's the page fault. periodt.
β¨ SYNOPSIS β¨
here's the whole thing, character for character, no cap β don't let the #defines scare you, they're just chillin' inside the struct:
struct xe_pagefault {
struct xe_gt *gt;
struct {
u64 page_addr;
u32 asid;
u8 access_type;
#define XE_PAGEFAULT_ACCESS_TYPE_MASK GENMASK(1, 0);
#define XE_PAGEFAULT_ACCESS_PREFETCH BIT(7);
u8 fault_type_level;
#define XE_PAGEFAULT_TYPE_LEVEL_NACK 0xff ;
#define XE_PAGEFAULT_LEVEL_MASK GENMASK(3, 0);
#define XE_PAGEFAULT_TYPE_MASK GENMASK(7, 4);
u8 engine_class;
u8 engine_instance;
u64 reserved;
} consumer;
struct {
void *private;
const struct xe_pagefault_ops *ops;
#define XE_PAGEFAULT_PRODUCER_MSG_LEN_DW 4;
u32 msg[XE_PAGEFAULT_PRODUCER_MSG_LEN_DW];
} producer;
};
likeβ¦ she's got two whole nested structs inside her, consumer and producer, and they each have a job. main character energy fr fr π«Ά
π Members π
gtβ the GT of the fault. that's the graphics tile in question, bestie, so you know exactly who's having the moment.consumerβ all the state for the software that's handling the fault. it gets populated by the producer, and heads up: the consumer is allowed to modify it, specifically so it can send info back to the producer once the fault gets acknowledged. it's giving two-way communication πconsumer.page_addrβ the address of the page fault πconsumer.asidβ the address space IDconsumer.access_typeβ the access type and the prefetch flag, packed together into oneu8. efficient queen.consumer.fault_type_levelβ the fault type and level, kept as au8instead of anenumpurely to keep the size compact. lowkey iconic of her.consumer.engine_classβ engine classconsumer.engine_instanceβ engine instanceconsumer.reservedβ reserved bits for future expansion π (future-proofing, we love to see it)
producerβ state for the producer, aka the HW/FW interface. this one is populated by the producer and β listen to me β it should not be modified by the consumer. it shouldn't even be inspected by the consumer, except for the one specific reason of calling operations. so likeβ¦ hands off, unless you're calling ops. πproducer.privateβ private pointerproducer.opsβ operationsproducer.msgβ the page fault message. the producer uses it during fault acknowledgment to formulate the response back to the HW/FW interface. and the reason it's baked into the page-fault message at all? because the producer typically catches the fault in a context where it literally cannot allocate memory β think atomic context or the reclaim path. no malloc for you. π
π¦ Description π¦
so this is the generic page fault structure, and it exists for communication between the producer and the consumer. she is carefully sized to be 64 bytes β exactly, deliberately, on purpose. π
when a device page fault happens, the producer fills this bad boy in, and then the consumer copies it into the page-fault queue so it can be handled later, deferred-style. no rush, no panic, just queue it and slay later. β¨
real talk though: the producer half is read-only for consumers β the manpage says don't modify it, don't even inspect it, except to call operations. that's not a suggestion, that's the contract. π«Ά
β SEE ALSO β
- Kernel file
./drivers/gpu/drm/xe/xe_pagefault_types.hβstruct xe_pagefault_queue(9)(go read that one next, iykyk)
and that's the whole page, bestie! source is ./drivers/gpu/drm/xe, from the October 2026 era of the Kernel API Manual, documenting struct xe_pagefault(9). go forth and fault gracefully ππ¦π
π¦ 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