summaryrefslogtreecommitdiff
path: root/target-ppc
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2016-06-07 12:50:21 +1000
committerDavid Gibson <david@gibson.dropbear.id.au>2016-06-07 13:10:44 +1000
commit3dcfb74fd4e4ab31508c80e6965a0cd477510234 (patch)
treea606efc70522b2336c3eef8310459ed2109ac6ca /target-ppc
parentf5d9c1089f0136c2aadf51389e93a94d517e430f (diff)
downloadqemu-3dcfb74fd4e4ab31508c80e6965a0cd477510234.zip
ppc: Fix tlb invalidations on 6xx/7xx/7xxx 32-bit processors
The processor only uses some bits of the address and invalidates an entire congruence class. Some OSes such as Darwin and HelenOS take advantage of this and occasionally invalidate the entire TLB by just doing a series of 64 consecutive tlbie for example. Our code tries to be too smart here only invalidating a segment congruence class (ie, allowing more address bits to be relevant in the invalidation), this fails miserably on those OSes. Instead don't bother, do like ppc64 and blow the whole tlb when tlbie is executed. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'target-ppc')
-rw-r--r--target-ppc/mmu_helper.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/target-ppc/mmu_helper.c b/target-ppc/mmu_helper.c
index f5c4e69a35..a5e387877f 100644
--- a/target-ppc/mmu_helper.c
+++ b/target-ppc/mmu_helper.c
@@ -1969,6 +1969,11 @@ void ppc_tlb_invalidate_one(CPUPPCState *env, target_ulong addr)
/* XXX: this case should be optimized,
* giving a mask to tlb_flush_page
*/
+ /* This is broken, some CPUs invalidate a whole congruence
+ * class on an even smaller subset of bits and some OSes take
+ * advantage of this. Just blow the whole thing away.
+ */
+#if 0
tlb_flush_page(cs, addr | (0x0 << 28));
tlb_flush_page(cs, addr | (0x1 << 28));
tlb_flush_page(cs, addr | (0x2 << 28));
@@ -1985,6 +1990,9 @@ void ppc_tlb_invalidate_one(CPUPPCState *env, target_ulong addr)
tlb_flush_page(cs, addr | (0xD << 28));
tlb_flush_page(cs, addr | (0xE << 28));
tlb_flush_page(cs, addr | (0xF << 28));
+#else
+ tlb_flush(cs, 1);
+#endif
break;
#if defined(TARGET_PPC64)
case POWERPC_MMU_64B: