[RFC PATCH 38/39] arm64: move vector-length sysctl context to priv

From: wen . yang

Date: Wed Oct 28 2026 - 12:44:24 EST


From: Wen Yang <wen.yang@xxxxxxxxx>

The two default-vector-length entries borrow extra1 for a struct vl_info
pointer, which is not a bound, while the handler delegates with a local
int table.

Pass vl_info through priv and leave extra1/extra2 to the numeric bounds.

Signed-off-by: Wen Yang <wen.yang@xxxxxxxxx>
---
arch/arm64/kernel/fpsimd.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
index ecfa21615f16..97e746bca99b 100644
--- a/arch/arm64/kernel/fpsimd.c
+++ b/arch/arm64/kernel/fpsimd.c
@@ -549,15 +549,14 @@ static unsigned int find_supported_vector_length(enum vec_type type,
static int vec_proc_do_default_vl(const struct ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
- struct vl_info *info = table->extra1;
+ struct vl_info *info = table->priv;
enum vec_type type = info->type;
int ret;
int vl = get_default_vl(type);
- struct ctl_table tmp_table = {
- .data = &vl,
- .maxlen = sizeof(vl),
- };
+ struct ctl_table tmp_table = *table;

+ tmp_table.data = &vl;
+ tmp_table.maxlen = sizeof(vl);
ret = proc_dointvec(&tmp_table, write, buffer, lenp, ppos);
if (ret || !write)
return ret;
@@ -578,7 +577,7 @@ static const struct ctl_table sve_default_vl_table[] = {
.procname = "sve_default_vector_length",
.mode = 0644,
.proc_handler = vec_proc_do_default_vl,
- .extra1 = &vl_info[ARM64_VEC_SVE],
+ .priv = &vl_info[ARM64_VEC_SVE],
},
};

@@ -601,7 +600,7 @@ static const struct ctl_table sme_default_vl_table[] = {
.procname = "sme_default_vector_length",
.mode = 0644,
.proc_handler = vec_proc_do_default_vl,
- .extra1 = &vl_info[ARM64_VEC_SME],
+ .priv = &vl_info[ARM64_VEC_SME],
},
};

--
2.25.1