[why]
Since the variable fpu_recursion_depth is per-CPU type, it has one copy
on each CPU, thread migration causes data consistency issue, then the
call trace shows up. And preemption disabling can't prevent migration.
[how]
Disable migration to ensure consistency of fpu_recursion_depth.
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Tianci Yin <tianci.yin@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
 
        if (*pcpu == 1) {
 #if defined(CONFIG_X86)
+               migrate_disable();
                kernel_fpu_begin();
 #elif defined(CONFIG_PPC64)
                if (cpu_has_feature(CPU_FTR_VSX_COMP)) {
        if (*pcpu <= 0) {
 #if defined(CONFIG_X86)
                kernel_fpu_end();
+               migrate_enable();
 #elif defined(CONFIG_PPC64)
                if (cpu_has_feature(CPU_FTR_VSX_COMP)) {
                        disable_kernel_vsx();