diff options
Diffstat (limited to 'arch/powerpc/kernel/entry_64.S')
-rw-r--r-- | arch/powerpc/kernel/entry_64.S | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index b40e0b4815b3..0e931aaffca2 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S | |||
@@ -593,6 +593,41 @@ _GLOBAL(ret_from_except_lite) | |||
593 | b .ret_from_except | 593 | b .ret_from_except |
594 | 594 | ||
595 | resume_kernel: | 595 | resume_kernel: |
596 | /* check current_thread_info, _TIF_EMULATE_STACK_STORE */ | ||
597 | CURRENT_THREAD_INFO(r9, r1) | ||
598 | ld r8,TI_FLAGS(r9) | ||
599 | andis. r8,r8,_TIF_EMULATE_STACK_STORE@h | ||
600 | beq+ 1f | ||
601 | |||
602 | addi r8,r1,INT_FRAME_SIZE /* Get the kprobed function entry */ | ||
603 | |||
604 | lwz r3,GPR1(r1) | ||
605 | subi r3,r3,INT_FRAME_SIZE /* dst: Allocate a trampoline exception frame */ | ||
606 | mr r4,r1 /* src: current exception frame */ | ||
607 | mr r1,r3 /* Reroute the trampoline frame to r1 */ | ||
608 | |||
609 | /* Copy from the original to the trampoline. */ | ||
610 | li r5,INT_FRAME_SIZE/8 /* size: INT_FRAME_SIZE */ | ||
611 | li r6,0 /* start offset: 0 */ | ||
612 | mtctr r5 | ||
613 | 2: ldx r0,r6,r4 | ||
614 | stdx r0,r6,r3 | ||
615 | addi r6,r6,8 | ||
616 | bdnz 2b | ||
617 | |||
618 | /* Do real store operation to complete stwu */ | ||
619 | lwz r5,GPR1(r1) | ||
620 | std r8,0(r5) | ||
621 | |||
622 | /* Clear _TIF_EMULATE_STACK_STORE flag */ | ||
623 | lis r11,_TIF_EMULATE_STACK_STORE@h | ||
624 | addi r5,r9,TI_FLAGS | ||
625 | ldarx r4,0,r5 | ||
626 | andc r4,r4,r11 | ||
627 | stdcx. r4,0,r5 | ||
628 | bne- 0b | ||
629 | 1: | ||
630 | |||
596 | #ifdef CONFIG_PREEMPT | 631 | #ifdef CONFIG_PREEMPT |
597 | /* Check if we need to preempt */ | 632 | /* Check if we need to preempt */ |
598 | andi. r0,r4,_TIF_NEED_RESCHED | 633 | andi. r0,r4,_TIF_NEED_RESCHED |