STRUCT XE_GUC_CT(9)
π struct xe_guc_ct(9)
okay bestie, buckle up β this is a page straight out of the Kernel API Manual, and it's all about struct xe_guc_ct, the GuC command transport (CT) layer. it's giving "the group chat between the Host and the GuC" and honestly? iconic. π
β¨ SYNOPSIS β¨
struct xe_guc_ct {
struct mutex lock;
spinlock_t fast_lock;
struct {
struct guc_ctb h2g;
struct guc_ctb g2h;
} ctbs;
u32 g2h_outstanding;
struct work_struct g2h_worker;
struct delayed_work safe_mode_worker;
enum xe_guc_ct_state state;
u32 fence_seqno;
struct xarray fence_lookup;
wait_queue_head_t wq;
wait_queue_head_t g2h_fence_wq;
struct workqueue_struct *g2h_wq;
u32 msg[GUC_CTB_MSG_MAX_LEN];
u32 fast_msg[GUC_CTB_MSG_MAX_LEN];
#if IS_ENABLED(CONFIG_DRM_XE_DEBUG);
struct xe_dead_ct dead;
struct xe_fast_req_fence fast_req[SZ_32];
#endif;
};
like, look at her. she's got locks, she's got workqueues, she's got buffers. main character energy fr fr. π
πΈ Members πΈ
time for the roll call, everyone say hi π
lockβ protects everything in CT layer. everything. she's the bodyguard of this whole struct, no cap.fast_lockβ protects G2H channel and credits. the speedy little lock for the receive side β‘ctbsβ buffers for sending and receiving commands. the actual mailboxes, bestie π¬ctbs.h2gβ Host to GuC (H2G, send) channel β this is you sliding into GuC's DMsctbs.g2hβ GuC to Host (G2H, receive) channel β and this is GuC replying back π
g2h_outstandingβ number of outstanding G2H. lowkey a counter of "how many texts are still on read" πg2h_workerβ worker to process G2H messages. the one who actually goes through the inboxsafe_mode_workerβ worker to check G2H messages with IRQ disabled. careful mode ON, no interruptions allowed π₯stateβ CT state. her current mood, basically.fence_seqnoβ G2H fence seqno - 16 bits used by CT. only 16 bits, so act accordingly πfence_lookupβ G2H fence lookup. the little index so you can find your fences againwqβ wait queue used for reliable CT sends and freeing G2H credits. you wait here. patiently. π«Άg2h_fence_wqβ wait queue used for G2H fencing. a second wait queue, because one is never enoughg2h_wqβ used to process G2H. the workqueue doing the actual processingmsgβ Message buffer. exactly what it says on the tin πfast_msgβ Message buffer. the same thing, but fast β¨deadβ information for debugging dead CTs π yes the field is literally calleddead, we love a dramatic queenfast_reqβ history of FAST_REQ messages for matching with G2H error responses. receipts, kept for later π§Ύ
π¦ Description π¦
so what does she do? simple: this struct includes a pair of CT buffers for bi-directional communication π« plus all the tracking for the H2G and G2H requests sent and received through those buffers. two-way street, both directions monitored, everybody accounted for. periodt. π
β SEE ALSO β
go read these next, iykyk:
- Kernel file
./drivers/gpu/drm/xe/xe_guc_ct_types.h struct guc_ctb_info(9)struct guc_ctb(9)struct guc_ctb_snapshot(9)struct xe_guc_ct_snapshot(9)enum xe_guc_ct_state(9)
and that's the whole vibe check, bestie π this page lives in ./drivers/gpu/drm/xe, dated October 2026, and it's literally titled struct xe_guc_ct(9). go forth and ship it π
π
π¦ 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