summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_sema_service.c
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-11-12 01:32:25 -0500
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-11-12 01:32:25 -0500
commit91aa8d91b54a2f9393d9582925464948b673601d (patch)
tree2f07a0b92d32e02bf298f19272397cac8e30cda9 /kernel/gsp_sema_service.c
parentfa985e759707ce011bd238bbbb73bc422fccb90f (diff)
downloadopen-iov-91aa8d91b54a2f9393d9582925464948b673601d.tar.gz
open-iov-91aa8d91b54a2f9393d9582925464948b673601d.zip
vgsp: aperture-aware foreign USERD guard and wire fallback
c24 (V30) skipped the X/GLX channel's own sysmem USERD block because the same numeric PA 0x8f0000 is owned by the RC watchdog channel in vidmem; the X server then failed with 'Failed to initialize DMA' and 'Failed to allocate push buffer'. Compare the aperture as well as the page, and keep base 0 + userdOffset as a fallback when the client memory-object table cannot name the USERD (the resolver still wins when it has a verified object). This restores the c23 X bring-up while keeping the fail-closed table path. Validation pending a fresh V31 cycle: X starts, glxinfo/glxgears, chan_dump userd page/aper, and the USERD resolution/fallback witness lines.
Diffstat (limited to 'kernel/gsp_sema_service.c')
-rw-r--r--kernel/gsp_sema_service.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/kernel/gsp_sema_service.c b/kernel/gsp_sema_service.c
index 146291c..6bf2b38 100644
--- a/kernel/gsp_sema_service.c
+++ b/kernel/gsp_sema_service.c
@@ -27233,6 +27233,7 @@ ce_fb_scan:
* write target for GP_GET.
*/
u64 foreign_userd_pages[SVC_MAX_CHANNELS];
+ u32 foreign_userd_as[SVC_MAX_CHANNELS];
unsigned long chflags;
u32 foreign_userd_n = 0;
u32 oi;
@@ -27249,8 +27250,11 @@ ce_fb_scan:
if (other->h_object == ch->h_object &&
other->vgpu == ch->vgpu)
continue;
- foreign_userd_pages[foreign_userd_n++] =
+ foreign_userd_pages[foreign_userd_n] =
other->userd_pa & ~0xfffULL;
+ foreign_userd_as[foreign_userd_n] =
+ other->userd_as;
+ foreign_userd_n++;
}
spin_unlock_irqrestore(&svc.chan_lock, chflags);
@@ -27296,7 +27300,16 @@ ce_fb_scan:
*/
page = off & ~0xfffULL;
for (oi = 0; oi < foreign_userd_n; oi++) {
- if (foreign_userd_pages[oi] == page) {
+ /*
+ * CONT.438b: the same numeric PA can
+ * exist in sysmem and vidmem (c23:
+ * X's 0x8f0000 sysmem block vs the
+ * RC watchdog's 0x8f0000 FB block).
+ * Only a same-aperture owner makes
+ * the candidate foreign.
+ */
+ if (foreign_userd_pages[oi] == page &&
+ foreign_userd_as[oi] == ch->userd_as) {
foreign = true;
break;
}