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 02FDE43928; Mon, 22 Jan 2024 12:04:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 722AF40291; Mon, 22 Jan 2024 12:04:21 +0100 (CET) Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) by mails.dpdk.org (Postfix) with ESMTP id 209F94028B for ; Mon, 22 Jan 2024 12:04:20 +0100 (CET) Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-55a87dfc3b5so1865234a12.3 for ; Mon, 22 Jan 2024 03:04:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1705921459; x=1706526259; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=uS1G4sMq3pnwqF79SbjXBZaWs0nPCuSYKU28YNCOICg=; b=cuKtvLGqz3aPavsJ8gF+WPZyhdRV2M8+F2iIMTLuSpekmHkrcr9IJo/wMxuZeJ+xo9 ELJDciTenfdpHXdjHbt006gFIoyTdVdGFCMJT6spmE0AMmcyGahWeUCV884G/PMS2kKt ic5wMoT5VgNxv+9DCJLNvPNwQbo5qJGIoI9zDmmNg3mEf0rXSElxUaV8t62q0gT2Vzq1 rrymkTLhIGz4B9BmMwIf+5L+IZ/ix4no7mu+UPGhHr2TsCgp1GYu4owKsB28VdGlsGcz NCFLmWKQKgLdW1naLWygokBwtYPqHU4KweRAUDhtRx+rWSznGn/oquYspgoX2NinpCcQ Novg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705921459; x=1706526259; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uS1G4sMq3pnwqF79SbjXBZaWs0nPCuSYKU28YNCOICg=; b=j6bbH+rc5ytueoRjumVu+tN+Ez8PScnCumc/wU3o9BUQxglTvys4JYe3w6/f80aqNW 6LkMt8WTSY+ap4dOXbvD6slu6+m/jvpqhw3UBT4w+sHQx1JeOo/+kMTIEVF+Eq5LBiBK 7p278WIOpKjck6K9F+PhjUul0VRgazYxugF+i3CgP9vsO4dqdSsryg4suQYiOHoavWzm NNT7FAmrW9pgsKadr/P/BAbhXpdszMzq+H/+lSJlkJ/lQp5Z+YKXHOdSIeT1jTj1edam YHVK1eQbhT4qiJmfg+hNckA7GJdBj2X6EUH+Cb6Yu1OrLyQISITsdmtUsZHWI90MNcyW LddQ== X-Gm-Message-State: AOJu0YyLyux9WFwJHiuhmz1WNXM0L+52meuKqlJPPstWhK6jEUz/Odx9 3sq5JsGXIOznrBJvgwj27mNhpRSMDlDwl9bEpMMd0HM5DrvD1Wl9k9xseex9tCoQ49JRoQkVLga mc70rz/uC97Yx4guOy8TDPzX1j6L7c53vDkxaiA== X-Google-Smtp-Source: AGHT+IF6jt25uQh7Elp8tQoJNKLX/C3hN8x0ihyZmZOo9cdwhJFmsKOrVYf2kNKeFzib77jxTYaQqz/08XT2QE6l1K0= X-Received: by 2002:a17:906:c17:b0:a2b:fd31:6da8 with SMTP id s23-20020a1709060c1700b00a2bfd316da8mr2036124ejf.53.1705921459612; Mon, 22 Jan 2024 03:04:19 -0800 (PST) MIME-Version: 1.0 References: <20240121093653.2890-1-pbhagavatula@marvell.com> <20240121093653.2890-2-pbhagavatula@marvell.com> In-Reply-To: <20240121093653.2890-2-pbhagavatula@marvell.com> From: =?UTF-8?Q?Juraj_Linke=C5=A1?= Date: Mon, 22 Jan 2024 12:04:08 +0100 Message-ID: Subject: Re: [PATCH 2/2] config/arm: add support for fallback march To: pbhagavatula@marvell.com Cc: jerinj@marvell.com, Ruifeng.Wang@arm.com, nd@arm.com, Bruce Richardson , dev@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Sun, Jan 21, 2024 at 10:37=E2=80=AFAM wrote: > > From: Pavan Nikhilesh > > Some ARM CPUs have specific march requirements and > are not compatible with the supported march list. > Add fallback march in case the mcpu and the march > advertised in the part_number_config are not supported > by the compiler. > It's not clear to me what this patch adds. We already have a fallback mechanism and this basically does the same thing, but there's some extra logic that's not clear to me. Looks like there are some extra conditions around mcpu. In that case, all of the mcpu/march processing should be done first and then we should do a common fallback. > Example > mcpu =3D neoverse-n2 > march =3D armv9-a > fallback_march =3D armv8.5-a > > mcpu, march not supported > machine_args =3D ['-march=3Darmv8.5-a'] > > mcpu, march, fallback_march not supported > least march supported =3D armv8-a > > machine_args =3D ['-march=3Darmv8-a'] > > Signed-off-by: Pavan Nikhilesh > --- > config/arm/meson.build | 15 +++++++++++++-- > 1 file changed, 13 insertions(+), 2 deletions(-) > > diff --git a/config/arm/meson.build b/config/arm/meson.build > index 8c8cfccca0..2aaf78a81a 100644 > --- a/config/arm/meson.build > +++ b/config/arm/meson.build > @@ -94,6 +94,7 @@ part_number_config_arm =3D { > '0xd49': { > 'march': 'armv9-a', > 'march_features': ['sve2'], > + 'fallback_march': 'armv8.5-a', > 'mcpu': 'neoverse-n2', > 'flags': [ > ['RTE_MACHINE', '"neoverse-n2"'], > @@ -709,14 +710,14 @@ if update_flags > > # probe supported archs and their features > candidate_march =3D '' > + supported_marchs =3D ['armv9-a', 'armv8.6-a', 'armv8.5-a', 'armv8.4-= a', > + 'armv8.3-a', 'armv8.2-a', 'armv8.1-a', 'armv8-a'= ] > if part_number_config.has_key('march') > if part_number_config.get('force_march', false) or support_mcpu > if cc.has_argument('-march=3D' + part_number_config['march'= ]) > candidate_march =3D part_number_config['march'] > endif > else > - supported_marchs =3D ['armv8.6-a', 'armv8.5-a', 'armv8.4-a',= 'armv8.3-a', > - 'armv8.2-a', 'armv8.1-a', 'armv8-a'] > check_compiler_support =3D false > foreach supported_march: supported_marchs > if supported_march =3D=3D part_number_config['march'] > @@ -733,6 +734,16 @@ if update_flags > endif > > if candidate_march !=3D part_number_config['march'] > + if part_number_config.has_key('fallback_march') and not supp= ort_mcpu > + fallback_march =3D part_number_config['fallback_march'] > + foreach supported_march: supported_marchs > + if (supported_march =3D=3D fallback_march > + and cc.has_argument('-march=3D' + supported_marc= h)) > + candidate_march =3D supported_march > + break > + endif > + endforeach > + endif > warning('Configuration march version is @0@, not supported.' > .format(part_number_config['march'])) > if candidate_march !=3D '' > -- > 2.25.1 >