summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-07 15:28:07 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-07 15:28:07 -0400
commit32f1c3d3bd55b94dfea451056fade4f29b8e8874 (patch)
tree4a813ffdf449ee14d1e475a09c92e125519c19e3
parent406c9ff19d7b3470e938e0ddfee565a709453053 (diff)
downloadopen-iov-32f1c3d3bd55b94dfea451056fade4f29b8e8874.tar.gz
open-iov-32f1c3d3bd55b94dfea451056fade4f29b8e8874.zip
vgsp: m111 - prepare the mail page unconditionally in stage 3
m110 ran without gr_data_prewin, and the mail prep was nested inside that block - mail.pages stayed 0 and the injection failed with EINVAL. Move the mail page preparation out; it is 4 KB and harmless.
-rw-r--r--kernel/gsp_phys_booter.c48
1 files changed, 25 insertions, 23 deletions
diff --git a/kernel/gsp_phys_booter.c b/kernel/gsp_phys_booter.c
index fdd20db..33bed84 100644
--- a/kernel/gsp_phys_booter.c
+++ b/kernel/gsp_phys_booter.c
@@ -7330,6 +7330,31 @@ static int gsp_phys_rmcall_map_pt_window(void __iomem *bar0)
* tables. This mirrors the ctx-window installs above, which the
* engine honours (post-commit installs are accepted but ineffective).
*/
+ /*
+ * m108/m111: allocate and fill the mail message page in stage 3,
+ * where dma_alloc_coherent demonstrably works (the launch-time
+ * allocation failed silently in m106/m107). Unconditional so the
+ * mail injection works with or without the data pool.
+ */
+ if (!boot_stage.rmcall_gr_mail.pages) {
+ static const char mail[] =
+ "the little gpu man says you've got mail";
+
+ if (!gsp_phys_chunk_alloc(boot_stage.pdev,
+ &boot_stage.rmcall_gr_mail, 1u)) {
+ gsp_phys_chunk_zero(&boot_stage.rmcall_gr_mail);
+ memcpy(gsp_phys_chunk_page_va(
+ &boot_stage.rmcall_gr_mail, 0),
+ mail, sizeof(mail));
+ dma_wmb();
+ pr_info("vgsp-boot: rm-call: mail page prepared (%u bytes, dma=0x%llx)\n",
+ (u32)sizeof(mail),
+ (u64)gsp_phys_chunk_page_dma(
+ &boot_stage.rmcall_gr_mail, 0));
+ } else {
+ pr_err("vgsp-boot: rm-call: mail page allocation failed\n");
+ }
+ }
if (gsp_phys_rmcall_gr_data_prewin_value()) {
struct gsp_phys_rmcall_update_pde2_params dp;
unsigned int k;
@@ -7372,29 +7397,6 @@ static int gsp_phys_rmcall_map_pt_window(void __iomem *bar0)
/* the install may zero the PT page; leaves come later */
gsp_phys_chunk_zero(dpt);
}
- /*
- * m108: allocate and fill the mail message page here, where
- * dma_alloc_coherent demonstrably works (the pool above); the
- * launch-time allocation failed silently in m106/m107.
- */
- if (!boot_stage.rmcall_gr_mail.pages) {
- static const char mail[] =
- "the little gpu man says you've got mail";
-
- if (!gsp_phys_chunk_alloc(boot_stage.pdev,
- &boot_stage.rmcall_gr_mail,
- 1u)) {
- gsp_phys_chunk_zero(&boot_stage.rmcall_gr_mail);
- memcpy(gsp_phys_chunk_page_va(
- &boot_stage.rmcall_gr_mail, 0),
- mail, sizeof(mail));
- dma_wmb();
- pr_info("vgsp-boot: rm-call: mail page prepared (%u bytes)\n",
- (u32)sizeof(mail));
- } else {
- pr_err("vgsp-boot: rm-call: mail page allocation failed\n");
- }
- }
pr_info("vgsp-boot: rm-call: data PT pool installed: %u windows at pdeIndex %u..%u (VA 0x%llx..0x%llx)\n",
GSP_PHYS_RMCALL_GR_DATA_WINS,
(u32)(GSP_PHYS_RMCALL_VA_GR_DATA_BASE >> 21),