Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B550C87FCA for ; Fri, 1 Aug 2025 10:49:37 +0000 (UTC) Received: from PA4PR04CU001.outbound.protection.outlook.com (PA4PR04CU001.outbound.protection.outlook.com [40.107.162.62]) by mx.groups.io with SMTP id smtpd.web11.84692.1754045367643086005 for ; Fri, 01 Aug 2025 03:49:28 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@cherry.de header.s=selector1 header.b=k7EsEanB; spf=pass (domain: cherry.de, ip: 40.107.162.62, mailfrom: quentin.schulz@cherry.de) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=D/WcSzGfyP5HyjGGh10WaY5Kl9/id4xtgfqSY5iHNdql7BG52Dt7BHVCBP0gA0dZ+W2iu3lvFyhjnFSrYdYWWSk2oVM8XOrl/GUO04yOItr/IUShVZbM2Egazl3cw9aGxEKjUKksJxO0EAEC1k2JOSWcdbHk8K4OX2oaSB1IXWPW/hm9tpwTw2dtvABKkyrENL1KDoSUdpvqtZDrswk7ltuwW+/zU1glXwtokCPbLJWxWzjJ13PMPOU/hFs5fwa1wWzgUBSK4kC5rDJOIDkRRHwOOejftKCvo+NtZ6YLPv2Ly6/pZgZVpZIml0SgojEX7nrlwjXMaWOAnPZajZMUnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5Zin9yeDJHMUAv6+hhTxAsU6PSQv06iAAX500tPHHMg=; b=j/Toe2hb9UzB2Rt4sh8AFgdpNgEvrKM4y9G0T8QIkO810mIyVL4U1cntVoK2RkThMmU27hEHWpHvsIwlHrkfKPhvqwEWPWrRTAG+ArPVefBF6gAOBgC0WWYsJAE5fgQUzmLklDxlJGTSOciGlHdLOBKKMgdTHKez/9OM5RUUBEWxiVrVpRWSvNZbilThYOEd12Uc0jIqs0nXyb5Tx+9yYUfIM8aYh3ZZcWnrWvUG3jaW2Wtm6twRhw/N5uOHL2X81OZ0wXVpd5dLuO0rsu1YbrkNd0AY9nCU9vBmsdEq6Vlb2UpUwW4RAGRAaR7u508eNeC/ibdAxgBY5mXP33AUDw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cherry.de; dmarc=pass action=none header.from=cherry.de; dkim=pass header.d=cherry.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cherry.de; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5Zin9yeDJHMUAv6+hhTxAsU6PSQv06iAAX500tPHHMg=; b=k7EsEanBIBPM4cJLDQKUBb94azYjiekhoyKitnOVLa0y/sDvHDecciAislF2LAKExgMTiYGFqbtLI63dc7F/O7ahT7xObcTytS/KFm/ttHbb59wqBoBR+jzmIQJX7oApAqICrLQllVlxRUzMEQiuiQsB0pVMWcwTEq6k7YmZO8E= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=cherry.de; Received: from AS8PR04MB8897.eurprd04.prod.outlook.com (2603:10a6:20b:42c::20) by DU0PR04MB9495.eurprd04.prod.outlook.com (2603:10a6:10:32f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8989.16; Fri, 1 Aug 2025 10:49:24 +0000 Received: from AS8PR04MB8897.eurprd04.prod.outlook.com ([fe80::5ee:7297:93b4:a8d1]) by AS8PR04MB8897.eurprd04.prod.outlook.com ([fe80::5ee:7297:93b4:a8d1%4]) with mapi id 15.20.8989.015; Fri, 1 Aug 2025 10:49:24 +0000 Message-ID: <0bb1a924-2288-4034-a468-bbf358ff28b8@cherry.de> Date: Fri, 1 Aug 2025 12:49:20 +0200 User-Agent: Mozilla Thunderbird From: Quentin Schulz Subject: Re: [OE-core] [PATCH v4] feature-arm-crypto: Add +nocrypto to -mcpu when crypto not in features To: raj.khem@gmail.com CC: openembedded-core@lists.openembedded.org References: <20250724170600.1113476-1-raj.khem@gmail.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: PA7P264CA0114.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:34c::17) To AS8PR04MB8897.eurprd04.prod.outlook.com (2603:10a6:20b:42c::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8897:EE_|DU0PR04MB9495:EE_ X-MS-Office365-Filtering-Correlation-Id: 34852ccd-c9f7-4901-add6-08ddd0e91409 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?rKqtNMiKCR0ZhPKNz1R0G/Uf4GW28LJqWLOk/sgKx1FZfji7l70X2G/shJYa?= =?us-ascii?Q?LVJ49zENVGAi8h+EK2Mft3S6A/q+c4LP7xV/AVukUnevSAFjx7VtAdAwlGJm?= =?us-ascii?Q?inhON6B+5eq/v/2lCN/Uo5CYhUq3wIPhvR4Tpt5fDRWuueajxnfTZKDBvR/L?= =?us-ascii?Q?9pvv/NpYFN19JYk6/5QuDR8NJH+yQetEPGhi3NXrHFc70QSTB3dnHxW/fPkY?= =?us-ascii?Q?u5LuYqQbedJe/fydiWl+R9TUGH3EetHZlpiwEjbE/KUBhA506Mxa1mCNgw0I?= =?us-ascii?Q?3M6bzlIN/Nago7S5Hu5quYVjYtZGS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-ascii?Q?6TWeiDa4aaYSUPLspx9P0CiKXbg03B8Ef94sJKNe9hlB/GilpouYmYR4z1fM?= =?us-ascii?Q?pJ7J/EAzYKbGKsZ6fBG7MdGW6phUAz7q6LUAbiCjzdmAYo6D8vFuJO2JCMZ7?= =?us-ascii?Q?awc0fvnpzUM4gfyWxQYCsIYjBol2tpNPxXYWemKRF2SIZo0IOxSBQgpHAMA1?= =?us-ascii?Q?GF79RhPZFTNi+b/synBMC3pGvQPRIhPk3ILKOCj/UO6558Cy7R6ErvxSzJdG?= =?us-ascii?Q?VkcLIcBiKGE=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8897.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?xv+RVXdALK/xZ43l/LX0t617cpyf/QqcQ3X1UWY+T744YOY3YK72G4zv4wn0?= =?us-ascii?Q?74gLPHN87KIjLvcNtQEVGTmZpEkjXQYThzj5QLfciUz8jPXW3sDqjHwcHuBR?= =?us-ascii?Q?fYgUriKd58s31czDgTmgnN3wi5lDHOin+XCF+b+CtjTX7znSIvE0NH1Xi1DM?= =?us-ascii?Q?tdZphgyzi22ajL5IoOTnZKuyYDBXxMEqjywzWGtqX1y6DZO5yTexgY8zIR6S?= =?us-ascii?Q?y5kwmqLvgPrAW5Uporm4U6IcfZ/UxzdoBRiZCwgLTfRpI9oTccFTcFUZZKyu?= =?us-ascii?Q?3aAX9PmahvVzmztQZBbahXkYWBfT01opRTXYTFSuMKZNHaXNK6wDDNKs2bfB?= =?us-ascii?Q?p3xkUl8W8HslMEZY7txuFASiwh2e6Fp/KPPRMmSNtJyj1o1r70LNF4yLUdA3?= =?us-ascii?Q?8fLkMoTFKi+qgoCgvjFB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8tZ?= =?us-ascii?Q?DZ+D/BTUEtcZDHt18JRO35nON8ypaCuQ3ZCh6RjbWGpL+A6X9WhR93ZY1/0V?= =?us-ascii?Q?K10ZPYLaoPzDdwNaalNMNk8AkA3eAEnPO56qRhoKCrOF+Uiw2+07bh/ONOxH?= =?us-ascii?Q?/aPirYWwNGYjJkeyTDvQ2OO057N1SmDEZ09Z9cbqYN3QUoKbOiRuC1lmbG9j?= =?us-ascii?Q?xbHpoh6MxcSWfsFz8rgcVu4lrwnTIXrUS+tXscg95LU/u7yK/riI6wotRDyh?= =?us-ascii?Q?/JKZj1RcNYbPNcuRMI/TNRRSBG55g4mKiSdyxdI5Pb+/M4c3siASkREnRmpJ?= =?us-ascii?Q?nQ=3D=3D?= X-OriginatorOrg: cherry.de X-MS-Exchange-CrossTenant-Network-Message-Id: 34852ccd-c9f7-4901-add6-08ddd0e91409 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8897.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2025 10:49:24.0708 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5e0e1b52-21b5-4e7b-83bb-514ec460677e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: IcFkljf0g4pCviNjC9urxfrFxqe6Sg8KFw22utVS9HzN2Egwuz9uEe3684y/MdJU0QT4yF2BP7bU9L2iEizJ3tN5MUl7FR3IutxLRFjC1QM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9495 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 01 Aug 2025 10:49:37 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/221229 Hi Khem, On 7/24/25 8:32 PM, Khem Raj via lists.openembedded.org wrote: > On Thu, Jul 24, 2025 at 10:10=E2=80=AFAM Quentin Schulz > wrote: >> >> Hi Khem >> >> On 7/24/25 7:06 PM, Khem Raj wrote: >>> When crypto is not in tune features then add +nocryto to >>> -mcpu explicitly. This makes the behavior between clang >>> and gcc match. Currently -mcpu=3Dcortex-a72 has different >>> behavior in clang and gcc in terms of what features are >>> considered default. Clang enables different set of common >>> features than gcc on other hand. For example clang >>> enables crypto with default set but gcc >>> does not, gcc recommends to disable unavailable extensions >>> in -mcpu [1] explicitly. crypto is optional on cortex-a53 >>> and cortex-a72. This is not as common but Broadcom >>> SOCs in raspberrypi3/4 have dropped crypto for cost >>> reasons [2]. This results in illegal instruction >>> traps [3] [4] when building components e.g. chromium, >>> qtwebengine, weston etc. with clang using -mcpu=3Dcortex-a72 >>> for rpi4 target. >>> >>> Adding +nocrypto makes clang behave like gcc does today. We >>> do have separate tune if crypto enabled cortex-a72 cores >>> are to be targeted (cortexa72-cryto) as DEFAULTTUNE >>> >>> They are added to default feature file since crypto extension >>> is available in multiple arm architecture versions e.g. armv8, >>> armv9. It is optional extension as per spec [5] >>> >>> Extensions can be enabled and disabled with -mcpu using the same >>> syntax as with -march, and have same effect thats why it is >>> intrumented via TUNE_CCARGS_MARCH_OPTS >>> >> >> I believe this is incorrect. TUNE_CCARGS_MARCH_OPTS applies to -march, >> not -mcpu. >=20 > Well, it applied to both in cpu specific tune files ( e.g. > tune-cortexa55.inc ) we override > arch specific TUNE_FEATURES and replace with then CPU specific TUNE_FEATU= RES > This results in TUNE_CCARGS_MARCH being empty and TUNE_CCARGS_MARCH_OP= TS > are still valid and they can appended to TUNE_CCARGS >=20 > in conf/machine/include/arm/arch-arm.inc we have > TUNE_CCARGS .=3D "${TUNE_CCARGS_MARCH}${TUNE_CCARGS_MARCH_OPTS > }" >=20 > Due to include order this append appears after the TUNE_CCARGS is > appended with -mcpu option in a mcpu tune file e.g. tune-cortexa55.inc >=20 > TUNE_CCARGS .=3D "${@bb.utils.contains('TUNE_FEATURES', 'cortexa55', ' > -mcpu=3Dcortex-a55', '', d)}" >=20 > so in the end we get -mcpu=3Dcortex-a55+nocrypto or > -mcpu=3Dcortex-a55+crypto in this case > if you were optimizing widely for an arch then the effect will be via > TUNE_CCARGS_MARCH and > TUNE_CCARGS_MARCH_OPTS >=20 And there's no world where we could have both cortexa55 AND armv8-a in=20 TUNE_FEATURES? I assume this doesn't make sense? If it does, then we=20 could have -mcpu without the +crypto and -march with the +crypto, I=20 assume this could be an issue? I'm probably overthinking this though,=20 aren't I? > I do wonder whether renaming both TUNE_CCARGS_MARCH and > TUNE_CCARGS_MARCH_OPTS to something more generic could help lessen the > confusion. It's there because we have -march and > introduced -mcpu options later on. >=20 It depends. If there are some scenario where we can have both -mcpu and=20 -march specified, then: - if they can have different options (I doubt this is legal), then each=20 have their own _OPTS is desirable, - if they cannot, then the options likely need to be repeated for both=20 mcpu and march If we can have one or the other (mcpu/march), then renaming the variable=20 so its name is more generic would be nice indeed :) Cheers, Quentin