From patchwork Sat Dec 28 14:57:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yukaixiong X-Patchwork-Id: 13922376 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 428ADE77191 for ; Sat, 28 Dec 2024 15:02:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C9F5B6B00A8; Sat, 28 Dec 2024 10:02:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C726C6B00A9; Sat, 28 Dec 2024 10:02:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AD0256B00AA; Sat, 28 Dec 2024 10:02:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 8A9836B00A8 for ; Sat, 28 Dec 2024 10:02:36 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 15EC71A0E79 for ; Sat, 28 Dec 2024 15:02:36 +0000 (UTC) X-FDA: 82944682548.25.8C6013E Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by imf11.hostedemail.com (Postfix) with ESMTP id C8A2440023 for ; Sat, 28 Dec 2024 15:01:52 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=none; spf=pass (imf11.hostedemail.com: domain of yukaixiong@huawei.com designates 45.249.212.191 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=1735398124; 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=lPikhI8ovtYyToadFhDXBAnfBVTHtEutqtIoe+amsrjysRrnbvIDk2rDBWbYW3F3EfLpYk exGzZ5lN0TMbxx57wMzrnhFtl7kB0LXzode92qk/QrTzu4inFBI6c9glLjqLUQwYtVQt6G PS9xpoLx4Uv96XCQvq9uxe1pIBmO1v8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1735398124; a=rsa-sha256; cv=none; b=p4vzMv/FiRxWWxqyaROr7G+7csHECt+cDPenTavS5sqQ+9qf7kqWfohIfZTlI2YzT4kNFT AV24UKgJLbBk1Yedf1pciFZATR6ORJOHGk/QLnK8+Z7r3Ln3DFCIZBCyQfFR5Q8NgJF55V EMbIyRlTqzpyeVKoI2RYRHpnosl3PbA= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=none; spf=pass (imf11.hostedemail.com: domain of yukaixiong@huawei.com designates 45.249.212.191 as permitted sender) smtp.mailfrom=yukaixiong@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4YL5B65CNdz1kx8v; Sat, 28 Dec 2024 22:59:42 +0800 (CST) Received: from kwepemh100016.china.huawei.com (unknown [7.202.181.102]) by mail.maildlp.com (Postfix) with ESMTPS id 2A977140136; Sat, 28 Dec 2024 23:02:30 +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; Sat, 28 Dec 2024 23:02:26 +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: Sat, 28 Dec 2024 22:57:45 +0800 Message-ID: <20241228145746.2783627-15-yukaixiong@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241228145746.2783627-1-yukaixiong@huawei.com> References: <20241228145746.2783627-1-yukaixiong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemh100016.china.huawei.com (7.202.181.102) X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: C8A2440023 X-Stat-Signature: yfuw8amqq37qxr7r931xjbejjiprzx7h X-Rspam-User: X-HE-Tag: 1735398112-963621 X-HE-Meta: U2FsdGVkX18uG3wYIO4SGTaa7Kj16u3XADJYddSmL1b9EWs3ggRVsCh8+qcHu/fcaXRub94yo81fzc/3azgXYY7vVJk2XVpROUqYyVWfa/551pNHkAnRigxW7cWGIwRjPrOTUY7G8RtvSTAjwhe1sFMOje4jHuiyQ9FjhrNuMjxNEUUIc2C4NrQJK4Gn7WTVty9f3ml06ZmING+v9T5Bk92gk7VTRjxhjj68WCdMCj1f73BpvsjEsgeoYzT7TnB2ElIePmDK+ZlZ0akrwhzhxn1A2jUs4x9l56UVDU3CRZ21NQcKYHLAx8xwxn33ce/QoswiGGELEKdaLSiu6WzJCIsazU44OvR2ikqTmbwREfIOHmILg4KxFJl0KmhjXRvbxUWOqHnJkLBE+CTM8AjjB9gB1P6Syfp0LnNxRTo25znWzwytP3LLBGC9XG02XKWcem5rXjYkBqI5zFiB9xfY41l/gYKXzWmLzxerJI9StNySTag1UF0q7V6wXfmdUEczmW0Kv6y6lZt3P0yksxO80pmhTTUQiTLcUead9tjMKJ2p+RdCGUejp+R3RsRULSW2bYlcJ+3uEJQt++4+js10+2PEyfeJKFgCVsc8ccn4RxhXnSfv6nEAXN3P8vJ91UKWg6g5tHFHyI3iy8551zWPXmQfuL739NKQ/SC+R1GXOkULNg6Kwy7EvrscuhYr9/wYJbrXIa8NC4+qRhI/8Cp8FoUji3IHUruycdQoGZ2doH+Rk4UGEffCkek5RCOILevPW5RGZsEFbk99wm5ZebirXrSopFrsaS4zeUkDnW4YU8yMfdDLwP2VojAvQV+CFKfUTAZ2ih/sbOHCnJ720uBM5DYMdX1dJsWdRdfrHOy+r3qYDd8dWKGF6nrkRAYtjFFBXsFc0M7nXnIHErmUj8Di6QRn/8vC0Ha5D1Oou3rdObKY1yyDhdkE1X/hI95uax9q9RahMsR+DoUZ63K1cl/ FQqEE5NB ic0tggONlcmrwQAV4cfL6xGlzR0925R26kJdZRPTT2mEvRfGMVvhPCH1yuu4LCp8MauqfwEEvgBIpjxIMVmN6Um9zWRQT8jEIrzt1wUiNR88wB98jWa5zh+ScXOxKD9L6SKp9oehnqLM5zKC+IvL81Uzwh+dQgqYYgtpeTeBKdmr4Agc2PlmLBNHrPvts1hs8FUe6MML7TulVlYkbHGU4oUKvMe9R6ZKH/6YCAc5Ct3GdECCZcbapNMumc98OSJQ3rNVZH96FNRPgXxNnKWRKGbPOzcYWFWUPpmaES9PTUCJ4nZj0ta2sn00W7gadW23l/e4K 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; }