linux-user: Minimum Sig Handler Stack Size for PPC64 ELF V2
authorTom Musta <tommusta@gmail.com>
Tue, 12 Aug 2014 18:53:40 +0000 (13:53 -0500)
committerRiku Voipio <riku.voipio@linaro.org>
Fri, 22 Aug 2014 12:06:35 +0000 (15:06 +0300)
The ELF V2 ABI for PPC64 defines MINSIGSTKSZ as 4096 bytes whereas it was
2048 previously.

Signed-off-by: Tom Musta <tommusta@gmail.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
18 files changed:
linux-user/aarch64/syscall.h
linux-user/alpha/syscall.h
linux-user/arm/syscall.h
linux-user/cris/syscall.h
linux-user/i386/syscall.h
linux-user/m68k/syscall.h
linux-user/microblaze/syscall.h
linux-user/mips/syscall.h
linux-user/mips64/syscall.h
linux-user/openrisc/syscall.h
linux-user/ppc/syscall.h
linux-user/s390x/syscall.h
linux-user/sh4/syscall.h
linux-user/signal.c
linux-user/sparc/syscall.h
linux-user/sparc64/syscall.h
linux-user/unicore32/syscall.h
linux-user/x86_64/syscall.h

index 18f44a8a40b36de0760a06fad4c7c34e07eaa1d3..d1f48232f38439276c694d503bc002ae030eca3a 100644 (file)
@@ -8,3 +8,4 @@ struct target_pt_regs {
 #define UNAME_MACHINE "aarch64"
 #define UNAME_MINIMUM_RELEASE "3.8.0"
 #define TARGET_CLONE_BACKWARDS
+#define TARGET_MINSIGSTKSZ       2048
index ed13d9a71869865d6a1a5a71152836851216c016..3adedeba3099742532eced3534e883632fbd6973 100644 (file)
@@ -252,3 +252,4 @@ struct target_pt_regs {
 #define TARGET_UAC_NOPRINT             1
 #define TARGET_UAC_NOFIX               2
 #define TARGET_UAC_SIGBUS              4
+#define TARGET_MINSIGSTKSZ              4096
index e0d2cc3e5d1940e48000915a6a117dc35dc14b5d..cdadb0ce82c65fee4646d6f3d91574ef334489cd 100644 (file)
@@ -44,3 +44,5 @@ struct target_pt_regs {
 #define UNAME_MINIMUM_RELEASE "2.6.32"
 
 #define TARGET_CLONE_BACKWARDS
+
+#define TARGET_MINSIGSTKSZ 2048
index f5783c0557b0d10f14c02d19d9e71fc6735eb7e2..a75bcc49ea756bc0a86027e7de406db263b24939 100644 (file)
@@ -39,5 +39,6 @@ struct target_pt_regs {
 };
 
 #define TARGET_CLONE_BACKWARDS2
+#define TARGET_MINSIGSTKSZ 2048
 
 #endif
index 9bfc1ad8f79a63d2b9ce4a4a9a31d22d1993332c..acf685622d1c6dfb008e6509c6c6066d685951f0 100644 (file)
@@ -147,3 +147,4 @@ struct target_vm86plus_struct {
 #define UNAME_MINIMUM_RELEASE "2.6.32"
 
 #define TARGET_CLONE_BACKWARDS
+#define TARGET_MINSIGSTKSZ 2048
index 889eaf732324428f3e796e68f0d8de042b89f5e9..f8553f8c11aff21a18fab43415610355b58e5766 100644 (file)
@@ -18,4 +18,6 @@ struct target_pt_regs {
 #define UNAME_MACHINE "m68k"
 #define UNAME_MINIMUM_RELEASE "2.6.32"
 
+#define TARGET_MINSIGSTKSZ 2048
+
 void do_m68k_simcall(CPUM68KState *, int);
index 5b5f6b447d1179937b39d9bc323962ba7de14e69..2a5e160b0304e4931ad6b0d57c39551665c6442b 100644 (file)
@@ -49,5 +49,6 @@ struct target_pt_regs {
 };
 
 #define TARGET_CLONE_BACKWARDS
+#define TARGET_MINSIGSTKSZ      2048
 
 #endif
index 5bc56962a45cf8cef7ba5f59ed701863077475de..0b4662c1d70dfd81eccf2aabac44128c6efdac99 100644 (file)
@@ -228,3 +228,4 @@ struct target_pt_regs {
 #define UNAME_MINIMUM_RELEASE "2.6.32"
 
 #define TARGET_CLONE_BACKWARDS
+#define TARGET_MINSIGSTKSZ 2048
index a7f5a5802a4d7d3d613f224d3ffdcfd5ee270485..39b8bedf05acbbfd7130376a89e912f5d84818f4 100644 (file)
@@ -225,3 +225,4 @@ struct target_pt_regs {
 #define UNAME_MINIMUM_RELEASE "2.6.32"
 
 #define TARGET_CLONE_BACKWARDS
+#define TARGET_MINSIGSTKSZ      2048
index c3b36da83c340245393ab9ad13d79c7dcdc39056..e5e618099f83150dd76caabc7c25258d398e3f6f 100644 (file)
@@ -23,3 +23,5 @@ struct target_pt_regs {
 
 #define UNAME_MACHINE "openrisc"
 #define UNAME_MINIMUM_RELEASE "2.6.32"
+
+#define TARGET_MINSIGSTKSZ 2048
index db92bbee17f9cd82443fd9e08a87ca9742c3660f..5311cc6987b1c920f0f544976a8e8a4977c8c421 100644 (file)
@@ -69,3 +69,5 @@ struct target_revectored_struct {
 #define UNAME_MINIMUM_RELEASE "2.6.32"
 
 #define TARGET_CLONE_BACKWARDS
+
+#define TARGET_MINSIGSTKSZ 2048
index aaad512d4d18328dacff3ba369f54c2e00d8b151..b11a3b2690451a6adcb2af162403da0de4618900 100644 (file)
@@ -24,3 +24,4 @@ struct target_pt_regs {
 #define UNAME_MINIMUM_RELEASE "2.6.32"
 
 #define TARGET_CLONE_BACKWARDS2
+#define TARGET_MINSIGSTKSZ        2048
index ccd2216e38e0d2e7e88a2d6898440a5d8fd72fef..285ecf3a79fc3162644d3dd55aff161976bd15db 100644 (file)
@@ -11,3 +11,5 @@ struct target_pt_regs {
 
 #define UNAME_MACHINE "sh4"
 #define UNAME_MINIMUM_RELEASE "2.6.32"
+
+#define TARGET_MINSIGSTKSZ 2048
index 1141054be2170128d6f7a340b41484b49a255936..26929c59de92b72f9e38be2bdad009cb2a335141 100644 (file)
@@ -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 = TARGET_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;
index 9549ea0a2f474a3b45e727a537699639e579e827..ae4074414f1d9bf84ea8b9ca7779787caa1f4a1b 100644 (file)
@@ -15,3 +15,4 @@ struct target_pt_regs {
  * and copy_thread().
  */
 #define TARGET_CLONE_BACKWARDS
+#define TARGET_MINSIGSTKSZ      4096
index 82b1680cb6c404a6f02a53ed035c983403953268..816a00f568242a68b73b4e8be9dafe2e1b8d0dde 100644 (file)
@@ -16,3 +16,4 @@ struct target_pt_regs {
  * and copy_thread().
  */
 #define TARGET_CLONE_BACKWARDS
+#define TARGET_MINSIGSTKSZ      4096
index f7e55254cfc5286f3795eeb8c31d244c5e05f9f9..3ed623721afbf2f749464e361b7c0e2878f39814 100644 (file)
@@ -53,4 +53,6 @@ struct target_pt_regs {
 #define UNAME_MACHINE "UniCore-II"
 #define UNAME_MINIMUM_RELEASE "2.6.32"
 
+#define TARGET_MINSIGSTKSZ 2048
+
 #endif /* __UC32_SYSCALL_H__ */
index e03b5a0cfc48b12d79ecf1b5a3534b03cb1d3c8a..5828b91026f0d4712d3aeab99b13c4305d715d15 100644 (file)
@@ -97,3 +97,4 @@ struct target_msqid64_ds {
 #define TARGET_ARCH_SET_FS 0x1002
 #define TARGET_ARCH_GET_FS 0x1003
 #define TARGET_ARCH_GET_GS 0x1004
+#define TARGET_MINSIGSTKSZ 2048