diff options
Diffstat (limited to 'arch/arc/mm/cache_arc700.c')
-rw-r--r-- | arch/arc/mm/cache_arc700.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/arch/arc/mm/cache_arc700.c b/arch/arc/mm/cache_arc700.c index a65c13942766..5651e7bd3b7e 100644 --- a/arch/arc/mm/cache_arc700.c +++ b/arch/arc/mm/cache_arc700.c | |||
@@ -642,8 +642,8 @@ void dma_cache_wback(unsigned long start, unsigned long sz) | |||
642 | EXPORT_SYMBOL(dma_cache_wback); | 642 | EXPORT_SYMBOL(dma_cache_wback); |
643 | 643 | ||
644 | /* | 644 | /* |
645 | * This is API for making I/D Caches consistent when modifying code | 645 | * This is API for making I/D Caches consistent when modifying |
646 | * (loadable modules, kprobes, etc) | 646 | * kernel code (loadable modules, kprobes, kgdb...) |
647 | * This is called on insmod, with kernel virtual address for CODE of | 647 | * This is called on insmod, with kernel virtual address for CODE of |
648 | * the module. ARC cache maintenance ops require PHY address thus we | 648 | * the module. ARC cache maintenance ops require PHY address thus we |
649 | * need to convert vmalloc addr to PHY addr | 649 | * need to convert vmalloc addr to PHY addr |
@@ -673,7 +673,13 @@ void flush_icache_range(unsigned long kstart, unsigned long kend) | |||
673 | 673 | ||
674 | /* Case: Kernel Phy addr (0x8000_0000 onwards) */ | 674 | /* Case: Kernel Phy addr (0x8000_0000 onwards) */ |
675 | if (likely(kstart > PAGE_OFFSET)) { | 675 | if (likely(kstart > PAGE_OFFSET)) { |
676 | __ic_line_inv(kstart, kend - kstart); | 676 | /* |
677 | * The 2nd arg despite being paddr will be used to index icache | ||
678 | * This is OK since no alternate virtual mappings will exist | ||
679 | * given the callers for this case: kprobe/kgdb in built-in | ||
680 | * kernel code only. | ||
681 | */ | ||
682 | __ic_line_inv_vaddr(kstart, kstart, kend - kstart); | ||
677 | __dc_line_op(kstart, kend - kstart, OP_FLUSH); | 683 | __dc_line_op(kstart, kend - kstart, OP_FLUSH); |
678 | return; | 684 | return; |
679 | } | 685 | } |
@@ -694,7 +700,7 @@ void flush_icache_range(unsigned long kstart, unsigned long kend) | |||
694 | sz = min_t(unsigned int, tot_sz, PAGE_SIZE - off); | 700 | sz = min_t(unsigned int, tot_sz, PAGE_SIZE - off); |
695 | local_irq_save(flags); | 701 | local_irq_save(flags); |
696 | __dc_line_op(phy, sz, OP_FLUSH); | 702 | __dc_line_op(phy, sz, OP_FLUSH); |
697 | __ic_line_inv(phy, sz); | 703 | __ic_line_inv_vaddr(phy, kstart, sz); |
698 | local_irq_restore(flags); | 704 | local_irq_restore(flags); |
699 | kstart += sz; | 705 | kstart += sz; |
700 | tot_sz -= sz; | 706 | tot_sz -= sz; |