From 18192509eb22d37ccdc5228c72df86984c60eb2f Mon Sep 17 00:00:00 2001 From: Michael Ryleev Date: Mon, 1 Jun 2015 09:22:05 -0700 Subject: [PATCH] [kernel][vm] Fix a bug in vm address allocator Pass arch_mmu_flags (instead of flags) to arch_mmu_pick_spot routine. This bug would mostly affect ARMv7 platforms with enabled support for non-secure memory. Change-Id: Ic97ee6d3f05528170d66ab5033b24adf1d0c514e --- kernel/vm/vmm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/vm/vmm.c b/kernel/vm/vmm.c index 7cffb260..1e359298 100644 --- a/kernel/vm/vmm.c +++ b/kernel/vm/vmm.c @@ -204,8 +204,8 @@ static inline bool check_gap(vmm_aspace_t *aspace, gap_end = aspace->base + aspace->size - 1; } - *pva = arch_mmu_pick_spot(gap_beg, prev ? prev->flags : ARCH_MMU_FLAG_INVALID, - gap_end, next ? next->flags : ARCH_MMU_FLAG_INVALID, + *pva = arch_mmu_pick_spot(gap_beg, prev ? prev->arch_mmu_flags : ARCH_MMU_FLAG_INVALID, + gap_end, next ? next->arch_mmu_flags : ARCH_MMU_FLAG_INVALID, align, size, arch_mmu_flags); if (*pva < gap_beg) goto not_found; /* address wrapped around */