Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp231827rwn; Fri, 16 Sep 2022 19:12:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5BCqYOtH0H7RvgSvhiezwl7bavyZMSyORlT9XYiaD2Doh8hcqvfuw0Ko1XKWRoOr97Lnn0 X-Received: by 2002:a05:6402:2b8d:b0:43a:5410:a9fc with SMTP id fj13-20020a0564022b8d00b0043a5410a9fcmr6206412edb.99.1663380759356; Fri, 16 Sep 2022 19:12:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663380759; cv=none; d=google.com; s=arc-20160816; b=LT2TQQcr/dDC+DFjKMU1Z1ICq1DZUCVHEUKQWbXxMvbX1xBTLsAu65+Pzj+HcZPuI4 yLKxvDvMJZPoRLNJUPjhnmSC30jfbo0FdukBY51aFn1RYAxASnJbuB44Vq39iMNdZ4kY w/5Hd9iE/8QDUDHA2ADV38oHnxweBUSnotpcCvoAne7EkKqgJTmaCGLc/nI9BlfC5w7n eMol0jRIyNYs2ZAeWX6WG5cvkNVy5QmPNVmiDjGRYRyMOnPeILkmibpQsKUA9TvBqgHW AAKpg9o4itYyc2gVzVDrZoB2wnzuEzOTKe2Yt1ecxtDww6mwU2PEDQIpw66n3seOjn1N udTw== 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=rjgIoIOU2yUYIOdySFhS99cwdb7HxMSxfnK/WXQaKK0=; b=GKJkurFDTraUu9SsNFMDU7h3BmZadH//YZO6ta7YmTYx/cFcVCRMwW6y08FYJy9SSC vzwKGwgtFbfNFxrKGXg/Qa66ZP2zWSTFZCPh5CM3S42d8Y+yxhA0wLEIwrZyY9zJ/nUO B8Xk5yWRssUV6oWdgOPFtyJpmL7/oxtZ4e0DeBXJHZjF/Ic1RaXWlQ1bTB0zlkoOYqmI is4E0WHRywQQx2zF7EmdsQisN1973v0CzWpb9MN/+WIyptV3B8lJqDqHT+VHaxHR+zeK BZ1L6LvDCnzF9ylWnkKfWfa40Sft/NdcyvsA+erjPJbK+HiNd1gZJk5Db4TSUgXWhdJ+ 7nIw== 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 mf23-20020a170906cb9700b0077e94a4867csi10244856ejb.796.2022.09.16.19.12.12; Fri, 16 Sep 2022 19:12:39 -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 S229627AbiIQB7e (ORCPT + 99 others); Fri, 16 Sep 2022 21:59:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229532AbiIQB7c (ORCPT ); Fri, 16 Sep 2022 21:59:32 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C86EE44; Fri, 16 Sep 2022 18:59:30 -0700 (PDT) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MTvFw1Z8SzBsPD; Sat, 17 Sep 2022 09:57:24 +0800 (CST) Received: from dggpemm500016.china.huawei.com (7.185.36.25) by dggpemm500023.china.huawei.com (7.185.36.83) 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:28 +0800 From: Yipeng Zou To: , , , , , , , , , , , , , , , , , , , , , CC: , , Subject: [PATCH 1/2] kprobes: make arch_init_kprobes as weak Date: Sat, 17 Sep 2022 09:55:21 +0800 Message-ID: <20220917015522.44583-2-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/csky/kernel/probes/kprobes.c | 5 ----- arch/riscv/kernel/probes/kprobes.c | 5 ----- arch/s390/kernel/kprobes.c | 5 ----- arch/x86/kernel/kprobes/core.c | 5 ----- kernel/kprobes.c | 5 +++++ 5 files changed, 5 insertions(+), 20 deletions(-) diff --git a/arch/csky/kernel/probes/kprobes.c b/arch/csky/kernel/probes/kprobes.c index 3c6e5c725d81..d31b6ab5cea0 100644 --- a/arch/csky/kernel/probes/kprobes.c +++ b/arch/csky/kernel/probes/kprobes.c @@ -405,8 +405,3 @@ int __kprobes arch_trampoline_kprobe(struct kprobe *p) { return 0; } - -int __init arch_init_kprobes(void) -{ - return 0; -} diff --git a/arch/riscv/kernel/probes/kprobes.c b/arch/riscv/kernel/probes/kprobes.c index e6e950b7cf32..d4577108e5c9 100644 --- a/arch/riscv/kernel/probes/kprobes.c +++ b/arch/riscv/kernel/probes/kprobes.c @@ -362,8 +362,3 @@ int __kprobes arch_trampoline_kprobe(struct kprobe *p) { return 0; } - -int __init arch_init_kprobes(void) -{ - return 0; -} diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c index 0032bdbe8e3f..aaf9329a7cf4 100644 --- a/arch/s390/kernel/kprobes.c +++ b/arch/s390/kernel/kprobes.c @@ -544,11 +544,6 @@ int kprobe_exceptions_notify(struct notifier_block *self, } NOKPROBE_SYMBOL(kprobe_exceptions_notify); -int __init arch_init_kprobes(void) -{ - return 0; -} - int arch_trampoline_kprobe(struct kprobe *p) { return 0; diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c index 4c3c27b6aea3..e26b336f8b18 100644 --- a/arch/x86/kernel/kprobes/core.c +++ b/arch/x86/kernel/kprobes/core.c @@ -1055,11 +1055,6 @@ int __init arch_populate_kprobe_blacklist(void) (unsigned long)__entry_text_end); } -int __init arch_init_kprobes(void) -{ - return 0; -} - int arch_trampoline_kprobe(struct kprobe *p) { return 0; diff --git a/kernel/kprobes.c b/kernel/kprobes.c index ca9d834d0b84..23f6d329b53b 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c @@ -2684,6 +2684,11 @@ void kprobe_free_init_mem(void) mutex_unlock(&kprobe_mutex); } +int __init __weak arch_init_kprobes(void) +{ + return 0; +} + static int __init init_kprobes(void) { int i, err = 0; -- 2.17.1