2 * ppc64 MMU hashtable management routines
4 * (c) Copyright IBM Corp. 2003, 2005
6 * Maintained by: Benjamin Herrenschmidt
7 * <benh@kernel.crashing.org>
9 * This file is covered by the GNU Public Licence v2 as
10 * described in the kernel's COPYING file.
13 #include <linux/config.h>
15 #include <asm/pgtable.h>
18 #include <asm/types.h>
19 #include <asm/ppc_asm.h>
20 #include <asm/asm-offsets.h>
21 #include <asm/cputable.h>
28 * +-> Back chain (SP + 256)
29 * | General register save area (SP + 112)
30 * | Parameter save area (SP + 48)
31 * | TOC save area (SP + 40)
32 * | link editor doubleword (SP + 32)
33 * | compiler doubleword (SP + 24)
34 * | LR save area (SP + 16)
35 * | CR save area (SP + 8)
36 * SP ---> +-- Back chain (SP + 0)
38 #define STACKFRAMESIZE 256
40 /* Save parameters offsets */
41 #define STK_PARM(i) (STACKFRAMESIZE + 48 + ((i)-3)*8)
43 /* Save non-volatile offsets */
44 #define STK_REG(i) (112 + ((i)-14)*8)
47 #ifndef CONFIG_PPC_64K_PAGES
49 /*****************************************************************************
51 * 4K SW & 4K HW pages implementation *
53 *****************************************************************************/
57 * _hash_page_4K(unsigned long ea, unsigned long access, unsigned long vsid,
58 * pte_t *ptep, unsigned long trap, int local)
60 * Adds a 4K page to the hash table in a segment of 4K pages only
63 _GLOBAL(__hash_page_4K)
66 stdu r1,-STACKFRAMESIZE(r1)
67 /* Save all params that we need after a function call */
68 std r6,STK_PARM(r6)(r1)
69 std r8,STK_PARM(r8)(r1)
71 /* Add _PAGE_PRESENT to access */
72 ori r4,r4,_PAGE_PRESENT
74 /* Save non-volatile registers.
75 * r31 will hold "old PTE"
79 * r27 is hashtab mask (maybe dynamic patched instead ?)
81 std r27,STK_REG(r27)(r1)
82 std r28,STK_REG(r28)(r1)
83 std r29,STK_REG(r29)(r1)
84 std r30,STK_REG(r30)(r1)
85 std r31,STK_REG(r31)(r1)
89 * Check permissions, atomically mark the linux PTE busy
94 /* Check access rights (access & ~(pte_val(*ptep))) */
96 bne- htab_wrong_access
97 /* Check if PTE is busy */
98 andi. r0,r31,_PAGE_BUSY
99 /* If so, just bail out and refault if needed. Someone else
100 * is changing this PTE anyway and might hash it.
104 /* Prepare new PTE value (turn access RW into DIRTY, then
105 * add BUSY,HASHPTE and ACCESSED)
107 rlwinm r30,r4,32-9+7,31-7,31-7 /* _PAGE_RW -> _PAGE_DIRTY */
109 ori r30,r30,_PAGE_BUSY | _PAGE_ACCESSED | _PAGE_HASHPTE
110 /* Write the linux PTE atomically (setting busy) */
117 * Insert/Update the HPTE in the hash table. At this point,
118 * r4 (access) is re-useable, we use it for the new HPTE flags
121 /* Calc va and put it in r29 */
122 rldicr r29,r5,28,63-28
126 /* Calculate hash value for primary slot and store it in r28 */
127 rldicl r5,r5,0,25 /* vsid & 0x0000007fffffffff */
128 rldicl r0,r3,64-12,48 /* (ea >> 12) & 0xffff */
131 /* Convert linux PTE bits into HW equivalents */
132 andi. r3,r30,0x1fe /* Get basic set of flags */
133 xori r3,r3,HPTE_R_N /* _PAGE_EXEC -> NOEXEC */
134 rlwinm r0,r30,32-9+1,30,30 /* _PAGE_RW -> _PAGE_USER (r0) */
135 rlwinm r4,r30,32-7+1,30,30 /* _PAGE_DIRTY -> _PAGE_USER (r4) */
136 and r0,r0,r4 /* _PAGE_RW & _PAGE_DIRTY ->r0 bit 30*/
137 andc r0,r30,r0 /* r0 = pte & ~r0 */
138 rlwimi r3,r0,32-1,31,31 /* Insert result into PP lsb */
140 /* We eventually do the icache sync here (maybe inline that
141 * code rather than call a C function...)
146 bl .hash_page_do_lazy_icache
147 END_FTR_SECTION(CPU_FTR_NOEXECUTE|CPU_FTR_COHERENT_ICACHE, CPU_FTR_NOEXECUTE)
149 /* At this point, r3 contains new PP bits, save them in
150 * place of "access" in the param area (sic)
152 std r3,STK_PARM(r4)(r1)
154 /* Get htab_hash_mask */
155 ld r4,htab_hash_mask@got(2)
156 ld r27,0(r4) /* htab_hash_mask -> r27 */
158 /* Check if we may already be in the hashtable, in this case, we
159 * go to out-of-line code to try to modify the HPTE
161 andi. r0,r31,_PAGE_HASHPTE
165 /* Clear hpte bits in new pte (we also clear BUSY btw) and
168 lis r0,_PAGE_HPTEFLAGS@h
169 ori r0,r0,_PAGE_HPTEFLAGS@l
171 ori r30,r30,_PAGE_HASHPTE
173 /* physical address r5 */
174 rldicl r5,r31,64-PTE_RPN_SHIFT,PTE_RPN_SHIFT
175 sldi r5,r5,PAGE_SHIFT
177 /* Calculate primary group hash */
179 rldicr r3,r0,3,63-3 /* r3 = (hash & mask) << 3 */
181 /* Call ppc_md.hpte_insert */
182 ld r6,STK_PARM(r4)(r1) /* Retreive new pp bits */
183 mr r4,r29 /* Retreive va */
184 li r7,0 /* !bolted, !secondary */
185 li r8,MMU_PAGE_4K /* page size */
186 _GLOBAL(htab_call_hpte_insert1)
187 bl . /* Patched by htab_finish_init() */
189 bge htab_pte_insert_ok /* Insertion successful */
190 cmpdi 0,r3,-2 /* Critical failure */
191 beq- htab_pte_insert_failure
193 /* Now try secondary slot */
195 /* physical address r5 */
196 rldicl r5,r31,64-PTE_RPN_SHIFT,PTE_RPN_SHIFT
197 sldi r5,r5,PAGE_SHIFT
199 /* Calculate secondary group hash */
201 rldicr r3,r0,3,63-3 /* r0 = (~hash & mask) << 3 */
203 /* Call ppc_md.hpte_insert */
204 ld r6,STK_PARM(r4)(r1) /* Retreive new pp bits */
205 mr r4,r29 /* Retreive va */
206 li r7,HPTE_V_SECONDARY /* !bolted, secondary */
207 li r8,MMU_PAGE_4K /* page size */
208 _GLOBAL(htab_call_hpte_insert2)
209 bl . /* Patched by htab_finish_init() */
211 bge+ htab_pte_insert_ok /* Insertion successful */
212 cmpdi 0,r3,-2 /* Critical failure */
213 beq- htab_pte_insert_failure
215 /* Both are full, we need to evict something */
217 /* Pick a random group based on TB */
223 rldicr r3,r0,3,63-3 /* r0 = (hash & mask) << 3 */
224 /* Call ppc_md.hpte_remove */
225 _GLOBAL(htab_call_hpte_remove)
226 bl . /* Patched by htab_finish_init() */
236 /* Insert slot number & secondary bit in PTE */
237 rldimi r30,r3,12,63-15
239 /* Write out the PTE with a normal write
240 * (maybe add eieio may be good still ?)
243 ld r6,STK_PARM(r6)(r1)
247 ld r27,STK_REG(r27)(r1)
248 ld r28,STK_REG(r28)(r1)
249 ld r29,STK_REG(r29)(r1)
250 ld r30,STK_REG(r30)(r1)
251 ld r31,STK_REG(r31)(r1)
252 addi r1,r1,STACKFRAMESIZE
258 /* Keep PP bits in r4 and slot idx from the PTE around in r3 */
260 rlwinm r3,r31,32-12,29,31
262 /* Secondary group ? if yes, get a inverted hash value */
264 andi. r0,r31,_PAGE_SECONDARY
268 /* Calculate proper slot value for ppc_md.hpte_updatepp */
270 rldicr r0,r0,3,63-3 /* r0 = (hash & mask) << 3 */
271 add r3,r0,r3 /* add slot idx */
273 /* Call ppc_md.hpte_updatepp */
275 li r6,MMU_PAGE_4K /* page size */
276 ld r7,STK_PARM(r8)(r1) /* get "local" param */
277 _GLOBAL(htab_call_hpte_updatepp)
278 bl . /* Patched by htab_finish_init() */
280 /* if we failed because typically the HPTE wasn't really here
281 * we try an insertion.
286 /* Clear the BUSY bit and Write out the PTE */
292 /* Bail out clearing reservation */
297 htab_pte_insert_failure:
298 /* Bail out restoring old PTE */
299 ld r6,STK_PARM(r6)(r1)
305 #else /* CONFIG_PPC_64K_PAGES */
308 /*****************************************************************************
310 * 64K SW & 4K or 64K HW in a 4K segment pages implementation *
312 *****************************************************************************/
314 /* _hash_page_4K(unsigned long ea, unsigned long access, unsigned long vsid,
315 * pte_t *ptep, unsigned long trap, int local)
319 * For now, we do NOT implement Admixed pages
321 _GLOBAL(__hash_page_4K)
324 stdu r1,-STACKFRAMESIZE(r1)
325 /* Save all params that we need after a function call */
326 std r6,STK_PARM(r6)(r1)
327 std r8,STK_PARM(r8)(r1)
329 /* Add _PAGE_PRESENT to access */
330 ori r4,r4,_PAGE_PRESENT
332 /* Save non-volatile registers.
333 * r31 will hold "old PTE"
336 * r28 is a hash value
337 * r27 is hashtab mask (maybe dynamic patched instead ?)
338 * r26 is the hidx mask
339 * r25 is the index in combo page
341 std r25,STK_REG(r25)(r1)
342 std r26,STK_REG(r26)(r1)
343 std r27,STK_REG(r27)(r1)
344 std r28,STK_REG(r28)(r1)
345 std r29,STK_REG(r29)(r1)
346 std r30,STK_REG(r30)(r1)
347 std r31,STK_REG(r31)(r1)
351 * Check permissions, atomically mark the linux PTE busy
356 /* Check access rights (access & ~(pte_val(*ptep))) */
358 bne- htab_wrong_access
359 /* Check if PTE is busy */
360 andi. r0,r31,_PAGE_BUSY
361 /* If so, just bail out and refault if needed. Someone else
362 * is changing this PTE anyway and might hash it.
365 /* Prepare new PTE value (turn access RW into DIRTY, then
366 * add BUSY and ACCESSED)
368 rlwinm r30,r4,32-9+7,31-7,31-7 /* _PAGE_RW -> _PAGE_DIRTY */
370 ori r30,r30,_PAGE_BUSY | _PAGE_ACCESSED | _PAGE_HASHPTE
371 /* Write the linux PTE atomically (setting busy) */
378 * Insert/Update the HPTE in the hash table. At this point,
379 * r4 (access) is re-useable, we use it for the new HPTE flags
382 /* Load the hidx index */
383 rldicl r25,r3,64-12,60
385 /* Calc va and put it in r29 */
386 rldicr r29,r5,28,63-28 /* r29 = (vsid << 28) */
387 rldicl r3,r3,0,36 /* r3 = (ea & 0x0fffffff) */
388 or r29,r3,r29 /* r29 = va
390 /* Calculate hash value for primary slot and store it in r28 */
391 rldicl r5,r5,0,25 /* vsid & 0x0000007fffffffff */
392 rldicl r0,r3,64-12,48 /* (ea >> 12) & 0xffff */
395 /* Convert linux PTE bits into HW equivalents */
396 andi. r3,r30,0x1fe /* Get basic set of flags */
397 xori r3,r3,HPTE_R_N /* _PAGE_EXEC -> NOEXEC */
398 rlwinm r0,r30,32-9+1,30,30 /* _PAGE_RW -> _PAGE_USER (r0) */
399 rlwinm r4,r30,32-7+1,30,30 /* _PAGE_DIRTY -> _PAGE_USER (r4) */
400 and r0,r0,r4 /* _PAGE_RW & _PAGE_DIRTY ->r0 bit 30*/
401 andc r0,r30,r0 /* r0 = pte & ~r0 */
402 rlwimi r3,r0,32-1,31,31 /* Insert result into PP lsb */
404 /* We eventually do the icache sync here (maybe inline that
405 * code rather than call a C function...)
410 bl .hash_page_do_lazy_icache
411 END_FTR_SECTION(CPU_FTR_NOEXECUTE|CPU_FTR_COHERENT_ICACHE, CPU_FTR_NOEXECUTE)
413 /* At this point, r3 contains new PP bits, save them in
414 * place of "access" in the param area (sic)
416 std r3,STK_PARM(r4)(r1)
418 /* Get htab_hash_mask */
419 ld r4,htab_hash_mask@got(2)
420 ld r27,0(r4) /* htab_hash_mask -> r27 */
422 /* Check if we may already be in the hashtable, in this case, we
423 * go to out-of-line code to try to modify the HPTE. We look for
424 * the bit at (1 >> (index + 32))
426 andi. r0,r31,_PAGE_HASHPTE
427 li r26,0 /* Default hidx */
429 ld r6,STK_PARM(r6)(r1)
430 ori r26,r6,0x8000 /* Load the hidx mask */
432 addi r5,r25,36 /* Check actual HPTE_SUB bit, this */
433 rldcr. r0,r31,r5,0 /* must match pgtable.h definition */
437 /* real page number in r5, PTE RPN value + index */
438 rldicl r5,r31,64-PTE_RPN_SHIFT,PTE_RPN_SHIFT
439 sldi r5,r5,PAGE_SHIFT-HW_PAGE_SHIFT
441 sldi r5,r5,HW_PAGE_SHIFT
443 /* Calculate primary group hash */
445 rldicr r3,r0,3,63-3 /* r0 = (hash & mask) << 3 */
447 /* Call ppc_md.hpte_insert */
448 ld r6,STK_PARM(r4)(r1) /* Retreive new pp bits */
449 mr r4,r29 /* Retreive va */
450 li r7,0 /* !bolted, !secondary */
451 li r8,MMU_PAGE_4K /* page size */
452 _GLOBAL(htab_call_hpte_insert1)
453 bl . /* patched by htab_finish_init() */
455 bge htab_pte_insert_ok /* Insertion successful */
456 cmpdi 0,r3,-2 /* Critical failure */
457 beq- htab_pte_insert_failure
459 /* Now try secondary slot */
461 /* real page number in r5, PTE RPN value + index */
462 rldicl r5,r31,64-PTE_RPN_SHIFT,PTE_RPN_SHIFT
463 sldi r5,r5,PAGE_SHIFT-HW_PAGE_SHIFT
465 sldi r5,r5,HW_PAGE_SHIFT
467 /* Calculate secondary group hash */
469 rldicr r3,r0,3,63-3 /* r0 = (~hash & mask) << 3 */
471 /* Call ppc_md.hpte_insert */
472 ld r6,STK_PARM(r4)(r1) /* Retreive new pp bits */
473 mr r4,r29 /* Retreive va */
474 li r7,HPTE_V_SECONDARY /* !bolted, secondary */
475 li r8,MMU_PAGE_4K /* page size */
476 _GLOBAL(htab_call_hpte_insert2)
477 bl . /* patched by htab_finish_init() */
479 bge+ htab_pte_insert_ok /* Insertion successful */
480 cmpdi 0,r3,-2 /* Critical failure */
481 beq- htab_pte_insert_failure
483 /* Both are full, we need to evict something */
485 /* Pick a random group based on TB */
491 rldicr r3,r0,3,63-3 /* r0 = (hash & mask) << 3 */
492 /* Call ppc_md.hpte_remove */
493 _GLOBAL(htab_call_hpte_remove)
494 bl . /* patched by htab_finish_init() */
504 /* Insert slot number & secondary bit in PTE second half,
505 * clear _PAGE_BUSY and set approriate HPTE slot bit
507 ld r6,STK_PARM(r6)(r1)
512 subfic r5,r25,27 /* Must match bit position in */
513 sld r0,r0,r5 /* pgtable.h */
528 ld r25,STK_REG(r25)(r1)
529 ld r26,STK_REG(r26)(r1)
530 ld r27,STK_REG(r27)(r1)
531 ld r28,STK_REG(r28)(r1)
532 ld r29,STK_REG(r29)(r1)
533 ld r30,STK_REG(r30)(r1)
534 ld r31,STK_REG(r31)(r1)
535 addi r1,r1,STACKFRAMESIZE
541 /* Keep PP bits in r4 and slot idx from the PTE around in r3 */
546 /* Secondary group ? if yes, get a inverted hash value */
548 andi. r0,r3,0x8 /* page secondary ? */
551 1: andi. r3,r3,0x7 /* extract idx alone */
553 /* Calculate proper slot value for ppc_md.hpte_updatepp */
555 rldicr r0,r0,3,63-3 /* r0 = (hash & mask) << 3 */
556 add r3,r0,r3 /* add slot idx */
558 /* Call ppc_md.hpte_updatepp */
560 li r6,MMU_PAGE_4K /* page size */
561 ld r7,STK_PARM(r8)(r1) /* get "local" param */
562 _GLOBAL(htab_call_hpte_updatepp)
563 bl . /* patched by htab_finish_init() */
565 /* if we failed because typically the HPTE wasn't really here
566 * we try an insertion.
571 /* Clear the BUSY bit and Write out the PTE */
574 ld r6,STK_PARM(r6)(r1)
580 /* Bail out clearing reservation */
585 htab_pte_insert_failure:
586 /* Bail out restoring old PTE */
587 ld r6,STK_PARM(r6)(r1)
593 /*****************************************************************************
595 * 64K SW & 64K HW in a 64K segment pages implementation *
597 *****************************************************************************/
599 _GLOBAL(__hash_page_64K)
602 stdu r1,-STACKFRAMESIZE(r1)
603 /* Save all params that we need after a function call */
604 std r6,STK_PARM(r6)(r1)
605 std r8,STK_PARM(r8)(r1)
607 /* Add _PAGE_PRESENT to access */
608 ori r4,r4,_PAGE_PRESENT
610 /* Save non-volatile registers.
611 * r31 will hold "old PTE"
614 * r28 is a hash value
615 * r27 is hashtab mask (maybe dynamic patched instead ?)
617 std r27,STK_REG(r27)(r1)
618 std r28,STK_REG(r28)(r1)
619 std r29,STK_REG(r29)(r1)
620 std r30,STK_REG(r30)(r1)
621 std r31,STK_REG(r31)(r1)
625 * Check permissions, atomically mark the linux PTE busy
630 /* Check access rights (access & ~(pte_val(*ptep))) */
632 bne- ht64_wrong_access
633 /* Check if PTE is busy */
634 andi. r0,r31,_PAGE_BUSY
635 /* If so, just bail out and refault if needed. Someone else
636 * is changing this PTE anyway and might hash it.
639 /* Prepare new PTE value (turn access RW into DIRTY, then
640 * add BUSY,HASHPTE and ACCESSED)
642 rlwinm r30,r4,32-9+7,31-7,31-7 /* _PAGE_RW -> _PAGE_DIRTY */
644 ori r30,r30,_PAGE_BUSY | _PAGE_ACCESSED | _PAGE_HASHPTE
645 /* Write the linux PTE atomically (setting busy) */
652 * Insert/Update the HPTE in the hash table. At this point,
653 * r4 (access) is re-useable, we use it for the new HPTE flags
656 /* Calc va and put it in r29 */
657 rldicr r29,r5,28,63-28
661 /* Calculate hash value for primary slot and store it in r28 */
662 rldicl r5,r5,0,25 /* vsid & 0x0000007fffffffff */
663 rldicl r0,r3,64-16,52 /* (ea >> 16) & 0xfff */
666 /* Convert linux PTE bits into HW equivalents */
667 andi. r3,r30,0x1fe /* Get basic set of flags */
668 xori r3,r3,HPTE_R_N /* _PAGE_EXEC -> NOEXEC */
669 rlwinm r0,r30,32-9+1,30,30 /* _PAGE_RW -> _PAGE_USER (r0) */
670 rlwinm r4,r30,32-7+1,30,30 /* _PAGE_DIRTY -> _PAGE_USER (r4) */
671 and r0,r0,r4 /* _PAGE_RW & _PAGE_DIRTY ->r0 bit 30*/
672 andc r0,r30,r0 /* r0 = pte & ~r0 */
673 rlwimi r3,r0,32-1,31,31 /* Insert result into PP lsb */
675 /* We eventually do the icache sync here (maybe inline that
676 * code rather than call a C function...)
681 bl .hash_page_do_lazy_icache
682 END_FTR_SECTION(CPU_FTR_NOEXECUTE|CPU_FTR_COHERENT_ICACHE, CPU_FTR_NOEXECUTE)
684 /* At this point, r3 contains new PP bits, save them in
685 * place of "access" in the param area (sic)
687 std r3,STK_PARM(r4)(r1)
689 /* Get htab_hash_mask */
690 ld r4,htab_hash_mask@got(2)
691 ld r27,0(r4) /* htab_hash_mask -> r27 */
693 /* Check if we may already be in the hashtable, in this case, we
694 * go to out-of-line code to try to modify the HPTE
696 andi. r0,r31,_PAGE_HASHPTE
700 /* Clear hpte bits in new pte (we also clear BUSY btw) and
703 lis r0,_PAGE_HPTEFLAGS@h
704 ori r0,r0,_PAGE_HPTEFLAGS@l
706 ori r30,r30,_PAGE_HASHPTE
708 /* Phyical address in r5 */
709 rldicl r5,r31,64-PTE_RPN_SHIFT,PTE_RPN_SHIFT
710 sldi r5,r5,PAGE_SHIFT
712 /* Calculate primary group hash */
714 rldicr r3,r0,3,63-3 /* r0 = (hash & mask) << 3 */
716 /* Call ppc_md.hpte_insert */
717 ld r6,STK_PARM(r4)(r1) /* Retreive new pp bits */
718 mr r4,r29 /* Retreive va */
719 li r7,0 /* !bolted, !secondary */
721 _GLOBAL(ht64_call_hpte_insert1)
722 bl . /* patched by htab_finish_init() */
724 bge ht64_pte_insert_ok /* Insertion successful */
725 cmpdi 0,r3,-2 /* Critical failure */
726 beq- ht64_pte_insert_failure
728 /* Now try secondary slot */
730 /* Phyical address in r5 */
731 rldicl r5,r31,64-PTE_RPN_SHIFT,PTE_RPN_SHIFT
732 sldi r5,r5,PAGE_SHIFT
734 /* Calculate secondary group hash */
736 rldicr r3,r0,3,63-3 /* r0 = (~hash & mask) << 3 */
738 /* Call ppc_md.hpte_insert */
739 ld r6,STK_PARM(r4)(r1) /* Retreive new pp bits */
740 mr r4,r29 /* Retreive va */
741 li r7,HPTE_V_SECONDARY /* !bolted, secondary */
743 _GLOBAL(ht64_call_hpte_insert2)
744 bl . /* patched by htab_finish_init() */
746 bge+ ht64_pte_insert_ok /* Insertion successful */
747 cmpdi 0,r3,-2 /* Critical failure */
748 beq- ht64_pte_insert_failure
750 /* Both are full, we need to evict something */
752 /* Pick a random group based on TB */
758 rldicr r3,r0,3,63-3 /* r0 = (hash & mask) << 3 */
759 /* Call ppc_md.hpte_remove */
760 _GLOBAL(ht64_call_hpte_remove)
761 bl . /* patched by htab_finish_init() */
771 /* Insert slot number & secondary bit in PTE */
772 rldimi r30,r3,12,63-15
774 /* Write out the PTE with a normal write
775 * (maybe add eieio may be good still ?)
778 ld r6,STK_PARM(r6)(r1)
782 ld r27,STK_REG(r27)(r1)
783 ld r28,STK_REG(r28)(r1)
784 ld r29,STK_REG(r29)(r1)
785 ld r30,STK_REG(r30)(r1)
786 ld r31,STK_REG(r31)(r1)
787 addi r1,r1,STACKFRAMESIZE
793 /* Keep PP bits in r4 and slot idx from the PTE around in r3 */
795 rlwinm r3,r31,32-12,29,31
797 /* Secondary group ? if yes, get a inverted hash value */
799 andi. r0,r31,_PAGE_F_SECOND
803 /* Calculate proper slot value for ppc_md.hpte_updatepp */
805 rldicr r0,r0,3,63-3 /* r0 = (hash & mask) << 3 */
806 add r3,r0,r3 /* add slot idx */
808 /* Call ppc_md.hpte_updatepp */
811 ld r7,STK_PARM(r8)(r1) /* get "local" param */
812 _GLOBAL(ht64_call_hpte_updatepp)
813 bl . /* patched by htab_finish_init() */
815 /* if we failed because typically the HPTE wasn't really here
816 * we try an insertion.
821 /* Clear the BUSY bit and Write out the PTE */
827 /* Bail out clearing reservation */
832 ht64_pte_insert_failure:
833 /* Bail out restoring old PTE */
834 ld r6,STK_PARM(r6)(r1)
840 #endif /* CONFIG_PPC_64K_PAGES */
843 /*****************************************************************************
845 * Huge pages implementation is in hugetlbpage.c *
847 *****************************************************************************/