From patchwork Thu Mar 4 16:32:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 42251 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 0A2F8389041C; Thu, 4 Mar 2021 16:33:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0A2F8389041C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614875590; bh=Lnoe552cAouLjP5568gJPfkZlWj9qINtGzRjt1D/CC4=; 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=Q6vNDhCS96vuRicAMip/M+TDwyCTrnnkHhjJmeC2L4blBsT5ypWtcbD+W6v1Uv0H0 KDhZ/bEyUCBtYNZAa5AB1wQGKKAxZrsWq8UCdSTW+itJXANpWSUyjPkHbeo+pjF2/t hY2JK3Ss/MDqw9YFHWvYkRrvZdpMFpmsRx/NXprs= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20054.outbound.protection.outlook.com [40.107.2.54]) by sourceware.org (Postfix) with ESMTPS id AC3BB389041C for ; Thu, 4 Mar 2021 16:33:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AC3BB389041C Received: from DB6PR0501CA0038.eurprd05.prod.outlook.com (2603:10a6:4:67::24) by VE1PR08MB5806.eurprd08.prod.outlook.com (2603:10a6:800:1b1::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.19; Thu, 4 Mar 2021 16:33:04 +0000 Received: from DB5EUR03FT051.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:67:cafe::99) by DB6PR0501CA0038.outlook.office365.com (2603:10a6:4:67::24) 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:33:04 +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 DB5EUR03FT051.mail.protection.outlook.com (10.152.21.19) 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:33:04 +0000 Received: ("Tessian outbound 72bd4bdd1f59:v71"); Thu, 04 Mar 2021 16:33:04 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: c75f31cd90f33d4e X-CR-MTA-TID: 64aa7808 Received: from fbd92ac607be.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 7E2353B4-72B8-47EA-AE0E-B400B37A3E86.1; Thu, 04 Mar 2021 16:32:59 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id fbd92ac607be.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 04 Mar 2021 16:32:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SQVebM927si/Jv5Bcu8QNx0uZrvMLfoQsCR1PLypsbshD/GZufxsAAnV5lTMrQedEKwWBGf28h7F9IsdU/MV9JZA/3fhToHmicKBvpzE7SBhoO42tdvZKhnqMbPxN/mN+Ldnulvgax/bTWi/M+uCElZPtIxzeUzvJBuu4+8UI/xDpGStTy/jUR2paWIOaWlODY1nGu6Ng39EQKNAvlkZJ71b0aEze8MKxx9EvD0JyKkJm7OcyF93w1kZYL7U09TX/6mS7K/vo7rMYWz2nTVY2ZZOWwEseuHshCL6HEactvRR9BlwIREOr/9/bDuwCcz/EmMjciTP2wFKWS2wfXt3nQ== 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=Lnoe552cAouLjP5568gJPfkZlWj9qINtGzRjt1D/CC4=; b=HV8kJmb/DH3XG1Tao8PPJPbujVN5dz1tER9aaGdtRjtGCJC8K0uAp0gbf+87xaSZE9SMr3Zs7ExxVX1wu1wnHYOqO9gAqIac5h0dcMYOTZuuXAIhOjFzpUguj3NPDeYpU4mTrAV0G6ZaqujGUAtuSlBH432jIaCCZZsQLvFMJhCcFFaHDATqrpXyQcdB7kbyu/7y8wFV5Ia3TUyCrcPUDIGQnbPVSxFGeKl5Gu4LePeZA/lXRIATsS+a5YFPYmqFv74HVQThp4v9TWvOY7yOUO/yVMQg1gd5TJhMRD1NtswF47oPiLrL+py1xzIe5bpjgcN/h8pdR1w247W5o5vA2Q== 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 PA4PR08MB6064.eurprd08.prod.outlook.com (2603:10a6:102:e2::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.20; Thu, 4 Mar 2021 16:32:57 +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:32:57 +0000 To: libc-alpha@sourceware.org, Richard.Earnshaw@arm.com, DJ Delorie Subject: [PATCH 09/16] malloc: Only support zeroing and not arbitrary memset with mtag Date: Thu, 4 Mar 2021 16:32:45 +0000 Message-Id: <4b85579387c095e4dbcc044042aa0f2dfdbd3a18.1614874816.git.szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-Originating-IP: [217.140.106.55] X-ClientProxiedBy: SN4PR0501CA0043.namprd05.prod.outlook.com (2603:10b6:803:41::20) 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 SN4PR0501CA0043.namprd05.prod.outlook.com (2603:10b6:803:41::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.13 via Frontend Transport; Thu, 4 Mar 2021 16:32:56 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 4c8e98da-faff-464a-3e35-08d8df2b2f5d X-MS-TrafficTypeDiagnostic: PA4PR08MB6064:|VE1PR08MB5806: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:10000;OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: pB17M2XveD2X7icT5th8Qbdpxq4dh/IJBZeEAj1E6MX5fNRAyZvbETvA5kq7lVfa99Zo6dLDUgnrZvNCZ5EY5FcY/8Mw4nhynlfix+oV3j5vIaN1Rg/CtJa/htFSXVLav19NMGvYJPVvPkfMFqKDFjP4z7fuV5etJHNTwqKP6ofVSAn9oFf0vVQn3zxwH7yu+TfPleSSt92x/GPJT/bVnXKA67vyZXadbxtWXcgzVs6+is382Ls6H8Ot7YE26QbF9nNZtSe9CsfZsZq07QIxd44DWbdLyxVOZySI4oC+8m5J8E/MaX/G//ZLKTphhhLRIuUlsIHvTs8X2RC+YhjY2DBYD7Mj8DOGmptOn22MNQ72hdBEry4nMtYz8FBetQIbjaHQ7eyqaU3mq/ZltF8i+WbvLs3i/NdzxFewgDLkPDBe1SleEfJPdS0cLx5+rvtUYJUCoZccEmQtOp88qaqy+2Fu25wmkfZtgq1ooXwq7qc6k+SxGaafNkydCfdK19Rq+97pyMoUIONSgUWYilCsJrNM8i3Ztwhz0Xfltn1dWjM5pmK/T26LkVYEI4JERt17xy676Vz3GP6ydlGr5rNAYA== 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)(39850400004)(376002)(366004)(346002)(136003)(396003)(69590400012)(8676002)(6512007)(8936002)(478600001)(6666004)(36756003)(2616005)(52116002)(956004)(86362001)(6916009)(6506007)(5660300002)(26005)(6486002)(316002)(66476007)(66946007)(66556008)(186003)(2906002)(16526019)(44832011)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: DLxMQas0Sy9kPVXVDisBDZdQSVhrYeRxBKxb5gEmv4FNsJ6099zz9oyiTTOaEWKP82m1bqoJQ/sygaarE6IQG7i6Cr7vkgkwpTjMiGor8TqIwDRHwJih8HLU3rw8Fq/u6skmwrGYtoTR/bqNi1c+IOC4B973VEjILFAjygzRgGXcYCyvAvSwMH5hPNpE4j1o1cqf8epbRQKyhbC9/IBf7ejzSjzw/65xSZUW+EebYa9LCheQR1oFpfGPuSaQtHGcCAWCTqyNa1PuKWn42Icx+NiDKttqkjMVhcumGrMpPtQZI1BqPSQ8Eq4VQMuDMcDVyheunTwxwC2bnnu4mrrZ3tMuOFWEmbIwUwCN0BJnqx/As5hQBpmIQRvizEAPk17U/GzwP8I5RstDvl8SCUkAhiz7cePSHgs6PjUOHn7h0wcW8vNpQKnYxCM2fFsuY4BcG/XhRBb3MgzsguHsO4VlvgniOx5ezZGf4lIwTvWoj1EBi/kzqFOsliKujxMUMbYBbvU3IJnGmvjqeLBFu8eUtDYsj01eXN8rFU8Wbad40hXClGc5AACCbI1obv1nzLaUm+VZ369SmHQ5Jj76lJgWtPmBge3BImonC1p+HqC/OLzPijvb2GTx/Z7RLJsxSULnow+hYtMVrx5zu3c7F4SIeh2nbD+91HUNUd6WcoH0XpPSOkQlmCHwXCZrO73Zb5axVz06DD0U53XMBoatJQ7/zHTqVVTWty9iwX4nQFfMveeqi2a2hJuUMpNRG7IHAh7StiXB/31FlH7kGzf2IGMBfPqPhvcgHnwZCUQ8ahCvKS1QoJ4aaEuIwQIxu+39XKJ9+27xKVpizYaSjv1Ri0LDvew3IyAJm1TFO8keGk5EnhBd/bW54Ee+VwbWdqO3mJrwBMenMO25Uh8rYsWMCwatu6KBq2aDu0qxrreEJl3PSsXImq2l3Yb1JG5WT2jaiSj3cnyT6oUO3TFrbHrmjsdV2fMMp3zs2toLWfifR81NsIHG17+PLoNZPW6IPiMqQaxwsEK+3iqGPlwKNUsYkD877lL3MVuqkO5wvuPIy7vedud34V2qKT0EkCw+D1QgiTroQhq2v5/WhXVFMrL0U7wn0b3nYWPAIAQjbCkjtAsQpHbgtO8pAb4h0aoprDS00kbBPw/MNSTJQaR1QSVwgOfTtTQ7D+tZVLERklid+i06ZUDXZiAXviGBE5vFxagKNxxAVo6Pg78kYgthsnJES5j38L8QIOeNxPQA/U5FN0DmSZ5nak1mlUWyN09g3lOKPHmXFcYYsjdaGgusgGuS/DYALjm2yBuQjPx3NfvtKqMUGwObWt/DsZYKfq2gIaZ6wIeO X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB6064 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: DB5EUR03FT051.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 9beb0f51-ac66-49e2-c8a0-08d8df2b2b10 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pSPK5/KuuPUIJx5d8BGJzeMShAQRlQ/yDOjRoyl3q4U4PHP9Syo5AAY/fEkRWJchMXfJI4Dz3GK4FcXBfRmXwRVzCVwgW0LGEXZRDHKqh3tnUwYwmgwJkBNbHju4iM56euT7eZ4CSBDQ2TAJ7qu8DXC6CvLmWvu2g1PM+8Pnl1XdeRVh7W1vDXebmk9bO0JNrDUp8MR/00ph9FyrpJ9/aBHIpr41ZuzSEFEmRmfvdabLnEwFz12ZHEeKOV43deyBP0/LXzuJWyX2gP/UlZitxOY834DqvvTIgKbFV7K7M7hpqUmpqaxVvTDsT+FZeRmQlcetaM+/Pbuj4jeetzp1SZw/+sjKpNaVlYAuwpkUJ5RJVDmRfWRBf5Ysb/EdkLF0Lzy14ym0jxHKCug/pe8XpqFyUbnCgu8tNGLwMPhq8IUV0/Qytshu3E9QKyvS4LOqWBaV7dMkEpfFBAjnjdTtwfafaeSWVarpd4KL2kvEP/hAy1fQJVwx+nnN14e2gKw11paMIS3yvZQxuDbSKbVVyZgdYNKNCQVeAqkiFKmpEz+7QSXoZQCYAQNT0ceyeju5TJ/sjLiB4q9rLpD8dfFzJww22N4r+SQVL7f2gmC/1sYxVnQGq+kk7rRKuuYMtsa2kzPwD+pxsnTbQ5rTeLhkkpNo+/ZdMpFz7Qea/+UjvL1e0waYO4oBm4AT6SpDBN4B 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)(346002)(39850400004)(136003)(396003)(36840700001)(46966006)(70586007)(82310400003)(69590400012)(6506007)(81166007)(316002)(70206006)(5660300002)(16526019)(8936002)(86362001)(478600001)(186003)(26005)(47076005)(336012)(36860700001)(6512007)(44832011)(6666004)(6486002)(8676002)(83380400001)(82740400003)(6862004)(36756003)(2906002)(2616005)(956004)(356005); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Mar 2021 16:33:04.4072 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4c8e98da-faff-464a-3e35-08d8df2b2f5d 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: DB5EUR03FT051.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5806 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, 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" The memset api is suboptimal and does not provide much benefit. Memory tagging only needs a zeroing memset (and only for memory that's sized and aligned to multiples of the tag granule), so change the internal api and the target hooks accordingly. This is to simplify the implementation of the target hook. --- malloc/malloc.c | 17 ++++++++--------- sysdeps/aarch64/Makefile | 2 +- ...g_memset_tag.S => __mtag_tag_zero_region.S} | 18 +++++++----------- sysdeps/aarch64/libc-mtag.h | 4 ++-- sysdeps/generic/libc-mtag.h | 6 +++--- 5 files changed, 21 insertions(+), 26 deletions(-) rename sysdeps/aarch64/{__mtag_memset_tag.S => __mtag_tag_zero_region.S} (82%) diff --git a/malloc/malloc.c b/malloc/malloc.c index caf34843f7..9002d51d7b 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -413,12 +413,11 @@ void *(*__morecore)(ptrdiff_t) = __default_morecore; operations can continue to be used. Support macros are used to do this: - void *tag_new_memset (void *ptr, int, val, size_t size) + void *tag_new_zero_region (void *ptr, size_t size) - Has the same interface as memset(), but additionally allocates a - new tag, colors the memory with that tag and returns a pointer that - is correctly colored for that location. The non-tagging version - will simply call memset. + Allocates a new tag, colors the memory with that tag, zeros the + memory and returns a pointer that is correctly colored for that + location. The non-tagging version will simply call memset with 0. void *tag_region (void *ptr, size_t size) @@ -458,11 +457,11 @@ tag_region (void *ptr, size_t size) } static __always_inline void * -tag_new_memset (void *ptr, int val, size_t size) +tag_new_zero_region (void *ptr, size_t size) { if (__glibc_unlikely (mtag_enabled)) - return __libc_mtag_memset_with_tag (__libc_mtag_new_tag (ptr), val, size); - return memset (ptr, val, size); + return __libc_mtag_tag_zero_region (__libc_mtag_new_tag (ptr), size); + return memset (ptr, 0, size); } /* Defined later. */ @@ -3679,7 +3678,7 @@ __libc_calloc (size_t n, size_t elem_size) regardless of MORECORE_CLEARS, so we zero the whole block while doing so. */ #ifdef USE_MTAG - return tag_new_memset (mem, 0, CHUNK_AVAILABLE_SIZE (p) - CHUNK_HDR_SZ); + return tag_new_zero_region (mem, CHUNK_AVAILABLE_SIZE (p) - CHUNK_HDR_SZ); #else INTERNAL_SIZE_T csz = chunksize (p); diff --git a/sysdeps/aarch64/Makefile b/sysdeps/aarch64/Makefile index d3ab37a40a..259070cfad 100644 --- a/sysdeps/aarch64/Makefile +++ b/sysdeps/aarch64/Makefile @@ -41,7 +41,7 @@ endif ifeq ($(subdir),misc) sysdep_headers += sys/ifunc.h sysdep_routines += __mtag_address_get_tag \ - __mtag_memset_tag \ + __mtag_tag_zero_region \ __mtag_new_tag \ __mtag_tag_region diff --git a/sysdeps/aarch64/__mtag_memset_tag.S b/sysdeps/aarch64/__mtag_tag_zero_region.S similarity index 82% rename from sysdeps/aarch64/__mtag_memset_tag.S rename to sysdeps/aarch64/__mtag_tag_zero_region.S index 3c202888a4..74d398bba5 100644 --- a/sysdeps/aarch64/__mtag_memset_tag.S +++ b/sysdeps/aarch64/__mtag_tag_zero_region.S @@ -20,9 +20,6 @@ #ifdef USE_MTAG -/* Use the same register names and assignments as memset. */ -#include "memset-reg.h" - .arch armv8.5-a .arch_extension memtag @@ -31,16 +28,15 @@ /* FIXME: This is a minimal implementation. We could do much better than this for large values of COUNT. */ -ENTRY(__libc_mtag_memset_with_tag) +#define dstin x0 +#define count x1 +#define dst x2 - and valw, valw, 255 - orr valw, valw, valw, lsl 8 - orr valw, valw, valw, lsl 16 - orr val, val, val, lsl 32 - mov dst, dstin +ENTRY(__libc_mtag_tag_zero_region) + mov dst, dstin L(loop): - stgp val, val, [dst], #16 + stzg dst, [dst], #16 subs count, count, 16 bne L(loop) #if 0 @@ -49,5 +45,5 @@ L(loop): ldg dstin, [dstin] // Recover the tag created (might be untagged). #endif ret -END (__libc_mtag_memset_with_tag) +END (__libc_mtag_tag_zero_region) #endif /* USE_MTAG */ diff --git a/sysdeps/aarch64/libc-mtag.h b/sysdeps/aarch64/libc-mtag.h index 979cbb743e..f58402ccf9 100644 --- a/sysdeps/aarch64/libc-mtag.h +++ b/sysdeps/aarch64/libc-mtag.h @@ -39,8 +39,8 @@ void *__libc_mtag_tag_region (const void *, size_t) */ void *__libc_mtag_tag_region (void *, size_t); -/* Optimized equivalent to __libc_mtag_tag_region followed by memset. */ -void *__libc_mtag_memset_with_tag (void *, int, size_t); +/* Optimized equivalent to __libc_mtag_tag_region followed by memset to 0. */ +void *__libc_mtag_tag_zero_region (void *, size_t); /* Convert address P to a pointer that is tagged correctly for that location. diff --git a/sysdeps/generic/libc-mtag.h b/sysdeps/generic/libc-mtag.h index e8fc236b6c..4743e873f1 100644 --- a/sysdeps/generic/libc-mtag.h +++ b/sysdeps/generic/libc-mtag.h @@ -44,12 +44,12 @@ __libc_mtag_tag_region (void *p, size_t n) return p; } -/* Optimized equivalent to __libc_mtag_tag_region followed by memset. */ +/* Optimized equivalent to __libc_mtag_tag_region followed by memset to 0. */ static inline void * -__libc_mtag_memset_with_tag (void *p, int c, size_t n) +__libc_mtag_tag_zero_region (void *p, size_t n) { __libc_mtag_link_error (); - return memset (p, c, n); + return memset (p, 0, n); } /* Convert address P to a pointer that is tagged correctly for that