summaryrefslogtreecommitdiffstats
path: root/kernel
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
commit92f94219789dee8b16fec070c540d835f303a64f (patch)
treecaa4e17fe57c4b2150bf3e9f483249db450ce72f /kernel
parent0a0133d62da40a30bb97e9253ff25e80728185bc (diff)
downloadopen-iov-92f94219789dee8b16fec070c540d835f303a64f.tar.gz
open-iov-92f94219789dee8b16fec070c540d835f303a64f.zip
vgsp: preserve the pointer page offset in the shadow QMD rewrite (program +0x800)
Diffstat (limited to 'kernel')
-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++;