• James Cowgill's avatar
    MIPS: Avoid BUG warning in arch_check_elf · 1ecc90c7
    James Cowgill authored
    [ Upstream commit c46f59e9 ]
    
    arch_check_elf contains a usage of current_cpu_data that will call
    smp_processor_id() with preemption enabled and therefore triggers a
    "BUG: using smp_processor_id() in preemptible" warning when an fpxx
    executable is loaded.
    
    As a follow-up to commit b244614a ("MIPS: Avoid a BUG warning during
    prctl(PR_SET_FP_MODE, ...)"), apply the same fix to arch_check_elf by
    using raw_current_cpu_data instead. The rationale quoted from the previous
    commit:
    
    "It is assumed throughout the kernel that if any CPU has an FPU, then
    all CPUs would have an FPU as well, so it is safe to perform the check
    with preemption enabled - change the code to use raw_ variant of the
    check to avoid the warning."
    
    Fixes: 46490b57 ("MIPS: kernel: elf: Improve the overall ABI and FPU mode checks")
    Signed-off-by: default avatarJames Cowgill <James.Cowgill@imgtec.com>
    CC: <stable@vger.kernel.org> # 4.0+
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/15951/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
    Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
    1ecc90c7
elf.c 7.61 KB