ARM: Disable outer cache before kexec call
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 2/2 | arm: Implement l2x0 cache disable function | +0 | 0 replies | |
| 2/2 | arm: Implement l2x0 cache disable function | +0 | 0 replies | |
| 2/2 | arm: Implement l2x0 cache disable function | +0 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [patch 0/2] ARM: Disable outer cache before kexec call
Quoted 22 lines · Catalin Marinas
Quoted 21 lines · Russell King - ARM Linux
Quoted 9 lines · Russell King - ARM Linux
1. we move the IRQ (and FIQ) disable out of each CPUs
proc_fin()
2. callflush_cache_all()immediately after IRQs are disabled (removing any cache flushing fromproc_fin()implementations.)
3. callouter_flush_all()(new function) after that
4. callproc_fin()to disable the C & I bits.
5. callflush_cache_all()again to invalidate the inner caches
6. callouter_flush_all()again to invalidate the outer caches
7. whatever's next after the existingcpu_proc_fin()...Quoted 6 lines
The only potential problem I see with this is that (5) and (6) may end up writing back some dirty data associated with the stack, and one of these functions may overwrite its return address - thereby causing us to loop back to (2) or (3). I don't think that's a problem as the next time around this 'loop' we won't be creating new dirty cache lines, and we should get to step 7.
Right, something like this. I've not made an effort to fix the L2 bits, but I have marked the places where attention is required. The interesting bit is the first two files.
Quoted 7 lines
Quoted 2 lines
The next question this provokes is whether we need a
dsb()between steps 3 and 4, and maybe again between 4 and 5, and possibly after 6 ?We don't need a
dsb()after 3 and 6. Theouter_flush_all()function would need to do acache_sync(which polls a register) since that's a background operation on the L2 cache. DSB doesn't have any effect on the L2 cache.
Well, that leaves a question about Feroceon:
#if defined(CONFIG_CACHE_FEROCEON_L2) && \
!defined(CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH)
mov r0, #0
mcr p15, 1, r0, c15, c9, 0 @ clean L2
mcr p15, 0, r0, c7, c10, 4 @ drain WB#endif
The question is where to move that (effective) DSB to - I guess it can move to arch/arm/mm/cache-feroceon-l2.c.