Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752255AbdHHTQM (ORCPT ); Tue, 8 Aug 2017 15:16:12 -0400 Received: from out02.mta.xmission.com ([166.70.13.232]:48997 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752066AbdHHTQK (ORCPT ); Tue, 8 Aug 2017 15:16:10 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Ralf Baechle Cc: Stephen Rothwell , James Hogan , Linux-Next Mailing List , Linux Kernel Mailing List , "Maciej W. Rozycki" References: <20170808151004.071d5a6d@canb.auug.org.au> <20170808055822.GI3509@linux-mips.org> <87wp6eezgl.fsf@xmission.com> Date: Tue, 08 Aug 2017 14:07:44 -0500 In-Reply-To: <87wp6eezgl.fsf@xmission.com> (Eric W. Biederman's message of "Tue, 08 Aug 2017 12:33:46 -0500") Message-ID: <873791g9of.fsf_-_@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1df9z0-0003Yx-L9;;;mid=<873791g9of.fsf_-_@xmission.com>;;;hst=in02.mta.xmission.com;;;ip=67.3.200.44;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX18pBM8Y1PX+24fL9OP46mxLoWZoHvOzloc= X-SA-Exim-Connect-IP: 67.3.200.44 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.7 XMSubLong Long Subject * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa05 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa05 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Ralf Baechle X-Spam-Relay-Country: X-Spam-Timing: total 5850 ms - load_scoreonly_sql: 0.05 (0.0%), signal_user_changed: 3.4 (0.1%), b_tie_ro: 2.4 (0.0%), parse: 1.43 (0.0%), extract_message_metadata: 27 (0.5%), get_uri_detail_list: 3.0 (0.1%), tests_pri_-1000: 4.7 (0.1%), tests_pri_-950: 1.63 (0.0%), tests_pri_-900: 1.41 (0.0%), tests_pri_-400: 28 (0.5%), check_bayes: 26 (0.5%), b_tokenize: 10 (0.2%), b_tok_get_all: 8 (0.1%), b_comp_prob: 2.5 (0.0%), b_tok_touch_all: 4.3 (0.1%), b_finish: 0.56 (0.0%), tests_pri_0: 294 (5.0%), check_dkim_signature: 0.62 (0.0%), check_dkim_adsp: 3.2 (0.1%), tests_pri_500: 5485 (93.7%), poll_dns_idle: 5479 (93.6%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH] mips/signal: In force_fcr31_sig return in the impossible case X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1885 Lines: 55 In a recent discussion Maciej Rozycki reported that this case is impossible. Handle the impossible case by just returning instead of trying to handle it. This makes static analysis simpler as it means nothing needs to consider the impossible case after the return statement. As the code no longer has to deal with this case remove FPE_FIXME from the mips siginfo.h Cc: "Maciej W. Rozycki" Cc: Ralf Baechle Link: http://lkml.kernel.org/r/20170718140651.15973-4-ebiederm@xmission.com Ref: ea1b75cf9138 ("signal/mips: Document a conflict with SI_USER with SIGFPE") Signed-off-by: "Eric W. Biederman" --- arch/mips/include/uapi/asm/siginfo.h | 7 ------- arch/mips/kernel/traps.c | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) Ralf, unless someone objects this is the patch I plan on merging into my tree, and building up. diff --git a/arch/mips/include/uapi/asm/siginfo.h b/arch/mips/include/uapi/asm/siginfo.h index 22a86d84a504..cf6113bbcb98 100644 --- a/arch/mips/include/uapi/asm/siginfo.h +++ b/arch/mips/include/uapi/asm/siginfo.h @@ -123,11 +123,4 @@ typedef struct siginfo { #define SI_TIMER -3 /* sent by timer expiration */ #define SI_MESGQ -4 /* sent by real time mesq state change */ -/* - * SIGFPE si_codes - */ -#ifdef __KERNEL__ -#define FPE_FIXME 0 /* Broken dup of SI_USER */ -#endif /* __KERNEL__ */ - #endif /* _UAPI_ASM_SIGINFO_H */ diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 6c9cca9c5341..2bf414993347 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -735,7 +735,7 @@ void force_fcr31_sig(unsigned long fcr31, void __user *fault_addr, else if (fcr31 & FPU_CSR_INE_X) si.si_code = FPE_FLTRES; else - si.si_code = FPE_FIXME; + return; /* Broken hardware? */ force_sig_info(SIGFPE, &si, tsk); } -- 2.10.1