diff --git a/userspace/units/fifo/channel/nvgpu-channel.c b/userspace/units/fifo/channel/nvgpu-channel.c index bf80cd10f..267ddf1d2 100644 --- a/userspace/units/fifo/channel/nvgpu-channel.c +++ b/userspace/units/fifo/channel/nvgpu-channel.c @@ -657,12 +657,12 @@ static int stub_os_channel_alloc_usermode_buffers(struct nvgpu_channel *ch, int err; struct gk20a *g = ch->g; - err = nvgpu_dma_alloc(g, PAGE_SIZE, &ch->usermode_userd); + err = nvgpu_dma_alloc(g, NVGPU_CPU_PAGE_SIZE, &ch->usermode_userd); if (err != 0) { return err; } - err = nvgpu_dma_alloc(g, PAGE_SIZE, &ch->usermode_gpfifo); + err = nvgpu_dma_alloc(g, NVGPU_CPU_PAGE_SIZE, &ch->usermode_gpfifo); if (err != 0) { return err; } @@ -759,7 +759,7 @@ int test_channel_setup_bind(struct unit_module *m, struct gk20a *g, void *vargs) mm.g = g; vm.mm = &mm; ch->vm = &vm; - err = nvgpu_dma_alloc(g, PAGE_SIZE, &pdb_mem); + err = nvgpu_dma_alloc(g, NVGPU_CPU_PAGE_SIZE, &pdb_mem); unit_assert(err == 0, goto done); vm.pdb.mem = &pdb_mem; @@ -1330,7 +1330,7 @@ int test_channel_deterministic_idle_unidle(struct unit_module *m, mm.g = g; vm.mm = &mm; ch->vm = &vm; - err = nvgpu_dma_alloc(g, PAGE_SIZE, &pdb_mem); + err = nvgpu_dma_alloc(g, NVGPU_CPU_PAGE_SIZE, &pdb_mem); unit_assert(err == 0, goto done); vm.pdb.mem = &pdb_mem; @@ -1693,7 +1693,7 @@ int test_channel_semaphore_wakeup(struct unit_module *m, mm.g = g; vm.mm = &mm; ch->vm = &vm; - err = nvgpu_dma_alloc(g, PAGE_SIZE, &pdb_mem); + err = nvgpu_dma_alloc(g, NVGPU_CPU_PAGE_SIZE, &pdb_mem); unit_assert(err == 0, goto done); vm.pdb.mem = &pdb_mem; diff --git a/userspace/units/fifo/tsg/nvgpu-tsg.c b/userspace/units/fifo/tsg/nvgpu-tsg.c index fb86d8af4..639390f2a 100644 --- a/userspace/units/fifo/tsg/nvgpu-tsg.c +++ b/userspace/units/fifo/tsg/nvgpu-tsg.c @@ -696,7 +696,7 @@ int test_tsg_release(struct unit_module *m, } if (branches & F_TSG_RELEASE_MEM) { - nvgpu_dma_alloc(g, PAGE_SIZE, &mem); + nvgpu_dma_alloc(g, NVGPU_CPU_PAGE_SIZE, &mem); tsg->gr_ctx->mem = mem; } diff --git a/userspace/units/mm/gmmu/pd_cache/pd_cache.c b/userspace/units/mm/gmmu/pd_cache/pd_cache.c index 9be380470..24ec51eb8 100644 --- a/userspace/units/mm/gmmu/pd_cache/pd_cache.c +++ b/userspace/units/mm/gmmu/pd_cache/pd_cache.c @@ -54,41 +54,41 @@ struct pd_cache_alloc_direct_gen { * Direct alloc testing: i.e larger than a page allocs. */ static struct pd_cache_alloc_direct_gen alloc_direct_1xPAGE = { - .bytes = PAGE_SIZE, + .bytes = NVGPU_CPU_PAGE_SIZE, .nr = 1U, }; static struct pd_cache_alloc_direct_gen alloc_direct_1024xPAGE = { - .bytes = PAGE_SIZE, + .bytes = NVGPU_CPU_PAGE_SIZE, .nr = 1024U, }; static struct pd_cache_alloc_direct_gen alloc_direct_1x16PAGE = { - .bytes = 16U * PAGE_SIZE, + .bytes = 16U * NVGPU_CPU_PAGE_SIZE, .nr = 1U, }; static struct pd_cache_alloc_direct_gen alloc_direct_1024x16PAGE = { - .bytes = 16U * PAGE_SIZE, + .bytes = 16U * NVGPU_CPU_PAGE_SIZE, .nr = 1024U, }; static struct pd_cache_alloc_direct_gen alloc_direct_1024xPAGE_x32x24 = { - .bytes = PAGE_SIZE, + .bytes = NVGPU_CPU_PAGE_SIZE, .nr = 1024U, .nr_allocs_before_free = 32U, .nr_frees_before_alloc = 24U }; static struct pd_cache_alloc_direct_gen alloc_direct_1024xPAGE_x16x4 = { - .bytes = PAGE_SIZE, + .bytes = NVGPU_CPU_PAGE_SIZE, .nr = 1024U, .nr_allocs_before_free = 16U, .nr_frees_before_alloc = 4U }; static struct pd_cache_alloc_direct_gen alloc_direct_1024xPAGE_x16x15 = { - .bytes = PAGE_SIZE, + .bytes = NVGPU_CPU_PAGE_SIZE, .nr = 1024U, .nr_allocs_before_free = 16U, .nr_frees_before_alloc = 15U }; static struct pd_cache_alloc_direct_gen alloc_direct_1024xPAGE_x16x1 = { - .bytes = PAGE_SIZE, + .bytes = NVGPU_CPU_PAGE_SIZE, .nr = 1024U, .nr_allocs_before_free = 16U, .nr_frees_before_alloc = 1U @@ -404,14 +404,14 @@ int test_pd_alloc_direct_fi(struct unit_module *m, struct gk20a *g, void *args) */ nvgpu_posix_enable_fault_injection(kmem_fi, true, 0); - err = nvgpu_pd_alloc(&vm, &pd, PAGE_SIZE); + err = nvgpu_pd_alloc(&vm, &pd, NVGPU_CPU_PAGE_SIZE); if (err == 0) { unit_return_fail(m, "pd_alloc() success with kmem OOM\n"); } nvgpu_posix_enable_fault_injection(kmem_fi, false, 0); nvgpu_posix_enable_fault_injection(dma_fi, true, 0); - err = nvgpu_pd_alloc(&vm, &pd, PAGE_SIZE); + err = nvgpu_pd_alloc(&vm, &pd, NVGPU_CPU_PAGE_SIZE); if (err == 0) { unit_return_fail(m, "pd_alloc() success with DMA OOM\n"); } @@ -558,7 +558,7 @@ int test_pd_cache_valid_alloc(struct unit_module *m, struct gk20a *g, * This covers the VCs 1 and 2. */ bytes = 256; /* 256 bytes is the min PD size. */ - while (bytes <= PAGE_SIZE) { + while (bytes <= NVGPU_CPU_PAGE_SIZE) { err = nvgpu_pd_alloc(&vm, &pd, bytes); if (err) { @@ -722,7 +722,7 @@ int test_per_pd_size(struct unit_module *m, struct gk20a *g, void *args) } pd_size = 256U; /* 256 bytes is the min PD size. */ - while (pd_size < PAGE_SIZE) { + while (pd_size < NVGPU_CPU_PAGE_SIZE) { err = fn(m, g, &vm, pd_size); if (err) { err = UNIT_FAIL; diff --git a/userspace/units/mm/nvgpu_mem/nvgpu_mem.c b/userspace/units/mm/nvgpu_mem/nvgpu_mem.c index 1f965da91..f45689a94 100644 --- a/userspace/units/mm/nvgpu_mem/nvgpu_mem.c +++ b/userspace/units/mm/nvgpu_mem/nvgpu_mem.c @@ -683,7 +683,7 @@ int test_nvgpu_mem_create_from_mem(struct unit_module *m, struct gk20a *g, nvgpu_mem_create_from_mem(g, &dest_mem, test_mem, 0, 2); unit_assert(dest_mem.cpu_va == test_mem->cpu_va, goto done); - unit_assert(dest_mem.size == (2 * PAGE_SIZE), goto done); + unit_assert(dest_mem.size == (2 * NVGPU_CPU_PAGE_SIZE), goto done); unit_assert((dest_mem.mem_flags & NVGPU_MEM_FLAG_SHADOW_COPY) == true, goto done); unit_assert(dest_mem.aperture == APERTURE_SYSMEM, goto done); diff --git a/userspace/units/posix/utils/posix-utils.c b/userspace/units/posix/utils/posix-utils.c index 141efe430..cdf942c6c 100644 --- a/userspace/units/posix/utils/posix-utils.c +++ b/userspace/units/posix/utils/posix-utils.c @@ -439,7 +439,7 @@ int test_align_macros(struct unit_module *m, test1 = PAGE_ALIGN_TEST_VALUE; result = PAGE_ALIGN(test1); - if (result & (PAGE_SIZE - 1)) { + if (result & (NVGPU_CPU_PAGE_SIZE - 1)) { unit_return_fail(m, "PAGE_ALIGN failure %x\n", result); } diff --git a/userspace/units/sync/nvgpu-sync.c b/userspace/units/sync/nvgpu-sync.c index 59437d448..e901fd395 100644 --- a/userspace/units/sync/nvgpu-sync.c +++ b/userspace/units/sync/nvgpu-sync.c @@ -51,7 +51,7 @@ static int init_syncpt_mem(struct unit_module *m, struct gk20a *g) int err; if (!nvgpu_mem_is_valid(&g->syncpt_mem)) { nr_pages = U64(DIV_ROUND_UP(g->syncpt_unit_size, - PAGE_SIZE)); + NVGPU_CPU_PAGE_SIZE)); err = nvgpu_mem_create_from_phys(g, &g->syncpt_mem, g->syncpt_unit_base, nr_pages); if (err != 0) {