From patchwork Thu Mar 1 17:44:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 10252085 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 84F80602B5 for ; Thu, 1 Mar 2018 17:45:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7398727F4B for ; Thu, 1 Mar 2018 17:45:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 686B32823E; Thu, 1 Mar 2018 17:45:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D474E27F4B for ; Thu, 1 Mar 2018 17:45:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=SXJyEwJwYAXdal6JqJNBOqzTSHODPAJBtIDgBLo0Xsc=; b=Yt7VyInJc0nkkLW68ypqgPOuo5 EzvB4m/YGVxUD5nSqNG6hxnK0tqZ6igNfUuOmk4/scZ91OGRp4JpPWmqU1bWvb59wAWh/eecw/HRW JRhgg8JGRYoaZwmQ44rLfKaKCo8vS0Ja511CD1Ss8n9V9P85a7+Chmh5QAr+UgEwx2lKltWzqqMZz EFh+h2wwwB5fpPIODxATH0e18WO2PUM3zru8mdBlkGdDSVIslmSKuu/Qp++cQbeRFeOoEDxuJmzEG 0bk1OJGmipSPPUscnm3iDGQg6apoS1CfqPrYm/MW2/VrTW8DsVAH9p28FKVRCBNAO12aMqTXMGrSF ccgtnljw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1erSGo-0003I5-MQ; Thu, 01 Mar 2018 17:45:30 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1erSFo-0001n8-AB for linux-arm-kernel@lists.infradead.org; Thu, 01 Mar 2018 17:44:32 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 801CF1596; Thu, 1 Mar 2018 09:44:19 -0800 (PST) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2A1B03F25C; Thu, 1 Mar 2018 09:44:18 -0800 (PST) From: Dave Martin To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 1/3] signal: Add FPE_FLTUNK si_code for undiagnosable fp exceptions Date: Thu, 1 Mar 2018 17:44:06 +0000 Message-Id: <1519926248-12591-2-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1519926248-12591-1-git-send-email-Dave.Martin@arm.com> References: <1519926248-12591-1-git-send-email-Dave.Martin@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180301_094428_506231_52F77E09 X-CRM114-Status: GOOD ( 10.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Will Deacon , James Morse , "Eric W. Biederman" , Catalin Marinas MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Some architectures cannot always report accurately what kind of floating-point exception triggered a floating-point exception trap. This can occur with fp exceptions occurring on lanes in a vector instruction on arm64 for example. Rather than have every architecture come up with its own way of describing such a condition, this patch adds a common FPE_FLTUNK si_code value to report that an fp exception caused a trap but we cannot be certain which kind of fp exception it was. Signed-off-by: Dave Martin Reviewed-by: "Eric W. Biederman" --- Changes since v1: Reported by James Morse: * Bump NSIGFPE BUILD_BUG_ON() check for x86 compat. FPE_FLTUNK does not current have any implications for x86, since it is not currently used and has no implications for the way siginfo is populated. --- arch/x86/kernel/signal_compat.c | 2 +- include/uapi/asm-generic/siginfo.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/signal_compat.c b/arch/x86/kernel/signal_compat.c index ac057f9..954ad99 100644 --- a/arch/x86/kernel/signal_compat.c +++ b/arch/x86/kernel/signal_compat.c @@ -26,7 +26,7 @@ static inline void signal_compat_build_tests(void) * new fields are handled in copy_siginfo_to_user32()! */ BUILD_BUG_ON(NSIGILL != 11); - BUILD_BUG_ON(NSIGFPE != 13); + BUILD_BUG_ON(NSIGFPE != 14); BUILD_BUG_ON(NSIGSEGV != 4); BUILD_BUG_ON(NSIGBUS != 5); BUILD_BUG_ON(NSIGTRAP != 4); diff --git a/include/uapi/asm-generic/siginfo.h b/include/uapi/asm-generic/siginfo.h index 85dc965..10304de 100644 --- a/include/uapi/asm-generic/siginfo.h +++ b/include/uapi/asm-generic/siginfo.h @@ -229,7 +229,8 @@ typedef struct siginfo { # define __FPE_INVASC 12 /* invalid ASCII digit */ # define __FPE_INVDEC 13 /* invalid decimal digit */ #endif -#define NSIGFPE 13 +#define FPE_FLTUNK 14 /* undiagnosed floating-point exception */ +#define NSIGFPE 14 /* * SIGSEGV si_codes