From patchwork Thu Oct 10 15:22:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yukaixiong X-Patchwork-Id: 13830205 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 92C75CF11F8 for ; Thu, 10 Oct 2024 14:12:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2367E6B00A8; Thu, 10 Oct 2024 10:12:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1BFFF6B00A9; Thu, 10 Oct 2024 10:12:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 03A356B00AA; Thu, 10 Oct 2024 10:12:21 -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 D9C1F6B00A8 for ; Thu, 10 Oct 2024 10:12:21 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 262381602F2 for ; Thu, 10 Oct 2024 14:12:18 +0000 (UTC) X-FDA: 82657882482.06.ED88FEC Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf17.hostedemail.com (Postfix) with ESMTP id ED22D40005 for ; Thu, 10 Oct 2024 14:12:17 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=none; spf=pass (imf17.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=1728569402; 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=Tc5FnBsSafy4CY1NgyRn7ck2eWhFzRsh6zdvbwaDRUk=; b=JvK4AOcqE7ZLzwlICFK40qysQe09Aoax/ARklxtLv2XLjGQVFFxfyucoluBYfgK1X/HgSj XKYuDIZcm6dW+x1xM7ljH5LZac2OVhrw6aKN+xDooMTe6KLNT8ThsjXw7JPWdM7VPnIVja r4JhHphpew7cYbxmEtmIZoRmXnpdEFU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1728569402; a=rsa-sha256; cv=none; b=q3Kj26OnxAGv1u7KJnyJp7Or/hGsemp52d2PAngWIdLeIlKYom9xjwGwlmceTTN7VgNIOK QRMeX36hzE6ieLazNyojUVpU5dKhSoIhMpEoU4iL9CxTAq6pe7P2snF/gLXsPPydUKZ8UN GuKrCQ0jS1jSU/wjPnXigUZPCFewS8Q= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=none; spf=pass (imf17.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 Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4XPWqp5qzmz1T8PS; Thu, 10 Oct 2024 22:10:30 +0800 (CST) Received: from kwepemh100016.china.huawei.com (unknown [7.202.181.102]) by mail.maildlp.com (Postfix) with ESMTPS id 95E1A1401E9; Thu, 10 Oct 2024 22:12:15 +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; Thu, 10 Oct 2024 22:12:12 +0800 From: Kaixiong Yu To: , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v3 -next 14/15] sh: vdso: move the sysctl to arch/sh/kernel/vsyscall/vsyscall.c Date: Thu, 10 Oct 2024 23:22:14 +0800 Message-ID: <20241010152215.3025842-15-yukaixiong@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241010152215.3025842-1-yukaixiong@huawei.com> References: <20241010152215.3025842-1-yukaixiong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemh100016.china.huawei.com (7.202.181.102) X-Stat-Signature: 3bjxnbxkuciaof4iey35axndms8qkogf X-Rspamd-Queue-Id: ED22D40005 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1728569537-483374 X-HE-Meta: U2FsdGVkX19Vhn7EewABA5Sd1ay0JaY33EVkdlb2yAcsXz3p/JED0Bf679f4rFL1o55BIB53s2PDRSWLVqS40nZ2iIzeGeI63owLppjKzhgM/j21TsmWSz/pGaXYS1ERbKTNgYM1VlTllBNjwEykVASuFpOUQXa+IRnGNPsP4gPANxZFQxnj0ubvKEUiL8BKEng+BDY+3gW0DvY/gTYxf/vkPMdNYaVHH2aDSZWRpswryAV9ye4z6iPb24++t3A6a71d64NYpyfMGW/L/B5jFOUdk8etfaHvUP1kYYwRIfg6sm1/TaJzHJlRyTJ1gRPHhItOJoEzWylZs1d7cnpiiVsJcFMbOOkY2cHYy/zlGzKtYRpz5mmD6akX/FankcoeK4QNuHrm/UMfiz8kmEUG3QEJBkplHjfx4Z/Qtid58BtzItNt2p4eczHXQL/QVo3TcyoXgMFZW4VoUpVxKyjX08TsgOUPq19MEcMJJGmb9d9eDV11w0vQrdlHvQnXp5idpF1MKmbJ28ACgYW5zEM0mB6f+VpqjBcLmJjKyeVJnfZdMe6szv93bnab6pEdjVkwPITdABSLgwpe6jzsMYykUlzhkij+K4/LnFjPSYR+UETptQ/jEu21SHH9Ipwg2yVFvYLe+v/lvXNz4Hi3AieRmJZsjyDNLcBcIWbLVjcyDfy1JfgfIPYYRbTs+Bil+CleIVnA5sNHyoV60FhEN92/gsdFjiHCL7ICAxPFNGZEdmhD08gkXkkhGklGwy6pvLz9KUUDwKk6t3mnK+O3yMsVdUNgwc8QCZ/6VoHfo/zN1JloPFyDLJJ6RKiWgFx9i8yIeFkS2mAKyuAM9fNTn5d5jv/8+CS395GDG7fSc6OEz6c2Fe1Olw0w6EHOZXN4bnJvhpIUZS/FogdMobvLPtD3FGEjMaF+2Gf82/ANSlPPqiOp/5CBqjD5BFUhd2CoKv3hPsZSivtYHU6PGfCYbot nHo9vNe5 KtkdEFzez+Irq9wYc0Ak+tYep9toT80hXoMsM72P6otuq3m6Dfdx8U9eINoIYfMbnejICyaZoHUJvm0GI72/E/abY7BKRJUPq38Fmxj3hQE/NsWZ3uLLNVhQtchXrfs2YKvueY8gazCeR3vvHjk13xzXL7Q9p162a0ThX 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 --- 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..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; }