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 1A66A43B73; Thu, 22 Feb 2024 11:47:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DA59840281; Thu, 22 Feb 2024 11:47:38 +0100 (CET) Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by mails.dpdk.org (Postfix) with ESMTP id D033040267 for ; Thu, 22 Feb 2024 11:47:37 +0100 (CET) Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a3f893ad5f4so61841766b.2 for ; Thu, 22 Feb 2024 02:47:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1708598856; x=1709203656; 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=CvaE7e8XS3f71H5FMaq7FQtoB+G3J7Y7F8jWXyCkTc0=; b=RLassf7JK5zruQWF7eRd3NPHACq2BBgbpqGC/xC/tXlPyQEJA72rwpPRCfTHzmQHTw SQhBLFtKhdmVYkPi9b0CoPI/3Mw/UrG725RkX9RETzc+ZNrpAocnC144U+IU2SSFnwa5 tBbu1XE9QrXQdAr/tVYeZ4dLrfEYe2ljARs15wCEj67Du7OCYe7EyiVVYY0K9r926St1 Xvt/tBOY/Et+XsSGrmEMJd5uzaDxC9mocAX/M9dpz2y23RRkDDegp7+bdCchJBbEEZCj oYiW4Z66EtM/VzwIrGFmttFaialn+uKvv4Xjo66zfnFJf7IJXyyIWYdzYh9aDynZ6E7E jjrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708598856; x=1709203656; 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=CvaE7e8XS3f71H5FMaq7FQtoB+G3J7Y7F8jWXyCkTc0=; b=iTS602JVfYefDBVQDI17M/yzEeSbjV0d1DOhxmS2KT68Tbl3HdBuCs6X6tYZBAxNSE SQ4XZS0WIxZUfOBbmQuF8mp52ugoZOFgY8i0ADifNRaf8+nA680IRKesnRdWyX8pFFtr zGRSqKfp0dqPDmBcGFFn1U6r9d0ix6lD0+2G5pRe+a6dKjX5LtexNYt8avpBzSraPD98 dTAiwOo+GaXSoDLFOUyiBmaC6q3UGIDcqHnVDqMMSPYvWoY5Izx74wCgWIHtyNKTkO4T Sp3qSoKzIN666CzkaCpgX/QJSyIPvrD6e2QZ4bQh3XHeP61+KCQvhBFQ25Tne1cKbPr2 ECMQ== X-Forwarded-Encrypted: i=1; AJvYcCXFwbygG/JeLn9Fct/5L9+qNercKlzlebCLAukP+vDl7jJ+d0buZfGEuPpYx+9jStXtvAAa2d9pHsNAeCw= X-Gm-Message-State: AOJu0YyAIqRkpswUAYTyfnmIzn0EeAe7Bk4fXY8leaNWnMorJdwHSc0S HRiH+bLmtt+/reInljlxcLeWdAsTPKRjS0mjbtYektFBU3MFG94cZzNbzz/ATWJeSVFT66jT0/f c7OX2g+mVcJFnbC8Zr4AASUSDq/ziVCY7vWrtzQ== X-Google-Smtp-Source: AGHT+IG5/v+/muwQ6ZDWdzpdsYumf4qrrfrhVLgHO9lgBl1tO0R3fRcqU8GY74C/KQHHGCPxAk3YR/i3XXVN1RmQuNg= X-Received: by 2002:a17:906:c198:b0:a3e:34e8:626f with SMTP id g24-20020a170906c19800b00a3e34e8626fmr10844149ejz.66.1708598856671; Thu, 22 Feb 2024 02:47:36 -0800 (PST) MIME-Version: 1.0 References: <20240202085031.10237-1-pbhagavatula@marvell.com> <20240221202018.14179-1-pbhagavatula@marvell.com> <20240221202018.14179-2-pbhagavatula@marvell.com> In-Reply-To: <20240221202018.14179-2-pbhagavatula@marvell.com> From: =?UTF-8?Q?Juraj_Linke=C5=A1?= Date: Thu, 22 Feb 2024 11:47:25 +0100 Message-ID: Subject: Re: [PATCH v4 2/3] config/arm: add support for fallback march To: pbhagavatula@marvell.com Cc: jerinj@marvell.com, nd@arm.com, wathsala.vithanage@arm.com, Ruifeng Wang , 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 Wed, Feb 21, 2024 at 9:20=E2=80=AFPM 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. > > 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 | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/config/arm/meson.build b/config/arm/meson.build > index e77b696d8e..f6521653c8 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"'], > @@ -716,6 +717,7 @@ if update_flags > > # probe supported archs and their features > candidate_march =3D '' > + fallback_march =3D '' > if part_number_config.has_key('march') and candidate_mcpu =3D=3D '' > if part_number_config.get('force_march', false) > if cc.has_argument('-march=3D' + part_number_config['march'= ]) > @@ -736,10 +738,18 @@ if update_flags > # highest supported march version found > break > endif > + if (part_number_config.has_key('fallback_march') and > + supported_march =3D=3D part_number_config['fallback_= march'] and > + cc.has_argument('-march=3D' + supported_march)) > + fallback_march =3D supported_march > + endif I'm trying to wrap my head around this. If I understand this correctly, fallback_march is going to be set only if fallback_march > part_number_config['march'] (fallback_march must be higher than the one in part_number_config, otherwise the loop will end with break before setting fallback_march). The added fallback_march configuration above is the opposite (fallback_march < part_number_config['march']) so I'm not sure what we're trying to accomplish here. Is the intention to specify a fallback_march that's lower than the one the original fallback mechanism would find? If so, we'll need to remove the break (and probably set check_compiler_support to false) so that the loop could continue. > endforeach > endif > > if candidate_march !=3D part_number_config['march'] > + if fallback_march !=3D '' > + candidate_march =3D fallback_march > + endif > warning('Configuration march version is @0@, not supported.' > .format(part_number_config['march'])) > if candidate_march !=3D '' > -- > 2.25.1 >