qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 09/12] linux-user: Minimum Sig Handler Stack Siz


From: Alexander Graf
Subject: Re: [Qemu-devel] [PATCH 09/12] linux-user: Minimum Sig Handler Stack Size for PPC64 ELF V2
Date: Tue, 12 Aug 2014 17:57:06 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.0


On 04.08.14 19:39, Peter Maydell wrote:
On 4 August 2014 17:45, Tom Musta <address@hidden> 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 <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
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

[Prev in Thread] Current Thread [Next in Thread]