Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 377219
b: refs/heads/master
c: 1bc3974
h: refs/heads/master
i:
  377217: 8ff4141
  377215: 8636674
v: v3
  • Loading branch information
Simon Baatz authored and Russell King committed Jun 17, 2013
1 parent 1b13702 commit 38bbc45
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 049be07053ebbf0ee8543caea23ae7bdf0765bb2
refs/heads/master: 1bc39742aab09248169ef9d3727c9def3528b3f3
4 changes: 1 addition & 3 deletions trunk/arch/arm/include/asm/cacheflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,7 @@ static inline void flush_anon_page(struct vm_area_struct *vma,
}

#define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE
static inline void flush_kernel_dcache_page(struct page *page)
{
}
extern void flush_kernel_dcache_page(struct page *);

#define flush_dcache_mmap_lock(mapping) \
spin_lock_irq(&(mapping)->tree_lock)
Expand Down
33 changes: 33 additions & 0 deletions trunk/arch/arm/mm/flush.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,39 @@ void flush_dcache_page(struct page *page)
}
EXPORT_SYMBOL(flush_dcache_page);

/*
* Ensure cache coherency for the kernel mapping of this page. We can
* assume that the page is pinned via kmap.
*
* If the page only exists in the page cache and there are no user
* space mappings, this is a no-op since the page was already marked
* dirty at creation. Otherwise, we need to flush the dirty kernel
* cache lines directly.
*/
void flush_kernel_dcache_page(struct page *page)
{
if (cache_is_vivt() || cache_is_vipt_aliasing()) {
struct address_space *mapping;

mapping = page_mapping(page);

if (!mapping || mapping_mapped(mapping)) {
void *addr;

addr = page_address(page);
/*
* kmap_atomic() doesn't set the page virtual
* address for highmem pages, and
* kunmap_atomic() takes care of cache
* flushing already.
*/
if (!IS_ENABLED(CONFIG_HIGHMEM) || addr)
__cpuc_flush_dcache_area(addr, PAGE_SIZE);
}
}
}
EXPORT_SYMBOL(flush_kernel_dcache_page);

/*
* Flush an anonymous page so that users of get_user_pages()
* can safely access the data. The expected sequence is:
Expand Down

0 comments on commit 38bbc45

Please sign in to comment.