config/arm: add checking SVE cpuflag

Message ID 1621568034-29269-1-git-send-email-fengchengwen@huawei.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series config/arm: add checking SVE cpuflag |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-abi-testing success Testing PASS
ci/github-robot success github build: passed
ci/iol-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Functional fail Functional Testing issues
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-mellanox-Performance fail Performance Testing issues

Commit Message

Chengwen Feng May 21, 2021, 3:33 a.m. UTC
  If compiled with SVE feature (e.g. "-march=armv8.2-a+sve'), the binary
could not run on non-SVE platform else it will encounter illegal
instruction [1].

This patch fixes it by add 'RTE_CPUFLAG_SVE' to compile_time_cpuflags,
so that rte_cpu_is_supported() will print meaningful log under above
situation.

[1] http://mails.dpdk.org/archives/dev/2021-May/209124.html

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
 config/arm/meson.build | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

Chengwen Feng June 21, 2021, 1:17 a.m. UTC | #1
Hi, ARM guys, Thomas

Could you help review this patch ?

Thanks

On 2021/5/21 11:33, Chengwen Feng wrote:
> If compiled with SVE feature (e.g. "-march=armv8.2-a+sve'), the binary
> could not run on non-SVE platform else it will encounter illegal
> instruction [1].
> 
> This patch fixes it by add 'RTE_CPUFLAG_SVE' to compile_time_cpuflags,
> so that rte_cpu_is_supported() will print meaningful log under above
> situation.
> 
> [1] http://mails.dpdk.org/archives/dev/2021-May/209124.html
> 
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> ---
>  config/arm/meson.build | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/config/arm/meson.build b/config/arm/meson.build
> index e83a56e..9b147c0 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -480,6 +480,10 @@ if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
>      compile_time_cpuflags += ['RTE_CPUFLAG_NEON']
>  endif
>  
> +if cc.get_define('__ARM_FEATURE_SVE', args: machine_args) != ''
> +    compile_time_cpuflags += ['RTE_CPUFLAG_SVE']
> +endif
> +
>  if cc.get_define('__ARM_FEATURE_CRC32', args: machine_args) != ''
>      compile_time_cpuflags += ['RTE_CPUFLAG_CRC32']
>  endif
>
  
Ruifeng Wang June 21, 2021, 5:56 a.m. UTC | #2
> -----Original Message-----
> From: Chengwen Feng <fengchengwen@huawei.com>
> Sent: Friday, May 21, 2021 11:34 AM
> To: thomas@monjalon.net; ferruh.yigit@intel.com
> Cc: dev@dpdk.org; viktorin@rehivetech.com; Ruifeng Wang
> <Ruifeng.Wang@arm.com>; jerinj@marvell.com;
> bruce.richardson@intel.com
> Subject: [PATCH] config/arm: add checking SVE cpuflag
> 
> If compiled with SVE feature (e.g. "-march=armv8.2-a+sve'), the binary could
> not run on non-SVE platform else it will encounter illegal instruction [1].
> 
> This patch fixes it by add 'RTE_CPUFLAG_SVE' to compile_time_cpuflags, so
> that rte_cpu_is_supported() will print meaningful log under above situation.
> 
> [1] http://mails.dpdk.org/archives/dev/2021-May/209124.html
> 
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> ---
>  config/arm/meson.build | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> e83a56e..9b147c0 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -480,6 +480,10 @@ if (cc.get_define('__ARM_NEON', args:
> machine_args) != '' or
>      compile_time_cpuflags += ['RTE_CPUFLAG_NEON']  endif
> 
> +if cc.get_define('__ARM_FEATURE_SVE', args: machine_args) != ''
> +    compile_time_cpuflags += ['RTE_CPUFLAG_SVE'] endif
> +
>  if cc.get_define('__ARM_FEATURE_CRC32', args: machine_args) != ''
>      compile_time_cpuflags += ['RTE_CPUFLAG_CRC32']  endif
> --
> 2.8.1
Thanks for the patch.
Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
  
Thomas Monjalon June 23, 2021, 7:29 a.m. UTC | #3
> > If compiled with SVE feature (e.g. "-march=armv8.2-a+sve'), the binary could
> > not run on non-SVE platform else it will encounter illegal instruction [1].
> > 
> > This patch fixes it by add 'RTE_CPUFLAG_SVE' to compile_time_cpuflags, so
> > that rte_cpu_is_supported() will print meaningful log under above situation.
> > 
> > [1] http://mails.dpdk.org/archives/dev/2021-May/209124.html
> > 
> > Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> 
> Thanks for the patch.
> Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>

Applied, thanks.
  

Patch

diff --git a/config/arm/meson.build b/config/arm/meson.build
index e83a56e..9b147c0 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -480,6 +480,10 @@  if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
     compile_time_cpuflags += ['RTE_CPUFLAG_NEON']
 endif
 
+if cc.get_define('__ARM_FEATURE_SVE', args: machine_args) != ''
+    compile_time_cpuflags += ['RTE_CPUFLAG_SVE']
+endif
+
 if cc.get_define('__ARM_FEATURE_CRC32', args: machine_args) != ''
     compile_time_cpuflags += ['RTE_CPUFLAG_CRC32']
 endif