From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26A34C07E95 for ; Fri, 16 Jul 2021 11:48:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0BE57613D4 for ; Fri, 16 Jul 2021 11:48:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234128AbhGPLv2 (ORCPT ); Fri, 16 Jul 2021 07:51:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232923AbhGPLv1 (ORCPT ); Fri, 16 Jul 2021 07:51:27 -0400 Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7170C061762 for ; Fri, 16 Jul 2021 04:48:31 -0700 (PDT) Received: by mail-ot1-x32e.google.com with SMTP id e1-20020a9d63c10000b02904b8b87ecc43so9578212otl.4 for ; Fri, 16 Jul 2021 04:48:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SCAMfplbo3e2iODI9poYTm8lXc8h2ulhVqpOO6GIdUY=; b=D8DMuB/NoSjS+60zzJxsOOILuPr+HxIwVzVsSJVfm6zUYFS1NK0YvlI3cpD03tai3C GJ9bLATPo02qo5E8EMlSboDUJKP3a9sv6/pf4ZEmXdYHyqYE4X6+ykPYrw+cf9C+ZsZM jy/vjWBZ+SwF6pCP9/yMw+4irHxJqozlpJZ+OAQ3CHtihG4wGuaWQk4a3h02e9VhfTPi +PPAsxYybVsZirFe4ViK0/MrEuKSapzKgGNQIhj70Cun52P3cfjO8EJCZushXIiZI7sY 0LPINYDjuebVi0DTeW+nsHzfkaLeQrUyZfCZXYYOUXNifGO03KOWcSSlKWPOBWDNiPVl VRpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SCAMfplbo3e2iODI9poYTm8lXc8h2ulhVqpOO6GIdUY=; b=mrNpCOK87aWNe2X6bgXTE8BU7NTdWkiwWNvc5N4I2kawX/+CZl5WNmChngOnAIQei9 P/ik5doZdHE5xlFWTGBwNkkzkeIR/fyM7+DzKmV1Bdue5A5wz/rVkRWe8KCYpntJ5s6L EqWKOoSNN9sZzKZnsU672pr3HI4xpslM0qIqqplewqnX+mP/ElzJZP0Mgl6Y93D21CWf DBXUzBjgT+HY8J8w9CPSEImiMgrgLSTG9FbHn9k+7SCb7QfKsScyCREC+r1M8BAm42oL IVRjvbQ8r0vD5g6WGOyXihpjMhNJfSMrsTipqVBL24ehPydP2zL0yk4C0FAow8B1OBv2 HI/w== X-Gm-Message-State: AOAM5328U08RTXogBdkZu64E8f19YMqaizSgLi1NNdwJzQk1A/JAdbjH wpCIN/MJAvkBcHFW7Pw8lsAb5UvX6HTDwuXGVsqATQ== X-Google-Smtp-Source: ABdhPJy8/WDKQVEqrCCE9FT/HDZN1LH/+u7mcWBjJjvPWwuIfb0/MZ3akM15S+WvAyRkg2OWOZfb6zqLz9Sg7NCFv6c= X-Received: by 2002:a9d:d04:: with SMTP id 4mr8241154oti.251.1626436110870; Fri, 16 Jul 2021 04:48:30 -0700 (PDT) MIME-Version: 1.0 References: <87a6mnzbx2.fsf_-_@disp2133> <87bl73xx6x.fsf_-_@disp2133> In-Reply-To: <87bl73xx6x.fsf_-_@disp2133> From: Marco Elver Date: Fri, 16 Jul 2021 13:48:18 +0200 Message-ID: Subject: Re: [PATCH 6/6] signal: Remove the generic __ARCH_SI_TRAPNO support To: "Eric W. Biederman" Cc: Arnd Bergmann , Florian Weimer , "David S. Miller" , Peter Zijlstra , Ingo Molnar , Thomas Gleixner , Peter Collingbourne , Dmitry Vyukov , Alexander Potapenko , sparclinux , linux-arch , Linux Kernel Mailing List , Linux API , kasan-dev Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 15 Jul 2021 at 20:13, Eric W. Biederman wrote: > Now that __ARCH_SI_TRAPNO is no longer set by any architecture remove > all of the code it enabled from the kernel. > > On alpha and sparc a more explict approach of using > send_sig_fault_trapno or force_sig_fault_trapno in the very limited > circumstances where si_trapno was set to a non-zero value. > > The generic support that is being removed always set si_trapno on all > fault signals. With only SIGILL ILL_ILLTRAP on sparc and SIGFPE and > SIGTRAP TRAP_UNK on alpla providing si_trapno values asking all senders > of fault signals to provide an si_trapno value does not make sense. > > Making si_trapno an ordinary extension of the fault siginfo layout has > enabled the architecture generic implementation of SIGTRAP TRAP_PERF, > and enables other faulting signals to grow architecture generic > senders as well. > > v1: https://lkml.kernel.org/r/m18s4zs7nu.fsf_-_@fess.ebiederm.org > v2: https://lkml.kernel.org/r/20210505141101.11519-8-ebiederm@xmission.com > Signed-off-by: "Eric W. Biederman" Reviewed-by: Marco Elver > --- > arch/mips/include/uapi/asm/siginfo.h | 2 -- > include/linux/sched/signal.h | 8 -------- > kernel/signal.c | 14 -------------- > 3 files changed, 24 deletions(-) > > diff --git a/arch/mips/include/uapi/asm/siginfo.h b/arch/mips/include/uapi/asm/siginfo.h > index c34c7eef0a1c..8cb8bd061a68 100644 > --- a/arch/mips/include/uapi/asm/siginfo.h > +++ b/arch/mips/include/uapi/asm/siginfo.h > @@ -10,9 +10,7 @@ > #ifndef _UAPI_ASM_SIGINFO_H > #define _UAPI_ASM_SIGINFO_H > > - > #define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(long) + 2*sizeof(int)) > -#undef __ARCH_SI_TRAPNO /* exception code needs to fill this ... */ > > #define __ARCH_HAS_SWAPPED_SIGINFO > > diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h > index 6657184cef07..928e0025d358 100644 > --- a/include/linux/sched/signal.h > +++ b/include/linux/sched/signal.h > @@ -298,11 +298,6 @@ static inline void kernel_signal_stop(void) > > schedule(); > } > -#ifdef __ARCH_SI_TRAPNO > -# define ___ARCH_SI_TRAPNO(_a1) , _a1 > -#else > -# define ___ARCH_SI_TRAPNO(_a1) > -#endif > #ifdef __ia64__ > # define ___ARCH_SI_IA64(_a1, _a2, _a3) , _a1, _a2, _a3 > #else > @@ -310,14 +305,11 @@ static inline void kernel_signal_stop(void) > #endif > > int force_sig_fault_to_task(int sig, int code, void __user *addr > - ___ARCH_SI_TRAPNO(int trapno) > ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr) > , struct task_struct *t); > int force_sig_fault(int sig, int code, void __user *addr > - ___ARCH_SI_TRAPNO(int trapno) > ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr)); > int send_sig_fault(int sig, int code, void __user *addr > - ___ARCH_SI_TRAPNO(int trapno) > ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr) > , struct task_struct *t); > > diff --git a/kernel/signal.c b/kernel/signal.c > index ae06a424aa72..2181423e562a 100644 > --- a/kernel/signal.c > +++ b/kernel/signal.c > @@ -1666,7 +1666,6 @@ void force_sigsegv(int sig) > } > > int force_sig_fault_to_task(int sig, int code, void __user *addr > - ___ARCH_SI_TRAPNO(int trapno) > ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr) > , struct task_struct *t) > { > @@ -1677,9 +1676,6 @@ int force_sig_fault_to_task(int sig, int code, void __user *addr > info.si_errno = 0; > info.si_code = code; > info.si_addr = addr; > -#ifdef __ARCH_SI_TRAPNO > - info.si_trapno = trapno; > -#endif > #ifdef __ia64__ > info.si_imm = imm; > info.si_flags = flags; > @@ -1689,16 +1685,13 @@ int force_sig_fault_to_task(int sig, int code, void __user *addr > } > > int force_sig_fault(int sig, int code, void __user *addr > - ___ARCH_SI_TRAPNO(int trapno) > ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr)) > { > return force_sig_fault_to_task(sig, code, addr > - ___ARCH_SI_TRAPNO(trapno) > ___ARCH_SI_IA64(imm, flags, isr), current); > } > > int send_sig_fault(int sig, int code, void __user *addr > - ___ARCH_SI_TRAPNO(int trapno) > ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr) > , struct task_struct *t) > { > @@ -1709,9 +1702,6 @@ int send_sig_fault(int sig, int code, void __user *addr > info.si_errno = 0; > info.si_code = code; > info.si_addr = addr; > -#ifdef __ARCH_SI_TRAPNO > - info.si_trapno = trapno; > -#endif > #ifdef __ia64__ > info.si_imm = imm; > info.si_flags = flags; > @@ -3283,10 +3273,6 @@ enum siginfo_layout siginfo_layout(unsigned sig, int si_code) > ((sig == SIGFPE) || > ((sig == SIGTRAP) && (si_code == TRAP_UNK)))) > layout = SIL_FAULT_TRAPNO; > -#ifdef __ARCH_SI_TRAPNO > - else if (layout == SIL_FAULT) > - layout = SIL_FAULT_TRAPNO; > -#endif > } > else if (si_code <= NSIGPOLL) > layout = SIL_POLL; > -- > 2.20.1 >