linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>,
	Nicholas Piggin <npiggin@gmail.com>,
	Alan Modra <amodra@gmail.com>
Subject: [PATCH 1/2] powerpc/64: Bump SIGSTKSZ and MINSIGSTKSZ
Date: Tue,  8 Mar 2022 04:27:33 +1000	[thread overview]
Message-ID: <20220307182734.289289-1-npiggin@gmail.com> (raw)

The sad tale of SIGSTKSZ and MINSIGSTKSZ is documented in glibc.git
commit f7c399cff5bd ("PowerPC SIGSTKSZ"), which explains why glibc
does not use the kernel defines for these constants. Since then in
fact there has been a further expansion of the signal stack frame size
on little-endian with linux commit 573ebfa6601f ("powerpc: Increase
stack redzone for 64-bit userspace to 512 bytes"), which has caused
it to exceed even the glibc defines.

Increase MINSIGSTKSZ to 8192 which is double the current glibc value
and fits the current stack frame with room to grow. SIGSTKSZ is set
to 4x the minimum as convention.

glibc will have to be updated as well.

Cc: Alan Modra <amodra@gmail.com>
Cc: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 arch/powerpc/include/uapi/asm/signal.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/powerpc/include/uapi/asm/signal.h b/arch/powerpc/include/uapi/asm/signal.h
index 04873dd311c2..81fa9d90be80 100644
--- a/arch/powerpc/include/uapi/asm/signal.h
+++ b/arch/powerpc/include/uapi/asm/signal.h
@@ -62,8 +62,13 @@ typedef struct {
 
 #define SA_RESTORER	0x04000000U
 
+#ifdef __powerpc64__
+#define MINSIGSTKSZ	8192
+#define SIGSTKSZ	32768
+#else
 #define MINSIGSTKSZ	2048
 #define SIGSTKSZ	8192
+#endif
 
 #include <asm-generic/signal-defs.h>
 
-- 
2.23.0


             reply	other threads:[~2022-03-07 18:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-07 18:27 Nicholas Piggin [this message]
2022-03-07 18:27 ` [PATCH 2/2] powerpc/signal: Report minimum signal frame size to userspace via AT_MINSIGSTKSZ Nicholas Piggin
2022-05-18 12:24   ` Tulio Magno Quites Machado Filho
2022-05-24 11:08 ` [PATCH 1/2] powerpc/64: Bump SIGSTKSZ and MINSIGSTKSZ Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220307182734.289289-1-npiggin@gmail.com \
    --to=npiggin@gmail.com \
    --cc=amodra@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=tuliom@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).