Received: by 10.192.165.148 with SMTP id m20csp148849imm; Thu, 19 Apr 2018 18:14:37 -0700 (PDT) X-Google-Smtp-Source: AIpwx4++Nb+V7mg+ofuvlqewoyQCl2VIOfv/A+lU53UHvDNnEdF6DkLKquUrBwrwaDa58PREoMv/ X-Received: by 2002:a17:902:60cd:: with SMTP id k13-v6mr8245850pln.44.1524186876947; Thu, 19 Apr 2018 18:14:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524186876; cv=none; d=google.com; s=arc-20160816; b=L+9SStSl5SSbtT3bn+di84ZO2CzceKBkWQIkUzNbMC5+96NSSI1N5YCfeu8RAxkBcZ q4DNMJnP77jeqozwjr2sIzcLvnt26ivP0ceN2XxVS85f03bQHny18zPw5fONCqNqA3tk ajJ0uT0JCRvPfI4vbLZC+6gfe/PHbkxr6ongCYOhwc/9VkD7kH7JtJYuLqt6Kbvl89lF zoyZG//w5HBn2vv9N0NxqwmvUTmy/svqZeoDCnK3JYn4In28fVna8onMiMB6TMKki5Jz NYB+9lT97Ce57/BpFQ7iiBMm/Nn5E90lc8PyBeH3G4JKRO49CXAbha0a2U9e5EOsCHs1 HDSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=/LUHH1jlAOaqCSLuHqQYyHTTLRpxcHRSXm3mMp1ixIU=; b=qgjFrf3Cm3Nh+2pOSWdrSV92Ag6efZrMgwKKiepRQs2mzMd0HRvYZui01sYA0u29nF hkmxbT6Z5Japm9vnMKlIvvOYa1Pz5BlmV4TUe3llnbl4Gz3X5pPSkrWnnOtCvyLh/jra qBbvzAQvEW/J0OqX5BrefxU3qOv1wUFHnwfOwWmoWA/IxCjpIfJVXVtOKK4dwwnD1/uN NE5eJe6OB+vNTbw0d5sV4hMDWNDDistoDZHqs2KH13p6MpyPp+iGuDKP6RbgcH1ov+jg fvaDyS216N4RUASZy6jI/yyQxADBqIRjxLTTSzBsXdl56oNxVs3j0pcguh6U12nuO6yz 90xQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v4si1420094pgn.260.2018.04.19.18.14.22; Thu, 19 Apr 2018 18:14:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754128AbeDTBMU (ORCPT + 99 others); Thu, 19 Apr 2018 21:12:20 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:36103 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753826AbeDTBMJ (ORCPT ); Thu, 19 Apr 2018 21:12:09 -0400 Received: from in01.mta.xmission.com ([166.70.13.51]) by out01.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1f9Kau-0003tc-7M; Thu, 19 Apr 2018 19:12:08 -0600 Received: from [97.119.174.25] (helo=x220.int.ebiederm.org) by in01.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1f9KXc-00014u-LS; Thu, 19 Apr 2018 19:08:59 -0600 From: "Eric W. Biederman" To: linux-arch@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, "Eric W. Biederman" , Paul Mackerras , Kumar Gala , Michael Ellerman , Benjamin Herrenschmidt , linuxppc-dev@lists.ozlabs.org Date: Thu, 19 Apr 2018 20:04:08 -0500 Message-Id: <20180420010408.24438-17-ebiederm@xmission.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <878t9ilmhv.fsf@xmission.com> References: <878t9ilmhv.fsf@xmission.com> X-XM-SPF: eid=1f9KXc-00014u-LS;;;mid=<20180420010408.24438-17-ebiederm@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=97.119.174.25;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX18bSq8ljw24PtGJS1uOQzJiTjnb/4GdPLA= X-SA-Exim-Connect-IP: 97.119.174.25 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa07.xmission.com X-Spam-Level: *** X-Spam-Status: No, score=3.5 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,TR_Symld_Words,T_TM2_M_HEADER_IN_MSG,T_TooManySym_01, XMNoVowels,XMSubLong autolearn=disabled version=3.4.1 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.7 XMSubLong Long Subject * 1.5 XMNoVowels Alpha-numberic number with no vowels * 1.5 TR_Symld_Words too many words that have symbols inside * 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: ***;linux-arch@vger.kernel.org X-Spam-Relay-Country: X-Spam-Timing: total 15037 ms - load_scoreonly_sql: 0.03 (0.0%), signal_user_changed: 2.8 (0.0%), b_tie_ro: 1.98 (0.0%), parse: 0.72 (0.0%), extract_message_metadata: 23 (0.2%), get_uri_detail_list: 2.3 (0.0%), tests_pri_-1000: 2.9 (0.0%), tests_pri_-950: 1.15 (0.0%), tests_pri_-900: 0.96 (0.0%), tests_pri_-400: 24 (0.2%), check_bayes: 23 (0.2%), b_tokenize: 8 (0.1%), b_tok_get_all: 7 (0.0%), b_comp_prob: 2.1 (0.0%), b_tok_touch_all: 3.8 (0.0%), b_finish: 0.59 (0.0%), tests_pri_0: 192 (1.3%), check_dkim_signature: 0.44 (0.0%), check_dkim_adsp: 3.4 (0.0%), tests_pri_500: 14788 (98.3%), poll_dns_idle: 14773 (98.2%), rewrite_mail: 0.00 (0.0%) Subject: [REVIEW][PATCH 17/17] signal/powerpc: Replace TRAP_FIXME with TRAP_UNK 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 in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Using an si_code of 0 that aliases with SI_USER is clearly the wrong thing todo, and causes problems in interesting ways. For use in unknown_exception the recently defined TRAP_UNK semantically is a perfect fit. For use in RunModeException it looks like something more specific than TRAP_UNK could be used. No one has bothered to find a better fit than the broken si_code of 0 in all of these years and I don't see an obvious better fit so TRAP_UNK is switching RunModeException to return TRAP_UNK is clearly an improvement. Recent history suggests no actually cares about crazy corner cases of the kernel behavior like this so I don't expect any regressions from changing this. However if something does happen this change is easy to revert. Though I wonder if SIGKILL might not be a better fit. Cc: Paul Mackerras Cc: Kumar Gala Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: linuxppc-dev@lists.ozlabs.org Fixes: 9bad068c24d7 ("[PATCH] ppc32: support for e500 and 85xx") Fixes: 0ed70f6105ef ("PPC32: Provide proper siginfo information on various exceptions.") History Tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git Signed-off-by: "Eric W. Biederman" --- arch/powerpc/include/uapi/asm/siginfo.h | 8 -------- arch/powerpc/kernel/traps.c | 4 ++-- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/include/uapi/asm/siginfo.h b/arch/powerpc/include/uapi/asm/siginfo.h index 0437afc9ef3c..1d51d9b88221 100644 --- a/arch/powerpc/include/uapi/asm/siginfo.h +++ b/arch/powerpc/include/uapi/asm/siginfo.h @@ -15,12 +15,4 @@ #include -/* - * SIGTRAP si_codes - */ -#ifdef __KERNEL__ -#define TRAP_FIXME 0 /* Broken dup of SI_USER */ -#endif /* __KERNEL__ */ - - #endif /* _ASM_POWERPC_SIGINFO_H */ diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index fdf9400beec8..0e17dcb48720 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c @@ -969,7 +969,7 @@ void unknown_exception(struct pt_regs *regs) printk("Bad trap at PC: %lx, SR: %lx, vector=%lx\n", regs->nip, regs->msr, regs->trap); - _exception(SIGTRAP, regs, TRAP_FIXME, 0); + _exception(SIGTRAP, regs, TRAP_UNK, 0); exception_exit(prev_state); } @@ -991,7 +991,7 @@ void instruction_breakpoint_exception(struct pt_regs *regs) void RunModeException(struct pt_regs *regs) { - _exception(SIGTRAP, regs, TRAP_FIXME, 0); + _exception(SIGTRAP, regs, TRAP_UNK, 0); } void single_step_exception(struct pt_regs *regs) -- 2.14.1