Lines Matching +full:supervisor +full:- +full:mode +full:- +full:visible
1 // SPDX-License-Identifier: GPL-2.0-or-later
10 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
40 #include <linux/elf-randomize.h>
59 #include <asm/code-patching.h>
63 #include <asm/asm-prototypes.h>
81 * Are we running in "Suspend disabled" mode? If so we have to block any
95 if (tsk == current && tsk->thread.regs && in check_if_tm_restore_required()
96 MSR_TM_ACTIVE(tsk->thread.regs->msr) && in check_if_tm_restore_required()
98 tsk->thread.ckpt_regs.msr = tsk->thread.regs->msr; in check_if_tm_restore_required()
159 msr = tsk->thread.regs->msr; in __giveup_fpu()
163 tsk->thread.regs->msr = msr; in __giveup_fpu()
177 * Make sure the floating-point register state in the
182 if (tsk->thread.regs) { in flush_fp_to_thread()
185 * another process could get scheduled after the regs->msr in flush_fp_to_thread()
192 if (tsk->thread.regs->msr & MSR_FP) { in flush_fp_to_thread()
216 if (current->thread.regs && (current->thread.regs->msr & MSR_FP)) { in enable_kernel_fp()
226 MSR_TM_ACTIVE(current->thread.regs->msr)) in enable_kernel_fp()
242 msr = tsk->thread.regs->msr; in __giveup_altivec()
246 tsk->thread.regs->msr = msr; in __giveup_altivec()
267 if (current->thread.regs && (current->thread.regs->msr & MSR_VEC)) { in enable_kernel_altivec()
277 MSR_TM_ACTIVE(current->thread.regs->msr)) in enable_kernel_altivec()
290 if (tsk->thread.regs) { in flush_altivec_to_thread()
292 if (tsk->thread.regs->msr & MSR_VEC) { in flush_altivec_to_thread()
305 unsigned long msr = tsk->thread.regs->msr; in __giveup_vsx()
337 if (current->thread.regs && in enable_kernel_vsx()
338 (current->thread.regs->msr & (MSR_VSX|MSR_VEC|MSR_FP))) { in enable_kernel_vsx()
348 MSR_TM_ACTIVE(current->thread.regs->msr)) in enable_kernel_vsx()
357 if (tsk->thread.regs) { in flush_vsx_to_thread()
359 if (tsk->thread.regs->msr & (MSR_VSX|MSR_VEC|MSR_FP)) { in flush_vsx_to_thread()
386 if (current->thread.regs && (current->thread.regs->msr & MSR_SPE)) { in enable_kernel_spe()
395 if (tsk->thread.regs) { in flush_spe_to_thread()
397 if (tsk->thread.regs->msr & MSR_SPE) { in flush_spe_to_thread()
399 tsk->thread.spefscr = mfspr(SPRN_SPEFSCR); in flush_spe_to_thread()
428 if (!tsk->thread.regs) in giveup_all()
433 usermsr = tsk->thread.regs->msr; in giveup_all()
457 if (current->thread.load_fp) { in should_restore_fp()
458 current->thread.load_fp++; in should_restore_fp()
466 load_fp_state(¤t->thread.fp_state); in do_restore_fp()
476 if (cpu_has_feature(CPU_FTR_ALTIVEC) && (current->thread.load_vec)) { in should_restore_altivec()
477 current->thread.load_vec++; in should_restore_altivec()
485 load_vr_state(¤t->thread.vr_state); in do_restore_altivec()
486 current->thread.used_vr = 1; in do_restore_altivec()
502 current->thread.used_vsr = 1; in do_restore_vsx()
514 * could be done by having ftrace entry code check for this un-reconciled
523 msr = regs->msr; in restore_math()
550 fpexc_mode = current->thread.fpexc_mode; in restore_math()
561 regs->msr |= new_msr | fpexc_mode; in restore_math()
570 if (!tsk->thread.regs) in save_all()
573 usermsr = tsk->thread.regs->msr; in save_all()
592 thread_pkey_regs_save(&tsk->thread); in save_all()
597 if (tsk->thread.regs) { in flush_all_to_thread()
601 if (tsk->thread.regs->msr & MSR_SPE) in flush_all_to_thread()
602 tsk->thread.spefscr = mfspr(SPRN_SPEFSCR); in flush_all_to_thread()
615 current->thread.trap_nr = TRAP_HWBKPT; in do_send_trap()
642 current->thread.hw_brk[0] = null_brk; in do_break_handler()
643 current->thread.hw_brk[0].flags |= HW_BRK_FLAG_DISABLED; in do_break_handler()
651 info = ¤t->thread.hw_brk[i]; in do_break_handler()
652 if (!info->address) in do_break_handler()
657 current->thread.hw_brk[i] = null_brk; in do_break_handler()
658 current->thread.hw_brk[i].flags |= HW_BRK_FLAG_DISABLED; in do_break_handler()
666 current->thread.trap_nr = TRAP_HWBKPT; in do_break()
697 thread->debug.iac1 = thread->debug.iac2 = 0; in set_debug_reg_defaults()
699 thread->debug.iac3 = thread->debug.iac4 = 0; in set_debug_reg_defaults()
701 thread->debug.dac1 = thread->debug.dac2 = 0; in set_debug_reg_defaults()
703 thread->debug.dvc1 = thread->debug.dvc2 = 0; in set_debug_reg_defaults()
705 thread->debug.dbcr0 = 0; in set_debug_reg_defaults()
708 * Force User/Supervisor bits to b11 (user-only MSR[PR]=1) in set_debug_reg_defaults()
710 thread->debug.dbcr1 = DBCR1_IAC1US | DBCR1_IAC2US | in set_debug_reg_defaults()
713 * Force Data Address Compare User/Supervisor bits to be User-only in set_debug_reg_defaults()
716 thread->debug.dbcr2 = DBCR2_DAC1US | DBCR2_DAC2US; in set_debug_reg_defaults()
718 thread->debug.dbcr1 = 0; in set_debug_reg_defaults()
731 mtspr(SPRN_IAC1, debug->iac1); in prime_debug_regs()
732 mtspr(SPRN_IAC2, debug->iac2); in prime_debug_regs()
734 mtspr(SPRN_IAC3, debug->iac3); in prime_debug_regs()
735 mtspr(SPRN_IAC4, debug->iac4); in prime_debug_regs()
737 mtspr(SPRN_DAC1, debug->dac1); in prime_debug_regs()
738 mtspr(SPRN_DAC2, debug->dac2); in prime_debug_regs()
740 mtspr(SPRN_DVC1, debug->dvc1); in prime_debug_regs()
741 mtspr(SPRN_DVC2, debug->dvc2); in prime_debug_regs()
743 mtspr(SPRN_DBCR0, debug->dbcr0); in prime_debug_regs()
744 mtspr(SPRN_DBCR1, debug->dbcr1); in prime_debug_regs()
746 mtspr(SPRN_DBCR2, debug->dbcr2); in prime_debug_regs()
756 if ((current->thread.debug.dbcr0 & DBCR0_IDM) in switch_booke_debug_regs()
757 || (new_debug->dbcr0 & DBCR0_IDM)) in switch_booke_debug_regs()
776 thread->hw_brk[i] = null_brk; in set_debug_reg_defaults()
778 set_breakpoint(i, &thread->hw_brk[i]); in set_debug_reg_defaults()
785 if (a->address != b->address) in hw_brk_match()
787 if (a->type != b->type) in hw_brk_match()
789 if (a->len != b->len) in hw_brk_match()
801 &new->thread.hw_brk[i]))) in switch_hw_breakpoint()
804 __set_breakpoint(i, &new->thread.hw_brk[i]); in switch_hw_breakpoint()
829 return -EINVAL; in __set_dabr()
837 dabr = brk->address | (brk->type & HW_BRK_TYPE_DABR); in set_dabr()
838 dabrx = ((brk->type >> 3) & 0x7); in set_dabr()
851 unsigned long start_addr = ALIGN_DOWN(brk->address, HW_BREAKPOINT_SIZE); in set_breakpoint_8xx()
852 unsigned long end_addr = ALIGN(brk->address + brk->len, HW_BREAKPOINT_SIZE); in set_breakpoint_8xx()
863 if ((brk->type & HW_BRK_TYPE_RDWR) == 0) in set_breakpoint_8xx()
866 if ((brk->type & HW_BRK_TYPE_RDWR) == HW_BRK_TYPE_READ) in set_breakpoint_8xx()
868 if ((brk->type & HW_BRK_TYPE_RDWR) == HW_BRK_TYPE_WRITE) in set_breakpoint_8xx()
871 mtspr(SPRN_CMPE, start_addr - 1); in set_breakpoint_8xx()
912 return tsk && tsk->thread.regs && (tsk->thread.regs->msr & MSR_TM); in tm_enabled()
951 if ((thr->ckpt_regs.msr & MSR_FP) == 0) in tm_reclaim_thread()
952 memcpy(&thr->ckfp_state, &thr->fp_state, in tm_reclaim_thread()
954 if ((thr->ckpt_regs.msr & MSR_VEC) == 0) in tm_reclaim_thread()
955 memcpy(&thr->ckvr_state, &thr->vr_state, in tm_reclaim_thread()
962 tm_reclaim_thread(¤t->thread, cause); in tm_reclaim_current()
971 * oldtask->thread.ckpt_regs. We tm_reclaim(oldproc); this saves the in tm_reclaim_task()
977 struct thread_struct *thr = &tsk->thread; in tm_reclaim_task()
979 if (!thr->regs) in tm_reclaim_task()
982 if (!MSR_TM_ACTIVE(thr->regs->msr)) in tm_reclaim_task()
987 TM_DEBUG("--- tm_reclaim on pid %d (NIP=%lx, " in tm_reclaim_task()
989 tsk->pid, thr->regs->nip, in tm_reclaim_task()
990 thr->regs->ccr, thr->regs->msr, in tm_reclaim_task()
991 thr->regs->trap); in tm_reclaim_task()
995 TM_DEBUG("--- tm_reclaim on pid %d complete\n", in tm_reclaim_task()
996 tsk->pid); in tm_reclaim_task()
1000 * This context-switches a thread's TM info SPRs. We do it here to in tm_reclaim_task()
1013 if (!(thread->regs->msr & MSR_TM)) in tm_recheckpoint()
1040 * If the task was using FP, we non-lazily reload both the original and in tm_recheckpoint_new_task()
1049 if (!MSR_TM_ACTIVE(new->thread.regs->msr)){ in tm_recheckpoint_new_task()
1050 tm_restore_sprs(&new->thread); in tm_recheckpoint_new_task()
1054 TM_DEBUG("*** tm_recheckpoint of pid %d (new->msr 0x%lx)\n", in tm_recheckpoint_new_task()
1055 new->pid, new->thread.regs->msr); in tm_recheckpoint_new_task()
1057 tm_recheckpoint(&new->thread); in tm_recheckpoint_new_task()
1064 new->thread.regs->msr &= ~(MSR_FP | MSR_VEC | MSR_VSX); in tm_recheckpoint_new_task()
1068 new->pid, mfmsr()); in tm_recheckpoint_new_task()
1079 prev->thread.load_tm++; in __switch_to_tm()
1081 if (!MSR_TM_ACTIVE(prev->thread.regs->msr) && prev->thread.load_tm == 0) in __switch_to_tm()
1082 prev->thread.regs->msr &= ~MSR_TM; in __switch_to_tm()
1114 if (!MSR_TM_ACTIVE(regs->msr)) in restore_tm_state()
1117 msr_diff = current->thread.ckpt_regs.msr & ~regs->msr; in restore_tm_state()
1122 current->thread.load_fp = 1; in restore_tm_state()
1125 current->thread.load_vec = 1; in restore_tm_state()
1129 regs->msr |= msr_diff; in restore_tm_state()
1141 t->vrsave = mfspr(SPRN_VRSAVE); in save_sprs()
1145 t->dscr = mfspr(SPRN_DSCR); in save_sprs()
1148 t->bescr = mfspr(SPRN_BESCR); in save_sprs()
1149 t->ebbhr = mfspr(SPRN_EBBHR); in save_sprs()
1150 t->ebbrr = mfspr(SPRN_EBBRR); in save_sprs()
1152 t->fscr = mfspr(SPRN_FSCR); in save_sprs()
1160 t->tar = mfspr(SPRN_TAR); in save_sprs()
1172 old_thread->vrsave != new_thread->vrsave) in restore_sprs()
1173 mtspr(SPRN_VRSAVE, new_thread->vrsave); in restore_sprs()
1177 u64 dscr = get_paca()->dscr_default; in restore_sprs()
1178 if (new_thread->dscr_inherit) in restore_sprs()
1179 dscr = new_thread->dscr; in restore_sprs()
1181 if (old_thread->dscr != dscr) in restore_sprs()
1186 if (old_thread->bescr != new_thread->bescr) in restore_sprs()
1187 mtspr(SPRN_BESCR, new_thread->bescr); in restore_sprs()
1188 if (old_thread->ebbhr != new_thread->ebbhr) in restore_sprs()
1189 mtspr(SPRN_EBBHR, new_thread->ebbhr); in restore_sprs()
1190 if (old_thread->ebbrr != new_thread->ebbrr) in restore_sprs()
1191 mtspr(SPRN_EBBRR, new_thread->ebbrr); in restore_sprs()
1193 if (old_thread->fscr != new_thread->fscr) in restore_sprs()
1194 mtspr(SPRN_FSCR, new_thread->fscr); in restore_sprs()
1196 if (old_thread->tar != new_thread->tar) in restore_sprs()
1197 mtspr(SPRN_TAR, new_thread->tar); in restore_sprs()
1201 old_thread->tidr != new_thread->tidr) in restore_sprs()
1202 mtspr(SPRN_TIDR, new_thread->tidr); in restore_sprs()
1217 new_thread = &new->thread; in __switch_to()
1218 old_thread = ¤t->thread; in __switch_to()
1224 if (batch->active) { in __switch_to()
1225 current_thread_info()->local_flags |= _TLF_LAZY_MMU; in __switch_to()
1226 if (batch->index) in __switch_to()
1228 batch->active = 0; in __switch_to()
1232 * On POWER9 the copy-paste buffer can only paste into in __switch_to()
1240 if (new->mm && (cpu_has_feature(CPU_FTR_ARCH_31) || in __switch_to()
1241 atomic_read(&new->mm->context.vas_windows))) in __switch_to()
1246 switch_booke_debug_regs(&new->thread.debug); in __switch_to()
1249 * For PPC_BOOK3S_64, we use the hw-breakpoint interfaces that would in __switch_to()
1261 save_sprs(&prev->thread); in __switch_to()
1298 * arch_enter_lazy_mmu_mode(), to re-activate the batch that was in __switch_to()
1302 if (current_thread_info()->local_flags & _TLF_LAZY_MMU) { in __switch_to()
1303 current_thread_info()->local_flags &= ~_TLF_LAZY_MMU; in __switch_to()
1305 batch->active = 1; in __switch_to()
1313 if (current->thread.regs) in __switch_to()
1314 restore_math(current->thread.regs); in __switch_to()
1325 unsigned long nip = regs->nip; in show_instructions()
1326 unsigned long pc = regs->nip - (NR_INSN_TO_PRINT * 3 / 4 * sizeof(int)); in show_instructions()
1334 if (!IS_ENABLED(CONFIG_BOOKE) && !(regs->msr & MSR_IR)) { in show_instructions()
1336 nip = (unsigned long)phys_to_virt(regs->nip); in show_instructions()
1368 pc = regs->nip - (NR_INSN_TO_PRINT * 3 / 4 * sizeof(int)); in show_user_instructions()
1377 for (i = 0; i < 8 && n; i++, n--, pc += sizeof(int)) { in show_user_instructions()
1385 seq_buf_printf(&s, regs->nip == pc ? "<%08x> " : "%08x ", instr); in show_user_instructions()
1389 pr_info("%s[%d]: code: %s\n", current->comm, in show_user_instructions()
1390 current->pid, s.buffer); in show_user_instructions()
1433 for (; bits->bit; ++bits) in print_bits()
1434 if (val & bits->bit) { in print_bits()
1435 pr_cont("%s%s", s, bits->name); in print_bits()
1492 regs->nip, regs->link, regs->ctr); in show_regs()
1494 regs, regs->trap, print_tainted(), init_utsname()->release); in show_regs()
1495 printk("MSR: "REG" ", regs->msr); in show_regs()
1496 print_msr_bits(regs->msr); in show_regs()
1497 pr_cont(" CR: %08lx XER: %08lx\n", regs->ccr, regs->xer); in show_regs()
1500 pr_cont("CFAR: "REG" ", regs->orig_gpr3); in show_regs()
1503 pr_cont("DEAR: "REG" ESR: "REG" ", regs->dar, regs->dsisr); in show_regs()
1505 pr_cont("DAR: "REG" DSISR: %08lx ", regs->dar, regs->dsisr); in show_regs()
1509 pr_cont("IRQMASK: %lx ", regs->softe); in show_regs()
1512 if (MSR_TM_ACTIVE(regs->msr)) in show_regs()
1513 pr_cont("\nPACATMSCRATCH: %016llx ", get_paca()->tm_scratch); in show_regs()
1519 pr_cont(REG " ", regs->gpr[i]); in show_regs()
1529 printk("NIP ["REG"] %pS\n", regs->nip, (void *)regs->nip); in show_regs()
1530 printk("LR ["REG"] %pS\n", regs->link, (void *)regs->link); in show_regs()
1532 show_stack(current, (unsigned long *) regs->gpr[1], KERN_DEFAULT); in show_regs()
1542 set_debug_reg_defaults(¤t->thread); in flush_thread()
1577 * re-execute wait. The correct thread, when scheduled, will execute either
1592 return -EINVAL; in set_thread_tidr()
1595 return -EINVAL; in set_thread_tidr()
1597 if (t->thread.tidr) in set_thread_tidr()
1600 t->thread.tidr = (u16)task_pid_nr(t); in set_thread_tidr()
1601 mtspr(SPRN_TIDR, t->thread.tidr); in set_thread_tidr()
1624 * transitions the CPU out of TM mode. Hence we need to call in arch_dup_task_struct()
1626 * checkpointed state back and the TM mode. in arch_dup_task_struct()
1656 p->thread.ksp_vsid = sp_vsid; in setup_ksp_vsid()
1665 * Copy architecture-specific thread state
1685 sp -= sizeof(struct pt_regs); in copy_thread()
1687 if (unlikely(p->flags & (PF_KTHREAD | PF_IO_WORKER))) { in copy_thread()
1690 childregs->gpr[1] = sp + sizeof(struct pt_regs); in copy_thread()
1693 childregs->gpr[14] = ppc_function_entry((void *)usp); in copy_thread()
1696 childregs->softe = IRQS_ENABLED; in copy_thread()
1698 childregs->gpr[15] = kthread_arg; in copy_thread()
1699 p->thread.regs = NULL; /* no user register state */ in copy_thread()
1700 ti->flags |= _TIF_RESTOREALL; in copy_thread()
1708 childregs->gpr[1] = usp; in copy_thread()
1709 p->thread.regs = childregs; in copy_thread()
1712 childregs->gpr[3] = 0; /* Result from fork() */ in copy_thread()
1715 childregs->gpr[13] = tls; in copy_thread()
1717 childregs->gpr[2] = tls; in copy_thread()
1725 childregs->msr &= ~(MSR_FP|MSR_VEC|MSR_VSX); in copy_thread()
1726 sp -= STACK_FRAME_OVERHEAD; in copy_thread()
1737 sp -= sizeof(struct pt_regs); in copy_thread()
1739 sp -= STACK_FRAME_OVERHEAD; in copy_thread()
1740 p->thread.ksp = sp; in copy_thread()
1742 p->thread.ksp_limit = (unsigned long)end_of_stack(p); in copy_thread()
1746 p->thread.ptrace_bps[i] = NULL; in copy_thread()
1749 p->thread.fp_save_area = NULL; in copy_thread()
1751 p->thread.vr_save_area = NULL; in copy_thread()
1758 p->thread.dscr_inherit = current->thread.dscr_inherit; in copy_thread()
1759 p->thread.dscr = mfspr(SPRN_DSCR); in copy_thread()
1762 childregs->ppr = DEFAULT_PPR; in copy_thread()
1764 p->thread.tidr = 0; in copy_thread()
1766 kregs->nip = ppc_function_entry(f); in copy_thread()
1778 unsigned long load_addr = regs->gpr[2]; /* saved by ELF_PLAT_INIT */ in start_thread()
1788 if (!current->thread.regs) { in start_thread()
1790 current->thread.regs = regs - 1; in start_thread()
1797 * user visible. in start_thread()
1803 memset(®s->gpr[1], 0, sizeof(regs->gpr) - sizeof(regs->gpr[0])); in start_thread()
1804 regs->ctr = 0; in start_thread()
1805 regs->link = 0; in start_thread()
1806 regs->xer = 0; in start_thread()
1807 regs->ccr = 0; in start_thread()
1808 regs->gpr[1] = sp; in start_thread()
1818 regs->mq = 0; in start_thread()
1819 regs->nip = start; in start_thread()
1820 regs->msr = MSR_USER; in start_thread()
1837 regs->gpr[12] = start; in start_thread()
1859 regs->gpr[2] = toc; in start_thread()
1861 regs->nip = entry; in start_thread()
1862 regs->msr = MSR_USER64; in start_thread()
1864 regs->nip = start; in start_thread()
1865 regs->gpr[2] = 0; in start_thread()
1866 regs->msr = MSR_USER32; in start_thread()
1870 current->thread.used_vsr = 0; in start_thread()
1872 current->thread.load_slb = 0; in start_thread()
1873 current->thread.load_fp = 0; in start_thread()
1874 memset(¤t->thread.fp_state, 0, sizeof(current->thread.fp_state)); in start_thread()
1875 current->thread.fp_save_area = NULL; in start_thread()
1877 memset(¤t->thread.vr_state, 0, sizeof(current->thread.vr_state)); in start_thread()
1878 current->thread.vr_state.vscr.u[3] = 0x00010000; /* Java mode disabled */ in start_thread()
1879 current->thread.vr_save_area = NULL; in start_thread()
1880 current->thread.vrsave = 0; in start_thread()
1881 current->thread.used_vr = 0; in start_thread()
1882 current->thread.load_vec = 0; in start_thread()
1885 memset(current->thread.evr, 0, sizeof(current->thread.evr)); in start_thread()
1886 current->thread.acc = 0; in start_thread()
1887 current->thread.spefscr = 0; in start_thread()
1888 current->thread.used_spe = 0; in start_thread()
1891 current->thread.tm_tfhar = 0; in start_thread()
1892 current->thread.tm_texasr = 0; in start_thread()
1893 current->thread.tm_tfiar = 0; in start_thread()
1894 current->thread.load_tm = 0; in start_thread()
1897 thread_pkey_regs_init(¤t->thread); in start_thread()
1906 struct pt_regs *regs = tsk->thread.regs; in set_fpexc_mode()
1911 * mode (asyn, precise, disabled) for 'Classic' FP. */ in set_fpexc_mode()
1922 * floating-point environment need to do so in set_fpexc_mode()
1927 tsk->thread.spefscr_last = mfspr(SPRN_SPEFSCR); in set_fpexc_mode()
1928 tsk->thread.fpexc_mode = val & in set_fpexc_mode()
1933 return -EINVAL; in set_fpexc_mode()
1943 return -EINVAL; in set_fpexc_mode()
1944 tsk->thread.fpexc_mode = __pack_fe01(val); in set_fpexc_mode()
1945 if (regs != NULL && (regs->msr & MSR_FP) != 0) in set_fpexc_mode()
1946 regs->msr = (regs->msr & ~(MSR_FE0|MSR_FE1)) in set_fpexc_mode()
1947 | tsk->thread.fpexc_mode; in set_fpexc_mode()
1955 if (tsk->thread.fpexc_mode & PR_FP_EXC_SW_ENABLE) { in get_fpexc_mode()
1965 * floating-point environment need to do so in get_fpexc_mode()
1970 tsk->thread.spefscr_last = mfspr(SPRN_SPEFSCR); in get_fpexc_mode()
1971 val = tsk->thread.fpexc_mode; in get_fpexc_mode()
1974 return -EINVAL; in get_fpexc_mode()
1976 val = __unpack_fe01(tsk->thread.fpexc_mode); in get_fpexc_mode()
1983 struct pt_regs *regs = tsk->thread.regs; in set_endian()
1987 return -EINVAL; in set_endian()
1990 return -EINVAL; in set_endian()
1993 regs->msr &= ~MSR_LE; in set_endian()
1995 regs->msr |= MSR_LE; in set_endian()
1997 return -EINVAL; in set_endian()
2004 struct pt_regs *regs = tsk->thread.regs; in get_endian()
2009 return -EINVAL; in get_endian()
2012 return -EINVAL; in get_endian()
2014 if (regs->msr & MSR_LE) { in get_endian()
2027 tsk->thread.align_ctl = val; in set_unalign_ctl()
2033 return put_user(tsk->thread.align_ctl, (unsigned int __user *)adr); in get_unalign_ctl()
2043 if (sp >= stack_page && sp <= stack_page + THREAD_SIZE - nbytes) in valid_irq_stack()
2047 if (sp >= stack_page && sp <= stack_page + THREAD_SIZE - nbytes) in valid_irq_stack()
2060 stack_page = (unsigned long)paca_ptrs[cpu]->emergency_sp - THREAD_SIZE; in valid_emergency_stack()
2061 if (sp >= stack_page && sp <= stack_page + THREAD_SIZE - nbytes) in valid_emergency_stack()
2065 stack_page = (unsigned long)paca_ptrs[cpu]->nmi_emergency_sp - THREAD_SIZE; in valid_emergency_stack()
2066 if (sp >= stack_page && sp <= stack_page + THREAD_SIZE - nbytes) in valid_emergency_stack()
2069 stack_page = (unsigned long)paca_ptrs[cpu]->mc_emergency_sp - THREAD_SIZE; in valid_emergency_stack()
2070 if (sp >= stack_page && sp <= stack_page + THREAD_SIZE - nbytes) in valid_emergency_stack()
2087 if (sp >= stack_page && sp <= stack_page + THREAD_SIZE - nbytes) in validate_sp()
2103 if (!p || p == current || p->state == TASK_RUNNING) in __get_wchan()
2106 sp = p->thread.ksp; in __get_wchan()
2113 p->state == TASK_RUNNING) in __get_wchan()
2160 sp = tsk->thread.ksp; in show_stack()
2193 lr = regs->link; in show_stack()
2194 printk("%s--- interrupt: %lx at %pS\n LR = %pS\n", in show_stack()
2195 loglvl, regs->trap, in show_stack()
2196 (void *)regs->nip, (void *)lr); in show_stack()
2224 * than RUN, so do the read-modify-write. in __ppc64_runlatch_on()
2231 ti->local_flags |= _TLF_RUNLATCH; in __ppc64_runlatch_on()
2239 ti->local_flags &= ~_TLF_RUNLATCH; in __ppc64_runlatch_off()
2255 if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space) in arch_align_stack()
2256 sp -= get_random_int() & ~PAGE_MASK; in arch_align_stack()
2266 rnd = (get_random_long() % (1UL<<(23-PAGE_SHIFT))); in brk_rnd()
2268 rnd = (get_random_long() % (1UL<<(30-PAGE_SHIFT))); in brk_rnd()
2275 unsigned long base = mm->brk; in arch_randomize_brk()
2288 base = max_t(unsigned long, mm->brk, 1UL << SID_SHIFT_1T); in arch_randomize_brk()
2293 if (ret < mm->brk) in arch_randomize_brk()
2294 return mm->brk; in arch_randomize_brk()