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=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 9D99DC6369E for ; Wed, 18 Nov 2020 17:16:47 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 83BD22489C for ; Wed, 18 Nov 2020 17:16:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="S3s4GWAX"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="n1XXjlos" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 83BD22489C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=I4r/R/Nkipt2ILDkV79lkdjob0p9AnFShXMEjJE+xvw=; b=S3s4GWAXXyz1ehdW9ghNfnx5Y q+Zbqfdcvgp5x1fDES7G0by+OYQfYW6YWEwBaymuc5eMzDdt2cYoGfnQnjeo/fiAIDjp2rFL7pk36 Yqmnxs6MrVBmVuv8Tf+1TINd9bhMZP87wFy5bFnvYn0U0tk+35Nh7pzitDOmKPKlI1ZvaUSjYah4U 0s/kQV5LI37yNP/DHJAHy/rBYR5atCRlgilR9cyFJBIj38Pjxu/26oFxXKpwxpEUBVlVBdnSwgmSs ZwxyVhh0ERa5QIMFb3uG501Uo6ZFUz1yGEP+4IkUXYX1ycgn1bkp8fClfphZvGMxc2Cg5Ig1nRlnE Q78O0taEg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kfR3D-0002wF-S2; Wed, 18 Nov 2020 17:15:23 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kfR3A-0002vU-Qf for linux-arm-kernel@lists.infradead.org; Wed, 18 Nov 2020 17:15:21 +0000 Received: from mail-ot1-f50.google.com (mail-ot1-f50.google.com [209.85.210.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8CB17248A2 for ; Wed, 18 Nov 2020 17:15:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605719719; bh=hioKIip0O3g9MqOMRsxtIUdogSfqXi6DEaMYka0VxYs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=n1XXjloshkOuH4dIykZShNv2KK7vPE7hZKhr77IG7NZOY1ejl/ra8WQhHThZVCrWt v5P8pdIxDSIOZR/yPOCYKtfwY2l/jWo3tGBNASUv8hnnj6aJntvHsScVJeaBylA88N 5BwlIEGGLhg5BmGZ6T91CMtfPhiIJrqleytIOQ/Y= Received: by mail-ot1-f50.google.com with SMTP id a15so2471887otf.5 for ; Wed, 18 Nov 2020 09:15:19 -0800 (PST) X-Gm-Message-State: AOAM532jYa8zFmDXgTPUNFqyggxYdQmll0GEgiQirPAWYMMRhSyPkXsx s40eIOKs7mlRtWbR9Wr0YaUFWzwVXyrXB7aRcI0= X-Google-Smtp-Source: ABdhPJw+iZwUn9Z0burxcBObJzlqmPP1bIG5wrNfv72XoQkf+U63o0VI0lQLOyD3Prq2UU8qRib/Kkjd6f9pXHgxAe8= X-Received: by 2002:a05:6830:214c:: with SMTP id r12mr6790808otd.90.1605719718775; Wed, 18 Nov 2020 09:15:18 -0800 (PST) MIME-Version: 1.0 References: <20201118130849.7445-1-ardb@kernel.org> In-Reply-To: From: Ard Biesheuvel Date: Wed, 18 Nov 2020 18:15:05 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] ARM: entry: omit FP emulation for UND exceptions taken in kernel mode To: Nick Desaulniers X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201118_121521_065915_F4F99735 X-CRM114-Status: GOOD ( 28.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dmitry Osipenko , Russell King , Linux ARM , Kees Cook Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 18 Nov 2020 at 18:08, Nick Desaulniers wrote: > > On Wed, Nov 18, 2020 at 9:00 AM Ard Biesheuvel wrote: > > > > On Wed, 18 Nov 2020 at 17:59, Nick Desaulniers wrote: > > > > > > On Wed, Nov 18, 2020 at 8:48 AM Ard Biesheuvel wrote: > > > > > > > > On Wed, 18 Nov 2020 at 17:42, Nick Desaulniers wrote: > > > > > > > > > > On Wed, Nov 18, 2020 at 5:09 AM Ard Biesheuvel wrote: > > > > > > > > > > > > There are a couple of problems with the exception entry code that deals > > > > > > with FP exceptions (which are reported as UND exceptions) when building > > > > > > the kernel in Thumb2 mode: > > > > > > - the conditional branch to vfp_kmode_exception in vfp_support_entry() > > > > > > may be out of range for its target, depending on how the linker decides > > > > > > to arrange the sections; > > > > > > - when the UND exception is taken in kernel mode, the emulation handling > > > > > > logic is entered via the 'call_fpe' label, which means we end up using > > > > > > the wrong value/mask pairs to match and detect the NEON opcodes. > > > > > > > > > > > > Since UND exceptions in kernel mode are unlikely to occur on a hot path > > > > > > (as opposed to the user mode version which is invoked for VFP support > > > > > > code and lazy restore), we can use the existing undef hook machinery for > > > > > > > > > > Right, I'd expect these maybe from userspace, but within the kernel? > > > > > > > > > > > > > Russell explained off-list that there used to be a case in the pre-VFP > > > > era, but this is no longer relevant. > > > > > > If the use case is no longer relevant, consider dropping support. > > > Dead code is technical debt. > > > > > > > Dropping support for what? > > By `there used to be a case`, I interpret "a case" to mean one case, > singular. "but this is no longer relevant" seems to imply that > singular case is not an issue anymore. > Indeed. Dropping support for the special FP case is precisely what I am proposing here. The only remaining option to handle an undef exception in kernel mode is via undef hooks, and those are not going away. > If what you're referring to is "UND exceptions in kernel mode," then I > guess we need exception handling support for those, even if they occur > less frequently than the "pre-VFP era" alluded to. So nvm No worries. Thanks for the review. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel