Re: [PATCH] MIPS: Avoid a BUG warning during prctl(PR_SET_FP_MODE, ...)

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

 



On Wed, Aug 31, 2016 at 12:33:23PM +0200, Marcin Nowakowski wrote:

> cpu_has_fpu macro uses smp_processor_id() and is currently executed
> with preemption enabled, that triggers the warning at runtime.
> 
> 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.

(Resending this, doesn't seem to have gone out the first time.)

That assumption is wrong.  With VSMP and previously also SMTC kernels
there used to be CPU configurations where a single core had only one FPU
which would be associated with (virtual) processor 0.

There are some older discrete MP systems where not necessarily all CPUs
and FPUs have the save revision and handling FPU errata may have require
disabling some but not all FPUs.

But in all practice, your patch is probably a good solution before
something sort out all the othe issues with mixed CPU/FPU versions.

  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