From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 6CBD33858D28 for ; Wed, 3 May 2023 16:12:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6CBD33858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=linux.vnet.ibm.com Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 343GB6O7021907; Wed, 3 May 2023 16:12:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=content-type : message-id : date : mime-version : subject : to : cc : references : from : in-reply-to; s=pp1; bh=Ty7ARKZmqCmAjWOCdXv160sp/5CtzwIBlvsgVgArs7k=; b=bJ1NbYM/0S8Z/ROcP5wE4BDQttM5p2lCFYgRjX95KTwsJK7cnrXPcgqWPcv8aCCHfMya epsex5HNkoP/NaouXs6K4dQRm+ADsF4L+2yvTyWFZQCoi6Dw/3wOv+UhCofhGzv8lyMX /s7xYlWJRQv/hFujA0/Gpn5SBwRbB1zHG7zKxyB//g/gsXIZzNr+U0x/tNPfpPOYbEqY fb7XLLXxTGIXHCIQ7XEatEou+JZnYtUjfkA2EBXIC7+BEXZwzUSHBvyPvQd4oQOpXl9O TSIUeA0sKzi9T0d0seIxQd26DDXeDV9GZHb1TCIG4Kshy7R6zNNxmfSKvFEiNl0Wugt1 sw== Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qbtwng28u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 03 May 2023 16:12:31 +0000 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 343F0rph002647; Wed, 3 May 2023 16:12:15 GMT Received: from smtprelay06.dal12v.mail.ibm.com ([9.208.130.100]) by ppma02wdc.us.ibm.com (PPS) with ESMTPS id 3q8tv8d95m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 03 May 2023 16:12:15 +0000 Received: from smtpav01.wdc07v.mail.ibm.com (smtpav01.wdc07v.mail.ibm.com [10.39.53.228]) by smtprelay06.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 343GCEgA40239506 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 3 May 2023 16:12:14 GMT Received: from smtpav01.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3808458055; Wed, 3 May 2023 16:12:14 +0000 (GMT) Received: from smtpav01.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 383DD5804B; Wed, 3 May 2023 16:12:12 +0000 (GMT) Received: from [9.43.29.242] (unknown [9.43.29.242]) by smtpav01.wdc07v.mail.ibm.com (Postfix) with ESMTP; Wed, 3 May 2023 16:12:11 +0000 (GMT) Content-Type: multipart/alternative; boundary="------------0wkDqTmy5f0fc9MtimV5gj59" Message-ID: <7620a9b1-fe92-0764-6011-81d3a19e5590@linux.vnet.ibm.com> Date: Wed, 3 May 2023 21:42:10 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [PATCH] powerpc: Use sysconf (_SC_SIGSTKSZ) to set SIGSTKSZ and MINSIGSTKSZ. To: Tulio Magno Quites Machado Filho , Manjunath Matti via Libc-alpha Cc: rajis@linux.ibm.com, Manjunath Matti References: <20230424105208.301614-1-mmatti@linux.ibm.com> <874jozevbl.fsf@ascii.art.br> From: Manjunath S Matti In-Reply-To: <874jozevbl.fsf@ascii.art.br> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: SDTo0WKoS4znapnH1LPLeaoc5ilByr05 X-Proofpoint-GUID: SDTo0WKoS4znapnH1LPLeaoc5ilByr05 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-03_11,2023-05-03_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 bulkscore=0 phishscore=0 mlxscore=0 lowpriorityscore=0 spamscore=0 adultscore=0 clxscore=1011 suspectscore=0 malwarescore=0 impostorscore=0 mlxlogscore=622 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2305030132 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,GIT_PATCH_0,HTML_MESSAGE,NICE_REPLY_A,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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 List-Id: This is a multi-part message in MIME format. --------------0wkDqTmy5f0fc9MtimV5gj59 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 28/04/23 11:35 pm, Tulio Magno Quites Machado Filho wrote: > Manjunath Matti via Libc-alpha writes: > >> Add support in PowerPC to use sysconf (_SC_SIGSTKSZ) to set SIGSTKSZ >> and MINSIGSTKSZ similar to x86. > This commit message explains what is being done, but it doesn't make it > clear why this commit is important. > If I understand correctly, the goal is to have dynamic values for the > signal stack size and minimum signal stack size. Is this correct? Yes that is correct, file: sysdeps/unix/sysv/linux/dl-parse_auxv.h  52   _dl_random = (void *) auxv_values[AT_RANDOM];  53   GLRO(dl_minsigstacksize) = auxv_values[AT_MINSIGSTKSZ]; <-- gets the value from kernel.  54   GLRO(dl_sysinfo_dso) = (void *) auxv_values[AT_SYSINFO_EHDR]; > I also suggest to mention the kernel commit ID that started doing this: > 2896b2dff49d0377e4372f470dcddbcb26f2be59 Yes I will add it. >> 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..2bec1e7917 >> --- /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) 2020-2023 Free Software Foundation, Inc. > ^ I believe this should be just 2023. Ack. > >> +#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) > I have been told that structs could be using SIGSTKSZ to set their size. > If that's happening, the softwares using them will stop building after this > change. > Is this reasonable? > >> +/* Minimum stack size for a signal handler: SIGSTKSZ/4. */ >> +# undef MINSIGSTKSZ >> +# define MINSIGSTKSZ (SIGSTKSZ >> 2) >> +#endif > I didn't understand this part. > Why SIGSTKSZ/4 ? I know this is correct now, but I think the kernel is > allowed to use another value. > Why is this part not using sysconf(_SC_MINSIGSTKSZ)? > I'm not suggesting to use sysconf() here, but I'm trying to understand > why the same source of value for both SIGSTKSZ and MINSIGSTKSZ is not > being used. In file: sysdeps/unix/sysv/linux/sysconf-sigstksz.h  28   if (minsigstacksize < MINSIGSTKSZ)  29     minsigstacksize = MINSIGSTKSZ;  30   /* MAX (MINSIGSTKSZ, sysconf (_SC_MINSIGSTKSZ)) * 4.  */  31   long int sigstacksize = minsigstacksize * 4; So we are not changing the default implementation. > If we reach consensus that both macros in this file can have values set > at runtime, then I it might be worth adding a test in order to check that > dl_minsigstacksize, MINSIGSTKSZ and AT_MINSIGSTKSZ passed by the kernel > are identical. > There are testcases which already use MINSIGSTKSZ sysdeps/pthread/tst-signal6.c signal/tst-minsigstksz-5.c I will resubmit my patch with the changes I have acknowledged. Thanks for your time and support. Manjunath Matti. --------------0wkDqTmy5f0fc9MtimV5gj59--