From 6fe24f3b8e480331d522adabc4ea6a84b4d74e45 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Thu, 1 Oct 2026 19:25:43 -0400 Subject: 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). --- kernel/gsp_phys_booter.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'kernel/gsp_phys_booter.c') 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; } -- cgit v1.2.3