Received: by 10.192.165.148 with SMTP id m20csp4799649imm; Tue, 24 Apr 2018 08:35:32 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+JDjvpiRiIVe0WWEVI8O6Syjo+pY99/Pn/5BW63xlOJhQwrJchy2sl2qlYrCqKT0Cc3Y5Y X-Received: by 10.98.254.17 with SMTP id z17mr24357483pfh.105.1524584132840; Tue, 24 Apr 2018 08:35:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524584132; cv=none; d=google.com; s=arc-20160816; b=BWXTLKZFwA5B0BqjI96FYjfnZi0gNeEZK8N8jjTEf83idoaBuorQ7fabLW1Zow2VaA UBchGLyLNFrY9PaKu6KJ/NCV8hTMfYa8tQMNOJ22sRNQZMjA+U5JwLw/mZWG3mBZwh0o i/wMNKXVtq4Ercs/K0rjp4lFhdkC68vF6LkEqmVCy0vGByeZp0dGhy1KQkBiFFSdVP18 DyDZMp9R1IewFx8rq90v1fZrl0pUlc3ELTqwPeebJoNUr26JyHctckT3L0UG9szvqGdQ FjbbsAbk0c/Wfe5XD0uP/t9MrXRQp9uH1X/TTkXmKTSfqfpzswFIZZ3lluM7cmBzbJQl +zJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:mime-version:user-agent :message-id:in-reply-to:date:references:cc:to:from :arc-authentication-results; bh=yFsCX45Vxv60SZsWwShZTCZB8A50mHLI475t2FMEAGk=; b=f7GaMhIMfdWB9XYhGMAfIEjShFdFyqJWOvX0D+/AiGtzKpcxzTiObe5Cg5dvbiMlug l9rZ2/uH+0k3zG1alORBHfhmDfi+E3xa2CCPwPYVr/GI1Q9czjHsIEA0bOh0+31Y70gV 54YVrj+NC1E7jG1hjoPMZutWlWkzinrYnuMsebNXPgn3cpP3sXFpPG06U27l5oQIzjPY hlieef/efD4q8eKfhNwSrsX7SE+qaer6Uv1qIWjCfTjCKFX3S/EoBL+TQq6dV0zeqWKs p059wyVEN5dsd/w+e2Q2kdY3ukdFAGSgI5BpHluc/WmVN22/tjaBL2cmhABYQusdazR2 qhjA== 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 z7si538717pgv.228.2018.04.24.08.35.18; Tue, 24 Apr 2018 08:35:32 -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 S1752318AbeDXPct (ORCPT + 99 others); Tue, 24 Apr 2018 11:32:49 -0400 Received: from out03.mta.xmission.com ([166.70.13.233]:56946 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750739AbeDXPcl (ORCPT ); Tue, 24 Apr 2018 11:32:41 -0400 Received: from in02.mta.xmission.com ([166.70.13.52]) by out03.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1fAzvs-0008H3-Fr; Tue, 24 Apr 2018 09:32:40 -0600 Received: from [97.119.174.25] (helo=x220.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1fAzvr-0001DY-Vb; Tue, 24 Apr 2018 09:32:40 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Christoph Hellwig Cc: linux-arch@vger.kernel.org, linux-riscv@lists.infradead.org, Palmer Dabbelt , linux-kernel@vger.kernel.org, Albert Ou References: <87604mhrnb.fsf@xmission.com> <20180420143811.9994-14-ebiederm@xmission.com> <20180421072550.GA6973@infradead.org> Date: Tue, 24 Apr 2018 10:31:15 -0500 In-Reply-To: <20180421072550.GA6973@infradead.org> (Christoph Hellwig's message of "Sat, 21 Apr 2018 00:25:50 -0700") Message-ID: <87lgdcei4c.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=1fAzvr-0001DY-Vb;;;mid=<87lgdcei4c.fsf_-_@xmission.com>;;;hst=in02.mta.xmission.com;;;ip=97.119.174.25;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+WDaj2D/V5/6KE+ux6VW//rK+8b/NktYw= 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 TR_Symld_Words too many words that have symbols inside * 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.4846] * -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: ***;Christoph Hellwig X-Spam-Relay-Country: X-Spam-Timing: total 195 ms - load_scoreonly_sql: 0.03 (0.0%), signal_user_changed: 2.6 (1.4%), b_tie_ro: 1.87 (1.0%), parse: 0.78 (0.4%), extract_message_metadata: 16 (8.1%), get_uri_detail_list: 1.46 (0.7%), tests_pri_-1000: 9 (4.7%), tests_pri_-950: 1.19 (0.6%), tests_pri_-900: 1.01 (0.5%), tests_pri_-400: 20 (10.1%), check_bayes: 19 (9.6%), b_tokenize: 6 (3.2%), b_tok_get_all: 6 (3.0%), b_comp_prob: 1.78 (0.9%), b_tok_touch_all: 3.0 (1.5%), b_finish: 0.56 (0.3%), tests_pri_0: 138 (70.9%), check_dkim_signature: 0.48 (0.2%), check_dkim_adsp: 2.9 (1.5%), tests_pri_500: 3.8 (1.9%), rewrite_mail: 0.00 (0.0%) Subject: [REVIEW][PATCH 23/22] signal/riscv: Replace do_trap_siginfo with force_sig_fault 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The function force_sig_fault is just the generic version of do_trap_siginfo with a (void __user *) instead of an unsigned long parameter for the address. So just use force_sig_fault to simplify the code. Cc: Palmer Dabbelt Cc: Albert Ou Cc: linux-riscv@lists.infradead.org Suggested-by: Christoph Hellwig Signed-off-by: "Eric W. Biederman" --- arch/riscv/kernel/traps.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c index 3087940008f4..b99d9dd21fd0 100644 --- a/arch/riscv/kernel/traps.c +++ b/arch/riscv/kernel/traps.c @@ -63,12 +63,6 @@ void die(struct pt_regs *regs, const char *str) do_exit(SIGSEGV); } -static inline void do_trap_siginfo(int signo, int code, - unsigned long addr, struct task_struct *tsk) -{ - force_sig_fault(signo, code, (void __user *)addr, tsk); -} - void do_trap(struct pt_regs *regs, int signo, int code, unsigned long addr, struct task_struct *tsk) { @@ -81,7 +75,7 @@ void do_trap(struct pt_regs *regs, int signo, int code, show_regs(regs); } - do_trap_siginfo(signo, code, addr, tsk); + force_sig_fault(signo, code, (void __user *)addr, tsk); } static void do_trap_error(struct pt_regs *regs, int signo, int code, @@ -143,7 +137,7 @@ asmlinkage void do_trap_break(struct pt_regs *regs) } #endif /* CONFIG_GENERIC_BUG */ - do_trap_siginfo(SIGTRAP, TRAP_BRKPT, regs->sepc, current); + force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)(regs->sepc), current); regs->sepc += 0x4; } -- 2.14.1