code wiki / _hdl_build / _gpu_dxg_pagingqueue_gate.nx

_gpu_dxg_pagingqueue_gate.nx

buildroot/runtime/_hdl_build/_gpu_dxg_pagingqueue_gate.nx

11375 B141 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind gate/prooftopic gpu
docsdependenciesstructsconstsfunctions

about

_gpu_dxg_pagingqueue_gate.nx -- SOVEREIGN-GPU ladder R4c (create a GPU PAGING QUEUE + fence on the 5080). R4b read the real VRAM budget. R4c creates the WDDM residency-manager object (the paging queue) that GPU memory is paged/made-resident against via LX_DXCREATEPAGINGQUEUE -- and the kernel mmaps a FENCE PAGE into our address space for lock-free CPU<->GPU fence polling. This is the residency substrate for real allocations (R4d) + command submission (R4e). ABI (recon-pinned LIVE, _gpu_dxg_r4c_pq_recon: no uapi header -> size-swept, only _IOC_SIZE=32 recognized; OUT offsets located by dump): LX_DXCREATEPAGINGQUEUE = _IOWR(0x47, 0x07, 32) = 0xC0204707 struct (32B): device @0 (in); priority @4 (in, 0=NORMAL); paging_queue @8 (OUT); sync_object @12 (OUT); fence_cpu_virtual_address @16 (u64, OUT -- a REAL page the kernel maps into us); physical_adapter_index @24 (in). GREEN iff (author=organ, from REAL device returns): A) device-create chain ok (enum/discrete/open-adapter/create-device all ret==0); B) CREATEPAGINGQUEUE #1 ret==0 AND paging_queue!=0 AND sync_object!=0 AND fence_VA!=0 (all written into pre-zeroed slots) AND fence_VA is a canonical userspace addr (<0x800000000000); C) the fence page is GENUINELY MAPPED: we DEREFERENCE fence_VA and read its u64 fence value -- if the VA were bogus the process would fault and never reach GREEN, so reaching the verdict after the read IS the proof; D) CREATEPAGINGQUEUE #2 ret==0 AND paging_queue2!=0 AND paging_queue2 != paging_queue1 (per-call allocation); E) TAMPER: T1 bogus device(0xdeadbeef) -> ret!=0 AND paging_queue stays 0; T2 wrong _IOC_SIZE(28) -> -ENOTTY; T3 on a non-dxg fd -> -ENOTTY. Marker -> knowledge/status/gpu_dxg.log (DXGPQGATE). raw syscalls only. NO-WAVE: creates a residency object + reads a fence page; NO compute/throughput claimed (that is R7). license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx _gpu_dxg_pagingqueue_gate.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main p sys_write sys_openat_rd sys_exit sys_mmap sys_ioctl rd32 query_type sys_mmap ↻ sys_ioctl ↻ rd32 ↻ open_from_luid sys_mmap ↻ sys_ioctl ↻ rd32 ↻ create_device sys_mmap ↻ sys_ioctl ↻ rd32 ↻ n sys_mmap ↻ sys_write ↻ x p ↻ sys_mmap ↻ sys_write ↻ create_pq sys_mmap ↻ sys_ioctl ↻ rd32 ↻ rd64 sys_close sys_openat_append fp sys_write ↻ fx sys_mmap ↻ fp ↻ sys_write ↻

structs

none

consts

28const ENUM2_CODE: i64 = 0xC0104714
29const QAI_CODE: i64 = 0xC0184709
30const OAFL_CODE: i64 = 0xC00C4701
31const CDEV_CODE: i64 = 0xC0404702
32const CPQ_CODE: i64 = 0xC0204707 // LX_DXCREATEPAGINGQUEUE (_IOWR(0x47,0x07,32), recon-pinned)
33const CPQ_BADSZ: i64 = 0xC01C4707 // wrong _IOC_SIZE=28 -> -ENOTTY tamper
34const USER_CANON: i64 = 0x800000000000

functions

36func p(s: *u8) -> i64 { var nn: i64=0; while s[nn]!=(0 as u8){nn=nn+1} sys_write(1,s,nn); return 0 }
called by 2: xmain calls 1: sys_write
37func fp(fd: i64, s: *u8) -> i64 { var nn: i64=0; while s[nn]!=(0 as u8){nn=nn+1} sys_write(fd,s,nn); return 0 }
called by 2: fxmain calls 1: sys_write
38func n(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(1,bb,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
39func x(v: i64) -> i64 { p("0x" as *u8); let bb:*u8=sys_mmap(20); var k:i64=0; var m:i64=v; if m==0{bb[0]=48;k=1}; while m>0{ let d:i64=m&15; if d<10{bb[k]=(48+d) as u8}else{bb[k]=(87+d) as u8}; m=(m>>4); k=k+1 } var i:i64=0; let o:*u8=sys_mmap(20); while i<k{o[i]=bb[k-1-i];i=i+1} sys_write(1,o,k); return 0 }
called by 1: main calls 3: psys_mmapsys_write
40func fx(fd: i64, v: i64) -> i64 { let bb:*u8=sys_mmap(20); var k:i64=0; var m:i64=v; if m==0{bb[0]=48;k=1}; while m>0{ let d:i64=m&15; if d<10{bb[k]=(48+d) as u8}else{bb[k]=(87+d) as u8}; m=(m>>4); k=k+1 } let o:*u8=sys_mmap(20); var i:i64=0; while i<k{o[i]=bb[k-1-i];i=i+1} fp(fd,"0x" as *u8); sys_write(fd,o,k); return 0 }
called by 1: main calls 3: sys_mmapfpsys_write
41func rd32(buf: *u8, off: i64) -> i64 { return (buf[off] as i64)|((buf[off+1] as i64)<<8)|((buf[off+2] as i64)<<16)|((buf[off+3] as i64)<<24) }
42func rd64(buf: *u8, off: i64) -> i64 { let q: *i64 = (buf as i64 + off) as *i64; return q[0] }
called by 1: create_pq
44func query_type(fd: i64, handle: i64, qtype: i64, psize: i64, outv: *i64) -> i64
called by 1: main calls 3: sys_mmapsys_ioctlrd32
52func open_from_luid(fd: i64, luid_lo: i64, luid_hi: i64, outh: *i64) -> i64
called by 1: main calls 3: sys_mmapsys_ioctlrd32
57func create_device(fd: i64, adapter: i64, outd: *i64) -> i64
called by 1: main calls 3: sys_mmapsys_ioctlrd32
63func create_pq(fd: i64, code: i64, device: i64, outpq: *i64, outsync: *i64, outfva: *i64) -> i64
called by 1: main calls 4: sys_mmapsys_ioctlrd32rd64
70func main() -> i64