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 558CB41C89; Mon, 13 Feb 2023 15:55:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D811440A81; Mon, 13 Feb 2023 15:55:04 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 95F4B400D6 for ; Mon, 13 Feb 2023 15:55:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676300103; x=1707836103; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=VheVpejFpfqhL7KhM3dA0Nf1h0TVM3afChixwmFKuMA=; b=aRUHW+9U5nS7WAu5ZIZAo16hMUsMQI15XCrp9Eo7lD2Vk4CO17mCHmNd ogL2MQpcDZ89IaP8pEcHzczTJ3hzwp7Tek5c7/NwNbl+o6WAoNk+rDsCn EwkuTRe2DRqrCdnClmBGoWmN6+bSIK8gQlLdEiwbeEzPL59CPsIpECPhO BSxpgOcZm6gGg3yu3YSlU5+Sr+Ks7t0dD+S2g/EqWg/Co8mUAfNIHdBEO dgXv+H/1PuiyiG/gB0yDMwgRIbevXjdLneW4SfD8+0RCY4lbCJJotUDwW 6cEog/NQaap699vwC5vE+Yh7cVLs20u0q+zyYftLNGLjIQpbdp5jsVAEl g==; X-IronPort-AV: E=McAfee;i="6500,9779,10620"; a="395514683" X-IronPort-AV: E=Sophos;i="5.97,294,1669104000"; d="scan'208";a="395514683" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2023 06:55:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10620"; a="646402426" X-IronPort-AV: E=Sophos;i="5.97,294,1669104000"; d="scan'208";a="646402426" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga006.jf.intel.com with ESMTP; 13 Feb 2023 06:55:00 -0800 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Mon, 13 Feb 2023 06:54:59 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Mon, 13 Feb 2023 06:54:59 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.104) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Mon, 13 Feb 2023 06:54:59 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Is9RBBkIQEBMboAfoUFQrOMPKdwO58Fe0BRRvi0gn858q0H62w/HdAXwJfD3lIQXO2NODa2ZloMQis3GhxTnz1R+K6FFLt7rqgVvvrqP4NlGmYqMl0xYmvXRx5W1jFSqUq4dfVkonO/PGfXGhlkcsboYRrCMKa+T1JzVaVDOoByd5yIK17zZFJiD5RVBg2yDL+3wdcI07KA4I4ZzC9TyCnQBWvjfUen0dNQ+f8EjKYMyRvfhKQdBWCMXUe9MwSHppOTw6bJJ0UdfcR1mwa/y2G/IRPfCaP0EoJgrE2kPk0ZSgQr89Blu4arMtwWGfYTLqKbaxu3M/5KI4doR5sRsFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=f6S/2YgzIcucZvGNZDThTZgHF8AJRRW/ggJarL6bDrw=; b=B4iTSj7f0i3qYJj2ntA0VIdrPDyK/nuM5KfxJXzEKgJqOH5lRHt47275nMCpkYrysLacfDFERnKTn94Jh91jpNmnsRKwa44ikMhabOAo8kOD3J+5BPh4ekjPQNf/mJc8Zbl8QYEk8e4wzXutjFvc74c0FTPwNR7mvlkUTbaWegd2fH2doautMqxh7XYCI/HLvanxUU6ts78RMEza0wzGw2aEDL0yiPLjkn39EXLYe1gyKNCgXDI4oZJ23VDbBEr5llRxd4fPArxN1b30E9ILfdLT8vUN8DaQDrwC1GE90g7Ulk8FQew8yQtoQQZ4ET3f5jI3UsI2msm7lbvREG4UOw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by DS0PR11MB7788.namprd11.prod.outlook.com (2603:10b6:8:f5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.22; Mon, 13 Feb 2023 14:54:58 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::aaba:abb7:8794:def]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::aaba:abb7:8794:def%8]) with mapi id 15.20.6086.024; Mon, 13 Feb 2023 14:54:58 +0000 Date: Mon, 13 Feb 2023 14:54:51 +0000 From: Bruce Richardson To: David Marchand CC: , , , Chenbo Xia , Morten =?iso-8859-1?Q?Br=F8rup?= , Maxime Coquelin Subject: Re: [PATCH] disable lock annotation with clang 3.4.2 Message-ID: References: <20230213144455.520669-1-david.marchand@redhat.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20230213144455.520669-1-david.marchand@redhat.com> X-ClientProxiedBy: LNXP265CA0002.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5e::14) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|DS0PR11MB7788:EE_ X-MS-Office365-Filtering-Correlation-Id: 881017a5-7205-4d89-30bb-08db0dd2463d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QZ1i+HyfpF7um6glYwIrYfadp4MVro6j+sF933Kc5kYXVyeZt1YyL+juq9ckjnDBk/DeE8I1ui09NUdATOs04Yf7nDRNLb+lFkTgMiBEJ8N06k6d8YhPrOF8bhZGm6yfN7Kscehn60XWWRVd4RqlCH28YckM5IeyAH+dk2S2/6TWTAAJLOXFmJCLkHL24Rv9kDH+dglz0xSzVbl0v+U4xlRsxwjiLejVYLzRFfron1FIAiLKrsZJq1uLPKuTIWAdd0NYuPa1odgXJWNahj+QPbvqDiQblEeIlROPQj94YsqokXlK7qx4Oiaz429+IWVkx7/B5myKSOngAenNT5RqBmz00wOa86QsFoAdxt5xiWQuS3vU4A1bpcdRgsFiwzj4GrXRCFfSLYx1nkW7Jjl09Nr3fQLKPlC9qgYI0iXh/Ya9CVb6M1gPRppY0TZMyG8hRqVD986MoLDViM4JegpdRDTUEAiBSs2tp0KbQgByYUzIuKcE6stxB+Pj7tr3JwdwfKgNKFEra1nIyQ1hYs1TGW8D3AnYzj59bdkjwvNAmV/5rhUyprbXiyPvpZQPzTol0ewnosME0rppwpCR7TsCBFvB4BJlKxIWHQyUbncrmZea2CyOWTMPpJvdPQGuHylclOl1v6HrTjYm2A9mpHG+t8COpqIjli78spVMQJPGRe+URBBoT1g5zg2FGKG2zvfu X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(346002)(396003)(366004)(39860400002)(136003)(376002)(451199018)(82960400001)(38100700002)(6486002)(83380400001)(478600001)(186003)(6506007)(6512007)(26005)(6666004)(44832011)(66556008)(66946007)(6916009)(66476007)(5660300002)(86362001)(8936002)(41300700001)(316002)(54906003)(4326008)(2906002)(8676002)(67856001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?nfjGFwe1EzqbTZYxne32S2nk5YEglJ8veC3qCcjvgJXR1ymyYSO9zi3M9Zf2?= =?us-ascii?Q?BnX4oRdQ04qPreLHNPT8YHK1FIqBkLj8UEbkD+O3n9id9jdK0W0kZu4xukhs?= =?us-ascii?Q?S/ojMcIroNvILSc9jMg00uRjqff1IMARJt04tTKno5M1TA7UBoAyQfE0Qkgu?= =?us-ascii?Q?JWQEypKGXRCVHCe0voHKUmqA3obtFY9XXDR7VAs6+fnoG8HttBMALCE5T1Gp?= =?us-ascii?Q?OkpJj9Saw5QWeZANRb0fCLT5PoAX6tx7gP26tuRkmgO3br6512bOJ/LNJNgr?= =?us-ascii?Q?isZApKOZvjWSJE/QsnHmxdrO3wX9YBPbClCEYurcnOQORT5sLinyEL+PtJzx?= =?us-ascii?Q?AnoiguF5/acBNfv3yD2aJWctQ5TZ58XIAtvqyZFkJT9CML9zL5lfXKLwamEV?= =?us-ascii?Q?6QFuASKwQTamYL/nh0r8qK1ExFcj5+6Vg60nKGbzVhyTgMa8CLIbt5w06Iom?= =?us-ascii?Q?o08roqbuTxRRR1emFbQtH7iwR7XFulx8kKOfNGD+hBBG2KzjVsNwOYdaQisv?= =?us-ascii?Q?n59VJg36j2hkkaFIiRI/N1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ii?Q?bQpkpdQnMMHni+ILxtMX4O1pCLnivxFehuDB4RuyJHRb+8IdBLSVKVDWZ4dW?= =?us-ascii?Q?cMpRXu8IEjzb5sBtAv1gJhPffVwgw9nxbWrateTAGcM4IOQp+mJFAxqeB6Ie?= =?us-ascii?Q?lnf3baGEsv29hvEv12XpDFEtRw0dDalZNk0/lVZZRKtyj4DTjJvXHTRJHoOv?= =?us-ascii?Q?fA=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 881017a5-7205-4d89-30bb-08db0dd2463d X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2023 14:54:57.8079 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: NbQnZcoS1qxNjq60GDrtW/+z5vAe4im/MJJ6L3YNG/v1Uo3lQstcE85mltSkItD6kRN5qfuPihMafMYjIuwVUgpTF87oUa7yjhwrD6uKBmo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB7788 X-OriginatorOrg: intel.com 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 Mon, Feb 13, 2023 at 03:44:55PM +0100, David Marchand wrote: > Venerable RHEL7 clang 3.4.2 has (at least) two issues with lock > annotations. > > A first one with regards to the attribute position: > ../lib/vhost/vhost.h:518:2: error: GCC does not allow > assert_exclusive_lock attribute in this position on a > function definition [-Werror,-Wgcc-compat] > __rte_assert_exclusive_lock(&vq->access_lock) > ^ > ../lib/eal/include/rte_lock_annotations.h:29:38: note: expanded > from macro '__rte_assert_exclusive_lock' > __attribute__((assert_exclusive_lock(__VA_ARGS__))) > ^ > > This can be worked around by splitting and having the allocation on the > function declaration. > > But on the other hand, clang 3.4.2 does not seem to propagate those > annotations in presence of a __builtin_expect (i.e. unlikely()), like > for example when calling if (unlikely(rte_spinlock_trylock() == 0)). > > Those annotations were only working with clang in any case, so restrict > to clang versions newer than 3.5.0. > > Fixes: 657a98f38940 ("eal: annotate spinlock, rwlock and seqlock") > > Signed-off-by: David Marchand > --- > drivers/meson.build | 2 +- > lib/meson.build | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/meson.build b/drivers/meson.build > index bddc4a6cc4..0618c31a69 100644 > --- a/drivers/meson.build > +++ b/drivers/meson.build > @@ -168,7 +168,7 @@ foreach subpath:subdirs > enabled_drivers += name > lib_name = '_'.join(['rte', class, name]) > cflags += '-DRTE_LOG_DEFAULT_LOGTYPE=' + '.'.join([log_prefix, name]) > - if annotate_locks and cc.has_argument('-Wthread-safety') > + if annotate_locks and cc.get_id() == 'clang' and cc.version().version_compare('>=3.5.0') > cflags += '-DRTE_ANNOTATE_LOCKS' > cflags += '-Wthread-safety' > endif Are we likely to see any issues with this with any other compilers? Should we look to do a built-test in meson to determine feature support rather than checking clang versions explicitly? On the plus side, checking clang version like this makes it clear when we can drop the conditional. /Bruce