From: Ralf Baechle <ralf@linux-mips.org>
To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: linux-mips@linux-mips.org
Subject: Re: [PATCH] rewrite restore_fp_context/save_fp_context
Date: Tue, 14 Nov 2006 17:46:08 +0000 [thread overview]
Message-ID: <20061114174608.GA5740@linux-mips.org> (raw)
In-Reply-To: <20060829.225631.41630441.anemo@mba.ocn.ne.jp>
On Tue, Aug 29, 2006 at 10:56:31PM +0900, Atsushi Nemoto wrote:
> The setup_sigcontect()/restore_sigcontext() might sleep on
> put_user()/get_user() with preemption disabled (i.e. atomic context).
> Sleeping in atomic context is not allowed. This patch fixes this
> problem by rewriting restore_fp_context()/save_fp_context().
So with this patch applied the context will be copied around twice, first
save the fp registers to memory then copied from memory to userspace and
as the result the non-preemptible kernel will suffer from fixing the
preemptible ...
To me it looks like the real problem that setup_sigcontext and
restore_sigcontext need to disable preemption. And the reason for that
is probably that 87d54649f67d8ffe0a8d8176de8c210a6c4bb4a7 around 2.6.9
took the wrong. The better fix would probably have been to allow
at least some fp instructions from kernel mode. The sole reason for
the die_if_kernel() call is to tell people attempting to put FPU code
into the kernel that they're screwing up.
Ralf
next prev parent reply other threads:[~2006-11-14 17:45 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-07 16:52 [PATCH] rewrite restore_fp_context/save_fp_context Atsushi Nemoto
2006-04-11 9:54 ` Atsushi Nemoto
2006-06-19 15:37 ` Atsushi Nemoto
2006-08-29 13:56 ` Atsushi Nemoto
2006-11-14 17:46 ` Ralf Baechle [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-03-09 16:18 Atsushi Nemoto
2007-03-10 12:36 ` Ralf Baechle
2004-10-06 1:19 fpu_emulator can lose fpu on get_user/put_user Atsushi Nemoto
2004-10-06 9:40 ` Atsushi Nemoto
2004-10-06 22:09 ` Jun Sun
2004-10-07 1:15 ` Atsushi Nemoto
2004-10-08 19:45 ` Jun Sun
2004-10-09 14:38 ` Atsushi Nemoto
2004-10-11 16:54 ` Jun Sun
2004-10-12 10:11 ` Atsushi Nemoto
2006-11-15 15:17 ` [PATCH] rewrite restore_fp_context/save_fp_context Atsushi Nemoto
2006-11-18 14:27 ` Atsushi Nemoto
2006-11-19 13:54 ` Atsushi Nemoto
2004-10-24 15:36 ` fpu_emulator can lose fpu on get_user/put_user Atsushi Nemoto
2004-10-07 6:20 ` Atsushi Nemoto
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=20061114174608.GA5740@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=anemo@mba.ocn.ne.jp \
--cc=linux-mips@linux-mips.org \
/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