From patchwork Thu Mar 4 16:34:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 42256 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 356933AAA0C3; Thu, 4 Mar 2021 16:34:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 356933AAA0C3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614875682; bh=unaaHVtpWmyJPnwjowhK0XBzn/zX5wGcj/kO7pOpHAQ=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=TE88KEKiDAt07IT3kPjbVcrNJkaKUIv7pfOp1FLYKueSgj4+DxcIee/k3sOV2xZZn 2RgkHNF65DFJ54iKuL93s+YqYpfX49c8O5CtotLzK+kOk60yunzrze+FJE9XNFvIIV G2/0k7b9hLX9fQZPS5/9TWkgHS/63QgbWkqvh0nY= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130048.outbound.protection.outlook.com [40.107.13.48]) by sourceware.org (Postfix) with ESMTPS id B716D389041C for ; Thu, 4 Mar 2021 16:34:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B716D389041C Received: from AS8PR04CA0108.eurprd04.prod.outlook.com (2603:10a6:20b:31e::23) by VI1PR0802MB2334.eurprd08.prod.outlook.com (2603:10a6:800:9d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.23; Thu, 4 Mar 2021 16:34:36 +0000 Received: from VE1EUR03FT024.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:31e:cafe::24) by AS8PR04CA0108.outlook.office365.com (2603:10a6:20b:31e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17 via Frontend Transport; Thu, 4 Mar 2021 16:34:36 +0000 X-MS-Exchange-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=pass 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 VE1EUR03FT024.mail.protection.outlook.com (10.152.18.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17 via Frontend Transport; Thu, 4 Mar 2021 16:34:35 +0000 Received: ("Tessian outbound dd71fb35fd76:v71"); Thu, 04 Mar 2021 16:34:35 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: be8fdb4b4cfb3830 X-CR-MTA-TID: 64aa7808 Received: from d3fea6626d10.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 0BFBE5A8-25AE-48DB-9E53-C3CEF37E6407.1; Thu, 04 Mar 2021 16:34:29 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d3fea6626d10.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 04 Mar 2021 16:34:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jwe2aR1+jlzBgf9dzlfB6wTrwreGJlKJRu3CJJ8KWVjOMzNp4dxK+pqAtC+HGF9olzSn0+2NUSIti3GqZCbXj9bmmr9142XSno++qATU3T4//IZabEl2dq034BnbfdWoSuul83o7RJ8JDFkcMNXMyOxmlyscFvbhaxhk76L2/2ZQOM+UZeGICb8xyjzCLrNaVbwnFqZ6habdQkg8bqJnEudIndUy+XOdfcUypITP3TWUqKrPdQZyiO7i9TyWQvGGPupfmhTGKwZe3j0vMa+yGs7lF+JebvxGkrZqMOnnsP5rAFda7fbQw1xQUyZEKez0NJsl55Vg9GcW2V1yLTgQ+A== 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=unaaHVtpWmyJPnwjowhK0XBzn/zX5wGcj/kO7pOpHAQ=; b=buTIFzgqjjb0J8Jmo1da1M8FY3JYciVA/qwXdbm9BwOCv6INVgthciP5AMJ/1SF41NiWQr3/YFt8LhHmq5b/bumvMXFWntJVsWtJ7SOLvF35AWNUnENk6hTEx7IE/0EgiqPkX2sKbG76MRlyrjcQf81lC9WXuVSr+8TE0tZMuQySLE9qjmMis5bTN1UhWprFVSgh+OJjdtSL1MdZ4ZC5j0jlAl/r5+ZViKMcjTn29GuMmrkfFHPKK3xwKoNOlAfIuVbuLmE7yM9OUtDxXLrhh6nRVve/Q1AgSNH/tVW6vk+Psu2MW9nLE/tf5lj3nXAzIur6u30K2P06ONpB7HoVCw== 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 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 PA4PR08MB6320.eurprd08.prod.outlook.com (2603:10a6:102:e5::9) by PAXPR08MB6480.eurprd08.prod.outlook.com (2603:10a6:102:155::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19; Thu, 4 Mar 2021 16:34:28 +0000 Received: from PA4PR08MB6320.eurprd08.prod.outlook.com ([fe80::60f0:3773:69b8:e336]) by PA4PR08MB6320.eurprd08.prod.outlook.com ([fe80::60f0:3773:69b8:e336%2]) with mapi id 15.20.3912.021; Thu, 4 Mar 2021 16:34:28 +0000 To: libc-alpha@sourceware.org, Richard.Earnshaw@arm.com, DJ Delorie Subject: [PATCH 14/16] aarch64: inline __libc_mtag_new_tag Date: Thu, 4 Mar 2021 16:34:22 +0000 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-Originating-IP: [217.140.106.55] X-ClientProxiedBy: LNXP265CA0029.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5c::17) To PA4PR08MB6320.eurprd08.prod.outlook.com (2603:10a6:102:e5::9) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (217.140.106.55) by LNXP265CA0029.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.25 via Frontend Transport; Thu, 4 Mar 2021 16:34:28 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3fe5a2e5-ba8b-4e2b-c6ba-08d8df2b660d X-MS-TrafficTypeDiagnostic: PAXPR08MB6480:|VI1PR0802MB2334: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8273;OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: IvjiudYGvOI/TVNwleBilucyP0dp1a91EojJC1HEYY2OYdscXOZzxr21KlqQAwrOB6uzuYFrocIFFWfsQVrj1df37qH4r5RC8z5y+7gHD4/fB5Z8XoTSOyvAA1kPAarMAOEYu5z2gO+6iNFTeMzC04f7IpySYoa5UJJS3DwEXDXnz++HlewyDguugFqg6V7ym4GQL+RbT0L12cHy1LZvO0RzweOep82yQoguDTxLynLGtYhqow3qYsNbE7GkzJ2gSlP2DvTfROOHjhJ0JUbsDuXRsLVR7zlZ7DeW/VbOgzJcLotH4fL8AAtpjRMnhAsDKwqYBLcLE7qlg3ZxdP7KEQETOaHPAz9Pkfr36TvrtxbZoh6D3s4Hxc5W0/GAqIS+C2EeV4fbrALV6tMdI25OrmW0x1/DDt4VWGB8ElzJBgJK4xafTl1Ope9jbyAB0vZjnfQ+fl/fVRsO2mtG5s0kdMR36LkfXQQ00H1/Ie/E1Zhfpav+x+8mGckzhd85Lufvm+EprinMejvUym7v4regoB499mTYVa5Q5NIna+BPJ6BTdr/iKSKvG/cKYYe7SvWDiTrQ+vZWFaXi1RHl0yDskAjQoO39sWHG6uYal3e1oawiqZRBNJOpbuBg0vagroVRBcvjuyvgxZg2IORVWGmr72ivd4XDQxF4ofYHxtoa8GUBsqwmSQAfz29JKcA/Rkgo X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR08MB6320.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(396003)(39850400004)(346002)(376002)(366004)(6512007)(2906002)(2616005)(956004)(6916009)(316002)(83380400001)(69590400012)(16526019)(66946007)(6506007)(8676002)(36756003)(5660300002)(6486002)(86362001)(44832011)(52116002)(6666004)(8936002)(26005)(186003)(478600001)(66556008)(66476007)(2004002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: TlQ//8Ky23mip3GhwOE7zW3Kr1r6ZVU5X60unZFJq8oBdbNHqyl3YRu3jy87p8Iy/02P9Fbwv+5cC3mHHRWeUtnVco0Hqfx05TktLPJT8qIlOqPEAc1jOUbNSXUQpQhqgZnDU3T2WWpnYPJqjvFhsKHF+x+qd9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1OksV107SENUffcufaF9pl2UTeWo5izrUfkR1ICttodzl2pw6/qCPh/M93rxk2DlW+3HrgmI1iKdRA0DotIHbxDMyJOXHFG99/EDohie9QbMMK2nsxbGj X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6480 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: VE1EUR03FT024.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: a8e9a598-8615-4dd4-d2a3-08d8df2b6162 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bYJEQKnEXQhKYgz/kKL+bmbeRzJpl8hm6QnAZXzF1rHXFg+DYouMiEjvkhWp22FzFIl8hg4tJLrJv5TShCGa0EhqEsTDUFvS919kHnriZm0neLc3hZ7ccnWdqLaZ6ITCUi8zbkTfV8VsHlot9/xdVgaDkPbJrEf6gVq7maSeYNtkcdp37nEJb/xUEewzIMuVvbeY/jQTHqtgQiEbiS07ZoqbsfOPXbYLimKAquBI0NTo78zNW5TsA55lzVrGnobCLGd2HB8czEWavJguuF1NFD7Kem8SRsJFtCI5et+GB713NfSGr8/H3tSRIIGe8dPHwNmW3YoX9fZpBBjc4DbxfzSoFAj+r1/S53DPbHbG7QOpW5qcfjF6k29s2WpELR9fVBPws7YpF86hOSpOosIw+VgtreoMqNVhB5R6I/gaMf9T/pEuPlqmy0xXIXIabsQYGRKLoMXz4Nv/Cdun66LCW9n/DjF5m9lZ+pVhVGZJDTPMrn/K/mh9/fIMgKHMmV7z22yRODeT1Cb+1FRXeGkRyJnG+JSVe9Mm/8xzlUr9q+CrnQEQOTDtmLJ/Pm5Kf17jgUSK+ukPknkx+Wya8zPQHyZoUuY29kJaj+oerYD5+KHlDwcGnibIDkesNiwNo7XlBuWFbc4BS3HLscHcoQAw1oKhqeJarpRUGjc2xogcFsqZgy30BlKZ0aUsBZ+/isDMa7Upk3X+g4ola9IjmaXovOmHyqYSM05S/1JpZVaNB2p+Hwb2huCwBYEZ7u009bGTOkS2seAm83XSVjbhNaH9CMThgZ60wrtbZv0sISs/Gog= 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; SFS:(4636009)(376002)(396003)(39850400004)(346002)(136003)(36840700001)(46966006)(36860700001)(6512007)(82740400003)(36756003)(69590400012)(8676002)(356005)(86362001)(6862004)(70586007)(83380400001)(8936002)(6666004)(81166007)(2906002)(478600001)(70206006)(82310400003)(47076005)(316002)(6506007)(186003)(44832011)(16526019)(336012)(5660300002)(956004)(26005)(6486002)(2616005)(2004002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Mar 2021 16:34:35.9992 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3fe5a2e5-ba8b-4e2b-c6ba-08d8df2b660d 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-AuthSource: VE1EUR03FT024.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2334 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_SHORT, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_NONE, 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 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: Szabolcs Nagy via Libc-alpha From: Szabolcs Nagy Reply-To: Szabolcs Nagy Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" This is a common operation when heap tagging is enabled, so inline the instructions instead of using an extern call. --- sysdeps/aarch64/Makefile | 1 - sysdeps/aarch64/__mtag_new_tag.S | 37 -------------------------------- sysdeps/aarch64/libc-mtag.h | 14 +++++++++--- 3 files changed, 11 insertions(+), 41 deletions(-) delete mode 100644 sysdeps/aarch64/__mtag_new_tag.S diff --git a/sysdeps/aarch64/Makefile b/sysdeps/aarch64/Makefile index 5d594debea..1099f1d657 100644 --- a/sysdeps/aarch64/Makefile +++ b/sysdeps/aarch64/Makefile @@ -41,7 +41,6 @@ endif ifeq ($(subdir),misc) sysdep_headers += sys/ifunc.h sysdep_routines += __mtag_tag_zero_region \ - __mtag_new_tag \ __mtag_tag_region endif diff --git a/sysdeps/aarch64/__mtag_new_tag.S b/sysdeps/aarch64/__mtag_new_tag.S deleted file mode 100644 index 72c1aded4c..0000000000 --- a/sysdeps/aarch64/__mtag_new_tag.S +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 2020-2021 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 - . */ - -#include - -#ifdef USE_MTAG - - .arch armv8.5-a - .arch_extension memtag - -/* NB, only supported on variants with 64-bit pointers. */ - -#define ptr x0 -#define xset x1 - -ENTRY(__libc_mtag_new_tag) - // Guarantee that the new tag is not the same as now. - gmi xset, ptr, xzr - irg ptr, ptr, xset - ret -END (__libc_mtag_new_tag) -#endif /* USE_MTAG */ diff --git a/sysdeps/aarch64/libc-mtag.h b/sysdeps/aarch64/libc-mtag.h index da1b6be776..7588c6de9e 100644 --- a/sysdeps/aarch64/libc-mtag.h +++ b/sysdeps/aarch64/libc-mtag.h @@ -52,9 +52,17 @@ __libc_mtag_address_get_tag (void *p) } /* Assign a new (random) tag to a pointer P (does not adjust the tag on - the memory addressed). - void *__libc_mtag_new_tag (void*) */ -void *__libc_mtag_new_tag (void *); + the memory addressed). */ +static __always_inline void * +__libc_mtag_new_tag (void *p) +{ + register void *x0 asm ("x0") = p; + register unsigned long x1 asm ("x1"); + /* Guarantee that the new tag is not the same as now. */ + asm (".inst 0x9adf1401 /* gmi x1, x0, xzr */\n" + ".inst 0x9ac11000 /* irg x0, x0, x1 */" : "+r" (x0), "=r" (x1)); + return x0; +} #endif /* USE_MTAG */