Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752716AbdHHPhy (ORCPT ); Tue, 8 Aug 2017 11:37:54 -0400 Received: from out03.mta.xmission.com ([166.70.13.233]:56155 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752470AbdHHPhs (ORCPT ); Tue, 8 Aug 2017 11:37:48 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: "Maciej W. Rozycki" Cc: , Andy Lutomirski , Linus Torvalds , Al Viro , Oleg Nesterov , Andrei Vagin , Thomas Gleixner , Greg KH , Andrey Vagin , Serge Hallyn , Pavel Emelyanov , Cyrill Gorcunov , Peter Zijlstra , Willy Tarreau , , , Linux Containers , Michael Kerrisk , Ralf Baechle References: <87o9shg7t7.fsf_-_@xmission.com> <20170718140651.15973-4-ebiederm@xmission.com> Date: Tue, 08 Aug 2017 10:29:18 -0500 In-Reply-To: (Maciej W. Rozycki's message of "Mon, 7 Aug 2017 17:18:11 +0100") Message-ID: <87mv7agjsh.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=1df6Zd-0004pk-HE;;;mid=<87mv7agjsh.fsf@xmission.com>;;;hst=in02.mta.xmission.com;;;ip=67.3.213.87;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX18zqFy/KGwOrzuf+pVZMzwTBA8cIb/LSxE= X-SA-Exim-Connect-IP: 67.3.213.87 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 * 1.5 XMNoVowels Alpha-numberic number with no vowels * 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 * [sa07 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa07 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;"Maciej W. Rozycki" X-Spam-Relay-Country: X-Spam-Timing: total 5305 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 2.4 (0.0%), b_tie_ro: 1.60 (0.0%), parse: 1.25 (0.0%), extract_message_metadata: 16 (0.3%), get_uri_detail_list: 1.81 (0.0%), tests_pri_-1000: 9 (0.2%), tests_pri_-950: 1.62 (0.0%), tests_pri_-900: 1.49 (0.0%), tests_pri_-400: 23 (0.4%), check_bayes: 22 (0.4%), b_tokenize: 9 (0.2%), b_tok_get_all: 7 (0.1%), b_comp_prob: 1.92 (0.0%), b_tok_touch_all: 3.1 (0.1%), b_finish: 0.54 (0.0%), tests_pri_0: 695 (13.1%), check_dkim_signature: 0.47 (0.0%), check_dkim_adsp: 2.7 (0.1%), tests_pri_500: 4550 (85.8%), poll_dns_idle: 4545 (85.7%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH 4/7] signal/mips: Document a conflict with SI_USER with SIGFPE 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: 1442 Lines: 44 "Maciej W. Rozycki" writes: > On Tue, 18 Jul 2017, Eric W. Biederman wrote: > >> diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c >> index b68b4d0726d3..6c9cca9c5341 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 = __SI_FAULT; >> + si.si_code = FPE_FIXME; > > This is an "impossible" state to reach unless your hardware is on fire. > One or more of the FCSR Cause bits will have been set (in `fcr31') or the > FPE exception would not have happened. > > Of course there could be a simulator bug, or we could have breakage > somewhere causing `process_fpemu_return' to be called with SIGFPE and > inconsistent `fcr31'. So we need to handle it somehow. > > So what would be the right value of `si_code' to use here for such an > unexpected exception condition? I think `BUG()' would be too big a > hammer here. Or wouldn't it? The possible solutions I can think of are: WARN_ON_ONCE with a comment. Add a new si_code to uapi/asm-generic/siginfo.h perhaps FPE_IMPOSSIBLE. Like syscall numbers si_codes are cheap. Call force_sig() instead of force_sig_info, using just a generic si_code. If this is truly impossible and the compiler doesn't complain just drop the code. Eric