From patchwork Mon Dec 23 14:15:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaixiong Yu X-Patchwork-Id: 13918967 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 87589E7718D for ; Mon, 23 Dec 2024 14:20:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AC4A06B00CC; Mon, 23 Dec 2024 09:20:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A70DE6B00CD; Mon, 23 Dec 2024 09:20:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 873776B00CE; Mon, 23 Dec 2024 09:20:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 649156B00CC for ; Mon, 23 Dec 2024 09:20:26 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 2C7E6A1790 for ; Mon, 23 Dec 2024 14:20:26 +0000 (UTC) X-FDA: 82926432582.07.CBCF92D Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf27.hostedemail.com (Postfix) with ESMTP id 13C6E40010 for ; Mon, 23 Dec 2024 14:19:41 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=none; spf=pass (imf27.hostedemail.com: domain of yukaixiong@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=yukaixiong@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734963588; a=rsa-sha256; cv=none; b=wAdGwyhcP0fo0m6cjag4rzLG8EW/BRRBhLOBByiqxNqg/NPPR8TKGWVDgNAnL3sACSCZ3d x8wk5bQhlK11ui/llTDYTd0GGCgPRduJJoN/Td0F26pmr+5Ur0OPJFKZUfj+hbmN6J4uuf sbkTwpCcRi7h95QfcCOFiKq0jLfuPo8= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none; spf=pass (imf27.hostedemail.com: domain of yukaixiong@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=yukaixiong@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734963588; 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=gIV2P9qgOzeX6vIBEmCKcWS42kXvq88UpPmzYlQq5r0=; b=BDGSuCEeP+1xcn6TmNp1sYMBrny+h6jvDln7iBLnjZMM5Tv9O/j6nJQZd3FfvZRaVPAe3p hsohorjpIAEPbttdVt33zPU263zKV3IX+Ho9/nP21bsK6N56uOXBNdBBnmMJwAXW9orITR XaxZM+zN6GvkMeRa2orabkoNaxMRCWY= Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4YH0T62Ssrz1V74N; Mon, 23 Dec 2024 22:16:58 +0800 (CST) Received: from kwepemh100016.china.huawei.com (unknown [7.202.181.102]) by mail.maildlp.com (Postfix) with ESMTPS id A0242140391; Mon, 23 Dec 2024 22:20:19 +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; Mon, 23 Dec 2024 22:20:16 +0800 From: Kaixiong Yu To: , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v4 -next 14/15] sh: vdso: move the sysctl to arch/sh/kernel/vsyscall/vsyscall.c Date: Mon, 23 Dec 2024 22:15:33 +0800 Message-ID: <20241223141550.638616-15-yukaixiong@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241223141550.638616-1-yukaixiong@huawei.com> References: <20241223141550.638616-1-yukaixiong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemh100016.china.huawei.com (7.202.181.102) X-Rspamd-Queue-Id: 13C6E40010 X-Stat-Signature: 7wofiwhf3atmcyhxe7xbrq5hgpp6q81g X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1734963581-638076 X-HE-Meta: U2FsdGVkX1+l4PaGbxG5dsIzln7ggpJLaQ0evtyLCeXI0M/zC2w0wrVc/fqa2jZpzSDYE+xcGoK1f3YA0GgYOX7ZBD4G8Hi2893Lr/EBcDHUucKY5YcZ1SP9LWuenpVVZTwbhjXCnQejwSywswdWn6H9UzTUVmP//WUFzt9NH1cSYJY2O/5QF0pxtg4TBqq1mFxhSFs7YkgN/UOjqsAcijP5r3eFmO0YTVxkmJ+RbhNSCG71A4m1wH6Qn8ej4xFMKUYgJ6CVPcMEbGPvv8rVaojh6p08jU9pLcukSA0OgUsUb797Lp4FEv6livAFKec/CEDg1kCsFcPxibyPVeq+XGfh2ts5dNSy4kUt493Y3yO/BAPzXIijHISwpUSdgQUrpoxhlbppzMrsoyspTBnxkFnkdY99Ez9GMZ/gosvvmuc5CdawsDQa/EsyrOngIw7WlbNcED3QR1yh3juFSDMIA6LhvvYX50CtaGqnE5lgibYyALjABPpbuJN0ZJrJ2uQ1DmOtF1nsT8OWXuGwBPgi5WDuopY8ipylvV8be64/OpOEaTwGIgYwXCtEfHVPqEhNW4oYL07yhfhN5XDdczH5vE1C4av+HWnQQsZ7ShXN22RNKHvfEx6pufyxqzQclLG5qNH+P8mXmiPyp6DfnSz34iCzgxEaq1uL7SUgCwQ7A0j0cL/WndeF0peoQyYT7nlfs7W+6ND+JdqDjEkAbLGO7Cvu9qN/xyKJYKLoQ5iH9ZS3Qeq9F4bvNoEgdqdT6ZlsYyy72XtIxfyC6aQdTbfC2ZsReGQVzo18sNBazucTo5SLcaQHWlr/gukNUT6FUXviGnxwgO0dYE1WaB1Xo4ZzHMqmgMXlc61/Ck5yOMGrwadWX8H4Qfmm595OwIS1JvnSi8fFANUech4xcnV6LTlT/is5AodWsewW58ujRNW3a6aWt+dUklgFjvDAaoRT+Kw62yq6PoT7rMtohZZStqn 1Ud5WPqM HSUDPxhEiP6rAWuHgcIR5NUmpd1Fknfevad9z90o4V/ppvqe1jvGX2bXVRDo7JvSPEzvEC1Gr6ENDWkMrbWAQHyyhuRuFeciIYNjHDaWuaW/cLbwFdVKj1oZMGe07tGao++JGl02iYoWcQvBh0sOoTakp0jpXIV0//hdL 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 --- v4: - const qualify struct ctl_table vdso_table v3: - change the title --- --- 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..898132f34e6a 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 const 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 7ff07b7560b4..cebd0ef5d19d 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -2012,23 +2012,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; }