Commit 19e99e7d authored by Dongxu Sun's avatar Dongxu Sun Committed by Will Deacon

arm64/signal: Alloc tpidr2 sigframe after checking system_supports_tpidr2()

Move tpidr2 sigframe allocation from under the checking of
system_supports_sme() to the checking of system_supports_tpidr2().
Signed-off-by: default avatarDongxu Sun <sundongxu3@huawei.com>
Reviewed-by: default avatarMark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230317124915.1263-3-sundongxu3@huawei.comSigned-off-by: default avatarWill Deacon <will@kernel.org>
parent e9d14f3f
...@@ -893,6 +893,13 @@ static int setup_sigframe_layout(struct rt_sigframe_user_layout *user, ...@@ -893,6 +893,13 @@ static int setup_sigframe_layout(struct rt_sigframe_user_layout *user,
return err; return err;
} }
if (system_supports_tpidr2()) {
err = sigframe_alloc(user, &user->tpidr2_offset,
sizeof(struct tpidr2_context));
if (err)
return err;
}
if (system_supports_sme()) { if (system_supports_sme()) {
unsigned int vl; unsigned int vl;
unsigned int vq = 0; unsigned int vq = 0;
...@@ -902,11 +909,6 @@ static int setup_sigframe_layout(struct rt_sigframe_user_layout *user, ...@@ -902,11 +909,6 @@ static int setup_sigframe_layout(struct rt_sigframe_user_layout *user,
else else
vl = task_get_sme_vl(current); vl = task_get_sme_vl(current);
err = sigframe_alloc(user, &user->tpidr2_offset,
sizeof(struct tpidr2_context));
if (err)
return err;
if (thread_za_enabled(&current->thread)) if (thread_za_enabled(&current->thread))
vq = sve_vq_from_vl(vl); vq = sve_vq_from_vl(vl);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment