summaryrefslogtreecommitdiff
path: root/arch/arc/include/asm/cacheflush.h
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2013-05-22 13:08:10 (GMT)
committerVineet Gupta <vgupta@synopsys.com>2013-05-23 08:54:52 (GMT)
commit3e87974dec5ec25a8a4852d9292db6be659164e6 (patch)
treece7d2e84901ade9ff8f56a9319eb1a690200c2f5 /arch/arc/include/asm/cacheflush.h
parenta950549c675f2c8c504469dec7d780da8a6433dc (diff)
downloadlinux-fsl-qoriq-3e87974dec5ec25a8a4852d9292db6be659164e6.tar.xz
ARC: Brown paper bag bug in macro for checking cache color
The VM_EXEC check in update_mmu_cache() was getting optimized away because of a stupid error in definition of macro addr_not_cache_congruent() The intention was to have the equivalent of following: if (a || (1 ? b : 0)) but we ended up with following: if (a || 1 ? b : 0) And because precedence of '||' is more that that of '?', gcc was optimizing away evaluation of <a> Nasty Repercussions: 1. For non-aliasing configs it would mean some extraneous dcache flushes for non-code pages if U/K mappings were not congruent. 2. For aliasing config, some needed dcache flush for code pages might be missed if U/K mappings were congruent. Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc/include/asm/cacheflush.h')
-rw-r--r--arch/arc/include/asm/cacheflush.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arc/include/asm/cacheflush.h b/arch/arc/include/asm/cacheflush.h
index 9f841af..7d81974 100644
--- a/arch/arc/include/asm/cacheflush.h
+++ b/arch/arc/include/asm/cacheflush.h
@@ -99,8 +99,10 @@ static inline int cache_is_vipt_aliasing(void)
* 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 \
+ (CACHE_COLOR(addr1) != CACHE_COLOR(addr2)) : 0; \
+})
#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
do { \