Received: by 2002:a05:6358:795:b0:dc:4c66:fc3e with SMTP id n21csp1070067rwj; Sat, 29 Oct 2022 16:20:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5cELBHR71NjI4eBpUp1L18hpDu1jUlxEjFCo0LVqMkSv8B0vMLwYPn+iBsIXXT1RrwEZLJ X-Received: by 2002:aa7:dd45:0:b0:458:7474:1fbe with SMTP id o5-20020aa7dd45000000b0045874741fbemr6343735edw.334.1667085634821; Sat, 29 Oct 2022 16:20:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667085634; cv=none; d=google.com; s=arc-20160816; b=rv1Afr1iYenJ3en30OSL9zOAHyESgT0lS89u1NzfwM9os5N9jM+CGRjHIvFKmhcZnU Ig3oxbnCTVYscsIcI+rNYQYneg3VxTL2BX9NpPtZOqfF3p3vFyKFBA8c2tlfjb9Yc6aT 7J1sHzbf4gIJNbhiiqL3ytPU8nSYjOlPDvpIRGqRiVHKZNk9E3/DeuvzQY9sHk1hNvUJ HVAGOFBjRv4uUKkiN3veqO2TUpB6JOF1/HPWIJEbV2Bgjk0dR+P7g/eBoppYFpVCkPvi r2zGvE1I1YCJ9PYasc8RL4hs1w5K3fWsnxCdFOakHSCgaqyC8XyJYKh6gLxL+9GLSDS1 cekw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=72jtzsfdBJvTgzNVU9mb5qNZZ75BLtKRZFZfbeGDBNg=; b=FLAX4AtiWjPS/bbY4NGChYt5EpmigxUjj2/Shu6UK6hOA0luNr729pd/HA79UBWUD8 9iDX3pKz0gxIVfVSAJdPmEmKH3JxynbKjs5erM8CCwFR21OhIju7ujCABH8mqHHlGjwo MlTWo+U4aHMxCGXNc8DCRy4htDNEoXx24tDwShPBVgQIpTNZTXCGRa8jpw5altfG/6HF J24bHQ9VdN59p33/al8GlsKPkfRwkl/8dG+ErMioaK7p1Y5EZZJPUSMk09kE60B7trKY b1rYJz2b6WazKPv4gULfOlJEz3Qae7OgIJa8gqG9OE4joqEvVeBXhHJzID8OvVpjwV3x +DuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=v8sMHHOM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o11-20020a170906974b00b00782933fe436si3112366ejy.965.2022.10.29.16.20.09; Sat, 29 Oct 2022 16:20:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=v8sMHHOM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229799AbiJ2XSz (ORCPT + 99 others); Sat, 29 Oct 2022 19:18:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbiJ2XSx (ORCPT ); Sat, 29 Oct 2022 19:18:53 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84A5B2F007; Sat, 29 Oct 2022 16:18:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=72jtzsfdBJvTgzNVU9mb5qNZZ75BLtKRZFZfbeGDBNg=; b=v8sMHHOMqaV+I7Og/bqdh3MjKC yJj9+SjgCHJGUS3+VwuR2Arofn5pLFRdNIH1hQWb1TihodaHKsqGaab0tIZLpGzTOEUvWXfXDSPtP dQPIydfpCRYbiVK131Z0N+yloDx83EK4YQIGLxF63KUhPSgJQK6z4zSHxpesShjTZ0oB+2nwP7Pfp 7Bm6YBXQX9GYvPGHYW3r7aiFai+kxtB23bZcEcztkpLPiEqPN/7XpljTGkYVDHcpmfg7nbhd0W5kG ofnmJZEv/yaOHzRYZOOgN3DmjVLSIor8PJmGrPUBEz4HSTpattmDyNkD40ThLPC0jwX2KbxIw74wn whjJ8mQw==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1oov6I-00FOKS-3D; Sat, 29 Oct 2022 23:18:51 +0000 From: Al Viro To: linux-arch@vger.kernel.org Cc: Linus Torvalds , linux-kernel@vger.kernel.org Subject: [PATCH 01/10] kill signal_pt_regs() Date: Sun, 30 Oct 2022 00:18:41 +0100 Message-Id: <20221029231850.3668437-1-viro@zeniv.linux.org.uk> X-Mailer: git-send-email 2.37.3 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Al Viro X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Once upon at it was used on hot paths, but that had not been true since 2013. IOW, there's no point for arch-optimized equivalent of task_pt_regs(current) - remaining two users are not worth bothering with. Signed-off-by: Al Viro --- arch/alpha/include/asm/ptrace.h | 1 - fs/coredump.c | 2 +- include/linux/ptrace.h | 9 --------- kernel/signal.c | 2 +- 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/arch/alpha/include/asm/ptrace.h b/arch/alpha/include/asm/ptrace.h index df5f317ab3fc..3557ce64ed21 100644 --- a/arch/alpha/include/asm/ptrace.h +++ b/arch/alpha/include/asm/ptrace.h @@ -16,7 +16,6 @@ #define current_pt_regs() \ ((struct pt_regs *) ((char *)current_thread_info() + 2*PAGE_SIZE) - 1) -#define signal_pt_regs current_pt_regs #define force_successful_syscall_return() (current_pt_regs()->r0 = 0) diff --git a/fs/coredump.c b/fs/coredump.c index 7bad7785e8e6..b4ec1bf889f9 100644 --- a/fs/coredump.c +++ b/fs/coredump.c @@ -525,7 +525,7 @@ void do_coredump(const kernel_siginfo_t *siginfo) static atomic_t core_dump_count = ATOMIC_INIT(0); struct coredump_params cprm = { .siginfo = siginfo, - .regs = signal_pt_regs(), + .regs = task_pt_regs(current), .limit = rlimit(RLIMIT_CORE), /* * We must use the same mm->flags while dumping core to avoid diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index c952c5ba8fab..eaaef3ffec22 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h @@ -389,15 +389,6 @@ static inline void user_single_step_report(struct pt_regs *regs) #define current_pt_regs() task_pt_regs(current) #endif -/* - * unlike current_pt_regs(), this one is equal to task_pt_regs(current) - * on *all* architectures; the only reason to have a per-arch definition - * is optimisation. - */ -#ifndef signal_pt_regs -#define signal_pt_regs() task_pt_regs(current) -#endif - #ifndef current_user_stack_pointer #define current_user_stack_pointer() user_stack_pointer(current_pt_regs()) #endif diff --git a/kernel/signal.c b/kernel/signal.c index d140672185a4..848d5c282d35 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -1255,7 +1255,7 @@ int send_signal_locked(int sig, struct kernel_siginfo *info, static void print_fatal_signal(int signr) { - struct pt_regs *regs = signal_pt_regs(); + struct pt_regs *regs = task_pt_regs(current); pr_info("potentially unexpected fatal signal %d.\n", signr); #if defined(__i386__) && !defined(__arch_um__) -- 2.30.2