Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751875AbdHGQSg (ORCPT ); Mon, 7 Aug 2017 12:18:36 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:52846 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751564AbdHGQSd (ORCPT ); Mon, 7 Aug 2017 12:18:33 -0400 Date: Mon, 7 Aug 2017 17:18:11 +0100 From: "Maciej W. Rozycki" To: "Eric W. Biederman" 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 Subject: Re: [PATCH 4/7] signal/mips: Document a conflict with SI_USER with SIGFPE In-Reply-To: <20170718140651.15973-4-ebiederm@xmission.com> Message-ID: References: <87o9shg7t7.fsf_-_@xmission.com> <20170718140651.15973-4-ebiederm@xmission.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [10.20.78.47] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1015 Lines: 26 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? Maciej