vserver 1.9.3
[linux-2.6.git] / arch / ppc64 / mm / hash_low.S
index 0d6b5c2..68dd4b9 100644 (file)
@@ -172,9 +172,9 @@ htab_insert_pte:
        li      r9,0
 _GLOBAL(htab_call_hpte_insert1)
        bl      .                       /* Will be patched by htab_finish_init() */
-       cmp   0,r3,0
+       cmpdi   0,r3,0
        bge     htab_pte_insert_ok      /* Insertion successful */
-       cmp   0,r3,-2                 /* Critical failure */
+       cmpdi   0,r3,-2                 /* Critical failure */
        beq-    htab_pte_insert_failure
 
        /* Now try secondary slot */
@@ -194,9 +194,9 @@ _GLOBAL(htab_call_hpte_insert1)
        li      r9,0
 _GLOBAL(htab_call_hpte_insert2)
        bl      .                       /* Will be patched by htab_finish_init() */
-       cmp   0,r3,0
+       cmpdi   0,r3,0
        bge+    htab_pte_insert_ok      /* Insertion successful */
-       cmp   0,r3,-2                 /* Critical failure */
+       cmpdi   0,r3,-2                 /* Critical failure */
        beq-    htab_pte_insert_failure
 
        /* Both are full, we need to evict something */
@@ -263,7 +263,7 @@ _GLOBAL(htab_call_hpte_updatepp)
        /* if we failed because typically the HPTE wasn't really here
         * we try an insertion. 
         */
-       cmp   0,r3,-1
+       cmpdi   0,r3,-1
        beq-    htab_insert_pte
 
        /* Clear the BUSY bit and Write out the PTE */
@@ -278,6 +278,10 @@ htab_wrong_access:
        b       bail
 
 htab_pte_insert_failure:
-       b       .htab_insert_failure
+       /* Bail out restoring old PTE */
+       ld      r6,STK_PARM(r6)(r1)
+       std     r31,0(r6)
+       li      r3,-1
+       b       bail