From nobody Tue Dec 23 11:09:41 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass(p=quarantine dis=none) header.from=epam.com ARC-Seal: i=2; a=rsa-sha256; t=1753994657; cv=pass; d=zohomail.com; s=zohoarc; b=EaADF6/KvPT7acfiioMrlEETnsYj9a6xi7eaDkuTPVjZ34ekErgcK+tvAS/9ECURDlPuRCCm7nwQc0lMK/OXcoiBHIK5DQsYnhKmsS5kiI5qIBUo3vOUCOCwpm4MrX+GwN4o2HefV+lp9ioWrXco2UKZhoohX1kqnL8xCn2VZZ0= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1753994657; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=xt6YMEuYgITW84qj2/noeBeiIFUXUm1dDawfozSEF3g=; b=Hs9WkHC4pJ6rFCh3K1H5vGhHm2N/X1LAJMVclPljLwh9f00eykQJaNfoS4n7Ykxt+Cqe3vU7NuucZj75F+JDMJT54uUfTSQMbKF18ikh+9i8C6301bw15LqhF7vbQ8MGLL2Q16fBeu4i7nLtR4tQUGTNCcdvefpR0hmP7VveOdM= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1753994657345821.4352043139619; Thu, 31 Jul 2025 13:44:17 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1066408.1431626 (Exim 4.92) (envelope-from ) id 1uha82-0000cg-Ke; Thu, 31 Jul 2025 20:43:54 +0000 Received: by outflank-mailman (output) from mailman id 1066408.1431626; Thu, 31 Jul 2025 20:43:54 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uha82-0000cZ-Gs; Thu, 31 Jul 2025 20:43:54 +0000 Received: by outflank-mailman (input) for mailman id 1066408; Thu, 31 Jul 2025 20:43:54 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uha81-0000cR-ST for xen-devel@lists.xenproject.org; Thu, 31 Jul 2025 20:43:54 +0000 Received: from MRWPR03CU001.outbound.protection.outlook.com (mail-francesouthazlp170110003.outbound.protection.outlook.com [2a01:111:f403:c207::3]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 116c7aab-6e4f-11f0-a320-13f23c93f187; Thu, 31 Jul 2025 22:43:52 +0200 (CEST) Received: from GV2PR03MB9572.eurprd03.prod.outlook.com (2603:10a6:150:da::5) by PAXPR03MB8132.eurprd03.prod.outlook.com (2603:10a6:102:22a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8989.12; Thu, 31 Jul 2025 20:43:48 +0000 Received: from GV2PR03MB9572.eurprd03.prod.outlook.com ([fe80::edd1:842f:9b14:509e]) by GV2PR03MB9572.eurprd03.prod.outlook.com ([fe80::edd1:842f:9b14:509e%3]) with mapi id 15.20.8989.011; Thu, 31 Jul 2025 20:43:48 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 116c7aab-6e4f-11f0-a320-13f23c93f187 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lqEqHA5Gkx36HPzEilyHkThEFeJ5cX5bPY14s0/GNBFdGHtpBVZSRa2nDTE8C271C1iyeewCqUn1yM75dw8HGUqhD2XuvlPk1hiZfImsoWBaqWO1uifNRna4RRoITyLqeyKK36TEJF0wD/5TadIq41+r6r5L4HgWGx7GRLJSshmk+zVLyK+2kb48QxedwkYZAMLEq3UbJYZko2yqT1QuP8ITLBYgsaMg6q1BtFJ4xynuTB86f825+FWBsrzmCcC3/GKTtxwPTwXMBPQmTsLDREYVlP7ZM+luMUQ1FxuV8jm0XZnTNMvHwocVbkWAR8jxF4nmkFsxBlYIGS/nD6WT/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=xt6YMEuYgITW84qj2/noeBeiIFUXUm1dDawfozSEF3g=; b=O6vtbvFRuVcq/sVbQfic8qxaYs51xsYqf96tLPYTtyuk4T1R2ll6XbFIf9lpfIEjyYRiPCQ8fDzxP0SJHAKfCTaZZZK8z59mz0mHxO64XG2S4U2eDxqFzsAIF+eZs60bk1fV9OREfeNUgx113xkf/vfUMdBRbhnna5OWbx/ZhOcbiaRO8kmZlDCOJJgyvOvgH9IRRoDuP7Q5Wh9koWNlEWjjTp5oUOZ3qMaFrg4rkxeQLXVMWqF/cSMlRNZ5dE0nY8i6JzsTsXqQ7+hVclT6Ps39Nps74utUXl92FGiM0Kv2uU+Lt0wubEw8GD5cfg/tLmjcrKSLsI7BdNm7LUrRCQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xt6YMEuYgITW84qj2/noeBeiIFUXUm1dDawfozSEF3g=; b=gQXt+FPpcjftqZ2hUx7RTQSurvsb18hz65YtnRuFrALnJFGP2BMbXdZPbqPJ20SbUfEmZbplKwZQGOWMn5DUxukOpkdfULWIeSLI3phmJYXX4FdiGCK7+qcNts4RM2vius2+Zz8mbjjKLS2OpIHAPjoA4zpT2jO4R0L72cGAqkADBy6YVeFA2HiivIQ2oYNui2/vnxIzd05Qw+uBUZ2PbqjDOiGqBtcDCG9qkkxTgYCZoiTKkEtuyy4Bjzav6UIMjlSdHhm7ltrgb3tgIoyb7IuKUBU/St3u869nMUDHZSY0kZel4+MBhiVwzH6JMsIXKcEhSs+Kpw7DFC7w9enKdg== From: Dmytro Prokopchuk1 To: "xen-devel@lists.xenproject.org" CC: Dmytro Prokopchuk1 , Nicola Vetrini , Doug Goldstein , Stefano Stabellini , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?iso-8859-1?Q?Roger_Pau_Monn=E9?= Subject: [PATCH v4] misra: add deviations of MISRA C Rule 5.5 Thread-Topic: [PATCH v4] misra: add deviations of MISRA C Rule 5.5 Thread-Index: AQHcAlvRPvsNJLdA4EKfF9mnriBuYQ== Date: Thu, 31 Jul 2025 20:43:48 +0000 Message-ID: Accept-Language: en-US, uk-UA, ru-RU Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: GV2PR03MB9572:EE_|PAXPR03MB8132:EE_ x-ms-office365-filtering-correlation-id: 02b1c2c0-d1f1-48d3-65ee-08ddd072f386 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|42112799006|7416014|366016|1800799024|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?Q?j+una2z7d5G4IydWEwXbtSNqM1REiroU/+yhWZtw4ZBzXNrIayd7NPgbs6?= =?iso-8859-1?Q?/uT/8uNzDErvHl2Gydn8kxCLBYKaTVOAII0BYJ/oFsGiwgjR+1msQkaht/?= =?iso-8859-1?Q?l0uBs/DNbCMZxnD2JDJlNRt/s4O9ySH0ynH1SUHh4wVBfJtall5PHnp3j1?= =?iso-8859-1?Q?XmPYHn8Vo+I9H9mAbqYsMsPqqxPDzAkq6HKbY0kTKQ+Podo7BBkkU//Vdu?= =?iso-8859-1?Q?5re+hD9ygsrFKNC699OaIlxzV7mMwb54I+2cfOo/h0C+EzrjszcEKid7Xd?= =?iso-8859-1?Q?/1cDHn6Aa61ljfpje7XMMz05fLId+YOjHGbgva1glJK9oh6liLXn6nU9kw?= =?iso-8859-1?Q?hZVspftpAv63sA8hnv8JfWAdFQ6l6LzYcZ0H9UpNT4gHrgduFWQcEf3zEG?= =?iso-8859-1?Q?ZV69vdDE5l+fLR/ompbxuHgAnHPtocA5a9lCd5hd7PUIUfuaIytMOkPx94?= =?iso-8859-1?Q?RvKFq7SXXpNwHdBqTJEI+a17cHsjy4KsZv65dxtlw1v6xmR/wO753e4IOJ?= =?iso-8859-1?Q?HzAnO1CxBrrh/COuTiBbeOHhI3DgejhxZH5n8zMGfLzM+u3vZgc+Y2lYKq?= =?iso-8859-1?Q?tsxwuuCygPVhjDFCRTAUEJnC9wYHzhYBudw089w1a4zxMxFZAZVQ5P76+1?= =?iso-8859-1?Q?fiAk7TNqPWp8plfhXp+qan6TNl4fcH/tvb2vdqdNBToipe0kLUz8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.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(42112799006)(7416014)(366016)(1800799024)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?YtjupczIB30NdRfEJqS9fUD0U7IUrTNE6ejpyHc3zE94fRZatDWYqzZewg?= =?iso-8859-1?Q?4ePuWA9AXDufy45aPb98N27dJqHw2NUcJpwmf7xo6RI3XASymv88/ah9TB?= =?iso-8859-1?Q?RxkUpDRawqDKuL5S3FT+noMt28DwinZfV/LCHrfNBDPKKiq+fxQyPVJdlB?= =?iso-8859-1?Q?5jcfq+IceiWvsur3BD9dezpp0kX1T+GhSUG+mVNPFGIwHd0B+tsJKx4O5K?= =?iso-8859-1?Q?xJ45d374P72GKBky+YazMMIscHb9G/ENwvoQw+EcpZXrZk8ybnTk4ICAKw?= =?iso-8859-1?Q?jH8p/Obd1yQJGhW86Jl3cogKSSEtNspZpdO3A4a3d7choPZWXBhJJdbfFk?= =?iso-8859-1?Q?ADrFwa18rfE6BfwvzU4oKs9xMsjr7xOl5hqFGGYIRliSB1WIjwyuDXoXz2?= =?iso-8859-1?Q?Lriz/wl/PD/cwbC1+By+DN8uHiJgDNw1SI+LvPhNLzKSN2Rz14RY9EDbli?= =?iso-8859-1?Q?fR8qVspytiqaG8YLji/PjXh69ZkkTEUp/VY6duKAEjwbokz1iS/1rFYMDi?= =?iso-8859-1?Q?/xOYBXZO2fEkaNn9mvxXwtf4a8SnRS1HKW2Q9GQg94xvojVibCukwGjKSM?= =?iso-8859-1?Q?nNiGUBNVaQG/O6IxF5IHvQlhDxE8dpDdCV2FOgl3SCCADUiiPmrs6ggCgx?= =?iso-8859-1?Q?IRf/EoNJnE82TxheAQrAL4VS0KYEaWGrjCkIYLAB602YB78jOsxWFU/Nxu?= =?iso-8859-1?Q?+qHFcwwSyX8BgnJAPMks9Dwzwi5At7B0vnfKC18ktL8QNfDwJlHzR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wVc7FB4e+NUtnt7B3hnixgzZQL5Y90tOaBsYNa8w?= =?iso-8859-1?Q?=3D=3D?= Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: GV2PR03MB9572.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 02b1c2c0-d1f1-48d3-65ee-08ddd072f386 X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Jul 2025 20:43:48.6973 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: qyBc3yn+Xwvqv6L6XP2s35ku1CONU6q9g/zpiO+rn/WqBzCq9bEXeKg+ftj3iWEnc2Rth1g7Q++3IseHMbrcu+Z73HpCN29BNIXndU+F+wQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR03MB8132 X-ZohoMail-DKIM: pass (identity @epam.com) X-ZM-MESSAGEID: 1753994658646124100 Content-Type: text/plain; charset="utf-8" MISRA C Rule 5.5 states: "Identifiers shall be distinct from macro names". Update ECLAIR configuration to deviate clashes: specify the macros that should be ignored. Update deviations.rst and rules.rst accordingly. Signed-off-by: Dmytro Prokopchuk Acked-by: Stefano Stabellini Reviewed-by: Nicola Vetrini Reviewed-by: Nicola Vetrini # ECLAIR --- Changes in v4: - fixed formatting (aligned length chars per line) - set 'ignored_macros' as a regex expression - set a deviation restriction on xen/common/grant_table.c - s/ensures/to ensure/ - fixed grammar errors Link to v3: https://patchew.org/Xen/e681e0c083d945f48e6d0add1aee32af16be224e.1753911247= .git.dmytro._5Fprokopchuk1@epam.com/ Test CI pipeline: https://gitlab.com/xen-project/people/dimaprkp4k/xen/-/pipelines/1960066579 --- .../eclair_analysis/ECLAIR/deviations.ecl | 10 +++++++++ docs/misra/deviations.rst | 22 +++++++++++++++++++ docs/misra/rules.rst | 17 ++++++++++++++ 3 files changed, 49 insertions(+) diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/= eclair_analysis/ECLAIR/deviations.ecl index 483507e7b9..ab3400fc89 100644 --- a/automation/eclair_analysis/ECLAIR/deviations.ecl +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl @@ -117,6 +117,16 @@ it defines would (in the common case) be already defin= ed. Peer reviewed by the c -config=3DMC3A2.R5.5,reports+=3D{deliberate, "any_area(decl(kind(function)= )||any_loc(macro(name(memcpy||memset||memmove))))&&any_area(any_loc(file(^x= en/common/libelf/libelf-private\\.h$)))"} -doc_end =20 +-doc_begin=3D"Clashes between bitops functions and macro names are deliber= ate. +These macros are needed for input validation and error handling." +-config=3DMC3A2.R5.5,ignored_macros+=3D"^(__)?(test|set|clear|change|test_= and_(set|clear|change))_bit$" +-doc_end + +-doc_begin=3D"Clashes between grant table functions and macro names in 'xe= n/common/grant_table.c' are deliberate. +These macros address differences in argument count during compile-time, ef= fectively discarding unused parameters to avoid warnings or errors related = to them." +-config=3DMC3A2.R5.5,ignored_macros+=3D"name(update_gnttab_par||parse_gntt= ab_limit)&&loc(file(^xen/common/grant_table\\.c$))" +-doc_end + -doc_begin=3D"The type \"ret_t\" is deliberately defined multiple times, depending on the guest." -config=3DMC3A2.R5.6,reports+=3D{deliberate,"any_area(any_loc(text(^.*ret_= t.*$)))"} diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst index e78179fcb8..4c64a8be62 100644 --- a/docs/misra/deviations.rst +++ b/docs/misra/deviations.rst @@ -142,6 +142,28 @@ Deviations related to MISRA C:2012 Rules: memmove. - Tagged as `deliberate` for ECLAIR. =20 + * - R5.5 + - Clashes between bitops ('__test_and_set_bit', '__test_and_clear_bit= ', + '__test_and_change_bit', 'test_bit', 'set_bit', 'clear_bit', 'chang= e_bit', + 'test_and_set_bit', 'test_and_clear_bit', 'test_and_change_bit') + functions and macro names are intentional. These are necessary for = error + handling and input validation to ensure that the size of the object= being + referenced by the memory address (passed as an argument to the macr= o) + meets the minimum requirements for the bit operation. This prevents= unsafe + operations on improperly sized data types that could lead to undefi= ned + behavior or memory corruption. The macros encapsulate this conditio= nal + logic into a single, reusable form, simplifying the code and avoidi= ng + function call overhead. Also this bit operations API was inherited = from + Linux and should be kept for familiarity. + - ECLAIR has been configured to ignore these macros. + + * - R5.5 + - Clashes between grant table ('update_gnttab_par', 'parse_gnttab_lim= it') + functions and macro names are intentional. These macros address + differences in argument count during compile-time, effectively disc= arding + unused 2nd and 3rd parameters to avoid warnings or errors related t= o them. + - ECLAIR has been configured to ignore these macros. + * - R5.6 - The type ret_t is deliberately defined multiple times depending on = the type of guest to service. diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst index 3e014a6298..cba15933fe 100644 --- a/docs/misra/rules.rst +++ b/docs/misra/rules.rst @@ -196,6 +196,23 @@ maintainers if you want to suggest a change. #define f(x, y) f(x, y) void f(int x, int y); =20 + Clashes between bitops functions and macro names are allowed + because they are used for input validation and error handling. + Example:: + + static inline void set_bit(int nr, volatile void *addr) + { + asm volatile ( "lock btsl %1,%0" + : "+m" (ADDR) : "Ir" (nr) : "memory"); + } + #define set_bit(nr, addr) ({ \ + if ( bitop_bad_size(addr) ) __bitop_bad_size(); \ + set_bit(nr, addr); \ + }) + + Clashes between grant table functions and macro names are allowed + because they are used for discarding unused parameters. + * - `Rule 5.6 `_ - Required - A typedef name shall be a unique identifier --=20 2.43.0