[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.21.1912260251520.3762799@eddie.linux-mips.org>
Date: Thu, 26 Dec 2019 03:01:06 +0000 (GMT)
From: "Maciej W. Rozycki" <macro@...ux-mips.org>
To: David Laight <David.Laight@...LAB.COM>
cc: 'Paul Burton' <paulburton@...nel.org>,
"linux-mips@...r.kernel.org" <linux-mips@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"stable@...r.kernel.org" <stable@...r.kernel.org>
Subject: RE: [PATCH] MIPS: Use __copy_{to,from}_user() for emulated FP
loads/stores
On Wed, 4 Dec 2019, David Laight wrote:
> > We used to have separate get_user_unaligned() & put_user_unaligned()
> > which would suggest that it's expected that get_user() & put_user()
> > require their accesses be aligned, but they were removed by commit
> > 3170d8d226c2 ("kill {__,}{get,put}_user_unaligned()") in v4.13.
> >
> > But perhaps we should just take the second AdEL exception & recover via
> > the fixups table. We definitely don't right now... Needs further
> > investigation...
>
> get/put_user can fault because the user page is absent (etc).
> So there must be code to 'expect' a fault on those instructions.
As I recall we only emulate unaligned accesses with a subset of integer
load/store instructions (and then only if TIF_FIXADE is set, which is the
default), and never with FP load/store instructions. Consequently I see
no point in doing this in the FP emulator either and I think these ought
to just send SIGBUS instead. Otherwise you'll end up with user code that
works differently depending on whether the FP hardware is real or
emulated, which is really bad.
FWIW,
Maciej
Powered by blists - more mailing lists