From: Ralf Baechle <ralf@linux-mips.org>
To: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
Cc: linux-mips@linux-mips.org
Subject: Re: [PATCH] MIPS: Avoid a BUG warning during prctl(PR_SET_FP_MODE, ...)
Date: Mon, 19 Sep 2016 16:11:17 +0200 [thread overview]
Message-ID: <20160919141117.GA14137@linux-mips.org> (raw)
In-Reply-To: <1472639603-26533-1-git-send-email-marcin.nowakowski@imgtec.com>
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
prev parent reply other threads:[~2016-09-19 14:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-31 10:33 [PATCH] MIPS: Avoid a BUG warning during prctl(PR_SET_FP_MODE, ...) Marcin Nowakowski
2016-08-31 10:33 ` Marcin Nowakowski
2016-09-19 14:11 ` Ralf Baechle [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160919141117.GA14137@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=linux-mips@linux-mips.org \
--cc=marcin.nowakowski@imgtec.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox