diff options
| author | Shell <[email protected]> | 2023-03-19 14:41:50 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-03-19 14:41:50 +0800 |
| commit | dd2f1a795af0674f0d2f2c23df721fb8decbafb8 (patch) | |
| tree | 322b7c0b46732d25274e7f3f982478ef4881214d /components | |
| parent | c11f5bb2510c9c961819c554c1e4cc69f7f52ab7 (diff) | |
[rt-smart] fix competition on aspace (#7064)
* [mm] mmu operations should be wrapped by _aspace_bst_insert & _aspace_bst_remove to avoid competition on page table
* [lwp] may not return null on failed
Diffstat (limited to 'components')
| -rw-r--r-- | components/lwp/lwp_user_mm.c | 6 | ||||
| -rw-r--r-- | components/mm/mm_aspace.c | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/components/lwp/lwp_user_mm.c b/components/lwp/lwp_user_mm.c index 1bdd5537cf..57dfb5338b 100644 --- a/components/lwp/lwp_user_mm.c +++ b/components/lwp/lwp_user_mm.c @@ -362,8 +362,12 @@ void *lwp_map_user_phy(struct rt_lwp *lwp, void *map_va, void *map_pa, va = RT_NULL; LOG_W("%s", __func__); } + else + { + va += offset; + } - return va + offset; + return va; } rt_base_t lwp_brk(void *addr) diff --git a/components/mm/mm_aspace.c b/components/mm/mm_aspace.c index b42cdfb5a4..e171af15d5 100644 --- a/components/mm/mm_aspace.c +++ b/components/mm/mm_aspace.c @@ -75,12 +75,12 @@ static inline void _varea_uninstall(rt_varea_t varea) rt_varea_free_pages(varea); + rt_hw_mmu_unmap(aspace, varea->start, varea->size); + rt_hw_tlb_invalidate_range(aspace, varea->start, varea->size, ARCH_PAGE_SIZE); + WR_LOCK(aspace); _aspace_bst_remove(aspace, varea); WR_UNLOCK(aspace); - - rt_hw_mmu_unmap(aspace, varea->start, varea->size); - rt_hw_tlb_invalidate_range(aspace, varea->start, varea->size, ARCH_PAGE_SIZE); } int _init_lock(rt_aspace_t aspace) |
