diff options
author | Kevin Hao <haokexin@gmail.com> | 2013-08-21 21:30:35 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-12-01 22:13:47 -0500 |
commit | 0ce636700c5bad54eda0e62903a1803f6d67b31d (patch) | |
tree | b3302187e8e314de7c7cef55f1147c755de8e8f6 /arch/powerpc/kernel | |
parent | dfee0efe3ec8d4099c69e8234e4e4306619b9ba6 (diff) |
powerpc: purge all the prefetched instructions for the coherent icache flush
As Benjamin Herrenschmidt has indicated, we still need a dummy icbi to
purge all the prefetched instructions from the ifetch buffers for the
snooping icache. We also need a sync before the icbi to order the
actual stores to memory that might have modified instructions with
the icbi.
Signed-off-by: Kevin Hao <haokexin@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/misc_32.S | 4 | ||||
-rw-r--r-- | arch/powerpc/kernel/misc_64.S | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S index e47d268727a4..879f09620f83 100644 --- a/arch/powerpc/kernel/misc_32.S +++ b/arch/powerpc/kernel/misc_32.S | |||
@@ -344,7 +344,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_UNIFIED_ID_CACHE) | |||
344 | */ | 344 | */ |
345 | _KPROBE(flush_icache_range) | 345 | _KPROBE(flush_icache_range) |
346 | BEGIN_FTR_SECTION | 346 | BEGIN_FTR_SECTION |
347 | isync | 347 | PURGE_PREFETCHED_INS |
348 | blr /* for 601, do nothing */ | 348 | blr /* for 601, do nothing */ |
349 | END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE) | 349 | END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE) |
350 | li r5,L1_CACHE_BYTES-1 | 350 | li r5,L1_CACHE_BYTES-1 |
@@ -448,6 +448,7 @@ _GLOBAL(invalidate_dcache_range) | |||
448 | */ | 448 | */ |
449 | _GLOBAL(__flush_dcache_icache) | 449 | _GLOBAL(__flush_dcache_icache) |
450 | BEGIN_FTR_SECTION | 450 | BEGIN_FTR_SECTION |
451 | PURGE_PREFETCHED_INS | ||
451 | blr | 452 | blr |
452 | END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE) | 453 | END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE) |
453 | rlwinm r3,r3,0,0,31-PAGE_SHIFT /* Get page base address */ | 454 | rlwinm r3,r3,0,0,31-PAGE_SHIFT /* Get page base address */ |
@@ -489,6 +490,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_TYPE_44x) | |||
489 | */ | 490 | */ |
490 | _GLOBAL(__flush_dcache_icache_phys) | 491 | _GLOBAL(__flush_dcache_icache_phys) |
491 | BEGIN_FTR_SECTION | 492 | BEGIN_FTR_SECTION |
493 | PURGE_PREFETCHED_INS | ||
492 | blr /* for 601, do nothing */ | 494 | blr /* for 601, do nothing */ |
493 | END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE) | 495 | END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE) |
494 | mfmsr r10 | 496 | mfmsr r10 |
diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S index e59caf874d05..a9f7a79a3a40 100644 --- a/arch/powerpc/kernel/misc_64.S +++ b/arch/powerpc/kernel/misc_64.S | |||
@@ -67,6 +67,7 @@ PPC64_CACHES: | |||
67 | 67 | ||
68 | _KPROBE(flush_icache_range) | 68 | _KPROBE(flush_icache_range) |
69 | BEGIN_FTR_SECTION | 69 | BEGIN_FTR_SECTION |
70 | PURGE_PREFETCHED_INS | ||
70 | blr | 71 | blr |
71 | END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE) | 72 | END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE) |
72 | /* | 73 | /* |
@@ -211,6 +212,11 @@ _GLOBAL(__flush_dcache_icache) | |||
211 | * Different systems have different cache line sizes | 212 | * Different systems have different cache line sizes |
212 | */ | 213 | */ |
213 | 214 | ||
215 | BEGIN_FTR_SECTION | ||
216 | PURGE_PREFETCHED_INS | ||
217 | blr | ||
218 | END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE) | ||
219 | |||
214 | /* Flush the dcache */ | 220 | /* Flush the dcache */ |
215 | ld r7,PPC64_CACHES@toc(r2) | 221 | ld r7,PPC64_CACHES@toc(r2) |
216 | clrrdi r3,r3,PAGE_SHIFT /* Page align */ | 222 | clrrdi r3,r3,PAGE_SHIFT /* Page align */ |