From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C548C2D0DB for ; Thu, 26 Dec 2019 03:35:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3DAD02075B for ; Thu, 26 Dec 2019 03:35:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727015AbfLZDff (ORCPT ); Wed, 25 Dec 2019 22:35:35 -0500 Received: from eddie.linux-mips.org ([148.251.95.138]:49492 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726741AbfLZDfe (ORCPT ); Wed, 25 Dec 2019 22:35:34 -0500 X-Greylist: delayed 2064 seconds by postgrey-1.27 at vger.kernel.org; Wed, 25 Dec 2019 22:35:33 EST Received: (from localhost user: 'macro', uid#1010) by eddie.linux-mips.org with ESMTP id S23991197AbfLZDBGcj560 (ORCPT + 2 others); Thu, 26 Dec 2019 04:01:06 +0100 Date: Thu, 26 Dec 2019 03:01:06 +0000 (GMT) From: "Maciej W. Rozycki" To: David Laight cc: 'Paul Burton' , "linux-mips@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: RE: [PATCH] MIPS: Use __copy_{to,from}_user() for emulated FP loads/stores In-Reply-To: Message-ID: References: <20191203204933.1642259-1-paulburton@kernel.org> <20191204154048.eotzglp4rdlx4yzl@lantea.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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