target-ppc: fix Book-E TLB matching
authorAlex Zuepke <azu@sysgo.de>
Tue, 14 Feb 2017 11:54:29 +0000 (12:54 +0100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 22 Feb 2017 03:28:53 +0000 (14:28 +1100)
The Book-E TLB matching process should bail out early when a TLB
entry matches, but the access permissions are wrong. The CPU
will then raise a DSI error instead of a Data TLB error, as
described for TLB matching in Freescale and IBM documents.

Signed-off-by: Alex Zuepke <azu@sysgo.de>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
target/ppc/mmu_helper.c

index 172a305e0f7ee87f63181d6023b19d6ac7613f4d..eb2d482ef77318259e34d12916618ea8ec417cba 100644 (file)
@@ -825,7 +825,7 @@ static int mmubooke_get_physical_address(CPUPPCState *env, mmu_ctx_t *ctx,
         tlb = &env->tlb.tlbe[i];
         ret = mmubooke_check_tlb(env, tlb, &raddr, &ctx->prot, address, rw,
                                  access_type, i);
-        if (!ret) {
+        if (ret != -1) {
             break;
         }
     }