Lines Matching full:msr

130 	unsigned long msr = regs->msr;  in __unsafe_setup_sigcontext()  local
144 /* set MSR_VEC in the MSR value in the frame to indicate that sc->v_reg) in __unsafe_setup_sigcontext()
147 msr |= MSR_VEC; in __unsafe_setup_sigcontext()
160 * Clear the MSR VSX bit to indicate there is no valid state attached in __unsafe_setup_sigcontext()
163 msr &= ~MSR_VSX; in __unsafe_setup_sigcontext()
173 /* set MSR_VSX in the MSR value in the frame to in __unsafe_setup_sigcontext()
176 msr |= MSR_VSX; in __unsafe_setup_sigcontext()
181 unsafe_put_user(msr, &sc->gp_regs[PT_MSR], efault_out); in __unsafe_setup_sigcontext()
210 unsigned long msr) in setup_tm_sigcontexts() argument
229 BUG_ON(!MSR_TM_ACTIVE(msr)); in setup_tm_sigcontexts()
237 msr |= tsk->thread.ckpt_regs.msr & (MSR_FP | MSR_VEC | MSR_VSX); in setup_tm_sigcontexts()
251 if (msr & MSR_VEC) in setup_tm_sigcontexts()
260 /* set MSR_VEC in the MSR value in the frame to indicate in setup_tm_sigcontexts()
263 msr |= MSR_VEC; in setup_tm_sigcontexts()
271 if (msr & MSR_VEC) in setup_tm_sigcontexts()
285 if (msr & MSR_FP) in setup_tm_sigcontexts()
302 if (msr & MSR_VSX) in setup_tm_sigcontexts()
307 /* set MSR_VSX in the MSR value in the frame to in setup_tm_sigcontexts()
310 msr |= MSR_VSX; in setup_tm_sigcontexts()
319 err |= __put_user(msr, &tm_sc->gp_regs[PT_MSR]); in setup_tm_sigcontexts()
320 err |= __put_user(msr, &sc->gp_regs[PT_MSR]); in setup_tm_sigcontexts()
344 unsigned long msr; in __unsafe_restore_sigcontext() local
359 /* get MSR separately, transfer the LE bit if doing signal return */ in __unsafe_restore_sigcontext()
360 unsafe_get_user(msr, &sc->gp_regs[PT_MSR], efault_out); in __unsafe_restore_sigcontext()
362 regs_set_return_msr(regs, (regs->msr & ~MSR_LE) | (msr & MSR_LE)); in __unsafe_restore_sigcontext()
381 * Clear these bits from the user process' MSR before copying into the in __unsafe_restore_sigcontext()
383 * uses FP/VEC/VSX, and this process has the MSR bits set, then the in __unsafe_restore_sigcontext()
387 regs_set_return_msr(regs, regs->msr & ~(MSR_FP | MSR_FE0 | MSR_FE1 | MSR_VEC | MSR_VSX)); in __unsafe_restore_sigcontext()
394 if (v_regs != NULL && (msr & MSR_VEC) != 0) { in __unsafe_restore_sigcontext()
418 if ((msr & MSR_VSX) != 0) { in __unsafe_restore_sigcontext()
445 unsigned long msr; in restore_tm_sigcontexts() local
472 /* get MSR separately, transfer the LE bit if doing signal return */ in restore_tm_sigcontexts()
473 err |= __get_user(msr, &sc->gp_regs[PT_MSR]); in restore_tm_sigcontexts()
475 if (MSR_TM_RESV(msr)) in restore_tm_sigcontexts()
478 /* pull in MSR LE from user context */ in restore_tm_sigcontexts()
479 regs_set_return_msr(regs, (regs->msr & ~MSR_LE) | (msr & MSR_LE)); in restore_tm_sigcontexts()
506 regs_set_return_msr(regs, regs->msr & ~(MSR_FP | MSR_FE0 | MSR_FE1 | MSR_VEC | MSR_VSX)); in restore_tm_sigcontexts()
518 if (v_regs != NULL && tm_v_regs != NULL && (msr & MSR_VEC) != 0) { in restore_tm_sigcontexts()
552 if (v_regs && ((msr & MSR_VSX) != 0)) { in restore_tm_sigcontexts()
571 * with MSR[TS] set without recheckpointing. in restore_tm_sigcontexts()
575 /* pull in MSR TS bits from user context */ in restore_tm_sigcontexts()
576 regs_set_return_msr(regs, regs->msr | (msr & MSR_TS_MASK)); in restore_tm_sigcontexts()
579 * Ensure that TM is enabled in regs->msr before we leave the signal in restore_tm_sigcontexts()
581 * through the manipulation of the MSR bits in uc_mcontext or (b) the in restore_tm_sigcontexts()
588 * After regs->MSR[TS] being updated, make sure that get_user(), in restore_tm_sigcontexts()
591 * to be de-scheduled with MSR[TS] set but without calling in restore_tm_sigcontexts()
594 regs_set_return_msr(regs, regs->msr | MSR_TM); in restore_tm_sigcontexts()
599 msr_check_and_set(msr & (MSR_FP | MSR_VEC)); in restore_tm_sigcontexts()
600 if (msr & MSR_FP) { in restore_tm_sigcontexts()
602 regs_set_return_msr(regs, regs->msr | (MSR_FP | tsk->thread.fpexc_mode)); in restore_tm_sigcontexts()
604 if (msr & MSR_VEC) { in restore_tm_sigcontexts()
606 regs_set_return_msr(regs, regs->msr | MSR_VEC); in restore_tm_sigcontexts()
674 * If the new context state sets the MSR VSX bits but in SYSCALL_DEFINE3()
749 unsigned long msr; in SYSCALL_DEFINE0() local
776 * Disable MSR[TS] bit also, so, if there is an exception in the in SYSCALL_DEFINE0()
783 * (Changing the CPU MSR[TS] state), since schedule() is called in SYSCALL_DEFINE0()
784 * with the CPU MSR[TS] disable and returns with MSR[TS]=Suspended in SYSCALL_DEFINE0()
789 * This can cause a TM Bad Thing, since the MSR in the stack will in SYSCALL_DEFINE0()
790 * have the MSR[TS]=0, and this is what will be used to RFID. in SYSCALL_DEFINE0()
792 * Clearing MSR[TS] state here will avoid a recheckpoint if there in SYSCALL_DEFINE0()
793 * is any process reschedule in kernel space. The MSR[TS] state in SYSCALL_DEFINE0()
795 * the MSR[TS] that came from user context later, at in SYSCALL_DEFINE0()
798 regs_set_return_msr(regs, regs->msr & ~MSR_TS_MASK); in SYSCALL_DEFINE0()
800 if (__get_user(msr, &uc->uc_mcontext.gp_regs[PT_MSR])) in SYSCALL_DEFINE0()
804 if (IS_ENABLED(CONFIG_PPC_TRANSACTIONAL_MEM) && MSR_TM_ACTIVE(msr)) { in SYSCALL_DEFINE0()
821 * Unset MSR[TS] on the thread regs since MSR from user in SYSCALL_DEFINE0()
822 * context does not have MSR active, and recheckpoint was in SYSCALL_DEFINE0()
827 * MSR[TS] set, but without CPU in the proper state, in SYSCALL_DEFINE0()
831 current->thread.regs->msr & ~MSR_TS_MASK); in SYSCALL_DEFINE0()
864 /* Save the thread's msr before get_tm_stackpointer() changes it */ in handle_rt_signal64()
865 unsigned long msr = regs->msr; in handle_rt_signal64() local
873 if (!MSR_TM_ACTIVE(msr)) in handle_rt_signal64()
886 if (MSR_TM_ACTIVE(msr)) { in handle_rt_signal64()
899 msr); in handle_rt_signal64()
955 regs_set_return_msr(regs, (regs->msr & ~MSR_LE) | (MSR_KERNEL & MSR_LE)); in handle_rt_signal64()