summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_phys_booter.c
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-06 16:43:42 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-06 16:43:42 -0400
commit1216d19c93b390abbd761f3ad817afe69325f1a9 (patch)
tree9891c5c0cefe1dc09cd0d18e6ba709ebc0a40f0d /kernel/gsp_phys_booter.c
parent191100b51d1e6ed36bf4ff776107d551c4793621 (diff)
downloadopen-iov-1216d19c93b390abbd761f3ad817afe69325f1a9.tar.gz
open-iov-1216d19c93b390abbd761f3ad817afe69325f1a9.zip
vgsp: preserve the pointer page offset in the shadow QMD rewrite (program +0x800)
Diffstat (limited to 'kernel/gsp_phys_booter.c')
-rw-r--r--kernel/gsp_phys_booter.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/kernel/gsp_phys_booter.c b/kernel/gsp_phys_booter.c
index 159751b..a4d9718 100644
--- a/kernel/gsp_phys_booter.c
+++ b/kernel/gsp_phys_booter.c
@@ -14548,8 +14548,17 @@ int gsp_phys_backend_guest_gr_submit(const struct gsp_phys_gr_submit *req,
n_shadow),
&sh_va);
if (!ret) {
- u64 ptr_va = sh_va +
- (pg->guest_va &
+ /*
+ * Preserve the original pointer's page
+ * offset: pg->guest_va is page-based,
+ * but the QMD pair (still the guest's
+ * value here) carries the exact entry
+ * offset (e.g. program +0x800). Without
+ * it the engine would fetch the wrong
+ * slot of the copied page.
+ */
+ u64 ptr_va = sh_va |
+ ((u64)qmd[pg->qmd_word] &
(GSP_PHYS_PAGE_SIZE - 1));
n_shadow++;