[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 09/12] linux-user: Minimum Sig Handler Stack Size for
From: |
Tom Musta |
Subject: |
[Qemu-ppc] [PATCH 09/12] linux-user: Minimum Sig Handler Stack Size for PPC64 ELF V2 |
Date: |
Mon, 4 Aug 2014 11:45:36 -0500 |
The ELF V2 ABI for PPC64 defines MINSIGSTKSZ as 4096 bytes whereas it was
2048 previously.
Signed-off-by: Tom Musta <address@hidden>
diff --git a/linux-user/signal.c b/linux-user/signal.c
index cdfcc52..b2a6e53 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -617,6 +617,15 @@ abi_long do_sigaltstack(abi_ulong uss_addr, abi_ulong
uoss_addr, abi_ulong sp)
{
struct target_sigaltstack *uss;
struct target_sigaltstack ss;
+ size_t minstacksize = MINSIGSTKSZ;
+
+#if defined(TARGET_PPC64)
+ /* ELF V2 for PPC64 has a 4K minimum stack size for signal handlers */
+ struct image_info *image = ((TaskState *)thread_cpu->opaque)->info;
+ if (get_ppc64_abi(image) > 1) {
+ minstacksize = 4096;
+ }
+#endif
ret = -TARGET_EFAULT;
if (!lock_user_struct(VERIFY_READ, uss, uss_addr, 1)) {
@@ -642,8 +651,9 @@ abi_long do_sigaltstack(abi_ulong uss_addr, abi_ulong
uoss_addr, abi_ulong sp)
ss.ss_sp = 0;
} else {
ret = -TARGET_ENOMEM;
- if (ss.ss_size < MINSIGSTKSZ)
+ if (ss.ss_size < minstacksize) {
goto out;
+ }
}
target_sigaltstack_used.ss_sp = ss.ss_sp;
--
1.7.1
- [Qemu-ppc] [PATCH 04/12] linux-user: Make ipc syscall's third argument an abi_long, (continued)
- [Qemu-ppc] [PATCH 04/12] linux-user: Make ipc syscall's third argument an abi_long, Tom Musta, 2014/08/04
- [Qemu-ppc] [PATCH 05/12] linux-user: Conditionally Pass Attribute Pointer to mq_open(), Tom Musta, 2014/08/04
- [Qemu-ppc] [PATCH 06/12] linux-user: Detect Negative Message Sizes in msgsnd System Call, Tom Musta, 2014/08/04
- [Qemu-ppc] [PATCH 07/12] linux-user: Handle NULL argument to sched_{get, set}param, Tom Musta, 2014/08/04
- [Qemu-ppc] [PATCH 08/12] linux-user: Detect fault in sched_rr_get_interval, Tom Musta, 2014/08/04
- [Qemu-ppc] [PATCH 09/12] linux-user: Minimum Sig Handler Stack Size for PPC64 ELF V2,
Tom Musta <=
- [Qemu-ppc] [PATCH 10/12] linux-user: clock_nanosleep errno Handling on PPC, Tom Musta, 2014/08/04
- [Qemu-ppc] [PATCH 11/12] linux-user: Support target-to-host translation of mlockall argument, Tom Musta, 2014/08/04
- [Qemu-ppc] [PATCH 12/12] linux-user: writev Partial Writes, Tom Musta, 2014/08/04