diff options
| author | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-11-16 14:14:26 -0500 |
|---|---|---|
| committer | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-11-16 14:14:26 -0500 |
| commit | 9731649e1284d544be111b381b8b77a45d209f2d (patch) | |
| tree | fb56af67dfddc312007e037d54be7a07f739b921 /kernel | |
| parent | 60b1bf75002eb33dc46f7c2354d0c6f3d39aec99 (diff) | |
| download | open-iov-9731649e1284d544be111b381b8b77a45d209f2d.tar.gz open-iov-9731649e1284d544be111b381b8b77a45d209f2d.zip | |
vgsp: eng89i - 16384-word raw window, 32-slot candidate ring, start snap
c946-c951 admitted the big 14865-word draw window but refused it at
raw_ok=0: the raw[] capture kept only the last 4096 words of a 14895-word
push. Raise GSP_PHYS_GR_RAW_WORDS/SVC_GR_PUSH_WORDS to 16384 (64 KB
static each; the IR pack stays 4096 and its maxa bound unchanged) and the
candidate ring 8 -> 32 so a three-chunk window is not truncated.
Add WIN-START-SNAP: c949-c951 admitted start=0x78 where w0=0x3f800000
parses as op=1 count=0xf80 (data, not a method header; the real BEGIN
run is at 0xe8). If the start word is not a plausible method header, scan
forward up to 0x400 bytes for the first plausible one and replay from
there; bounded receipt names old/new.
c949 was the first boot with guest surface stores from the engine
(GUEST-WIT 601/2030 pages, va=0x120400000, post=0xff000000); the beef
big-window replay is now the remaining gate.
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/gsp_phys_booter.h | 2 | ||||
| -rw-r--r-- | kernel/gsp_sema_service.c | 52 |
2 files changed, 51 insertions, 3 deletions
diff --git a/kernel/gsp_phys_booter.h b/kernel/gsp_phys_booter.h index 5a94f93..7760e9a 100644 --- a/kernel/gsp_phys_booter.h +++ b/kernel/gsp_phys_booter.h @@ -397,7 +397,7 @@ void gsp_phys_backend_relay_counters(u64 *requested, u64 *ok, u64 *verify_fail, * (svc_gl_stream_chunks) can run instead of falling back. Must equal * SVC_GR_PUSH_WORDS (static_assert in gsp_sema_service.c). */ -#define GSP_PHYS_GR_RAW_WORDS 4096u +#define GSP_PHYS_GR_RAW_WORDS 16384u /* * B-2 (large-operand data path): the grown, boot-fixed GR data-bounce region. diff --git a/kernel/gsp_sema_service.c b/kernel/gsp_sema_service.c index 8cc7aaa..4b3c24c 100644 --- a/kernel/gsp_sema_service.c +++ b/kernel/gsp_sema_service.c @@ -9116,7 +9116,7 @@ static struct svc_fwd_cand svc_fwd_cand; * method-aligned svc_gl_stream_chunks() split (<=448-word chunks, six * per frame) can run. Must stay equal to GSP_PHYS_GR_RAW_WORDS. */ -#define SVC_GR_PUSH_WORDS 4096 +#define SVC_GR_PUSH_WORDS 16384 #define SVC_GR_QMD_WORD_NONE 0xffffffffu /* svc_gr_cand.rel_flags bits (decoded from qmd[24] and qmd[4]). */ #define SVC_GR_REL_REDUCTION 0x1u @@ -9250,7 +9250,7 @@ struct svc_gr_cand_rec { * evict its own later chunks (or the X channel's pending candidate) before * the pump drained them. */ -#define SVC_GR_CAND_RING 8 +#define SVC_GR_CAND_RING 32 static struct svc_gr_cand_rec svc_gr_cand_ring[SVC_GR_CAND_RING]; static u32 svc_gr_cand_pos; #define svc_gr_cand (svc_gr_cand_ring[svc_gr_cand_pos]) @@ -12105,6 +12105,27 @@ module_param_named(sema_gl_win_rt0_admit, svc_gl_rt0_class_admit, bool, 0644); MODULE_PARM_DESC(sema_gl_win_rt0_admit, "Admit a beef draw-synth window to the verbatim replay lane when its FIRST colour-target write is a usable surface-class bind even if the last-write heuristic refuses it (default 1)"); +/* + * eng89i: method-header plausibility for window-start alignment. The + * direct-GL draw push's section opener can point at a data word (c949-c951: + * start=0x78 where w0=0x3f800000 parses as op=1 cnt=0xf80 and swallows the + * window as data; the real BEGIN run starts at 0xe8). A real method header + * uses op 1/3/4/5 with a plausible count and method address. + */ +static bool svc_gl_hdr_plausible(const u8 *p, u32 rem) +{ + u32 w, op, cnt, m; + + if (!p || rem < 4u) + return false; + memcpy(&w, p, 4); + op = (w >> 29) & 7u; + cnt = (w >> 16) & 0xfffu; + m = (w & 0x1fffu) << 2; + return (op == 1u || op == 3u || op == 4u || op == 5u) && + cnt <= 0x400u && m <= 0x3ffcu; +} + static bool svc_gl_window_rt_first_valid(const u8 *buf, u32 len, u32 start_off, u32 at_off) { @@ -23161,6 +23182,33 @@ static void svc_decode_stream(struct nv_vgpu_device *vgpu, const u8 *buf, u32 keep_pay = svc_gl.rel_payload; u32 wstart = gl_win_start ? gl_win_start : off; + /* + * eng89i: snap a data-led start to the first plausible + * method header within 0x400 bytes. Without this the + * first replay chunk parses data as methods and the + * lane poisons (c949-c951). + */ + if (gl_win_start && + !svc_gl_hdr_plausible(buf + wstart, len - wstart)) { + u32 scan; + + for (scan = wstart + 4u; + scan + 4u <= len && scan <= wstart + 0x400u; + scan += 4u) { + if (svc_gl_hdr_plausible(buf + scan, + len - scan)) { + if (svc_gl_np_log < 64) { + svc_gl_np_log++; + pr_info("sema-gl: WIN-START-SNAP h=0x%x push=0x%llx old=0x%x new=0x%x\n", + ch->h_object, + push_va, + wstart, scan); + } + wstart = scan; + break; + } + } + } memset(&svc_gl, 0, sizeof(svc_gl)); svc_gl.seen = true; svc_gl.subch = subch; |
