From patchwork Tue May 16 11:11:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manjunath Matti X-Patchwork-Id: 69463 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DA927385700F for ; Tue, 16 May 2023 11:12:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DA927385700F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1684235555; bh=sAn89Uncf1WtTegelB1J1+AIUuRYzqMRbtXZGpF/b0c=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=kHUhRF0qLG5c54GmWw3mmgsSz+u1c9xMhwukW9FplDH0zL3+KZ0Uc+g3jVCkzJ0Ew BfChEO0DEb4PWqwG5DP9z5KzS/Zz3YiEdSrRAqZ/znLGj+SWR68DHOBYV6ds4xaFJf lYg7EZfeLz3FBZW2tBy7kffRVlNylZ+OSN6xXVGw= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 257F73858439 for ; Tue, 16 May 2023 11:12:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 257F73858439 Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34GAek0N016987 for ; Tue, 16 May 2023 11:12:11 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qm82f14dq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 16 May 2023 11:12:10 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 34G0lQ1q005719 for ; Tue, 16 May 2023 11:12:08 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma06ams.nl.ibm.com (PPS) with ESMTPS id 3qj1tdsjym-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 16 May 2023 11:12:08 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 34GBC5gd40567052 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 16 May 2023 11:12:05 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E8FC62004B; Tue, 16 May 2023 11:12:04 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3DC1920040; Tue, 16 May 2023 11:12:04 +0000 (GMT) Received: from ltcd97-lp3.. (unknown [9.40.194.171]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 16 May 2023 11:12:04 +0000 (GMT) To: libc-alpha@sourceware.org Cc: rajis@linux.ibm.com, Manjunath Matti Subject: [PATCH] powerpc: Use sysconf (_SC_SIGSTKSZ) to set SIGSTKSZ and MINSIGSTKSZ. Date: Tue, 16 May 2023 07:11:40 -0400 Message-Id: <20230516111140.2585699-1-mmatti@linux.ibm.com> X-Mailer: git-send-email 2.37.2 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: oQPgH6W815Ucf8PXBlAEiOcs-S-QaRYk X-Proofpoint-ORIG-GUID: oQPgH6W815Ucf8PXBlAEiOcs-S-QaRYk X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-16_04,2023-05-16_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 bulkscore=0 spamscore=0 suspectscore=0 mlxlogscore=606 impostorscore=0 malwarescore=0 adultscore=0 phishscore=0 priorityscore=1501 clxscore=1015 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305160094 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Manjunath Matti via Libc-alpha From: Manjunath Matti Reply-To: Manjunath Matti Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Add support in PowerPC to use sysconf (_SC_SIGSTKSZ) to set SIGSTKSZ and MINSIGSTKSZ similar to x86. The minimum signal stack size derived from AT_MINSIGSTKSZ, which is the minimum number of bytes of free stack space required in order to gurantee successful, non-nested handling of a single signal whose handler is an empty function. The kernel commit 2896b2dff49d0377e4372f470dcddbcb26f2be59 implements AT_MINSIGSTKSZ AUXV entry, allowing userspace to dynamically size stack allocations. --- .../unix/sysv/linux/powerpc/bits/sigstksz.h | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/powerpc/bits/sigstksz.h diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/sigstksz.h b/sysdeps/unix/sysv/linux/powerpc/bits/sigstksz.h new file mode 100644 index 0000000000..399a49c1b0 --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/bits/sigstksz.h @@ -0,0 +1,33 @@ +/* Definition of MINSIGSTKSZ and SIGSTKSZ. Linux/PowerPC version. + Copyright (C) 2023 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SIGNAL_H +# error "Never include directly; use instead." +#endif + +#if defined __USE_DYNAMIC_STACK_SIZE && __USE_DYNAMIC_STACK_SIZE +# include + +/* Default stack size for a signal handler: sysconf (SC_SIGSTKSZ). */ +# undef SIGSTKSZ +# define SIGSTKSZ sysconf (_SC_SIGSTKSZ) + +/* Minimum stack size for a signal handler: SIGSTKSZ/4. */ +# undef MINSIGSTKSZ +# define MINSIGSTKSZ (SIGSTKSZ >> 2) +#endif