[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 13/15] linux-user/s390x: Add build asserts for sigset sizes
From: |
Richard Henderson |
Subject: |
[PATCH v2 13/15] linux-user/s390x: Add build asserts for sigset sizes |
Date: |
Wed, 28 Apr 2021 12:34:06 -0700 |
At point of usage, it's not immediately obvious that
we don't need a loop to copy these arrays.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
linux-user/s390x/signal.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/linux-user/s390x/signal.c b/linux-user/s390x/signal.c
index 81ba59b46a..839a7ae4b3 100644
--- a/linux-user/s390x/signal.c
+++ b/linux-user/s390x/signal.c
@@ -141,6 +141,8 @@ void setup_frame(int sig, struct target_sigaction *ka,
return;
}
+ /* Make sure that we're initializing all of oldmask. */
+ QEMU_BUILD_BUG_ON(ARRAY_SIZE(frame->sc.oldmask) != 1);
__put_user(set->sig[0], &frame->sc.oldmask[0]);
save_sigregs(env, &frame->sregs);
@@ -266,6 +268,9 @@ long do_sigreturn(CPUS390XState *env)
force_sig(TARGET_SIGSEGV);
return -TARGET_QEMU_ESIGRETURN;
}
+
+ /* Make sure that we're initializing all of target_set. */
+ QEMU_BUILD_BUG_ON(ARRAY_SIZE(target_set.sig) != 1);
__get_user(target_set.sig[0], &frame->sc.oldmask[0]);
target_to_host_sigset_internal(&set, &target_set);
--
2.25.1
- [PATCH v2 05/15] linux-user/s390x: Fix trace in restore_regs, (continued)
- [PATCH v2 05/15] linux-user/s390x: Fix trace in restore_regs, Richard Henderson, 2021/04/28
- [PATCH v2 07/15] linux-user/s390x: Use tswap_sigset in setup_rt_frame, Richard Henderson, 2021/04/28
- [PATCH v2 08/15] linux-user/s390x: Tidy save_sigregs, Richard Henderson, 2021/04/28
- [PATCH v2 10/15] linux-user/s390x: Set psw.mask properly for the signal handler, Richard Henderson, 2021/04/28
- [PATCH v2 11/15] linux-user/s390x: Add stub sigframe argument for last_break, Richard Henderson, 2021/04/28
- [PATCH v2 13/15] linux-user/s390x: Add build asserts for sigset sizes,
Richard Henderson <=
- [PATCH v2 09/15] linux-user/s390x: Clean up single-use gotos in signal.c, Richard Henderson, 2021/04/28
- [PATCH v2 12/15] linux-user/s390x: Fix frame_addr corruption in setup_frame, Richard Henderson, 2021/04/28
- [PATCH v2 15/15] linux-user/s390x: Handle vector regs in signal stack, Richard Henderson, 2021/04/28
- [PATCH v2 14/15] linux-user/s390x: Clean up signal.c, Richard Henderson, 2021/04/28
- Re: [PATCH v2 00/15] linux-user/s390x: some signal fixes, Richard Henderson, 2021/04/28