Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 100718
b: refs/heads/master
c: 826cbda
h: refs/heads/master
v: v3
  • Loading branch information
Catalin Marinas authored and Russell King committed Jul 3, 2008
1 parent a0896d2 commit 822fb0c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 43df5220e455d426ec7462d0bf906e686c65ebb5
refs/heads/master: 826cbdaff29764bb6928c715c6a025e49469dda9
4 changes: 4 additions & 0 deletions trunk/arch/arm/mm/fault-armv.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,17 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte)
page = pfn_to_page(pfn);
mapping = page_mapping(page);
if (mapping) {
#ifndef CONFIG_SMP
int dirty = test_and_clear_bit(PG_dcache_dirty, &page->flags);

if (dirty)
__flush_dcache_page(mapping, page);
#endif

if (cache_is_vivt())
make_coherent(mapping, vma, addr, pfn);
else if (vma->vm_flags & VM_EXEC)
__flush_icache_all();
}
}

Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/arm/mm/flush.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ void flush_dcache_page(struct page *page)
__flush_dcache_page(mapping, page);
if (mapping && cache_is_vivt())
__flush_dcache_aliases(mapping, page);
else if (mapping)
__flush_icache_all();
}
}
EXPORT_SYMBOL(flush_dcache_page);
Expand Down
7 changes: 7 additions & 0 deletions trunk/include/asm-arm/cacheflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,13 @@ extern void flush_dcache_page(struct page *);

extern void __flush_dcache_page(struct address_space *mapping, struct page *page);

static inline void __flush_icache_all(void)
{
asm("mcr p15, 0, %0, c7, c5, 0 @ invalidate I-cache\n"
:
: "r" (0));
}

#define ARCH_HAS_FLUSH_ANON_PAGE
static inline void flush_anon_page(struct vm_area_struct *vma,
struct page *page, unsigned long vmaddr)
Expand Down
5 changes: 5 additions & 0 deletions trunk/include/asm-arm/mmu_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next,
#ifdef CONFIG_MMU
unsigned int cpu = smp_processor_id();

#ifdef CONFIG_SMP
/* check for possible thread migration */
if (!cpus_empty(next->cpu_vm_mask) && !cpu_isset(cpu, next->cpu_vm_mask))
__flush_icache_all();
#endif
if (!cpu_test_and_set(cpu, next->cpu_vm_mask) || prev != next) {
check_context(next);
cpu_switch_mm(next->pgd, next);
Expand Down

0 comments on commit 822fb0c

Please sign in to comment.