On 04.08.14 19:39, Peter Maydell wrote:
On 4 August 2014 17:45, Tom Musta <tommu...@gmail.com> wrote:
The ELF V2 ABI for PPC64 defines MINSIGSTKSZ as 4096 bytes whereas it was
2048 previously.
Alpha and SPARC also have a 4096 byte MINSIGSTKSZ...

Signed-off-by: Tom Musta <tommu...@gmail.com>

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
Shouldn't we just define and use a TARGET_MINSIGSTKSZ ?
Checking against the host's MINSIGSTKSZ is wrong, I think.

Again, define the TARGET_MINSIGSTKSZ in a file in
linux-user/$ARCH/, for all targets:
  alpha, sparc, ppc64: 4096
  everything else: 2048
(itanium is weird here but we don't support that for linux-user guests)

and supporting ia64 is really hard, because it uses the full 64bit virtual address space which we can't provide on x86_64.


Alex


Reply via email to