Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6019958d authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull second set of arc arch updates from Vineet Gupta:
 "Aliasing VIPT dcache support for ARC

  I'm satisified with testing, specially with fuse which has
  historically given grief to VIPT arches (ARM/PARISC...)"

* tag 'arc-v3.10-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
  ARC: [TB10x] Remove GENERIC_GPIO
  ARC: [mm] Aliasing VIPT dcache support 4/4
  ARC: [mm] Aliasing VIPT dcache support 3/4
  ARC: [mm] Aliasing VIPT dcache support 2/4
  ARC: [mm] Aliasing VIPT dcache support 1/4
  ARC: [mm] refactor the core (i|d)cache line ops loops
  ARC: [mm] serious bug in vaddr based icache flush
parents 977b58e1 e7d5bab5
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -182,6 +182,10 @@ config ARC_CACHE_PAGES
	  Note that Global I/D ENABLE + Per Page DISABLE works but corollary
	  Note that Global I/D ENABLE + Per Page DISABLE works but corollary
	  Global DISABLE + Per Page ENABLE won't work
	  Global DISABLE + Per Page ENABLE won't work


config ARC_CACHE_VIPT_ALIASING
	bool "Support VIPT Aliasing D$"
	default n

endif	#ARC_CACHE
endif	#ARC_CACHE


config ARC_HAS_ICCM
config ARC_HAS_ICCM
+0 −1
Original line number Original line Diff line number Diff line
@@ -32,7 +32,6 @@ generic-y += resource.h
generic-y += scatterlist.h
generic-y += scatterlist.h
generic-y += sembuf.h
generic-y += sembuf.h
generic-y += shmbuf.h
generic-y += shmbuf.h
generic-y += shmparam.h
generic-y += siginfo.h
generic-y += siginfo.h
generic-y += socket.h
generic-y += socket.h
generic-y += sockios.h
generic-y += sockios.h
+0 −3
Original line number Original line Diff line number Diff line
@@ -55,9 +55,6 @@
	: "r"(data), "r"(ptr));		\
	: "r"(data), "r"(ptr));		\
})
})


/* used to give SHMLBA a value to avoid Cache Aliasing */
extern unsigned int ARC_shmlba;

#define ARCH_DMA_MINALIGN      L1_CACHE_BYTES
#define ARCH_DMA_MINALIGN      L1_CACHE_BYTES


/*
/*
+49 −9
Original line number Original line Diff line number Diff line
@@ -19,6 +19,7 @@
#define _ASM_CACHEFLUSH_H
#define _ASM_CACHEFLUSH_H


#include <linux/mm.h>
#include <linux/mm.h>
#include <asm/shmparam.h>


/*
/*
 * Semantically we need this because icache doesn't snoop dcache/dma.
 * Semantically we need this because icache doesn't snoop dcache/dma.
@@ -33,7 +34,9 @@ void flush_cache_all(void);
void flush_icache_range(unsigned long start, unsigned long end);
void flush_icache_range(unsigned long start, unsigned long end);
void __sync_icache_dcache(unsigned long paddr, unsigned long vaddr, int len);
void __sync_icache_dcache(unsigned long paddr, unsigned long vaddr, int len);
void __inv_icache_page(unsigned long paddr, unsigned long vaddr);
void __inv_icache_page(unsigned long paddr, unsigned long vaddr);
void __flush_dcache_page(unsigned long paddr);
void ___flush_dcache_page(unsigned long paddr, unsigned long vaddr);
#define __flush_dcache_page(p, v)	\
		___flush_dcache_page((unsigned long)p, (unsigned long)v)


#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1


@@ -50,18 +53,55 @@ void dma_cache_wback(unsigned long start, unsigned long sz);
#define flush_cache_vmap(start, end)		flush_cache_all()
#define flush_cache_vmap(start, end)		flush_cache_all()
#define flush_cache_vunmap(start, end)		flush_cache_all()
#define flush_cache_vunmap(start, end)		flush_cache_all()


/*
#define flush_cache_dup_mm(mm)			/* called on fork (VIVT only) */
 * VM callbacks when entire/range of user-space V-P mappings are

 * torn-down/get-invalidated
#ifndef CONFIG_ARC_CACHE_VIPT_ALIASING
 *

 * Currently we don't support D$ aliasing configs for our VIPT caches
 * NOPS for VIPT Cache with non-aliasing D$ configurations only
 */
#define flush_cache_dup_mm(mm)			/* called on fork */
#define flush_cache_mm(mm)			/* called on munmap/exit */
#define flush_cache_mm(mm)			/* called on munmap/exit */
#define flush_cache_range(mm, u_vstart, u_vend)
#define flush_cache_range(mm, u_vstart, u_vend)
#define flush_cache_page(vma, u_vaddr, pfn)	/* PF handling/COW-break */
#define flush_cache_page(vma, u_vaddr, pfn)	/* PF handling/COW-break */


#else	/* VIPT aliasing dcache */

/* To clear out stale userspace mappings */
void flush_cache_mm(struct mm_struct *mm);
void flush_cache_range(struct vm_area_struct *vma,
	unsigned long start,unsigned long end);
void flush_cache_page(struct vm_area_struct *vma,
	unsigned long user_addr, unsigned long page);

/*
 * To make sure that userspace mapping is flushed to memory before
 * get_user_pages() uses a kernel mapping to access the page
 */
#define ARCH_HAS_FLUSH_ANON_PAGE
void flush_anon_page(struct vm_area_struct *vma,
	struct page *page, unsigned long u_vaddr);

#endif	/* CONFIG_ARC_CACHE_VIPT_ALIASING */

/*
 * Simple wrapper over config option
 * Bootup code ensures that hardware matches kernel configuration
 */
static inline int cache_is_vipt_aliasing(void)
{
#ifdef CONFIG_ARC_CACHE_VIPT_ALIASING
	return 1;
#else
	return 0;
#endif
}

#define CACHE_COLOR(addr)	(((unsigned long)(addr) >> (PAGE_SHIFT)) & 3)

/*
 * checks if two addresses (after page aligning) index into same cache set
 */
#define addr_not_cache_congruent(addr1, addr2)				\
	cache_is_vipt_aliasing() ? 					\
		(CACHE_COLOR(addr1) != CACHE_COLOR(addr2)) : 0		\

#define copy_to_user_page(vma, page, vaddr, dst, src, len)		\
#define copy_to_user_page(vma, page, vaddr, dst, src, len)		\
do {									\
do {									\
	memcpy(dst, src, len);						\
	memcpy(dst, src, len);						\
+15 −1
Original line number Original line Diff line number Diff line
@@ -16,13 +16,27 @@
#define get_user_page(vaddr)		__get_free_page(GFP_KERNEL)
#define get_user_page(vaddr)		__get_free_page(GFP_KERNEL)
#define free_user_page(page, addr)	free_page(addr)
#define free_user_page(page, addr)	free_page(addr)


/* TBD: for now don't worry about VIPT D$ aliasing */
#define clear_page(paddr)		memset((paddr), 0, PAGE_SIZE)
#define clear_page(paddr)		memset((paddr), 0, PAGE_SIZE)
#define copy_page(to, from)		memcpy((to), (from), PAGE_SIZE)
#define copy_page(to, from)		memcpy((to), (from), PAGE_SIZE)


#ifndef CONFIG_ARC_CACHE_VIPT_ALIASING

#define clear_user_page(addr, vaddr, pg)	clear_page(addr)
#define clear_user_page(addr, vaddr, pg)	clear_page(addr)
#define copy_user_page(vto, vfrom, vaddr, pg)	copy_page(vto, vfrom)
#define copy_user_page(vto, vfrom, vaddr, pg)	copy_page(vto, vfrom)


#else	/* VIPT aliasing dcache */

struct vm_area_struct;
struct page;

#define __HAVE_ARCH_COPY_USER_HIGHPAGE

void copy_user_highpage(struct page *to, struct page *from,
			unsigned long u_vaddr, struct vm_area_struct *vma);
void clear_user_page(void *to, unsigned long u_vaddr, struct page *page);

#endif	/* CONFIG_ARC_CACHE_VIPT_ALIASING */

#undef STRICT_MM_TYPECHECKS
#undef STRICT_MM_TYPECHECKS


#ifdef STRICT_MM_TYPECHECKS
#ifdef STRICT_MM_TYPECHECKS
Loading