From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 993C345C05; Tue, 29 Oct 2024 02:06:32 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 70E054014F; Tue, 29 Oct 2024 02:06:32 +0100 (CET) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id E741D40144 for ; Tue, 29 Oct 2024 02:06:29 +0100 (CET) Received: from mail.maildlp.com (unknown [172.19.88.105]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4XcsV56LwJzpXXj; Tue, 29 Oct 2024 09:04:29 +0800 (CST) Received: from dggpeml500024.china.huawei.com (unknown [7.185.36.10]) by mail.maildlp.com (Postfix) with ESMTPS id A854D140157; Tue, 29 Oct 2024 09:06:25 +0800 (CST) Received: from [10.67.121.161] (10.67.121.161) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 29 Oct 2024 09:06:25 +0800 Message-ID: Date: Tue, 29 Oct 2024 09:06:25 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] config/arm: strict use of -mcpu for supported CPUs To: Wathsala Vithanage , Bruce Richardson CC: , , , Dhruv Tripathi References: <20241028233139.922029-1-wathsala.vithanage@arm.com> Content-Language: en-US From: fengchengwen In-Reply-To: <20241028233139.922029-1-wathsala.vithanage@arm.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.121.161] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpeml500024.china.huawei.com (7.185.36.10) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 2024/10/29 7:31, Wathsala Vithanage wrote: > Arm recommends using -mcpu over -march and march-extensions when the > compiler supports the target CPU (neoverse-n1 etc.). Arm build so far > has been an amalgam of -mcpu and -march. When march is in use, it has > been the case so far to silently fall back to a downgraded march when > the compiler does not support the requested march. This is unnecessary > and confusing to an end user who could be building DPDK with a > particular ISA version and performance expectations in mind. I couldn't understand the problem, current the arm build already prefer use mcpu and then march: if (part_number_config.has_key('mcpu') and elif part_number_config.has_key('march') > > This patch aims to rectify both the above issues. For part numbers that > has a corresponding -mcpu, this patch removes all references to march > and march_features from meson.build. For those SOCs that do not have a > corresponding -mcpu, a pseudo cpu name in the format mcpu_ is > introduced and referenced in the mcpu field in the part number > dictionary of the part_number_config dictionary. The definition of the > mcpu_ must be provided in the mcpu_defs dictionary. > Each mcpu_ dictionary in the mcpu_defs have a march field and > a march_extensions field to construct the optimal compiler setting for > an SOC that has no corresponding -mcpu value. This patch alters the > behavior of the build system such that it will no longer silently fall > back to an older ISA version, it will only perform what's specified in > the build dictionaries, if the compiler does not support the specified > configuration it will fail with an error message. > > How to add a new SOC to the build system with these changes? > If compiler supports mcpu follow the usual practice but without march > and march_features fields in the part number dictionary. If mcpu is not > available or buggy (misses certain features) for some reason follow the > same process but set mcpu field to a string in the form 'mcpu_foo' > (pseudo mcpu mentioned earlier). Then in the mcpu_defs dictionary add > mcpu_foo dictionary as shown. > > 'mcpu_foo': { > 'march': 'armv8.2-a', > 'march_extensions': [rcpc] Prefer extend or change already existed struct. In addition, there are many structures in the arm build. But it seemed there is no document to describe the structure to which a feature should be added. > } > > march_extensions is a comma separated list of march extensions supported > by the compiler such as sve, crypto etc. Empty match_extensions allowed > as use of such extensions are optional. > > Signed-off-by: Wathsala Vithanage > Reviewed-by: Dhruv Tripathi