Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp244526rwn; Fri, 16 Sep 2022 19:33:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5JouIoY8PVhdGlHFEoUpHqh1XPrzgZ+VFstfLh0zIiAcuckvESWj4ZRK4YVzAqOAfePhbS X-Received: by 2002:a17:906:4786:b0:780:ed2a:ed6a with SMTP id cw6-20020a170906478600b00780ed2aed6amr83009ejc.769.1663381993668; Fri, 16 Sep 2022 19:33:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663381993; cv=none; d=google.com; s=arc-20160816; b=vmSqa4szcMWK4jXudzdlR/tdvnlCuXgvQSPidxI8ESoPaRR291sgPE8Yqt6bKfyq7y CYzZQs8dqmt9ycpvL6eBOKBdyJqAUq5HuwOe3k8e/+NxVwCDAn6B9rNZN9/LQksKdSgu 31uYKYT/6KfqF4EVnjjj99lhxqv/peKmZo28c+MZMk4lAhMhlI5mojAZOQuXVBvc02te nY4ZXR36AMNyP+YvHtGcdU8rPgJarxmtT0Bpm2PZQaeNafu7tYTdKGgzXAI8qACSGUwa OMvkesVR4mAo0zZ3gUlRyBtlIYItaqh4t67zEUDSYzXnQ4P94Gh9UdiPudbKRMW755b3 FUkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=Bhb1gnh6dm8iIkbl/Soy3Uhd8xwWGJsJBw5DcA/dlYE=; b=e1pYi60QyuR9VZx0pF8UrqwFs6i6W7vCiil4e4R+n2I/bVg4LVAfBr9qTHVZM+akEv bG1xauhM1UqkMx1CaXpbjeMxbLV+p9ziUaSvNdAjAZIFmOh5fD0+Xg3l1mT/pJkStpkg WsT597pizph4fK+CYTMAHLhU8ywDZXvIb2/+MkNErL2cXQugNXCzQQbQW7Gx9gkvkbDH gH2hqCa1+4qiXaSk7yUTUEsYDz196SCQVFVPSuhIZdd6JrCQCwXJyIYLA0erq6r0h1PC ZGvEXEs3j/o9E8BgoN4Fa6R1sLd/WbiXZ13KSxXMYQYD4EaPXMvHY+NaVeBHpK428vxg HREQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g15-20020a1709065d0f00b0077f92be81aasi13382745ejt.379.2022.09.16.19.32.45; Fri, 16 Sep 2022 19:33:13 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229684AbiIQB7m (ORCPT + 99 others); Fri, 16 Sep 2022 21:59:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229728AbiIQB7d (ORCPT ); Fri, 16 Sep 2022 21:59:33 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 241FFE24; Fri, 16 Sep 2022 18:59:31 -0700 (PDT) Received: from dggpemm500024.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MTvCh2PtNzlVkl; Sat, 17 Sep 2022 09:55:28 +0800 (CST) Received: from dggpemm500016.china.huawei.com (7.185.36.25) by dggpemm500024.china.huawei.com (7.185.36.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 17 Sep 2022 09:59:29 +0800 Received: from huawei.com (10.67.175.41) by dggpemm500016.china.huawei.com (7.185.36.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 17 Sep 2022 09:59:29 +0800 From: Yipeng Zou To: , , , , , , , , , , , , , , , , , , , , , CC: , , Subject: [PATCH 2/2] uprobes: make arch_uprobe_exception_notify as weak Date: Sat, 17 Sep 2022 09:55:22 +0800 Message-ID: <20220917015522.44583-3-zouyipeng@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220917015522.44583-1-zouyipeng@huawei.com> References: <20220917015522.44583-1-zouyipeng@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.175.41] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500016.china.huawei.com (7.185.36.25) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 The function implementation under some arch does nothing. We can mark it with weak attributes to improve. Signed-off-by: Yipeng Zou --- arch/arm/probes/uprobes/core.c | 6 ------ arch/arm64/kernel/probes/uprobes.c | 6 ------ arch/csky/kernel/probes/uprobes.c | 6 ------ arch/riscv/kernel/probes/uprobes.c | 6 ------ kernel/events/uprobes.c | 6 ++++++ 5 files changed, 6 insertions(+), 24 deletions(-) diff --git a/arch/arm/probes/uprobes/core.c b/arch/arm/probes/uprobes/core.c index f5f790c6e5f8..535ea1b355ed 100644 --- a/arch/arm/probes/uprobes/core.c +++ b/arch/arm/probes/uprobes/core.c @@ -175,12 +175,6 @@ void arch_uprobe_abort_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) instruction_pointer_set(regs, utask->vaddr); } -int arch_uprobe_exception_notify(struct notifier_block *self, - unsigned long val, void *data) -{ - return NOTIFY_DONE; -} - static int uprobe_trap_handler(struct pt_regs *regs, unsigned int instr) { unsigned long flags; diff --git a/arch/arm64/kernel/probes/uprobes.c b/arch/arm64/kernel/probes/uprobes.c index d49aef2657cd..687ede3375a6 100644 --- a/arch/arm64/kernel/probes/uprobes.c +++ b/arch/arm64/kernel/probes/uprobes.c @@ -159,12 +159,6 @@ arch_uretprobe_hijack_return_addr(unsigned long trampoline_vaddr, return orig_ret_vaddr; } -int arch_uprobe_exception_notify(struct notifier_block *self, - unsigned long val, void *data) -{ - return NOTIFY_DONE; -} - static int uprobe_breakpoint_handler(struct pt_regs *regs, unsigned long esr) { diff --git a/arch/csky/kernel/probes/uprobes.c b/arch/csky/kernel/probes/uprobes.c index 2d31a12e46cf..67ff13d960e8 100644 --- a/arch/csky/kernel/probes/uprobes.c +++ b/arch/csky/kernel/probes/uprobes.c @@ -132,12 +132,6 @@ arch_uretprobe_hijack_return_addr(unsigned long trampoline_vaddr, return ra; } -int arch_uprobe_exception_notify(struct notifier_block *self, - unsigned long val, void *data) -{ - return NOTIFY_DONE; -} - int uprobe_breakpoint_handler(struct pt_regs *regs) { if (uprobe_pre_sstep_notifier(regs)) diff --git a/arch/riscv/kernel/probes/uprobes.c b/arch/riscv/kernel/probes/uprobes.c index c976a21cd4bd..770f16c6e00f 100644 --- a/arch/riscv/kernel/probes/uprobes.c +++ b/arch/riscv/kernel/probes/uprobes.c @@ -131,12 +131,6 @@ arch_uretprobe_hijack_return_addr(unsigned long trampoline_vaddr, return ra; } -int arch_uprobe_exception_notify(struct notifier_block *self, - unsigned long val, void *data) -{ - return NOTIFY_DONE; -} - bool uprobe_breakpoint_handler(struct pt_regs *regs) { if (uprobe_pre_sstep_notifier(regs)) diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index d9e357b7e17c..33e637f7a202 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c @@ -2343,6 +2343,12 @@ int uprobe_post_sstep_notifier(struct pt_regs *regs) return 1; } +int __weak arch_uprobe_exception_notify(struct notifier_block *self, + unsigned long val, void *data) +{ + return NOTIFY_DONE; +} + static struct notifier_block uprobe_exception_nb = { .notifier_call = arch_uprobe_exception_notify, .priority = INT_MAX-1, /* notified after kprobes, kgdb */ -- 2.17.1