Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc: Call check_if_tm_restore_required() in enable_kernel_*()

Commit a0e72cf12b1a ("powerpc: Create msr_check_and_{set,clear}()")
removed a call to check_if_tm_restore_required() in the
enable_kernel_*() functions. Add them back in.

Fixes: a0e72cf12b1a ("powerpc: Create msr_check_and_{set,clear}()")
Reported-by: Rashmica Gupta <rashmicy@gmail.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Anton Blanchard and committed by
Michael Ellerman
d64d02ce d1e1cf2e

+10 -3
+10 -3
arch/powerpc/kernel/process.c
··· 181 181 182 182 msr_check_and_set(MSR_FP); 183 183 184 - if (current->thread.regs && (current->thread.regs->msr & MSR_FP)) 184 + if (current->thread.regs && (current->thread.regs->msr & MSR_FP)) { 185 + check_if_tm_restore_required(current); 185 186 __giveup_fpu(current); 187 + } 186 188 } 187 189 EXPORT_SYMBOL(enable_kernel_fp); 188 190 #endif /* CONFIG_PPC_FPU */ ··· 206 204 207 205 msr_check_and_set(MSR_VEC); 208 206 209 - if (current->thread.regs && (current->thread.regs->msr & MSR_VEC)) 207 + if (current->thread.regs && (current->thread.regs->msr & MSR_VEC)) { 208 + check_if_tm_restore_required(current); 210 209 __giveup_altivec(current); 210 + } 211 211 } 212 212 EXPORT_SYMBOL(enable_kernel_altivec); 213 213 ··· 253 249 msr_check_and_set(MSR_FP|MSR_VEC|MSR_VSX); 254 250 255 251 if (current->thread.regs && (current->thread.regs->msr & MSR_VSX)) { 252 + check_if_tm_restore_required(current); 256 253 if (current->thread.regs->msr & MSR_FP) 257 254 __giveup_fpu(current); 258 255 if (current->thread.regs->msr & MSR_VEC) ··· 294 289 295 290 msr_check_and_set(MSR_SPE); 296 291 297 - if (current->thread.regs && (current->thread.regs->msr & MSR_SPE)) 292 + if (current->thread.regs && (current->thread.regs->msr & MSR_SPE)) { 293 + check_if_tm_restore_required(current); 298 294 __giveup_spe(current); 295 + } 299 296 } 300 297 EXPORT_SYMBOL(enable_kernel_spe); 301 298