diff options
| author | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-10-23 20:09:08 -0400 |
|---|---|---|
| committer | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-10-23 20:09:08 -0400 |
| commit | bd01273cd1b221f55eb484e8b7fd742417a4d4bd (patch) | |
| tree | df3763a5e427939fdeebaac162fb68b90f094351 /kernel/gsp_rm_emulation.c | |
| parent | ccdc1240d5df9777503a05b247109b6136d03313 (diff) | |
| download | open-iov-bd01273cd1b221f55eb484e8b7fd742417a4d4bd.tar.gz open-iov-bd01273cd1b221f55eb484e8b7fd742417a4d4bd.zip | |
r578 diag: event-function reachability probe (gsp_rm_ev_func)
The r577 A/B (sequence, bNotifyList, hClient) all yielded nv_post_event=0
with every record consumed by the guest: the drop is content-independent.
This knob posts event records with a caller-chosen RPC function instead of
POST_EVENT 0x1003; posting an event whose handler has an unmistakable guest
side effect (UCODE_LIBOS_PRINT 0x100C trips NV_ASSERT_FAILED on an
unsupported ucode; OS_ERROR_LOG 0x1006 logs an errString) proves whether
the guest dispatches our status-queue event records at all - dispatch vs
consumed-without-dispatch decides the next probe (inside _kgspRpcPostEvent
or earlier in the drain).
Diffstat (limited to 'kernel/gsp_rm_emulation.c')
| -rw-r--r-- | kernel/gsp_rm_emulation.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/kernel/gsp_rm_emulation.c b/kernel/gsp_rm_emulation.c index f44c01b..357997c 100644 --- a/kernel/gsp_rm_emulation.c +++ b/kernel/gsp_rm_emulation.c @@ -770,6 +770,19 @@ static void gsp_rm_evlog_post(struct nv_vgpu_device *vgpu, unsigned gsp_rm_ev_seq; unsigned gsp_rm_ev_nlist; unsigned gsp_rm_ev_cl; +/* + * r578: reachability probe for the guest-RM event drop. When nonzero, event + * records carry this RPC function instead of POST_EVENT (0x1003). Posting a + * function with an unmistakable guest-side side effect (e.g. + * NV_VGPU_MSG_EVENT_UCODE_LIBOS_PRINT 0x100C with an unsupported ucodeEngDesc + * trips NV_ASSERT_FAILED in _kgspRpcUcodeLibosPrint, or + * NV_VGPU_MSG_EVENT_OS_ERROR_LOG 0x1006 logs an errString) proves whether + * the guest ever DISPATCHES our status-queue event records: visible side + * effect => the dispatch works and POST_EVENT is dropped inside + * _kgspRpcPostEvent; no side effect => the records are consumed without + * dispatch. + */ +unsigned gsp_rm_ev_func; static void gsp_rm_fill_ev_payload(const struct gsp_rm_emu *rm, u32 i, u8 *payload) @@ -793,6 +806,11 @@ static u32 gsp_rm_ev_sequence(const struct gsp_rm_emu *rm) return gsp_rm_ev_seq ? rm->stat_seq : 0; } +static u32 gsp_rm_ev_function(void) +{ + return gsp_rm_ev_func ? gsp_rm_ev_func : GSPRM_RPC_EVENT_POST_EVENT; +} + /* * Post the GPU event that tells the guest's CPU-side RM a channel's * submitted work is complete. A real GPU raises an interrupt, the host GSP @@ -827,8 +845,7 @@ int gsp_rm_post_channel_event(struct nv_vgpu_device *vgpu, u32 h_src) gsp_rm_fill_ev_payload(rm, i, payload); { - int rc = gsp_rm_send_flags(ctx, - GSPRM_RPC_EVENT_POST_EVENT, + int rc = gsp_rm_send_flags(ctx, gsp_rm_ev_function(), gsp_rm_ev_sequence(rm), 0, payload, sizeof(payload), true); @@ -854,7 +871,7 @@ int gsp_rm_post_channel_event(struct nv_vgpu_device *vgpu, u32 h_src) gsp_rm_fill_ev_payload(rm, i, payload); { int rc = gsp_rm_send_flags(ctx, - GSPRM_RPC_EVENT_POST_EVENT, + gsp_rm_ev_function(), gsp_rm_ev_sequence(rm), 0, payload, sizeof(payload), @@ -896,7 +913,7 @@ static int gsp_rm_post_event_idx(struct gsp_emu_context *ctx, u32 idx) gsp_rm_fill_ev_payload(rm, idx, payload); - rc = gsp_rm_send(ctx, GSPRM_RPC_EVENT_POST_EVENT, + rc = gsp_rm_send(ctx, gsp_rm_ev_function(), gsp_rm_ev_sequence(rm), 0, payload, sizeof(payload)); if (!rc) rm->events[idx].last_post = jiffies; @@ -977,7 +994,7 @@ int gsp_rm_post_all_events(struct nv_vgpu_device *vgpu) gsp_rm_fill_ev_payload(rm, i, payload); { - int rc = gsp_rm_send(ctx, GSPRM_RPC_EVENT_POST_EVENT, + int rc = gsp_rm_send(ctx, gsp_rm_ev_function(), gsp_rm_ev_sequence(rm), 0, payload, sizeof(payload)); |
