aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Martin <Dave.Martin@arm.com>2017-10-10 19:38:45 +0100
committerAlex Bennée <alex.bennee@linaro.org>2017-10-13 16:56:26 +0100
commit4c198d11318943554429cbc5a50e55ca5a2c4772 (patch)
treef19257f3f8aa68102270b5d55e9599ebe3e84679
parent684a8d5bb88778fe0f2e332dac09f43f3b9d8639 (diff)
arm64/sve: signal: Include SVE when computing AT_MINSIGSTKSZreview/sve-kernel-support-v3
The SVE context block in the signal frame needs to be considered too when computing the maximum possible signal frame size. Because the size of this block depends on the vector length, this patch computes the size based not on the thread's current vector length but instead on the maximum possible vector length: this determines the maximum size of SVE context block that can be observed in any signal frame for the lifetime of the process. Signed-off-by: Dave Martin <Dave.Martin@arm.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Alex Bennée <alex.bennee@linaro.org>
-rw-r--r--arch/arm64/kernel/signal.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c
index 3382e872a1ac..15bc2ad28179 100644
--- a/arch/arm64/kernel/signal.c
+++ b/arch/arm64/kernel/signal.c
@@ -595,8 +595,18 @@ static int setup_sigframe_layout(struct rt_sigframe_user_layout *user,
if (system_supports_sve()) {
unsigned int vq = 0;
- if (test_thread_flag(TIF_SVE))
- vq = sve_vq_from_vl(current->thread.sve_vl);
+ if (add_all || test_thread_flag(TIF_SVE)) {
+ int vl = sve_max_vl;
+
+ if (!add_all)
+ vl = current->thread.sve_vl;
+
+ /* Fail safe if something wasn't initialised */
+ if (WARN_ON(!sve_vl_valid(vl)))
+ vl = SVE_VL_MIN;
+
+ vq = sve_vq_from_vl(vl);
+ }
err = sigframe_alloc(user, &user->sve_offset,
SVE_SIG_CONTEXT_SIZE(vq));