Skip to content

Commit 981bbf2

Browse files
committed
csky: Fixup wrong update_mmu_cache implementation
In our stress test, we found some crash problem caused by: if (!(vma->vm_flags & VM_EXEC)) return; in update_mmu_cache(). Seems current update_mmu_cache implementation is wrong and we retread to the conservative implementation. Also the usage of kmap_atomic in update_mmu_cache is risky, page-virtual may be scheduled out and changed, so we must use preempt_disable & pagefault_disable which is called by kmap_atomic(). Signed-off-by: Guo Ren <ren_guo@c-sky.com> Cc: Arnd Bergmann <arnd@arndb.de>
1 parent f62e316 commit 981bbf2

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

‎arch/csky/abiv2/cacheflush.c‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
3434
{
3535
unsigned long addr, pfn;
3636
struct page *page;
37-
void *va;
38-
39-
if (!(vma->vm_flags & VM_EXEC))
40-
return;
4137

4238
pfn = pte_pfn(*pte);
4339
if (unlikely(!pfn_valid(pfn)))
@@ -47,14 +43,9 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
4743
if (page == ZERO_PAGE(0))
4844
return;
4945

50-
va = page_address(page);
51-
addr = (unsigned long) va;
52-
53-
if (va == NULL && PageHighMem(page))
54-
addr = (unsigned long) kmap_atomic(page);
46+
addr = (unsigned long) kmap_atomic(page);
5547

5648
cache_wbinv_range(addr, addr + PAGE_SIZE);
5749

58-
if (va == NULL && PageHighMem(page))
59-
kunmap_atomic((void *) addr);
50+
kunmap_atomic((void *) addr);
6051
}

0 commit comments

Comments
 (0)