From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 42336385625F for ; Wed, 4 May 2022 13:10:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 42336385625F Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 244D5G33009114 for ; Wed, 4 May 2022 13:10:32 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3fussfrq4y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 04 May 2022 13:10:32 +0000 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 244D5Ws7011273 for ; Wed, 4 May 2022 13:10:31 GMT Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3fussfrq3s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 May 2022 13:10:31 +0000 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 244D82kE026397; Wed, 4 May 2022 13:10:29 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma02fra.de.ibm.com with ESMTP id 3frvr8vjut-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 May 2022 13:10:29 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 244DANgl27656638 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 4 May 2022 13:10:23 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AE773A4067; Wed, 4 May 2022 13:10:26 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7B9D4A405F; Wed, 4 May 2022 13:10:26 +0000 (GMT) Received: from [9.145.85.108] (unknown [9.145.85.108]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 4 May 2022 13:10:26 +0000 (GMT) Message-ID: Date: Wed, 4 May 2022 15:10:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH 2/5] Linux: Define MMAP_CALL_INTERNAL Content-Language: en-US To: Florian Weimer Cc: libc-alpha@sourceware.org References: <74b7baf4b2b0ff4264b87dac0850eb8ef6aa04ee.1651518694.git.fweimer@redhat.com> <87wnf2eaek.fsf@oldenburg.str.redhat.com> From: Stefan Liebler In-Reply-To: <87wnf2eaek.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: OX6BbQAZtDqh-NCup9Ztpge3yhzWTBGO X-Proofpoint-ORIG-GUID: NoQMamEnZ7otVVzQQokCpRxaOPtYR6Kb Content-Transfer-Encoding: 7bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-04_04,2022-05-04_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 adultscore=0 priorityscore=1501 malwarescore=0 clxscore=1015 mlxscore=0 lowpriorityscore=0 spamscore=0 mlxlogscore=999 phishscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205040082 X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, NICE_REPLY_A, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-List-Received-Date: Wed, 04 May 2022 13:10:35 -0000 On 03/05/2022 20:30, Florian Weimer wrote: > * Florian Weimer via Libc-alpha: > >> Unlike MMAP_CALL, this avoids a TCB dependency for an errno update >> on failure. >> >> cannot be included as is on several architectures >> due to the definition of page_unit, so introduce a separate header >> file for the definition of MMAP_CALL and MMAP_CALL_INTERNAL, >> . >> --- >> sysdeps/unix/sysv/linux/mmap_call.h | 22 +++++++++++++++++++ >> sysdeps/unix/sysv/linux/mmap_internal.h | 6 +---- >> .../s390/{mmap_internal.h => mmap_call.h} | 14 ++++++------ >> 3 files changed, 30 insertions(+), 12 deletions(-) >> create mode 100644 sysdeps/unix/sysv/linux/mmap_call.h >> rename sysdeps/unix/sysv/linux/s390/{mmap_internal.h => mmap_call.h} (78%) >> >> diff --git a/sysdeps/unix/sysv/linux/mmap_call.h b/sysdeps/unix/sysv/linux/mmap_call.h >> new file mode 100644 >> index 0000000000..3547c99e14 >> --- /dev/null >> +++ b/sysdeps/unix/sysv/linux/mmap_call.h >> @@ -0,0 +1,22 @@ >> +/* Generic definition of MMAP_CALL and MMAP_CALL_INTERNAL. >> + Copyright (C) 2017-2022 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 >> + . */ >> + >> +#define MMAP_CALL(__nr, __addr, __len, __prot, __flags, __fd, __offset) \ >> + INLINE_SYSCALL_CALL (__nr, __addr, __len, __prot, __flags, __fd, __offset) >> +#define MMAP_CALL_INTERNAL(__nr, __addr, __len, __prot, __flags, __fd, __offset) \ >> + INTERNAL_SYSCALL_CALL (__nr, __addr, __len, __prot, __flags, __fd, __offset) >> diff --git a/sysdeps/unix/sysv/linux/mmap_internal.h b/sysdeps/unix/sysv/linux/mmap_internal.h >> index 841b731391..aebf97d064 100644 >> --- a/sysdeps/unix/sysv/linux/mmap_internal.h >> +++ b/sysdeps/unix/sysv/linux/mmap_internal.h >> @@ -42,10 +42,6 @@ static uint64_t page_unit; >> /* Do not accept offset not multiple of page size. */ >> #define MMAP_OFF_LOW_MASK (MMAP2_PAGE_UNIT - 1) >> >> -/* An architecture may override this. */ >> -#ifndef MMAP_CALL >> -# define MMAP_CALL(__nr, __addr, __len, __prot, __flags, __fd, __offset) \ >> - INLINE_SYSCALL_CALL (__nr, __addr, __len, __prot, __flags, __fd, __offset) >> -#endif >> +#include >> >> #endif /* MMAP_INTERNAL_LINUX_H */ >> diff --git a/sysdeps/unix/sysv/linux/s390/mmap_internal.h b/sysdeps/unix/sysv/linux/s390/mmap_call.h >> similarity index 78% >> rename from sysdeps/unix/sysv/linux/s390/mmap_internal.h >> rename to sysdeps/unix/sysv/linux/s390/mmap_call.h >> index cc76ac9735..f169b8bab9 100644 >> --- a/sysdeps/unix/sysv/linux/s390/mmap_internal.h >> +++ b/sysdeps/unix/sysv/linux/s390/mmap_call.h >> @@ -16,9 +16,6 @@ >> License along with the GNU C Library; if not, see >> . */ >> >> -#ifndef MMAP_S390_INTERNAL_H >> -# define MMAP_S390_INTERNAL_H >> - >> #define MMAP_CALL(__nr, __addr, __len, __prot, __flags, __fd, __offset) \ >> ({ \ >> long int __args[6] = { (long int) (__addr), (long int) (__len), \ >> @@ -26,7 +23,10 @@ >> (long int) (__fd), (long int) (__offset) }; \ >> INLINE_SYSCALL_CALL (__nr, __args); \ >> }) >> - >> -#include_next >> - >> -#endif >> +#define MMAP_CALL_INTERNAL(__nr, __addr, __len, __prot, __flags, __fd, __offset) \ >> + ({ \ >> + long int __args[6] = { (long int) (__addr), (long int) (__len), \ >> + (long int) (__prot), (long int) (__flags), \ >> + (long int) (__fd), (long int) (__offset) }; \ >> + INTERNAL_SYSCALL_CALL (__nr, __args); \ >> + }) > > Stefan, would you be able to review this patch? It's mostly an S390 > change, after all. > > Thanks, > Florian > Sure. The patch looks good to me. Moving the definition of MMAP_CALL is just a mechanical change. The definition of MMAP_CALL_INTERNAL is similar and no other architecture than s390x has its own definition of MMAP_CALL. Thanks. Reviewed-by: Stefan Liebler