From patchwork Mon Dec 23 14:15:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaixiong Yu X-Patchwork-Id: 13918982 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 B4CB6E7718D for ; Mon, 23 Dec 2024 14:21:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4A9126B00EA; Mon, 23 Dec 2024 09:21:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 457B26B00EB; Mon, 23 Dec 2024 09:21:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2D1336B00EC; Mon, 23 Dec 2024 09:21:19 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 103B06B00EA for ; Mon, 23 Dec 2024 09:21:19 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id BC4211417AE for ; Mon, 23 Dec 2024 14:21:18 +0000 (UTC) X-FDA: 82926435144.22.A38B95B Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by imf09.hostedemail.com (Postfix) with ESMTP id 3BC7A14000E for ; Mon, 23 Dec 2024 14:20:49 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf09.hostedemail.com: domain of yukaixiong@huawei.com designates 45.249.212.191 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=1734963659; 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=sGOZ+Me4ctEgzM4GLSPYbTrYV8UV2ZPQotNXMgRYsBObgRX+gIJhkud9xToqVlvIDgxkRx Mo4zv1ZS5HdsKvN81LCzrojVQsx5ZjLLJZs4md9sbdFjjkqCoRUmF7QDuMatFUq+Ijc3F8 gUEfToK7RDejLHAtxS2JuJfz+m7Kmt0= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf09.hostedemail.com: domain of yukaixiong@huawei.com designates 45.249.212.191 as permitted sender) smtp.mailfrom=yukaixiong@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734963659; a=rsa-sha256; cv=none; b=R/bEmoai3r16nN9UiVqGFn3OCkBeKtStDQX9dBJyAcCPxJAXoEpeEQmYign4MTjon4x1KP ry5AgR8zif9+tEBKmMqw5fxVOKBsIi5X0Gk+IqWkRmWKn268O3Do33WSaPRWWevmWBaiWj SG5GMYvRyva2chCOPMynoo3Q0nx0qfI= Received: from mail.maildlp.com (unknown [172.19.163.44]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4YH0YS60ZCz1JG5j; Mon, 23 Dec 2024 22:20:44 +0800 (CST) Received: from kwepemh100016.china.huawei.com (unknown [7.202.181.102]) by mail.maildlp.com (Postfix) with ESMTPS id 1079C140202; Mon, 23 Dec 2024 22:21:13 +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:21:09 +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:49 +0800 Message-ID: <20241223141550.638616-31-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: 3BC7A14000E X-Stat-Signature: uuyy3t4gh6p5mmkhtirkdezbqdp8i7it X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1734963649-623948 X-HE-Meta: U2FsdGVkX1+DtE/5Mii5zHyrcuUjnK4MSNwUhcV0te+NWsEi4ZI9oR5AjG9Tf68WCijDJlfJUSt6HFCBiAYfUCVrsKE6kZwAcs50z8AK7HsDIrtvywc/BR2Yx05Sv1fd73Hat4arvidbrW/Vypz8cCsAviEZB5RzHb4JuOt27D+usN8gbGeSN7PdtBg3cGAnMO6iYsZ9DeTfjhoXXXWcDdqNaiZqxVeiMw957Iu2HcEl6yXlzd3nHNbAsu+XlTPekp7B/vnMmSaXL/nWfICJOUyWy1I6sAsUfRkICXOCwcbnOhXTjBpTy9RsnLLDZ200HFYckiPWJUDlT3c3nFduJ5Vq8/0A/ZtNdIvrEoqsdP8SlZNBO/YT/B8oTwqCaHYqdbPfzvfuGfKdeKcB10vV7Vz6Ot2GjSrP6v/nP7LFpACcvs8QKgzgwFPYobpLgsEZso2uhbCC2NfnI+PPyrsRSqzfVlTy8whB05xtwSfiYsoIed0BuSIw1M/frNuJInqewtevITqBkTR7u8wZjFMCA6+02cUrKK8ap6nXUPt4yx34UdvGFkGPjStH/hh7WBqBLwjGEXqehZopm3OdeCmqd790NYueIZtVFn8Yadphneb+QYkOyTuooeY95M9qNh3ZWZc2duLwRA/3nVpaB83FgFfNKBuccpyZ2XRN2Ihnno6p9LDZCZGyyNQsfRPX+MpP2wCUfKs0QsVHwTHP/0WvL7+cfQyPxmefaCQ7+CQgUMnOoSA858LGgBvYFoV+iJ7BYbAOmosI2qFcophXwhC7/bEdWiLXpwwz3Jc2AI+vTObHkw6B9gjw+KUQVJVfEilcgtHOn7A1kma25FDlUqS2komzlXCvV29a8mxyH65DXpyElH15Q3jH+aQayvffNRtvFqOZol7F5mUS4rstub3PYhEV35eOYd3/YxGWIdr0CvmZEhpqghGK7sDbhgiR6+4FcdVksYDsWgpbmyRec+m AsRLJW6k e0+y7toqUqDtzH7tbp1N+Whv0NBCPkTwLkNHS3V6BkuuDGn+miNDLYAjYT6xrq8xpMeRdKtTjK3qvL2juC4d4VJ3PxRyNpIRN0ZETwiY1DtPrC3qJuQp6dIAgHBCH8AEQ2HbXqdWFC1m43vEgxG90eIzKvfQLdGpt3oLs 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; }