From 00b41b85389fe08be780d0e6134e9e891ea65399 Mon Sep 17 00:00:00 2001 From: Peter Daifuku Date: Sun, 18 Nov 2018 16:55:15 -0800 Subject: gpu: nvgpu: align size to page size in vgpu map Align size to the page size in vgpu_gp10b_locked_gmmu_map before setting up the memory descriptors being passed to the RM server Bug 2212569 Bug 200528973 Change-Id: I7149f3116c2c4c909f77cd791f5954ad8c486073 Signed-off-by: Peter Daifuku Reviewed-on: https://git-master.nvidia.com/r/1953444 (cherry picked from commit 0babd46eb49d9d1b2f8562cea17a419677619b0e) Reviewed-on: https://git-master.nvidia.com/r/2140963 Reviewed-by: svc-mobile-coverity Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Thomas Steinle Reviewed-by: Satish Arora Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu') diff --git a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c index 6017046f..4b06aea8 100644 --- a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c +++ b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c @@ -1,7 +1,7 @@ /* * Virtualized GPU Memory Management * - * Copyright (c) 2015-2018, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2015-2019, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -108,6 +108,10 @@ u64 vgpu_gp10b_locked_gmmu_map(struct vm_gk20a *vm, goto fail; } sgl = sgt->sgl; + + /* Align size to page size */ + size = ALIGN(size, page_size); + while (sgl) { u64 phys_addr; u64 chunk_length; -- cgit v1.2.2