Re: [PATCH] MIPS: avoid BUG warning in arch_check_elf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 11, 2017 at 01:51:07PM +0100, James Cowgill wrote:

> 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 b244614a60ab ("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."

Which really is a bug though.  Multiprocessor systems with discrete CPUs
may use a mix of CPU versions and sometimes the associated FPUs were so
broken the kernel can't use them.  On MT with MIPS_MT_FPAFF there's only a
single FPU which stays associated with CPU 0 and we try to do terribly
clever games to force floating point intensive jobs to be scheduled to CPU 0
and use emulation on all other CPUs.

  Ralf




[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux