Skip to content

Commit 9b75600

Browse files
committed
ARC: kprobe/kgdb helpers patch #3
We need to flush instruction $ not only from vmalloc area but also from another memory ranges when using kprobe as exemple. Correct this. Squash this patch with "ARCv3: Add support L2$ flush/invalidate operations", f11124f
1 parent 4fb2ecd commit 9b75600

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

arch/arc/mm/cache-arcv3.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,19 @@ void flush_icache_range(unsigned long kvaddr, unsigned long kvend)
613613
{
614614
unsigned int tot_sz = kvend - kvaddr;
615615

616-
BUG_ON((kvaddr < VMALLOC_START) || (kvend > VMALLOC_END));
616+
WARN(kvaddr < TASK_SIZE, "%s() can't handle user vaddr", __func__);
617+
618+
/* Case: Kernel Phy addr (0x8000_0000 onwards) */
619+
if (likely(kvaddr > PAGE_OFFSET)) {
620+
/*
621+
* The 2nd arg despite being paddr will be used to index icache
622+
* This is OK since no alternate virtual mappings will exist
623+
* given the callers for this case: kprobe/kgdb in built-in
624+
* kernel code only.
625+
*/
626+
__sync_icache_dcache(kvaddr, kvaddr, kvend - kvaddr);
627+
return;
628+
}
617629

618630
while (tot_sz > 0) {
619631
unsigned int off, sz;

0 commit comments

Comments
 (0)