gpu: nvgpu: Exclude first page from vidmem size

We initialized vidmem allocator with base=4K, and size of 4GB. This
caused allocator to allocate addresses between 4K and 4GB+4K, causing
a physical MMU fault.

Bug 1793810

Change-Id: I554f62aeee4080acd86ef2c8011089ec9b8120df
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1196300
(cherry picked from commit 41a860e21c6da3f8fda58ceb56e78316f6987f53)
Reviewed-on: http://git-master/r/1200712
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Terje Bergstrom
2016-08-02 14:47:59 -07:00
parent 4a979fd7bc
commit 6effe31755

View File

@@ -765,7 +765,7 @@ static int gk20a_init_vidmem(struct mm_gk20a *mm)
return 0;
err = gk20a_buddy_allocator_init(&g->mm.vidmem.allocator, "vidmem",
SZ_4K, size, SZ_4K, 0);
SZ_4K, size - SZ_4K, SZ_4K, 0);
if (err) {
gk20a_err(d, "Failed to register vidmem for size %zu: %d",
size, err);