From bd8ad491365bf0164d7b397564f051b014da92d1 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Wed, 7 Oct 2026 14:25:18 -0400 Subject: vgsp: m99 - identity-map the forwarded kernel's guest data pages into the engine tree The m97/m98 decode proved the SM instruction fetch and const reads work; the wall is the kernel's first global data access (prologue instruction at +0x80) to a guest-VA device pointer (param page words 6..9 carry the demo's two 16MB buffers at 0x763dXXXXXXXX), which is not mapped in the engine's page tables. The walker walks OUR root->PD2->PD1->PD0->PT tree (SC PDB == our VASPDB chunk, proven by matching the same-run INST base to the PDB-root DMA log), and fresh direct-planted tables are visible at first fetch. Service side (gsp_sema_service.c): svc_gr_data_fill() scans the param (c[0x0]) page for plausible device VAs, resolves the containing 2MB windows (-1..+16 windows, early stop when a window resolves nothing) via svc_resolve_va on the service thread, and carries {va, pa} in svc_fwd_req.gr_data; svc_fwd_gr_work() converts PA->HPA and attaches the list to the submit. Backend (gsp_phys_booter.c): gsp_phys_rmcall_gr_data_map() plants VA->HPA leaf PTEs (GENERIC_MEMORY kind 0x06, like UVM/RM on Turing) into lazily allocated PD1/PD0/PT chunk branches under root[0] (VAs < 2^47), caching branches per index; the submit maps all req->data pages before publish and logs the count. --- kernel/gsp_phys_booter.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'kernel/gsp_phys_booter.h') diff --git a/kernel/gsp_phys_booter.h b/kernel/gsp_phys_booter.h index e46fb86..29cf07f 100644 --- a/kernel/gsp_phys_booter.h +++ b/kernel/gsp_phys_booter.h @@ -362,6 +362,12 @@ struct gsp_phys_gr_inline { u8 data[GSP_PHYS_GR_INLINE_BYTES]; }; +/* m99: one guest data page identity-mapped into the engine's page tree. */ +struct gsp_phys_gr_data_page { + u64 va; /* guest VA, page aligned */ + u64 hpa; /* host PA, page aligned */ +}; + struct gsp_phys_gr_submit { const u32 *qmd; /* 64 rewritten-QMD source words */ u32 qmd_words; /* must be GSP_PHYS_GR_QMD_WORDS */ @@ -382,6 +388,8 @@ struct gsp_phys_gr_submit { u32 n_pages; const struct gsp_phys_gr_inline *inl; u32 n_inl; + const struct gsp_phys_gr_data_page *data; /* m99: identity pages */ + u32 n_data; u64 rel_hpa; /* guest-visible QMD release0 page, or 0 */ u32 rel_off; u32 rel_payload; -- cgit v1.2.3