From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130088.outbound.protection.outlook.com [40.107.13.88]) by sourceware.org (Postfix) with ESMTPS id D13C83861843 for ; Wed, 23 Sep 2020 16:19:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D13C83861843 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=6uqLdFqUolK9K7/fyLHRETR4Y0wBV1QbaATrLh2uZbI=; b=bbPYdj+lXukQ3wklpZKSi3J32gEgO37fmTTyv3dZ4FjDZKKBrJXU+oCWxT/zIZFPJ6ena0neX7BMVEzYsTlmz/6uGJWcUwMEtck7YRaCfrloNz2bCmw46fXERcnWSXlQXqd9kAZFwKptvw6jz4RgiUefElO2xiYughDmzjI05Tk= Received: from AM6PR01CA0045.eurprd01.prod.exchangelabs.com (2603:10a6:20b:e0::22) by DB7PR08MB3451.eurprd08.prod.outlook.com (2603:10a6:10:49::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.20; Wed, 23 Sep 2020 16:19:46 +0000 Received: from AM5EUR03FT037.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:e0:cafe::37) by AM6PR01CA0045.outlook.office365.com (2603:10a6:20b:e0::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.20 via Frontend Transport; Wed, 23 Sep 2020 16:19:46 +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=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.3412.21 via Frontend Transport; Wed, 23 Sep 2020 16:19:46 +0000 Received: ("Tessian outbound 195a290eb161:v64"); Wed, 23 Sep 2020 16:19:46 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: a1af0847578fc08e X-CR-MTA-TID: 64aa7808 Received: from 83bceb714c66.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 46E44166-AC81-45F1-B285-BFB69A83B940.1; Wed, 23 Sep 2020 16:19:38 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 83bceb714c66.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 23 Sep 2020 16:19:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jh86fmpjiWMsUx/L0KGLJNYLoTsVl10Ayc1nxNemXlTgs1V1H+PM9ZZIAfqvg+SYkEg8dssJwTvN8PNRSbBCAAWdugQVCBuX1ctG/UEG9GVbDqrbWTvoZVpEk9f6Or2ai85Yz3ddnanc+aesAVZucV8PCprYiH9YxpqLM/HGQio+wmnjRGZxitajad980wRiRhkyQlr0Hk+ENC6LTreLFmR8fAzKqlfXtOvhjXUDHfuvzhLbguq70WLItXnLDuVK1XXj1HaY7Bcqhii+bYlZtRwZ0SGxebEMEUAar2j33Etz9KKy+sU0qR7e7eaHwaxySn4Gmx6ETVed+lgf+fRRTA== 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=6uqLdFqUolK9K7/fyLHRETR4Y0wBV1QbaATrLh2uZbI=; b=CSzsqfCl0c0ucYb4lEzPO27iju/y2WcFlc9jUQLKwpSAcQ0VALgtYTtWjSjf5gDRAHELpJhnIAfiVlotZZMDnAa7QOxFLTreG8+PMKHCrDrANfQXtSMD1IMt0O2WA+Kkz7/3ifhL8EgTScXTkO3G0ejNE0aVjPREw1THDHRmro1sQG5UnfekEORdpyHOef4YVNLGiYp/j+5qzMhXB0/xadfNY4c4LOGTjjjFc1JrEzmkcrmAvx0qn/zlWLF8qSVAgh8kWz0rpJCw0LJhKVNGsKFwalvIsXPFFVhUqSl+epOK16YTAwfAQcPU8hMm+DMnVBd2Y6yYNAEWgc7xhYl3fQ== 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=6uqLdFqUolK9K7/fyLHRETR4Y0wBV1QbaATrLh2uZbI=; b=bbPYdj+lXukQ3wklpZKSi3J32gEgO37fmTTyv3dZ4FjDZKKBrJXU+oCWxT/zIZFPJ6ena0neX7BMVEzYsTlmz/6uGJWcUwMEtck7YRaCfrloNz2bCmw46fXERcnWSXlQXqd9kAZFwKptvw6jz4RgiUefElO2xiYughDmzjI05Tk= 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 VE1PR08MB5566.eurprd08.prod.outlook.com (2603:10a6:800:1a9::7) by VE1PR08MB5134.eurprd08.prod.outlook.com (2603:10a6:803:110::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.14; Wed, 23 Sep 2020 16:19:35 +0000 Received: from VE1PR08MB5566.eurprd08.prod.outlook.com ([fe80::11d4:e51c:433e:ed0a]) by VE1PR08MB5566.eurprd08.prod.outlook.com ([fe80::11d4:e51c:433e:ed0a%7]) with mapi id 15.20.3391.025; Wed, 23 Sep 2020 16:19:34 +0000 Date: Wed, 23 Sep 2020 17:19:27 +0100 From: Szabolcs Nagy To: Ben Coyote Woodard Cc: libc-alpha@sourceware.org Subject: Re: [PATCH] Fix runtime linker auditing on aarch64 Message-ID: <20200923161927.GH16385@arm.com> References: <20200923011613.2243151-1-woodard@redhat.com> <20200923123426.GD16385@arm.com> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-ClientProxiedBy: SN4PR0501CA0092.namprd05.prod.outlook.com (2603:10b6:803:22::30) To VE1PR08MB5566.eurprd08.prod.outlook.com (2603:10a6:800:1a9::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from arm.com (217.140.106.54) by SN4PR0501CA0092.namprd05.prod.outlook.com (2603:10b6:803:22::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.17 via Frontend Transport; Wed, 23 Sep 2020 16:19:33 +0000 X-Originating-IP: [217.140.106.54] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: b5235ece-14ab-4157-d619-08d85fdc7cdc X-MS-TrafficTypeDiagnostic: VE1PR08MB5134:|DB7PR08MB3451: X-LD-Processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:9508;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: ZA20SU/78/IJWUT87jpSJ1tNUaYRGARgtnLJedk3AEZIoz53RLf391DqPaosPSYSOt/TvihoHHs2mS75fBPxg6CkruiG7BqD9OI6GpgcqclftEXzCC6PHX4CcE2pNrXWd3PuvUyS195Cjmw9bRUVainy158E5OQB+XQ1ucvGfJRIPvFuklpASdNm7RVdgqfKBzAJjvxQcOA1cZHUlE97rakHO26EiRJU9OrP+Uwjz/NYs0o2c0H/nvJ0Q2QWcQOnR8Y5dywgQgnb6Oy2xPp3B+YicAIQdyReZsds1RPJMUuWLtrFbm/37si2probcgDqWVqFhhdjL1/UcKKen1V5S+GiQ9yn4N0aDxiG2J9JENAVfLGft1yVw9y3GslyO+ChEljkmzbK8jvUTbp7RVcTBqmliyYVI8MSCzlUBvmfMAOoJQaGy+1W5WPOlMR0dNMKFa2zi04d5/snmHK1H95fyA== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR08MB5566.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(366004)(346002)(39850400004)(136003)(376002)(53546011)(4326008)(52116002)(7696005)(2906002)(33656002)(8676002)(966005)(36756003)(8936002)(478600001)(55016002)(956004)(2616005)(86362001)(316002)(66476007)(1076003)(6666004)(186003)(66556008)(6916009)(44832011)(66946007)(16526019)(26005)(8886007)(83380400001)(5660300002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: XYMs2rjGJ4aAaMDf1b8O/ptBYaCZYT5pDejuh/6OOM8R9DKUgsiL6LxwWWGtDpWArS2NTFwWQ+t8xtsD/rKusKgHWuFy48IBfDwCy2fjQr774OZX5msU/4bqpKXc/A1pPRoyqoK2kmZldgPmNl5u8l2/wHjB5iR8Y8hEl50R9jbNshUsKFpyRFv3AJGaBPvqg4LMljM35RDefdIXfBQNMLzDeBcuAJ4gQfSGwbzDTYAAvIl2g3j1JpyzURO4ejLQW+HVvdobzGSapYu3XM/bkxab/lVuVRat5Y6cVi9LUseXC4l0ogHLGlNrsj4EdFNxOTD1D3MX7Yl34q9/4b8kQm6Pl/uoUKLdp9HuQgPTvNmQTxabIl8bwUnFS9CU+srB7+75LWXZZ5xg4qXerafEbCpIRRLsK4vG+eZaBbMRe/jWYc6BDcWk8uzxGzPbRwVuWjH4aZvSGy/+9hXqUuq6mYBcASEzg3yWMz8k7Gt1XyME9jtCYDeVeYvHSK13RjeVFl5LBRLnt0LziPnGxmUSM4d5P/o2GOdG7yJ4+ZkZDrxozXMxKjpbkZqwX2vSdpe2dBeamUFRWXxBKn0rPqtJ2o1WBN76PsimRLzbZzeV7JZZnPjEgyUd142zYRVGDyfA8ls2rO7Ucf04fv2j2UYlwg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5134 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: AM5EUR03FT037.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 44db2cb7-4ac5-44b9-393d-08d85fdc75ac X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MpL12Zvyy5i8r0oMxMkbOvUL9RDSaj9djvp/AQCKzu1vLTuF1H1C2LwyOdk8h9AFVRNjVC54DaG3tPjPTqPyNq72Eu8IuATPN/PVqZCXs6Al+Kiz5pYqkwiw6jCqq6CkXY4nTMnhW2MzueE64bWCD3wmoNk88nzbR459y4Bq0fFKQ++4gAujo9PLRn1AU6SePNRklreHlrj2icHKmfrZFS/01laM/enVIf/ezMsgkJ3h26OuRvJxwV3CGahbMdSftCTgx/7gWPPgYJGae6Z139iWE7HE/oEki1WYeBhNLy7Qyxm+Y+GcqgDtBEleKxnGGoURw5fzTeUSV7N+HjVuwvpBYVA0XL9MAHv4ia6G1r5aATJWwIAZLic1N7ghLoA3m7151+SF6GgYXtKLtsC1hltCM8v7qG1DFvB87R4qb++KR3cPohTduoP6VenHGBLoFCOHZH96d55/jsDVfUwwqA+hUEZiVGge/mY8FJ0Dva8= 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)(39860400002)(136003)(46966005)(356005)(81166007)(36906005)(70206006)(26005)(336012)(47076004)(16526019)(53546011)(6862004)(8936002)(7696005)(2616005)(8886007)(6666004)(316002)(186003)(956004)(2906002)(82310400003)(5660300002)(478600001)(44832011)(86362001)(33656002)(8676002)(1076003)(4326008)(966005)(36756003)(55016002)(82740400003)(83380400001)(70586007); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2020 16:19:46.4676 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b5235ece-14ab-4157-d619-08d85fdc7cdc 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: AM5EUR03FT037.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3451 X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, KAM_NUMSUBJECT, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=no 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-List-Received-Date: Wed, 23 Sep 2020 16:19:50 -0000 The 09/23/2020 08:10, Ben Coyote Woodard wrote: > On Wed, Sep 23, 2020 at 13:34, Szabolcs Nagy wrote: > > The 09/22/2020 18:16, Ben Woodard via Libc-alpha wrote: > > > /* Return values for calls from PLT on AArch64. */ > > > typedef struct La_aarch64_retval > > > { > > > - /* Up to two integer registers can be used for a return value. > > > */ > > > - uint64_t lrv_xreg[2]; > > > - /* Up to four D registers can be used for a return value. */ > > > - uint64_t lrv_dreg[4]; > > > + /* Up to eight integer registers and the indirect result > > > location register > > > + can be used for a return value. */ > > > + uint64_t lrv_xreg[9]; > > > > x8 is not preserved so recording it at function exit > > is not useful. (on entry it points to where results > > are stored but on exit it can be clobbered) > > OK that was not clear to me reading the AAPCS. Do you want to ping you're > colleagues the tech writers over at arm and see if they can tighten up the > language a bit. aapcs is now openly developed (on github) so you can submit bug reports easily ;) in this case section 6.1.1 does not say if x8 is preserved or not, but 6.5 is quite explicit i think: https://github.com/ARM-software/abi-aa/blob/master/aapcs64/aapcs64.rst#result-return > > > + /* Up to eight V registers can be used for a return value. */ > > > + __uint128_t lrv_vreg[8]; > > > > > > } La_aarch64_retval; > > > __BEGIN_DECLS > > > > note: i don't like to use non-standard types in > > public apis (like __uint128_t), but we already > > made this mistake in the linux sigcontext, so this > > is probably ok. > > > > (my preference normally is to use a standard type > > e.g. long double or char[] with alignment attr, > > but in practice __uint128_t is probably easier to > > deal with) > > > > I kind of prefer "long double" here as well. It is after all what it likely > is. I'm not really attached to __uint128_t; the previous version of the > interface had uint64_t and so when making the registers the correct size I > changed it to uint128_t but that didn't compile and then when I grepped the > source I found __uint128_t. It wasn't like I put a lot of thought into that > decision. hm, i think the common case is to inspect float or double arguments in the v regs, so the __uint128_t is probably easier for the user to deal with. (and sigcontext etc already uses that for save/restore of the registers so it is better for interop and least surprise) it's unfortunate that there is no standard uint128_t type. (i think the arm way would be to use "uint8x16_t" or similar type from arm_neon.h but in practice that's harder to use) so keep this as is. (but this reminds me that the current hooks are broken for long double functions, not just for functions taking neon vector args)