Skip to content

Commit

Permalink
mtl: bugfix: tlb driver should allow remapping all unused pages
Browse files Browse the repository at this point in the history
UNUSED_L2_START_ALIGNED is a marker of first page not used by the
linker. Starting from this page, the memory may be re-mapped.
assertion <= is banning remapping of the first unused page
changing to <

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
  • Loading branch information
marcinszkudlinski authored and stephanosio committed Feb 3, 2023
1 parent f00da4b commit 44222b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mm/mm_drv_intel_adsp_mtl_tlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ int sys_mm_drv_map_page(void *virt, uintptr_t phys, uint32_t flags)
}

/* Check bounds of virtual address space */
CHECKIF((va <= UNUSED_L2_START_ALIGNED) ||
CHECKIF((va < UNUSED_L2_START_ALIGNED) ||
(va >= (CONFIG_KERNEL_VM_BASE + CONFIG_KERNEL_VM_SIZE))) {
ret = -EINVAL;
goto out;
Expand Down Expand Up @@ -336,7 +336,7 @@ int sys_mm_drv_unmap_page(void *virt)
uintptr_t va = POINTER_TO_UINT(z_soc_cached_ptr(virt));

/* Check bounds of virtual address space */
CHECKIF((va <= UNUSED_L2_START_ALIGNED) ||
CHECKIF((va < UNUSED_L2_START_ALIGNED) ||
(va >= (CONFIG_KERNEL_VM_BASE + CONFIG_KERNEL_VM_SIZE))) {
ret = -EINVAL;
goto out;
Expand Down

0 comments on commit 44222b7

Please sign in to comment.