From patchwork Tue Sep 3 03:30:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yukaixiong X-Patchwork-Id: 13787963 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F25ACD3427 for ; Tue, 3 Sep 2024 03:31:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CFA358D0134; Mon, 2 Sep 2024 23:31:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C85798D0119; Mon, 2 Sep 2024 23:31:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AD5098D0134; Mon, 2 Sep 2024 23:31:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 9077B8D0119 for ; Mon, 2 Sep 2024 23:31:41 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 4F98AC0307 for ; Tue, 3 Sep 2024 03:31:41 +0000 (UTC) X-FDA: 82522002402.25.5F1F6B6 Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by imf24.hostedemail.com (Postfix) with ESMTP id E341D180004 for ; Tue, 3 Sep 2024 03:31:38 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf24.hostedemail.com: domain of yukaixiong@huawei.com designates 45.249.212.32 as permitted sender) smtp.mailfrom=yukaixiong@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725334223; a=rsa-sha256; cv=none; b=Y1cCgAZMrScF65gj4pCmB3jzwa7pdEcElU70KAEgIrCCOnSi4b22fKrup7AHYzD4un7Wmk 03zAktB4jaLhIfl+XuFX8IzQhflF5InQtg+NTmvt5HemMThMBryPhOYtvlNW+jS/6xtFz8 qotaHJXe0WrlOv4QMUbYwgb5HCNJZcQ= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf24.hostedemail.com: domain of yukaixiong@huawei.com designates 45.249.212.32 as permitted sender) smtp.mailfrom=yukaixiong@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725334223; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VfYEzkPFsF9AkAknCzuaF9x0tumE2fk5uby1PFfWFEY=; b=DYbP2k45hW+KWLLl1CZhRcWpG5Fzj7MYKFrJY+f9DvqOR/HZRCHU/FRXBLt/sNW8JXv0na KLD58vv1+aQsBYNMLPdE+mN4SWTdfM1XqPYLqP3q0Oitc0/TZgRjrwCRnzA9tB7U+MhF50 6w20Rva9ZxFfXd34hBoOau0ndz+zViI= Received: from mail.maildlp.com (unknown [172.19.88.214]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4WyWMM6C3nz1xwsb; Tue, 3 Sep 2024 11:29:35 +0800 (CST) Received: from kwepemh100016.china.huawei.com (unknown [7.202.181.102]) by mail.maildlp.com (Postfix) with ESMTPS id 0D2CE1A016C; Tue, 3 Sep 2024 11:31:36 +0800 (CST) Received: from huawei.com (10.175.113.32) by kwepemh100016.china.huawei.com (7.202.181.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 3 Sep 2024 11:31:33 +0800 From: Kaixiong Yu To: , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v2 -next 14/15] sh: vdso: move the sysctl into its own file Date: Tue, 3 Sep 2024 11:30:10 +0800 Message-ID: <20240903033011.2870608-15-yukaixiong@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240903033011.2870608-1-yukaixiong@huawei.com> References: <20240903033011.2870608-1-yukaixiong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemh100016.china.huawei.com (7.202.181.102) X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: E341D180004 X-Stat-Signature: xmdanyx5ehthcy68uqzypyps5s7cjbib X-Rspam-User: X-HE-Tag: 1725334298-911326 X-HE-Meta: U2FsdGVkX1+OBCXa1CkzNNKfLodSEI6iGaKq8MpNRJNea7TIQMA7DYgJnCto7t3EPI1UKaUlzyZcJljQkC+UMDlo0OM0+0JXdP6a8lVUBp6/XWZIpOQkhcMhoDeY15pCsRyut7o/Xz0DfRjjtWPCYaKnvbV18MVzRXYiBYxYt/BliayGypT4mc0DMssTpoC87SQ5ORU0ST4egIU162eWgbRvwbdCjVeyj0+dVfHER/UJ6piGKJw1Apo1ls35TNshlxTUpnfJUH7suXuzODzTTbVJsUXnjp0zvckfTyzrK/JbE7aHaK+kOEF1MipnvkV9X8zpzqgTTnwh9nPjdoIjVey2lwEhUHdSRk+BPcyZzXeNM9PKOfEa35oZmsGr25eq0LkRYeSuDYHqGgnoHCe/sm179kjiLIknkIkVpXoa5SrNRCv/78qvQNyTGdjwI2mDFuPIFteIlqGI6w5OoTFCSZyy5GVkS+Ay25/BrkXW3sBD/jR7ZHklczpMZJA19+91+qU2VAUMrmtx2qJgJjv4w0VchTRACFr/9dcWWyiLz3titMHjpz96JFxJXLoFD27YgFKJj2v0e7qH67qn+ytQTnhjNNuKrxiMSuTb5Q5Wva1Ibcg6jqurTxm2B9q2GtELLYvxzHFnF4naEK9AEuahwP9ZpuBtzjpQiouv9TtF1jBn0lY5chXkJEPQ3YqNiG+1ZjnUP4Ltle7HQzPNsVgASTdd15oSptNsiC5cUZMMWHOWyB4Z+iC7sJNVFKFzbrNggNZ5y0MVq895g0l0PGFBSqY8mi+tU9V1X5FAobbS6T75sdIhF7QwDWBjA6ecs4EnCGPKH55qTAAbTmMesvtJMk8Xmvv2Ydql3/rVCP2YXPjymZNciZ1tD8y7TPQdWMGozVTkJjeWW/z7l60x6g6WMYynaOqdmTKGCPwBOY0FoGgL8eFwmPLHpPZgrwg9Kuf5quObMzzI8PpGKRMw/N6 icfW220m CnYEJg9DZLx/MJ6bHSYihzht6wIx+94Ada4Vz6D9TGOZOEZQGIXHDhBs7CFTlaTeStOyPojkU4HRUNmHPzRz4v3bvq0sNkAht0zdr1DUvvdcdhWPZ27ga/tOVGPMFlHW2evRuph+Cu+lvqr3dQmYgprKG0izrhwdKz2U0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: When CONFIG_SUPERH and CONFIG_VSYSCALL are defined, vdso_enabled belongs to arch/sh/kernel/vsyscall/vsyscall.c. So, move it into its own file. After this patch is applied, all sysctls of vm_table would be moved. So, delete vm_table. Signed-off-by: Kaixiong Yu Reviewed-by: Kees Cook --- arch/sh/kernel/vsyscall/vsyscall.c | 14 ++++++++++++++ kernel/sysctl.c | 14 -------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/arch/sh/kernel/vsyscall/vsyscall.c b/arch/sh/kernel/vsyscall/vsyscall.c index add35c51e017..43bc3715e38c 100644 --- a/arch/sh/kernel/vsyscall/vsyscall.c +++ b/arch/sh/kernel/vsyscall/vsyscall.c @@ -14,6 +14,7 @@ #include #include #include +#include #include /* @@ -30,6 +31,17 @@ static int __init vdso_setup(char *s) } __setup("vdso=", vdso_setup); +static struct ctl_table vdso_table[] = { + { + .procname = "vdso_enabled", + .data = &vdso_enabled, + .maxlen = sizeof(vdso_enabled), + .mode = 0644, + .proc_handler = proc_dointvec, + .extra1 = SYSCTL_ZERO, + }, +}; + /* * These symbols are defined by vsyscall.o to mark the bounds * of the ELF DSO images included therein. @@ -55,6 +67,8 @@ int __init vsyscall_init(void) &vsyscall_trapa_start, &vsyscall_trapa_end - &vsyscall_trapa_start); + register_sysctl_init("vm", vdso_table); + return 0; } diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 24617be93119..f04da9f3abc6 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -2022,23 +2022,9 @@ static struct ctl_table kern_table[] = { #endif }; -static struct ctl_table vm_table[] = { -#if defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL) - { - .procname = "vdso_enabled", - .data = &vdso_enabled, - .maxlen = sizeof(vdso_enabled), - .mode = 0644, - .proc_handler = proc_dointvec, - .extra1 = SYSCTL_ZERO, - }, -#endif -}; - int __init sysctl_init_bases(void) { register_sysctl_init("kernel", kern_table); - register_sysctl_init("vm", vm_table); return 0; }