Message ID | 20200430174250.GC29015@arm.com |
---|---|
State | Superseded |
Headers |
Return-Path: <libc-alpha-bounces@sourceware.org> 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 4FCE8396E468; Thu, 30 Apr 2020 17:43:14 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70059.outbound.protection.outlook.com [40.107.7.59]) by sourceware.org (Postfix) with ESMTPS id B3082396D838 for <libc-alpha@sourceware.org>; Thu, 30 Apr 2020 17:43:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B3082396D838 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Szabolcs.Nagy@arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=y9+VXiMU6DcRnWwaex86XBWDhrgkY11WqtnJjadsTkQ=; b=g7cC6frs0rFeirhj5mFPDo+vq4Tx14SHHX+ltU8lHjMVXZ8/u0WEzo/Zvo9izmDVKb9hXtZUBb7ndsXa9y5D5CngfUY8OAJTzGINQvIxzyWwS0L1RP1Nq1M+kVsImfr0NatTC4F2VZPUJ3VN6W9WF/87ILp+y2u7/oJOnQwaUK0= Received: from AM5PR0701CA0054.eurprd07.prod.outlook.com (2603:10a6:203:2::16) by AM5PR0801MB1923.eurprd08.prod.outlook.com (2603:10a6:203:4c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20; Thu, 30 Apr 2020 17:42:59 +0000 Received: from AM5EUR03FT037.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:2:cafe::23) by AM5PR0701CA0054.outlook.office365.com (2603:10a6:203:2::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.11 via Frontend Transport; Thu, 30 Apr 2020 17:42:59 +0000 Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; sourceware.org; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT037.mail.protection.outlook.com (10.152.17.241) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Thu, 30 Apr 2020 17:42:58 +0000 Received: ("Tessian outbound 4cdf5642225a:v54"); Thu, 30 Apr 2020 17:42:58 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ce49f0fe58083f1f X-CR-MTA-TID: 64aa7808 Received: from 5aa76c5a1944.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 09F8248D-504B-4573-B03B-3C84A5FB2914.1; Thu, 30 Apr 2020 17:42:53 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 5aa76c5a1944.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 30 Apr 2020 17:42:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hG2S/qRoD42VPxLe1S6s05cTHmn0FG6sdeO5l2FIXe4KS9X697IqrvOxs48jCxxay82FQ1lvdjqMPZbn6QGcEO9kiFjJPAzq4hB/x4ZgfKs8jpWDRX4d7XwT1+WAuMVhocwlbssXnbFU9PHGpcJ7rY8+K0hJJM1PVeW1ujmmzQW7jC/AGu4ItnNp/LrhwMa66Dw6iXCTVmxSfV/um9aS83IrPpcE8YNquWurY8hvEirBp1aBWWO+EhpKiheRnNurYFtWeGkv1CUidRNbJ8lZTrBGrwP6EGVuzhLFFMkFnmvKNVbZALMH7uYYBfw3c9JDEGBgphL6l0bt0ldVYTDapQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=y9+VXiMU6DcRnWwaex86XBWDhrgkY11WqtnJjadsTkQ=; b=niTlYMhOKeOqLf+qC94CPYEtI2PiQ/LKGIsmE7DpqWYDsKm9d8qfV9mHsYna5JG4Jt4W/9nnPLEbM1OVt7QBFV4KqvH1QuQ5HieMpRTBR5m7A30ysWcOeMwZDuVLQsy12NnFrEYWKhrYFWp2j6Lwxzc9jkOFjt8YuA2nU96x9+H+jZ3ym988ByI+KV+kWAHYCdi06OAwfeq0pYwbZKoLMv0VoUqQCFvq+iYuykF3BuhKIxPsUgxAWPqM3jQ7rKpkxso7G1W/ddrl7Y72Qu04TVbdBYb5AkNHku9nOl3UFYrJCANiJVU0AQo4uHiXOa5k5TS/6GEUKZVRzDtIUn5jFA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=y9+VXiMU6DcRnWwaex86XBWDhrgkY11WqtnJjadsTkQ=; b=g7cC6frs0rFeirhj5mFPDo+vq4Tx14SHHX+ltU8lHjMVXZ8/u0WEzo/Zvo9izmDVKb9hXtZUBb7ndsXa9y5D5CngfUY8OAJTzGINQvIxzyWwS0L1RP1Nq1M+kVsImfr0NatTC4F2VZPUJ3VN6W9WF/87ILp+y2u7/oJOnQwaUK0= Authentication-Results-Original: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=arm.com; Received: from AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) by AM6PR08MB3224.eurprd08.prod.outlook.com (2603:10a6:209:47::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19; Thu, 30 Apr 2020 17:42:52 +0000 Received: from AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862]) by AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862%7]) with mapi id 15.20.2958.020; Thu, 30 Apr 2020 17:42:52 +0000 Date: Thu, 30 Apr 2020 18:42:50 +0100 From: Szabolcs Nagy <szabolcs.nagy@arm.com> To: libc-alpha@sourceware.org Subject: [PATCH 07/12] aarch64: fix syscalls for BTI Message-ID: <20200430174250.GC29015@arm.com> References: <20200430173458.GV29015@arm.com> In-Reply-To: <20200430173458.GV29015@arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-ClientProxiedBy: LO2P265CA0029.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:61::17) To AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from arm.com (217.140.106.55) by LO2P265CA0029.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:61::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Thu, 30 Apr 2020 17:42:51 +0000 X-Originating-IP: [217.140.106.55] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 37245255-213a-4caa-ae72-08d7ed2dec2e X-MS-TrafficTypeDiagnostic: AM6PR08MB3224:|AM6PR08MB3224:|AM5PR0801MB1923: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: <AM5PR0801MB1923EE7C4D51756C4353BA8EEDAA0@AM5PR0801MB1923.eurprd08.prod.outlook.com> x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:7219;OLM:7219; X-Forefront-PRVS: 0389EDA07F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: Cj+pu+KUg83q1A2uyVqrrW2RUSUP7xoaidUBYljvRnRtpX/vZYt8bJK7nmZv5u7L0cNqeevjcYuLOJTQmlIcbgdciV72Yw0uCLV0EgUYsSRjozKbo9jwUqcrcTCRRl1693R/SJ4fctf0J+Hg+W/sU2ttUT+MpIbepUqRdpijFQNoYy6FgTAZNHFP9SEgb75Qiw1s4xO3TWhtkGy2mYRWpYYgb2l94lBtnBxSKoruHtav3nkZrWKVVRLmLx7/xqRvSC9MRVr7MyarOJ+DLpm1kj8ddS7gU/Z7x7wlagyKznljNr2C0i/+nbYFmgd4x1gjAwdahnKm9U9bMdGtXtTyJVPGwDNhTAb74pz89VabVJaOjE1sUQWRd1xBcp0Q9aOh X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR08MB3047.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(346002)(376002)(366004)(396003)(136003)(39860400002)(1076003)(86362001)(33656002)(36756003)(66946007)(235185007)(66476007)(8886007)(55016002)(66556008)(66616009)(564344004)(478600001)(16526019)(26005)(186003)(52116002)(6916009)(44832011)(7696005)(33964004)(2906002)(4326008)(8676002)(8936002)(44144004)(956004)(2616005)(316002)(2700100001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: X7tzAyCvDEmQYou571IlONCg8oQnVuoa+E5uhFfEejMSTCEIlg7fO/YrnGMisfoEnQofz7MK/oj/NfQK/tUVawX/SGsh4WhTA46NdpTn+4b6rrtj0D9bv0yiYS1zOLYVuf/ZiDhkFWP871VM/Zev/KpeEyE5ElkB6KnLYkdGtIQvfMHiL88NiOI+qVIAgzbFFzs9ho7vUcY3gdUjgMZyH8O5DpnPtbVie6DR0+P7Ard+azcDz3YpIOwsr6l2WkCAfft4Vi4q1KdQwyaYM12KdfbAxlHdITviD7gn4lacHRd2d15QLFx5gTX5dOA+4i3dWoWMqFgkfV+lZ1hvBd5iM42ocsxDRDd7klfGI58h/nQtraxRsi0GgTQVRgvAwDaftert3W17dJUre5NXaG6tHQ3aCc8Bq8q6/ldZpCSaOuZOi1laxrSlA7p9+fx2DiUNGH7nferA3cVvXQwbZ2SjPVYWhpZkKFpjxCojVGgbY8kJiBNGGOlrmg5aOn1KD6wQ49NZXf9E7MG39VoI6p5nFq0G32hzWRmZTz/XwBh8i5g7OuA/I3amsv9tcYmvE91s0w4e4moB/uIn7SC2NdlSsM+wrbCwcp9zXn1DsSUlqDAojM1FH+7o72WeEsC/04h+reZrmHFcKBAEHG9lH/yB02tpe6iW/EggYM2YKseDKVVT0u2o8du8/7uZuGKJde6im2zLofbFJ2VIBfbhoYoehhAzan0z6DhUYIuBQOamB/p9a9Ls6zTILXL/SoYq9+slvHznWw0WF7dxh9vZubRv3cJGBJ/DZRf9dg9uHlWKUtU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3224 Original-Authentication-Results: sourceware.org; dkim=none (message not signed) header.d=none; sourceware.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT037.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(396003)(376002)(136003)(346002)(46966005)(1076003)(44144004)(2906002)(235185007)(33964004)(26005)(4326008)(6916009)(36906005)(70586007)(186003)(316002)(47076004)(7696005)(8936002)(66616009)(82310400002)(16526019)(8676002)(36756003)(70206006)(564344004)(44832011)(2616005)(956004)(55016002)(81166007)(33656002)(478600001)(82740400003)(86362001)(356005)(336012)(8886007)(2700100001); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: c64d2b54-484b-40d5-148a-08d7ed2de80c X-Forefront-PRVS: 0389EDA07F X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zfBs71w39SXBjY7Y1NVPl7ftMfdsBz9A1iDdLUyYGuRgtbzLaVqc/D1U5k/SqXul134iKDqBuEDa+4+bW+l36wVk878IMn8lQaD9PS0np+AAy9wX8ZCuEl+sv3LCHAmpvoi25lG1VZOcj7l4lG8THomlHFU4Hv+LNHSUFFosRaxfHK6Zj7Dp+ObBFDDDyP5ujPpyK7pnpIgm1h7ZRImxFBagzEo1v57IKLK1qK5GaVvOLqWnPmOJMDD8PFQIT3wT5tMQQPXg5MXAzBZdnE92jKFlaOFUrY2GN7oBScWfuVk6zek9Y04TD9D/aVkM3jORuccQlVPQ3PSpXY/rwndu/gCtxM2aJmbIuiqVw1PpF4PjpXBRF8H0+luKOsURYkLmghDHb/tF3Gy8Carzs8yab1KloawFWagjeskj0++bsaM= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2020 17:42:58.7438 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 37245255-213a-4caa-ae72-08d7ed2dec2e X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1923 X-Spam-Status: No, score=-28.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="0007-aarch64-fix-syscalls-for-BTI.patch" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <http://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <http://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> Cc: Sudakshina Das <Sudi.Das@arm.com> Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces@sourceware.org> |
Series |
aarch64: branch protection support
|
|
Commit Message
Szabolcs Nagy
April 30, 2020, 5:42 p.m. UTC
Comments
On 30/04/2020 14:42, Szabolcs Nagy wrote: > Syscall asm code needs an ELF property marking for BTI > when glibc is built with BTI support so we add AArch64 > variants of syscall-template.S and umount2.S. > --- > .../sysv/linux/aarch64/syscall-template.S | 20 +++++++++++++++ > sysdeps/unix/sysv/linux/aarch64/umount2.S | 25 +++++++++++++++++++ > 2 files changed, 45 insertions(+) > create mode 100644 sysdeps/unix/sysv/linux/aarch64/syscall-template.S > create mode 100644 sysdeps/unix/sysv/linux/aarch64/umount2.S > > diff --git a/sysdeps/unix/sysv/linux/aarch64/syscall-template.S b/sysdeps/unix/sysv/linux/aarch64/syscall-template.S > new file mode 100644 > index 0000000000..50db585289 > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/aarch64/syscall-template.S > @@ -0,0 +1,20 @@ > +/* Assembly code template for system call stubs. > + Copyright (C) 2020 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 > + <https://www.gnu.org/licenses/>. */ > + > +#include <sysdeps/unix/syscall-template.S> > +END_FILE Although I am not very found of adding another arch-specific file, I don't see better straightforward solution. > diff --git a/sysdeps/unix/sysv/linux/aarch64/umount2.S b/sysdeps/unix/sysv/linux/aarch64/umount2.S > new file mode 100644 > index 0000000000..4fe26c35e2 > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/aarch64/umount2.S > @@ -0,0 +1,25 @@ > +/* umount system call with two parameters. > + Copyright (C) 2020 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 > + <https://www.gnu.org/licenses/>. */ > + > +#include <sysdep.h> > +PSEUDO (__umount2, umount2, 2) > + ret > +PSEUDO_END(__umount2) > +weak_alias (__umount2, umount2) > +END_FILE I think it is better to adapt the linux umount2.S to a C file instead of adding another arch-specific implementation. Only alpha and ia64 do not support __NR_umount2 (exported as __NR_umount), but recent kernel fixes (74cd2184833f for ia64, 12b57c5c70f39 for alpha) add the alias. So we can use __NR_umount without the need to check its definition: diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 0326f92c40..62ac921e8f 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -54,7 +54,7 @@ CFLAGS-malloc.c += -DMORECORE_CLEARS=2 endif ifeq ($(subdir),misc) -sysdep_routines += adjtimex clone umount umount2 readahead sysctl \ +sysdep_routines += adjtimex clone umount readahead sysctl \ setfsuid setfsgid epoll_pwait signalfd \ eventfd eventfd_read eventfd_write prlimit \ personality epoll_wait tee vmsplice splice \ diff --git a/sysdeps/unix/sysv/linux/ia64/syscalls.list b/sysdeps/unix/sysv/linux/ia64/syscalls.list index 56f4138c43..bd39441d3c 100644 --- a/sysdeps/unix/sysv/linux/ia64/syscalls.list +++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list @@ -1,7 +1,5 @@ # File name Caller Syscall name # args Strong name Weak names -umount2 - umount 2 __umount2 umount2 - getpriority - getpriority i:ii __getpriority getpriority # proper socket implementations: diff --git a/sysdeps/unix/sysv/linux/umount.c b/sysdeps/unix/sysv/linux/umount.c index ab6a20f596..cdc8759118 100644 --- a/sysdeps/unix/sysv/linux/umount.c +++ b/sysdeps/unix/sysv/linux/umount.c @@ -16,12 +16,17 @@ License along with the GNU C Library. If not, see <https://www.gnu.org/licenses/>. */ -/* Since the generic Linux syscall ABI doesn't have an oldumount system call, - do what the kernel does down here. */ +#include <sys/mount.h> +#include <sysdep.h> -extern long int __umount2 (const char *name, int flags); +int +__umount2 (const char *special_file, int flags) +{ + return INLINE_SYSCALL_CALL (umount2, special_file, flags); +} +weak_alias (__umount2, umount2) -long int +int __umount (const char *name) { return __umount2 (name, 0); diff --git a/sysdeps/unix/sysv/linux/umount2.S b/sysdeps/unix/sysv/linux/umount2.S deleted file mode 100644 index 92241bbf97..0000000000 --- a/sysdeps/unix/sysv/linux/umount2.S +++ /dev/null @@ -1,13 +0,0 @@ -/* umount system call with two parameters. */ - -#include <sysdep.h> -#if defined __NR_oldumount || defined __NR_umount2 -#ifdef __NR_oldumount -PSEUDO (__umount2, umount, 2) -#else -PSEUDO (__umount2, umount2, 2) -#endif - ret -PSEUDO_END(__umount2) -weak_alias (__umount2, umount2) -#endif
The 05/07/2020 16:40, Adhemerval Zanella via Libc-alpha wrote: > > +#include <sysdep.h> > > +PSEUDO (__umount2, umount2, 2) > > + ret > > +PSEUDO_END(__umount2) > > +weak_alias (__umount2, umount2) > > +END_FILE > > I think it is better to adapt the linux umount2.S to a C file instead of > adding another arch-specific implementation. Only alpha and ia64 do > not support __NR_umount2 (exported as __NR_umount), but recent kernel > fixes (74cd2184833f for ia64, 12b57c5c70f39 for alpha) add the alias. > So we can use __NR_umount without the need to check its definition: yes i think this is a useful thing to do (independently of aarch64 bti work). doesn't the patch add new umount2 symbol on ia64 and alpha though? > diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile > index 0326f92c40..62ac921e8f 100644 > --- a/sysdeps/unix/sysv/linux/Makefile > +++ b/sysdeps/unix/sysv/linux/Makefile > @@ -54,7 +54,7 @@ CFLAGS-malloc.c += -DMORECORE_CLEARS=2 > endif > > ifeq ($(subdir),misc) > -sysdep_routines += adjtimex clone umount umount2 readahead sysctl \ > +sysdep_routines += adjtimex clone umount readahead sysctl \ > setfsuid setfsgid epoll_pwait signalfd \ > eventfd eventfd_read eventfd_write prlimit \ > personality epoll_wait tee vmsplice splice \ > diff --git a/sysdeps/unix/sysv/linux/ia64/syscalls.list b/sysdeps/unix/sysv/linux/ia64/syscalls.list > index 56f4138c43..bd39441d3c 100644 > --- a/sysdeps/unix/sysv/linux/ia64/syscalls.list > +++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list > @@ -1,7 +1,5 @@ > # File name Caller Syscall name # args Strong name Weak names > > -umount2 - umount 2 __umount2 umount2 > - > getpriority - getpriority i:ii __getpriority getpriority > > # proper socket implementations: > diff --git a/sysdeps/unix/sysv/linux/umount.c b/sysdeps/unix/sysv/linux/umount.c > index ab6a20f596..cdc8759118 100644 > --- a/sysdeps/unix/sysv/linux/umount.c > +++ b/sysdeps/unix/sysv/linux/umount.c > @@ -16,12 +16,17 @@ > License along with the GNU C Library. If not, see > <https://www.gnu.org/licenses/>. */ > > -/* Since the generic Linux syscall ABI doesn't have an oldumount system call, > - do what the kernel does down here. */ > +#include <sys/mount.h> > +#include <sysdep.h> > > -extern long int __umount2 (const char *name, int flags); > +int > +__umount2 (const char *special_file, int flags) > +{ > + return INLINE_SYSCALL_CALL (umount2, special_file, flags); > +} > +weak_alias (__umount2, umount2) > > -long int > +int > __umount (const char *name) > { > return __umount2 (name, 0); > diff --git a/sysdeps/unix/sysv/linux/umount2.S b/sysdeps/unix/sysv/linux/umount2.S > deleted file mode 100644 > index 92241bbf97..0000000000 > --- a/sysdeps/unix/sysv/linux/umount2.S > +++ /dev/null > @@ -1,13 +0,0 @@ > -/* umount system call with two parameters. */ > - > -#include <sysdep.h> > -#if defined __NR_oldumount || defined __NR_umount2 > -#ifdef __NR_oldumount > -PSEUDO (__umount2, umount, 2) > -#else > -PSEUDO (__umount2, umount2, 2) > -#endif > - ret > -PSEUDO_END(__umount2) > -weak_alias (__umount2, umount2) > -#endif > > --
From 10741a1943239f0b22c8dd3f7df93aa338ec003f Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy <szabolcs.nagy@arm.com> Date: Wed, 1 Apr 2020 15:27:12 +0100 Subject: [PATCH 07/12] aarch64: fix syscalls for BTI Syscall asm code needs an ELF property marking for BTI when glibc is built with BTI support so we add AArch64 variants of syscall-template.S and umount2.S. --- .../sysv/linux/aarch64/syscall-template.S | 20 +++++++++++++++ sysdeps/unix/sysv/linux/aarch64/umount2.S | 25 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/aarch64/syscall-template.S create mode 100644 sysdeps/unix/sysv/linux/aarch64/umount2.S diff --git a/sysdeps/unix/sysv/linux/aarch64/syscall-template.S b/sysdeps/unix/sysv/linux/aarch64/syscall-template.S new file mode 100644 index 0000000000..50db585289 --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/syscall-template.S @@ -0,0 +1,20 @@ +/* Assembly code template for system call stubs. + Copyright (C) 2020 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 + <https://www.gnu.org/licenses/>. */ + +#include <sysdeps/unix/syscall-template.S> +END_FILE diff --git a/sysdeps/unix/sysv/linux/aarch64/umount2.S b/sysdeps/unix/sysv/linux/aarch64/umount2.S new file mode 100644 index 0000000000..4fe26c35e2 --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/umount2.S @@ -0,0 +1,25 @@ +/* umount system call with two parameters. + Copyright (C) 2020 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 + <https://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +PSEUDO (__umount2, umount2, 2) + ret +PSEUDO_END(__umount2) +weak_alias (__umount2, umount2) +END_FILE -- 2.17.1