提交 521fdc79 编写于 作者: M Mark Brown 提交者: Wang ShaoBo

arm64/sve: Rename find_supported_vector_length()

mainline inclusion
from mainline-v5.16-rc1
commit 059613f5
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5ITJT
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=059613f546b67423a5b49cb6e6fa8b72fbaa4e0b

-------------------------------------------------

The function has SVE specific checks in it and it will be more trouble
to add conditional code for SME than it is to simply rename it to be SVE
specific.
Signed-off-by: NMark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20211019172247.3045838-6-broonie@kernel.orgSigned-off-by: NWill Deacon <will@kernel.org>
Signed-off-by: NWang ShaoBo <bobo.shaobowang@huawei.com>
上级 6100510a
...@@ -335,7 +335,7 @@ static void fpsimd_save(void) ...@@ -335,7 +335,7 @@ static void fpsimd_save(void)
* If things go wrong there's a bug somewhere, but try to fall back to a * If things go wrong there's a bug somewhere, but try to fall back to a
* safe choice. * safe choice.
*/ */
static unsigned int find_supported_vector_length(unsigned int vl) static unsigned int find_supported_sve_vector_length(unsigned int vl)
{ {
int bit; int bit;
int max_vl = sve_max_vl; int max_vl = sve_max_vl;
...@@ -377,7 +377,7 @@ static int sve_proc_do_default_vl(struct ctl_table *table, int write, ...@@ -377,7 +377,7 @@ static int sve_proc_do_default_vl(struct ctl_table *table, int write,
if (!sve_vl_valid(vl)) if (!sve_vl_valid(vl))
return -EINVAL; return -EINVAL;
set_sve_default_vl(find_supported_vector_length(vl)); set_sve_default_vl(find_supported_sve_vector_length(vl));
return 0; return 0;
} }
...@@ -596,7 +596,7 @@ int sve_set_vector_length(struct task_struct *task, ...@@ -596,7 +596,7 @@ int sve_set_vector_length(struct task_struct *task,
if (vl > SVE_VL_ARCH_MAX) if (vl > SVE_VL_ARCH_MAX)
vl = SVE_VL_ARCH_MAX; vl = SVE_VL_ARCH_MAX;
vl = find_supported_vector_length(vl); vl = find_supported_sve_vector_length(vl);
if (flags & (PR_SVE_VL_INHERIT | if (flags & (PR_SVE_VL_INHERIT |
PR_SVE_SET_VL_ONEXEC)) PR_SVE_SET_VL_ONEXEC))
...@@ -871,14 +871,14 @@ void __init sve_setup(void) ...@@ -871,14 +871,14 @@ void __init sve_setup(void)
* Sanity-check that the max VL we determined through CPU features * Sanity-check that the max VL we determined through CPU features
* corresponds properly to sve_vq_map. If not, do our best: * corresponds properly to sve_vq_map. If not, do our best:
*/ */
if (WARN_ON(sve_max_vl != find_supported_vector_length(sve_max_vl))) if (WARN_ON(sve_max_vl != find_supported_sve_vector_length(sve_max_vl)))
sve_max_vl = find_supported_vector_length(sve_max_vl); sve_max_vl = find_supported_sve_vector_length(sve_max_vl);
/* /*
* For the default VL, pick the maximum supported value <= 64. * For the default VL, pick the maximum supported value <= 64.
* VL == 64 is guaranteed not to grow the signal frame. * VL == 64 is guaranteed not to grow the signal frame.
*/ */
set_sve_default_vl(find_supported_vector_length(64)); set_sve_default_vl(find_supported_sve_vector_length(64));
bitmap_andnot(tmp_map, sve_vq_partial_map, sve_vq_map, bitmap_andnot(tmp_map, sve_vq_partial_map, sve_vq_map,
SVE_VQ_MAX); SVE_VQ_MAX);
...@@ -1064,7 +1064,7 @@ void fpsimd_flush_thread(void) ...@@ -1064,7 +1064,7 @@ void fpsimd_flush_thread(void)
if (WARN_ON(!sve_vl_valid(vl))) if (WARN_ON(!sve_vl_valid(vl)))
vl = SVE_VL_MIN; vl = SVE_VL_MIN;
supported_vl = find_supported_vector_length(vl); supported_vl = find_supported_sve_vector_length(vl);
if (WARN_ON(supported_vl != vl)) if (WARN_ON(supported_vl != vl))
vl = supported_vl; vl = supported_vl;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册