From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS, UNPARSEABLE_RELAY shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 050DA1F8C6 for ; Thu, 12 Aug 2021 12:03:08 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8A67F388C00C for ; Thu, 12 Aug 2021 12:03:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8A67F388C00C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1628769786; bh=TwDdTdzeVzkFPt+eWCJ8p48i2ebI6tYhw4xnQxZ+1a8=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=lTS7VIqYUEInWkMxlySqByjORkpf/Xu6ozOoAzd7AKNr+ATqHvLDy99h+kh5j1YO4 9Na3EHpzEn1qJcB1JiW+ppKmoKTnctku5Cyrdf6o22qEP7bMoxTSl4bALzQXcAUH5w vXjavY2FpXFIaj8gOUmv5GwSjqzwnkPpHoYxLyhI= Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-am5eur02on0607.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe07::607]) by sourceware.org (Postfix) with ESMTPS id 37166388E833 for ; Thu, 12 Aug 2021 12:01:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 37166388E833 Received: from AM5PR1001CA0062.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:206:15::39) by DB7PR08MB3243.eurprd08.prod.outlook.com (2603:10a6:5:21::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.19; Thu, 12 Aug 2021 12:01:29 +0000 Received: from VE1EUR03FT016.eop-EUR03.prod.protection.outlook.com (2603:10a6:206:15:cafe::85) by AM5PR1001CA0062.outlook.office365.com (2603:10a6:206:15::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Thu, 12 Aug 2021 12:01:29 +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 VE1EUR03FT016.mail.protection.outlook.com (10.152.18.115) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Thu, 12 Aug 2021 12:01:29 +0000 Received: ("Tessian outbound 1a0c40aa17d8:v103"); Thu, 12 Aug 2021 12:01:29 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: b43b69ee522a21ec X-CR-MTA-TID: 64aa7808 Received: from 4480d24db47e.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3166B1E5-240D-4851-AFA6-B701206BBDBE.1; Thu, 12 Aug 2021 12:01:22 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 4480d24db47e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 12 Aug 2021 12:01:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XV11ij21MuTiNK1a8WLzelCGAA4SgJLLkoloMGT1KNGiixPZnEpo3fTYlWD+dGmH82p4NUA/JjFwy/dWeHbajRXa0nNJDxBU65L3iZ0VUNJbEBQxGCXpXEResUb3Rm64qfuiHokElXyzoTZzg30pL29lY7C2a4/GMv9VmQ4D+vU3BOGAJ+7DDp9bDJ7CLOabyClO/TPla8H3HfU7fntL06mZXd8uYJYCG6QPgPFzYvanPFX1LoV45W2A1fvkcKeTljiSKjENrZkqb3swdTvMQNvHLkrT1PixoeF+SDG3DRs/+77TK/a9vDOinAO0qbVxMjpkEQln3+jVhexRX16UTw== 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=TwDdTdzeVzkFPt+eWCJ8p48i2ebI6tYhw4xnQxZ+1a8=; b=A+n3YCl59/bCovdcUW11UebC6zLlG6N5E6SX6roFw1l1MaQnGW7N6OMGf0sTQ0Z3bhxf/VJfmmjKhyt5utds9CznvBgcXk1WKmSUAJmxD0JN+gV6h6GDOBMFIyhHdnN2L6YCYXvLWCaMdQCExkucSmwY49zCf9FLriTjj7lrrf3OkypDd3gJ7QGZxpXgRhYNM+WUvsBDdxP+cfqZhEsRjXSsEhtt514Tu4K0rIzvAX6jH2vP4zQqXSk0RXL2c4zwHFUmm6OYHuYmC1drhaovr0LGjCg1wdi+tomqQYFU7o/5a0hqXtvKTJoAE3jhKIQKj3Us29FjTo/BZC5yQWIjeQ== 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: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=arm.com; Received: from PA4PR08MB6320.eurprd08.prod.outlook.com (2603:10a6:102:e5::9) by PAXPR08MB6893.eurprd08.prod.outlook.com (2603:10a6:102:13f::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13; Thu, 12 Aug 2021 12:01:20 +0000 Received: from PA4PR08MB6320.eurprd08.prod.outlook.com ([fe80::cd22:a583:c97c:72a6]) by PA4PR08MB6320.eurprd08.prod.outlook.com ([fe80::cd22:a583:c97c:72a6%7]) with mapi id 15.20.4415.017; Thu, 12 Aug 2021 12:01:20 +0000 Date: Thu, 12 Aug 2021 13:01:16 +0100 To: Florian Weimer Subject: Re: [PATCH v5 1/1] : An API for tagged address Message-ID: <20210812120115.GN20410@arm.com> References: <20210805131358.300475-1-hjl.tools@gmail.com> <20210805131358.300475-2-hjl.tools@gmail.com> <87bl63giup.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87bl63giup.fsf@oldenburg.str.redhat.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-ClientProxiedBy: LO4P123CA0496.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1ab::15) To PA4PR08MB6320.eurprd08.prod.outlook.com (2603:10a6:102:e5::9) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from arm.com (217.140.106.49) by LO4P123CA0496.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1ab::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Thu, 12 Aug 2021 12:01:19 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 85a45f20-eae9-468c-3e71-08d95d88eb6a X-MS-TrafficTypeDiagnostic: PAXPR08MB6893:|DB7PR08MB3243: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8882;OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: XSPBjYYSHSJDXERn5uuoj1eu4bNf3qFrqg9xR8fDKe/rt0hR4jo9voJORhsjp2wm1/1CElP25wDPQ6FX9Q7GvpE2aZp73/fyn7WO83T9q3d/EITSdAiUhbKnMZuR2z30pGR4uANky49HxKPBXzBZoIRRlqTyOwJV0VCVE3/5KZYvuaeQ48/RsjEZMg53/TfIYZwrGvaSjeN09B4VGJTGoeo6w/ZKX4E5KY7uDkTZBl91qVch6QB6ZkcpqI6vPJuVdEvpO69B4blJ0vDB3ObuZ6pweGsJv1n441Yt2XJ/i25aQ4OI8UbJ2lP9YDnIgONhlBvOvgaDVhAWZ1bW28CF26oISGgj2ryBleomtdJ26Tqxh2OcVezAOLlNiDVtxQ5r77LOvSMP2X3qhv1He4p6whrfRI87BRc2XzMUGCGuQIkDKyOWu0Bg7+wmtxp9/th/APwTg0QiXW92vRkYnFnoq72Q3qQBX15phoDhSSLlMsgzn227Z4HiT1jCjpYL8uvgNMs8l90ezh59hDm60b2+LfUB63RfqZSiU0EG5sXjhO+l8+14n/uZb72twDfCcEcnROgocfQTCnQrW6if9ZfM0LSL+4P94i2lnxs0mOqw/+FPHpWluGZQrUH2EItBcrLp3cv/78LlZH6kOGpzPbX2uQZPTPdW5AST9p+1NhBsAQFurIuAn3l/hRTwFNIn8CNbqQcjynhw2j7J3bYvVV69wg== 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)(376002)(396003)(366004)(346002)(39860400002)(136003)(38350700002)(38100700002)(8676002)(83380400001)(36756003)(1076003)(4326008)(7696005)(52116002)(55016002)(2906002)(66946007)(478600001)(66476007)(66556008)(8886007)(6666004)(26005)(5660300002)(33656002)(186003)(86362001)(2616005)(956004)(316002)(8936002)(44832011)(54906003)(6916009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NVFoVmhFWW9HNTEyOWdOL3FGOXh4NWZ5V1NOV3VRQytueXlFNDQ5enBQbjUx?= =?utf-8?B?ZmJucFYzU2F1aEd2R0ROckNBWjlEbXVzZFZ6cEU1SVk4TDNReHJJeFlrWkFw?= =?utf-8?B?enZxRnZwYlFpU1dLRHVjL1ByZHR5UUE3RTBvK3ZSdlQ4ZXBpNGpsWHNYd09D?= =?utf-8?B?UWx2K1Z5TXk2Ymt2YS9GdTNlWDNaSnkzUHhXWDg2QW14SExGeWlteTA3eDRS?= =?utf-8?B?MytudWYycVFuVUpTM2xwYTNSaGxpL2VtRHdIVFlMTmRTQjVKcktCUEVialZa?= =?utf-8?B?dENjNHlTZ3FaV21pUG5qc3dYcGd4S0ROanRmNldvbFlNeWdOYzVVUTdha3dK?= =?utf-8?B?ZHNlT3RWbXRnbWxYLzBEYXBSajNFQjlKS3BFaVBsY3BIdGZseVVzdTk2aXRE?= =?utf-8?B?dC8waHY2ZEY4dnN2R3lKOThVTXRzTkVPWUw4ZXI4Ylk4UzFUQS9XamYyQ25t?= =?utf-8?B?TS84ZHJSWHhXZ1l6cG5HVExreVpRUW4yNm81VFk0ekw1anhKaEhGVzQyOXpL?= =?utf-8?B?NFJzd2hqazhFVFpwUnNqaXpIQ054S2R6UWdXVHA5V0Rtbmtp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ZxUzZDdU1ZNFgwa2hBdTdSZkp5N293?= =?utf-8?B?YldoaStZanBUOTRLQlNSUk5ySTVjcm9mTTZQRFNQME4rcm5jNElpL1pZaysy?= =?utf-8?B?cTYyQmhpdStrSElQaTZlbmI0UmFNQm9qMFBHbnowTzFNWWRiY1RyTXNha1hR?= =?utf-8?B?QXpPcTdjSElxeUZCdEg4a2l1cHBRREl5NllxaFlNNTloRTJJSU5mOHFVREZC?= =?utf-8?B?dnJQWkZjTU5YSDFna3dEMnlrMGkzMy9hc1lpVlNQM1kwVDdDYisrRFdpL2VY?= =?utf-8?Q?LgkYV7xQE1wLrA9A1XfLfW/Ws8u4mK3pyxG0WTZ?= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6893 Original-Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT016.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: d2e65ef8-6c9a-487c-7999-08d95d88e581 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Fo2Tx5ZutTOe9vQJmv28NvEqeFoCvIe6Vmpf7pW5BReKM0kUZbG+YAWMr+fwQPE5HRm+UD9ax1bMH00Zvpy2a79VPef0zF0xzLWWgpfizCwoKs/LtAcksIj1wDnJ9pOCJiqSgdRzajr0MlKPocibabn1weNpcAbTLLOasVZwsFrLOyEZviI7NS0XjneMyL6W0ktV+joxGNJAKKObxRg1q4F05/yiR1nLo/aYEVDjsvsQkg/H2VrIFymqkVpWgrNn8qhVo8WSWaib1dSmPoI9JGTY85ofssDukI/S9Z5LCUOIHNNhDgamy1mnLNK4E3aM7Rnh9PZtymycHELK1VdRNHTp+DYX82yT7DbJ81aGW8JS9YzKFZR0Y3+oPuYcdj39PiasJ2cofqgdqf/Y9HyIQ9x//Jj2PPWS+7GyC5bS9NigRadVWc3eVSGr/0ZEYx0WdTQNAxROJlmd1S/04nQK3+RgeiMV05fLX6Sf51e24EFxJpNP6JwMzu5npEQIFzVlPDUMOZcmTWt9uOBxv/cYyeKlMvu0yVQuBDJ0I1Y2aWqoXSJ7/Zrv1hiL6PekdNPBSEt0lW/MAuwhN8HN33UKQRpg1ME+aQ4mbjPPetcIBPsP8s0DR4rFEc8uhT18nXLJu/mXUvON9TrhMY4Buf5wvR658xFtDEedJ/CV2dtDFVWfDQjiii09HrU001lNCpRLFz3KsYEZSCP76+NTIG7Y9w== 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)(396003)(346002)(376002)(136003)(39860400002)(36840700001)(46966006)(478600001)(956004)(1076003)(186003)(44832011)(26005)(36756003)(54906003)(82310400003)(82740400003)(107886003)(4326008)(336012)(33656002)(316002)(8676002)(2616005)(47076005)(6862004)(70206006)(70586007)(5660300002)(6666004)(7696005)(2906002)(8886007)(83380400001)(356005)(36860700001)(86362001)(8936002)(81166007)(55016002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2021 12:01:29.4970 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 85a45f20-eae9-468c-3e71-08d95d88eb6a 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: VE1EUR03FT016.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3243 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: , From: Szabolcs Nagy via Libc-alpha Reply-To: Szabolcs Nagy Cc: libc-alpha@sourceware.org, Joseph Myers , "Kirill A . Shutemov" Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" The 08/12/2021 10:36, Florian Weimer wrote: > * H. J. Lu: > > +@deftypefun int set_tagged_address_mask (uintptr_t @var{mask}) > > +@standards{GNU, sys/tagged-address.h} > > +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} > > +Set the mask for address bits used in address translation to @var{mask}. > > +Only bits set in @var{mask} will be used in address translation. The > > +return value is @code{0} on success and @code{-1} on failure. This > > +function can be called only once before @code{main}. > > Again the restriction around @code{main} is unclear. If it's “before > allocating memory” or “before starting threads”, than we should say > that. it should be at least before thread creation on aarch64. > I still don't see a way how we can split tag address bits used by the > implementation (glibc, sanitizers) and the application. an application may not be able to use tag bits at all: +All pointers participating in a pointer arithmetic operation should have +the same tag if they point to the same memory object so that pointer +equality operation can be performed on tagged pointers. if the implementation gives an untagged pointer to user code which tags it then there are differently tagged pointers to the same object: 0 tag and user tag. it is generally hard to ensure that pointers don't escape and don't end up breaking pointer cmp somewhere. so one approach is to just disallow user tags, only sanitizer and similar tools can tag (and i think hwasan can coordinate with glibc via less formal api/abi that we can change later) another approach is to allow user tags and user has to deal with potential problems (requiring compiler barriers around pointer tagging etc), in that case i think we have to reserve bits for the implementation if we want to use that for malloc.