process.c (d5fa30e6993ffcdd1859d8dab1a07a6f6c6e7c3f) process.c (48a8ab4eeb8271f2a0e2ca3cf80844a59acca153)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Derived from "arch/i386/kernel/process.c"
4 * Copyright (C) 1995 Linus Torvalds
5 *
6 * Updated and modified by Cort Dougan (cort@cs.nmt.edu) and
7 * Paul Mackerras (paulus@cs.anu.edu.au)
8 *

--- 575 unchanged lines hidden (view full) ---

584
585 if (usermsr & MSR_VEC)
586 save_altivec(tsk);
587
588 if (usermsr & MSR_SPE)
589 __giveup_spe(tsk);
590
591 msr_check_and_clear(msr_all_available);
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Derived from "arch/i386/kernel/process.c"
4 * Copyright (C) 1995 Linus Torvalds
5 *
6 * Updated and modified by Cort Dougan (cort@cs.nmt.edu) and
7 * Paul Mackerras (paulus@cs.anu.edu.au)
8 *

--- 575 unchanged lines hidden (view full) ---

584
585 if (usermsr & MSR_VEC)
586 save_altivec(tsk);
587
588 if (usermsr & MSR_SPE)
589 __giveup_spe(tsk);
590
591 msr_check_and_clear(msr_all_available);
592 thread_pkey_regs_save(&tsk->thread);
593}
594
595void flush_all_to_thread(struct task_struct *tsk)
596{
597 if (tsk->thread.regs) {
598 preempt_disable();
599 BUG_ON(tsk != current);
600#ifdef CONFIG_SPE

--- 554 unchanged lines hidden (view full) ---

1155 * Note that the TAR is not available for use in the kernel.
1156 * (To provide this, the TAR should be backed up/restored on
1157 * exception entry/exit instead, and be in pt_regs. FIXME,
1158 * this should be in pt_regs anyway (for debug).)
1159 */
1160 t->tar = mfspr(SPRN_TAR);
1161 }
1162#endif
592}
593
594void flush_all_to_thread(struct task_struct *tsk)
595{
596 if (tsk->thread.regs) {
597 preempt_disable();
598 BUG_ON(tsk != current);
599#ifdef CONFIG_SPE

--- 554 unchanged lines hidden (view full) ---

1154 * Note that the TAR is not available for use in the kernel.
1155 * (To provide this, the TAR should be backed up/restored on
1156 * exception entry/exit instead, and be in pt_regs. FIXME,
1157 * this should be in pt_regs anyway (for debug).)
1158 */
1159 t->tar = mfspr(SPRN_TAR);
1160 }
1161#endif
1163
1164 thread_pkey_regs_save(t);
1165}
1166
1167static inline void restore_sprs(struct thread_struct *old_thread,
1168 struct thread_struct *new_thread)
1169{
1170#ifdef CONFIG_ALTIVEC
1171 if (cpu_has_feature(CPU_FTR_ALTIVEC) &&
1172 old_thread->vrsave != new_thread->vrsave)

--- 24 unchanged lines hidden (view full) ---

1197 mtspr(SPRN_TAR, new_thread->tar);
1198 }
1199
1200 if (cpu_has_feature(CPU_FTR_P9_TIDR) &&
1201 old_thread->tidr != new_thread->tidr)
1202 mtspr(SPRN_TIDR, new_thread->tidr);
1203#endif
1204
1162}
1163
1164static inline void restore_sprs(struct thread_struct *old_thread,
1165 struct thread_struct *new_thread)
1166{
1167#ifdef CONFIG_ALTIVEC
1168 if (cpu_has_feature(CPU_FTR_ALTIVEC) &&
1169 old_thread->vrsave != new_thread->vrsave)

--- 24 unchanged lines hidden (view full) ---

1194 mtspr(SPRN_TAR, new_thread->tar);
1195 }
1196
1197 if (cpu_has_feature(CPU_FTR_P9_TIDR) &&
1198 old_thread->tidr != new_thread->tidr)
1199 mtspr(SPRN_TIDR, new_thread->tidr);
1200#endif
1201
1205 thread_pkey_regs_restore(new_thread, old_thread);
1206}
1207
1208struct task_struct *__switch_to(struct task_struct *prev,
1209 struct task_struct *new)
1210{
1211 struct thread_struct *new_thread, *old_thread;
1212 struct task_struct *last;
1213#ifdef CONFIG_PPC_BOOK3S_64

--- 1094 unchanged lines hidden ---
1202}
1203
1204struct task_struct *__switch_to(struct task_struct *prev,
1205 struct task_struct *new)
1206{
1207 struct thread_struct *new_thread, *old_thread;
1208 struct task_struct *last;
1209#ifdef CONFIG_PPC_BOOK3S_64

--- 1094 unchanged lines hidden ---