[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ca38cfef-2b60-b917-afa1-4cc44403df8f@huawei.com>
Date: Thu, 9 Jan 2025 10:40:34 +0800
From: yukaixiong <yukaixiong@...wei.com>
To: Joel Granados <joel.granados@...nel.org>
CC: <akpm@...ux-foundation.org>, <mcgrof@...nel.org>,
<ysato@...rs.sourceforge.jp>, <dalias@...c.org>,
<glaubitz@...sik.fu-berlin.de>, <luto@...nel.org>, <tglx@...utronix.de>,
<mingo@...hat.com>, <bp@...en8.de>, <dave.hansen@...ux.intel.com>,
<hpa@...or.com>, <viro@...iv.linux.org.uk>, <brauner@...nel.org>,
<jack@...e.cz>, <kees@...nel.org>, <j.granados@...sung.com>,
<willy@...radead.org>, <Liam.Howlett@...cle.com>, <vbabka@...e.cz>,
<lorenzo.stoakes@...cle.com>, <trondmy@...nel.org>, <anna@...nel.org>,
<chuck.lever@...cle.com>, <jlayton@...nel.org>, <neilb@...e.de>,
<okorniev@...hat.com>, <Dai.Ngo@...cle.com>, <tom@...pey.com>,
<davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
<pabeni@...hat.com>, <paul@...l-moore.com>, <jmorris@...ei.org>,
<linux-sh@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-fsdevel@...r.kernel.org>, <linux-mm@...ck.org>,
<linux-nfs@...r.kernel.org>, <netdev@...r.kernel.org>,
<linux-security-module@...r.kernel.org>, <dhowells@...hat.com>,
<haifeng.xu@...pee.com>, <baolin.wang@...ux.alibaba.com>,
<shikemeng@...weicloud.com>, <dchinner@...hat.com>, <bfoster@...hat.com>,
<souravpanda@...gle.com>, <hannes@...xchg.org>, <rientjes@...gle.com>,
<pasha.tatashin@...een.com>, <david@...hat.com>, <ryan.roberts@....com>,
<ying.huang@...el.com>, <yang@...amperecomputing.com>,
<zev@...ilderbeest.net>, <serge@...lyn.com>, <vegard.nossum@...cle.com>,
<wangkefeng.wang@...wei.com>
Subject: Re: [PATCH v4 -next 14/15] sh: vdso: move the sysctl to
arch/sh/kernel/vsyscall/vsyscall.c
On 2025/1/6 19:59, Joel Granados wrote:
> On Sat, Dec 28, 2024 at 10:57:45PM +0800, Kaixiong Yu wrote:
>> 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 <yukaixiong@...wei.com>
>> Reviewed-by: Kees Cook <kees@...nel.org>
>> ---
>> 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 <linux/module.h>
>> #include <linux/elf.h>
>> #include <linux/sched.h>
>> +#include <linux/sysctl.h>
>> #include <linux/err.h>
>>
>> /*
>> @@ -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
>> };
>>
> As you mentioned in the commit message, this patch has two objectives.
> 1. It moves the vdso_enabled table and 2. It removes the vm_table.
> Please separate these two in such a way that the second (removal of
> vm_table) can be done at the end and is not related to any particular
> table under vm_table. I prefer it that way so that the removal of
> vm_table does not block the upstreaming of a move that is already
> reviewed and ready.
>
Thank you for your advice ! I will modify it in series patches v5.
>> -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;
>> }
>> --
>> 2.34.1
>>
Powered by blists - more mailing lists