summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_phys_booter.c
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-01 19:25:43 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-01 19:25:43 -0400
commitc99d6eaa464937f979b474ab971b63250d340ea7 (patch)
treebe7997aa422931f730aa1cfcc26d710aa841451c /kernel/gsp_phys_booter.c
parent1053f3bd77c83d14f906dad7fdc8f3686d742b39 (diff)
downloadopen-iov-c99d6eaa464937f979b474ab971b63250d340ea7.tar.gz
open-iov-c99d6eaa464937f979b474ab971b63250d340ea7.zip
gsp-phys: use the 4-entry GP10X root format for the VAS page directory
The TU104 GMMU root level has 2 index bits (4 PDEs of 2^47 bytes each), so the server's vaLimitNew = (numEntries << 47) - 1 must stay within its vaLimitMax = 2^49-1; numEntries=256 computed 2^55-1 and drew NV_ERR_INVALID_ARGUMENT (0x1f). Send 4 entries (32 bytes of the 4 KB page-aligned VASPDB chunk) and log the value on failure. The aperture/flags word is unchanged (0x0a, SYSMEM_NONCOH + ALL_CHANNELS).
Diffstat (limited to 'kernel/gsp_phys_booter.c')
-rw-r--r--kernel/gsp_phys_booter.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/kernel/gsp_phys_booter.c b/kernel/gsp_phys_booter.c
index b5ec52b..920ccdb 100644
--- a/kernel/gsp_phys_booter.c
+++ b/kernel/gsp_phys_booter.c
@@ -236,7 +236,14 @@ bool gsp_phys_boot_requested(void)
#define GSP_PHYS_RMCALL_VAS_FLAG_IS_EXTERNALLY_OWNED BIT(3)
#define GSP_PHYS_RMCALL_VAS_FLAG_ALLOW_ZERO_ADDRESS BIT(8)
#define GSP_PHYS_RMCALL_VAS_SIZE 0x10000000ULL
-#define GSP_PHYS_RMCALL_PDB_NUM_ENTRIES 256u
+/*
+ * Turing/TU104 uses the GP10X GMMU root format: the root level has 2 index
+ * bits, i.e. exactly 4 entries covering 2^47 bytes each, and the server caps
+ * the external root at vaLimitMax = 2^49-1 with vaLimitNew =
+ * (numEntries << 47) - 1, so numEntries must not exceed 4. The 4 KB zeroed,
+ * page-aligned VASPDB chunk backs the 4 x 8 B = 32 B root PDB.
+ */
+#define GSP_PHYS_RMCALL_PDB_NUM_ENTRIES 4u
#define GSP_PHYS_RMCALL_PDB_FLAG_APERTURE_SYSMEM_NONCOH BIT(1)
#define GSP_PHYS_RMCALL_PDB_FLAG_ALL_CHANNELS BIT(3)
#define GSP_PHYS_RMCALL_PDB_SUBDEVICE_ID 1u
@@ -4876,8 +4883,9 @@ static int gsp_phys_rmcall_stage3(void __iomem *bar0)
&pdb, sizeof(pdb), 16, NULL, 0,
&pdb_rpc, "DMA_SET_PAGE_DIRECTORY");
if (ret) {
- pr_err("gsp-phys-boot: rm-call: stage 3 aborted: DMA_SET_PAGE_DIRECTORY on hVas=0x%x failed (rpc_result=0x%x); the VAS has no page-directory base\n",
- boot_stage.rmcall_vas, pdb_rpc);
+ pr_err("gsp-phys-boot: rm-call: stage 3 aborted: DMA_SET_PAGE_DIRECTORY on hVas=0x%x numEntries=%u failed (rpc_result=0x%x); the VAS has no page-directory base\n",
+ boot_stage.rmcall_vas, le32_to_cpu(pdb.num_entries),
+ pdb_rpc);
return ret;
}