Commit c911d2e1 authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc/64: Replace CURRENT_THREAD_INFO with PACA_THREAD_INFO

Now that current_thread_info is located at the beginning of 'current'
task struct, CURRENT_THREAD_INFO macro is not really needed any more.

This patch replaces it by loads of the value at PACA_THREAD_INFO(r13).
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
[mpe: Add PACA_THREAD_INFO rather than using PACACURRENT]
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent f7354cca
...@@ -671,7 +671,7 @@ END_FTR_SECTION_NESTED(ftr,ftr,943) ...@@ -671,7 +671,7 @@ END_FTR_SECTION_NESTED(ftr,ftr,943)
#define RUNLATCH_ON \ #define RUNLATCH_ON \
BEGIN_FTR_SECTION \ BEGIN_FTR_SECTION \
CURRENT_THREAD_INFO(r3, r1); \ ld r3, PACA_THREAD_INFO(r13); \
ld r4,TI_LOCAL_FLAGS(r3); \ ld r4,TI_LOCAL_FLAGS(r3); \
andi. r0,r4,_TLF_RUNLATCH; \ andi. r0,r4,_TLF_RUNLATCH; \
beql ppc64_runlatch_on_trampoline; \ beql ppc64_runlatch_on_trampoline; \
...@@ -721,7 +721,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_CTRL) ...@@ -721,7 +721,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_CTRL)
#ifdef CONFIG_PPC_970_NAP #ifdef CONFIG_PPC_970_NAP
#define FINISH_NAP \ #define FINISH_NAP \
BEGIN_FTR_SECTION \ BEGIN_FTR_SECTION \
CURRENT_THREAD_INFO(r11, r1); \ ld r11, PACA_THREAD_INFO(r13); \
ld r9,TI_LOCAL_FLAGS(r11); \ ld r9,TI_LOCAL_FLAGS(r11); \
andi. r10,r9,_TLF_NAPPING; \ andi. r10,r9,_TLF_NAPPING; \
bnel power4_fixup_nap; \ bnel power4_fixup_nap; \
......
...@@ -17,10 +17,6 @@ ...@@ -17,10 +17,6 @@
#define THREAD_SIZE (1 << THREAD_SHIFT) #define THREAD_SIZE (1 << THREAD_SHIFT)
#ifdef CONFIG_PPC64
#define CURRENT_THREAD_INFO(dest, sp) stringify_in_c(ld dest, PACACURRENT(r13))
#endif
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <linux/cache.h> #include <linux/cache.h>
#include <asm/processor.h> #include <asm/processor.h>
......
...@@ -182,6 +182,8 @@ int main(void) ...@@ -182,6 +182,8 @@ int main(void)
OFFSET(PACAPROCSTART, paca_struct, cpu_start); OFFSET(PACAPROCSTART, paca_struct, cpu_start);
OFFSET(PACAKSAVE, paca_struct, kstack); OFFSET(PACAKSAVE, paca_struct, kstack);
OFFSET(PACACURRENT, paca_struct, __current); OFFSET(PACACURRENT, paca_struct, __current);
DEFINE(PACA_THREAD_INFO, offsetof(struct paca_struct, __current) +
offsetof(struct task_struct, thread_info));
OFFSET(PACASAVEDMSR, paca_struct, saved_msr); OFFSET(PACASAVEDMSR, paca_struct, saved_msr);
OFFSET(PACAR1, paca_struct, saved_r1); OFFSET(PACAR1, paca_struct, saved_r1);
OFFSET(PACATOC, paca_struct, kernel_toc); OFFSET(PACATOC, paca_struct, kernel_toc);
......
...@@ -166,7 +166,7 @@ system_call: /* label this so stack traces look sane */ ...@@ -166,7 +166,7 @@ system_call: /* label this so stack traces look sane */
li r10,IRQS_ENABLED li r10,IRQS_ENABLED
std r10,SOFTE(r1) std r10,SOFTE(r1)
CURRENT_THREAD_INFO(r11, r1) ld r11, PACA_THREAD_INFO(r13)
ld r10,TI_FLAGS(r11) ld r10,TI_FLAGS(r11)
andi. r11,r10,_TIF_SYSCALL_DOTRACE andi. r11,r10,_TIF_SYSCALL_DOTRACE
bne .Lsyscall_dotrace /* does not return */ bne .Lsyscall_dotrace /* does not return */
...@@ -213,7 +213,7 @@ system_call: /* label this so stack traces look sane */ ...@@ -213,7 +213,7 @@ system_call: /* label this so stack traces look sane */
ld r3,RESULT(r1) ld r3,RESULT(r1)
#endif #endif
CURRENT_THREAD_INFO(r12, r1) ld r12, PACA_THREAD_INFO(r13)
ld r8,_MSR(r1) ld r8,_MSR(r1)
#ifdef CONFIG_PPC_BOOK3S #ifdef CONFIG_PPC_BOOK3S
...@@ -346,7 +346,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR) ...@@ -346,7 +346,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR)
/* Repopulate r9 and r10 for the syscall path */ /* Repopulate r9 and r10 for the syscall path */
addi r9,r1,STACK_FRAME_OVERHEAD addi r9,r1,STACK_FRAME_OVERHEAD
CURRENT_THREAD_INFO(r10, r1) ld r10, PACA_THREAD_INFO(r13)
ld r10,TI_FLAGS(r10) ld r10,TI_FLAGS(r10)
cmpldi r0,NR_syscalls cmpldi r0,NR_syscalls
...@@ -740,7 +740,7 @@ _GLOBAL(ret_from_except_lite) ...@@ -740,7 +740,7 @@ _GLOBAL(ret_from_except_lite)
mtmsrd r10,1 /* Update machine state */ mtmsrd r10,1 /* Update machine state */
#endif /* CONFIG_PPC_BOOK3E */ #endif /* CONFIG_PPC_BOOK3E */
CURRENT_THREAD_INFO(r9, r1) ld r9, PACA_THREAD_INFO(r13)
ld r3,_MSR(r1) ld r3,_MSR(r1)
#ifdef CONFIG_PPC_BOOK3E #ifdef CONFIG_PPC_BOOK3E
ld r10,PACACURRENT(r13) ld r10,PACACURRENT(r13)
...@@ -854,7 +854,7 @@ resume_kernel: ...@@ -854,7 +854,7 @@ resume_kernel:
1: bl preempt_schedule_irq 1: bl preempt_schedule_irq
/* Re-test flags and eventually loop */ /* Re-test flags and eventually loop */
CURRENT_THREAD_INFO(r9, r1) ld r9, PACA_THREAD_INFO(r13)
ld r4,TI_FLAGS(r9) ld r4,TI_FLAGS(r9)
andi. r0,r4,_TIF_NEED_RESCHED andi. r0,r4,_TIF_NEED_RESCHED
bne 1b bne 1b
......
...@@ -493,7 +493,7 @@ exc_##n##_bad_stack: \ ...@@ -493,7 +493,7 @@ exc_##n##_bad_stack: \
* interrupts happen before the wait instruction. * interrupts happen before the wait instruction.
*/ */
#define CHECK_NAPPING() \ #define CHECK_NAPPING() \
CURRENT_THREAD_INFO(r11, r1); \ ld r11, PACA_THREAD_INFO(r13); \
ld r10,TI_LOCAL_FLAGS(r11); \ ld r10,TI_LOCAL_FLAGS(r11); \
andi. r9,r10,_TLF_NAPPING; \ andi. r9,r10,_TLF_NAPPING; \
beq+ 1f; \ beq+ 1f; \
......
...@@ -1629,7 +1629,7 @@ do_hash_page: ...@@ -1629,7 +1629,7 @@ do_hash_page:
ori r0,r0,DSISR_BAD_FAULT_64S@l ori r0,r0,DSISR_BAD_FAULT_64S@l
and. r0,r4,r0 /* weird error? */ and. r0,r4,r0 /* weird error? */
bne- handle_page_fault /* if not, try to insert a HPTE */ bne- handle_page_fault /* if not, try to insert a HPTE */
CURRENT_THREAD_INFO(r11, r1) ld r11, PACA_THREAD_INFO(r13)
lwz r0,TI_PREEMPT(r11) /* If we're in an "NMI" */ lwz r0,TI_PREEMPT(r11) /* If we're in an "NMI" */
andis. r0,r0,NMI_MASK@h /* (i.e. an irq when soft-disabled) */ andis. r0,r0,NMI_MASK@h /* (i.e. an irq when soft-disabled) */
bne 77f /* then don't call hash_page now */ bne 77f /* then don't call hash_page now */
......
...@@ -63,7 +63,7 @@ _GLOBAL(\name) ...@@ -63,7 +63,7 @@ _GLOBAL(\name)
1: /* Let's set the _TLF_NAPPING flag so interrupts make us return 1: /* Let's set the _TLF_NAPPING flag so interrupts make us return
* to the right spot * to the right spot
*/ */
CURRENT_THREAD_INFO(r11, r1) ld r11, PACACURRENT(r13)
ld r10,TI_LOCAL_FLAGS(r11) ld r10,TI_LOCAL_FLAGS(r11)
ori r10,r10,_TLF_NAPPING ori r10,r10,_TLF_NAPPING
std r10,TI_LOCAL_FLAGS(r11) std r10,TI_LOCAL_FLAGS(r11)
......
...@@ -68,7 +68,7 @@ BEGIN_FTR_SECTION ...@@ -68,7 +68,7 @@ BEGIN_FTR_SECTION
DSSALL DSSALL
sync sync
END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
CURRENT_THREAD_INFO(r9, r1) ld r9, PACA_THREAD_INFO(r13)
ld r8,TI_LOCAL_FLAGS(r9) /* set napping bit */ ld r8,TI_LOCAL_FLAGS(r9) /* set napping bit */
ori r8,r8,_TLF_NAPPING /* so when we take an exception */ ori r8,r8,_TLF_NAPPING /* so when we take an exception */
std r8,TI_LOCAL_FLAGS(r9) /* it will return to our caller */ std r8,TI_LOCAL_FLAGS(r9) /* it will return to our caller */
......
...@@ -229,7 +229,7 @@ ftrace_call: ...@@ -229,7 +229,7 @@ ftrace_call:
* - r0, r11 & r12 are free * - r0, r11 & r12 are free
*/ */
livepatch_handler: livepatch_handler:
CURRENT_THREAD_INFO(r12, r1) ld r12, PACA_THREAD_INFO(r13)
/* Allocate 3 x 8 bytes */ /* Allocate 3 x 8 bytes */
ld r11, TI_livepatch_sp(r12) ld r11, TI_livepatch_sp(r12)
...@@ -256,7 +256,7 @@ livepatch_handler: ...@@ -256,7 +256,7 @@ livepatch_handler:
* restore it. * restore it.
*/ */
CURRENT_THREAD_INFO(r12, r1) ld r12, PACA_THREAD_INFO(r13)
ld r11, TI_livepatch_sp(r12) ld r11, TI_livepatch_sp(r12)
...@@ -273,7 +273,7 @@ livepatch_handler: ...@@ -273,7 +273,7 @@ livepatch_handler:
ld r2, -24(r11) ld r2, -24(r11)
/* Pop livepatch stack frame */ /* Pop livepatch stack frame */
CURRENT_THREAD_INFO(r12, r1) ld r12, PACA_THREAD_INFO(r13)
subi r11, r11, 24 subi r11, r11, 24
std r11, TI_livepatch_sp(r12) std r11, TI_livepatch_sp(r12)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment