]> git.baikalelectronics.ru Git - kernel.git/commit
ARC: Brown paper bag bug in macro for checking cache color
authorVineet Gupta <vgupta@synopsys.com>
Wed, 22 May 2013 13:08:10 +0000 (18:38 +0530)
committerVineet Gupta <vgupta@synopsys.com>
Thu, 23 May 2013 08:54:52 +0000 (14:24 +0530)
commit8277c27ed1cc35a48d6ac3fe64dfc9bc9025f540
treece7d2e84901ade9ff8f56a9319eb1a690200c2f5
parentb252662be8f76c83f49afa46827462d0a1754e86
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>
arch/arc/include/asm/cacheflush.h
arch/arc/mm/tlb.c