From 682c32c65569ec363a759362fdd0a7d9d1b03116 Mon Sep 17 00:00:00 2001 From: Gang Deng Date: Mon, 4 Dec 2023 14:28:14 +0800 Subject: [PATCH] nvidia: bugfix when access remote vma The address mapped was always the start address which was wrong. Signed-off-by: Gang Deng Signed-off-by: Xu Yu --- kernel-open/nvidia/nv-mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel-open/nvidia/nv-mmap.c b/kernel-open/nvidia/nv-mmap.c index 3db8b8075..4fe822ccb 100644 --- a/kernel-open/nvidia/nv-mmap.c +++ b/kernel-open/nvidia/nv-mmap.c @@ -172,7 +172,7 @@ nvidia_vma_access( } else if (IS_FB_OFFSET(nv, offset, length)) { - addr = (offset & PAGE_MASK); + addr = (offset & PAGE_MASK) + pageIndex * PAGE_SIZE; kernel_mapping = os_map_kernel_space(addr, PAGE_SIZE, NV_MEMORY_UNCACHED); if (kernel_mapping == NULL) return -ENOMEM;