STRUCT XE_GUC_CT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ 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 DMs
    • ctbs.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 inbox
  • safe_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 again
  • wq β€” 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 enough
  • g2h_wq β€” used to process G2H. the workqueue doing the actual processing
  • msg β€” 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 called dead, we love a dramatic queen
  • fast_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