Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9336020ybl; Wed, 25 Dec 2019 19:37:31 -0800 (PST) X-Google-Smtp-Source: APXvYqwFLlAv7/DtrPDi40t84HH70vLYypOasWVUey862V1eHlrLaAB0cc04kgCBCjiEarYl7+9f X-Received: by 2002:a9d:ec1:: with SMTP id 59mr45599723otj.141.1577331451791; Wed, 25 Dec 2019 19:37:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577331451; cv=none; d=google.com; s=arc-20160816; b=NoEGkDSm9pyJmIl+qBPgQssa0lxi0S8WdeCMhSnkGIoSMpPcLF2E55W6Yqsbmdt40N Le61EM1/u/CTbo8Y5cdiev5Njqkl3pbK/imEbpqKjRv7WPg3gnpeDLMZY+0+sFTg01hb gs6BrcvVOA5vPg53dH5BDlzN0SDbEe3O7wlEP7jEIrfR+tCppvJHAHlZTXKihrkqZFp8 1YCphjWRoy24O+LOhbnwECrgD76H5Hegbu80W6LoDsiZI37BPIna2Ceckp2GzaBalYHR 3wxl1lkl7GupbhXD1oHH+qsQJSKrXYeLtAMPJIbZE2IJ3/zHzLsxOqpk+i2uHc1oC9jY 8IhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:message-id :in-reply-to:subject:cc:to:from:date; bh=CQ0xsGxVhzJJ1lnS5F/aFERF3QDUqXZKIUctrdjPV7o=; b=fsJGZR0vMoB7C3bmksfeO1tLlJoflzsV8zJ89V9ah47UZtwg4suw/Om0OHGpy1OSNC IMRCgdQf3cl1SIHBT2cN0DyiAakYl1J/x93VKhRrU0X/nX4vaZAAzQiWLJvLe4L8O45j +FH1KUEcoLkXMtW8w6yliKtOIBtzahfv0hLcPbPz89jcQsVh2FazqB6VBFNwkM53BbxR YDNaPbSNIeqGZkM1GdlxbKjRJ53Gl7YuMwIv3CCv0OaRm8Ed93FlERd26xcKOpr+tYNh Un0wyZr2F5R2/ZbQ+j2RCj8e34hmw+y9jP6P71Fwfdp6Fh/uQpx0RW6Dk/oHZoS8HCp5 AmwA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 21si11961133oty.33.2019.12.25.19.37.20; Wed, 25 Dec 2019 19:37:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727009AbfLZDff (ORCPT + 99 others); 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