drm/amdgpu: check alignment on CPU page for bo map
authorXℹ Ruoyao <xry111@mengyan1223.wang>
Tue, 30 Mar 2021 15:33:34 +0000 (23:33 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 9 Apr 2021 20:50:00 +0000 (16:50 -0400)
commit9a89a721b41b23c6da8f8a6dd0e382966a850dcf
tree12ac97808cc47f388d90992c067e5eeb4c216fa3
parentf4d3da72a76a9ce5f57bba64788931686a9dc333
drm/amdgpu: check alignment on CPU page for bo map

The page table of AMDGPU requires an alignment to CPU page so we should
check ioctl parameters for it.  Return -EINVAL if some parameter is
unaligned to CPU page, instead of corrupt the page table sliently.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Xi Ruoyao <xry111@mengyan1223.wang>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c