From nobody Mon Nov 25 05:00:04 2024 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; 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 Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1715759542956887.8307684450372; Wed, 15 May 2024 00:52:22 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.721983.1125756 (Exim 4.92) (envelope-from ) id 1s79Qk-0003Ud-Q3; Wed, 15 May 2024 07:52:06 +0000 Received: by outflank-mailman (output) from mailman id 721983.1125756; Wed, 15 May 2024 07:52:06 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s79Qk-0003UW-My; Wed, 15 May 2024 07:52:06 +0000 Received: by outflank-mailman (input) for mailman id 721983; Wed, 15 May 2024 07:52:05 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s79Qj-0003UQ-5G for xen-devel@lists.xenproject.org; Wed, 15 May 2024 07:52:05 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 0473f657-1290-11ef-b4bb-af5377834399; Wed, 15 May 2024 09:52:03 +0200 (CEST) Received: from nico.bugseng.com (unknown [46.228.253.202]) by support.bugseng.com (Postfix) with ESMTPSA id DC49F4EE0738; Wed, 15 May 2024 09:52:01 +0200 (CEST) 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: 0473f657-1290-11ef-b4bb-af5377834399 From: Nicola Vetrini To: xen-devel@lists.xenproject.org, nicola.vetrini@bugseng.com Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, consulting@bugseng.com, Simone Ballarin , Doug Goldstein , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall Subject: [XEN PATCH] automation/eclair_analysis: fully deviate MISRA C Rules 21.9 and 21.10 Date: Wed, 15 May 2024 09:51:59 +0200 Message-Id: <6990027e12e108a2eaee7300931b1dd01c30795d.1715758910.git.nicola.vetrini@bugseng.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1715759544287100001 Content-Type: text/plain; charset="utf-8" These rules are concerned with the use of facilities provided by the C Standard Library (qsort, bsearch for rule 21.9, and those provided by for rule 21.10). Xen provides in its source code its own implementation of some of these functions and macros, therefore a justification is provided for allowing uses of these functions in the project. The rules are also marked as clean as a consequence. Signed-off-by: Nicola Vetrini Reviewed-by: Stefano Stabellini --- .../eclair_analysis/ECLAIR/deviations.ecl | 14 ++++++++++++++ .../eclair_analysis/ECLAIR/monitored.ecl | 2 ++ automation/eclair_analysis/ECLAIR/tagging.ecl | 2 +- docs/misra/deviations.rst | 18 ++++++++++++++++++ 4 files changed, 35 insertions(+), 1 deletion(-) diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/= eclair_analysis/ECLAIR/deviations.ecl index 5eb7368a7322..1478c64a5af1 100644 --- a/automation/eclair_analysis/ECLAIR/deviations.ecl +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl @@ -477,6 +477,20 @@ leads to a violation of the Rule are deviated." -config=3DMC3R1.R20.12,macros+=3D{deliberate, "name(GENERATE_CASE)&&loc(fi= le(deliberate_generate_case))"} -doc_end =20 +# +# Series 21. +# + +-doc_begin=3D"Xen does not use the functions provided by the Standard Libr= ary, but +implements a set of functions that share the same names as their Standard = Library equivalent. +The implementation of these functions is available in source form, so the = undefined, unspecified +or implementation-defined behaviors contemplated by the C Standard do not = apply. +If some undefined or unspecified behavior does arise in the implementation= , it +falls under the jurisdiction of other MISRA rules." +-config=3DMC3R1.R21.9,reports+=3D{deliberate, "any()"} +-config=3DMC3R1.R21.10,reports+=3D{deliberate, "any()"} +-doc_end + # # General # diff --git a/automation/eclair_analysis/ECLAIR/monitored.ecl b/automation/e= clair_analysis/ECLAIR/monitored.ecl index 69308ea51c01..9da709dc889c 100644 --- a/automation/eclair_analysis/ECLAIR/monitored.ecl +++ b/automation/eclair_analysis/ECLAIR/monitored.ecl @@ -36,12 +36,14 @@ -enable=3DMC3R1.R20.4 -enable=3DMC3R1.R20.9 -enable=3DMC3R1.R2.1 +-enable=3DMC3R1.R21.10 -enable=3DMC3R1.R21.13 -enable=3DMC3R1.R21.17 -enable=3DMC3R1.R21.18 -enable=3DMC3R1.R21.19 -enable=3DMC3R1.R21.20 -enable=3DMC3R1.R21.21 +-enable=3DMC3R1.R21.9 -enable=3DMC3R1.R2.2 -enable=3DMC3R1.R22.2 -enable=3DMC3R1.R22.4 diff --git a/automation/eclair_analysis/ECLAIR/tagging.ecl b/automation/ecl= air_analysis/ECLAIR/tagging.ecl index a14bda5033df..acea15f486a1 100644 --- a/automation/eclair_analysis/ECLAIR/tagging.ecl +++ b/automation/eclair_analysis/ECLAIR/tagging.ecl @@ -19,7 +19,7 @@ =20 -doc_begin=3D"Clean guidelines: new violations for these guidelines are no= t accepted." =20 --service_selector=3D{clean_guidelines_common, "MC3R1.D1.1||MC3R1.D2.1||MC3= R1.D4.1||MC3R1.D4.11||MC3R1.D4.14||MC3R1.R11.7||MC3R1.R11.9||MC3R1.R12.5||M= C3R1.R1.1||MC3R1.R1.3||MC3R1.R1.4||MC3R1.R14.1||MC3R1.R16.7||MC3R1.R17.1||M= C3R1.R17.3||MC3R1.R17.4||MC3R1.R17.5||MC3R1.R17.6||MC3R1.R20.13||MC3R1.R20.= 14||MC3R1.R20.4||MC3R1.R20.9||MC3R1.R21.13||MC3R1.R21.19||MC3R1.R21.21||MC3= R1.R2.2||MC3R1.R22.2||MC3R1.R22.4||MC3R1.R22.5||MC3R1.R22.6||MC3R1.R2.6||MC= 3R1.R3.1||MC3R1.R3.2||MC3R1.R4.1||MC3R1.R4.2||MC3R1.R5.1||MC3R1.R5.2||MC3R1= .R5.4||MC3R1.R5.6||MC3R1.R6.1||MC3R1.R6.2||MC3R1.R7.1||MC3R1.R7.2||MC3R1.R7= .4||MC3R1.R8.1||MC3R1.R8.10||MC3R1.R8.12||MC3R1.R8.14||MC3R1.R8.2||MC3R1.R8= .5||MC3R1.R8.6||MC3R1.R8.8||MC3R1.R9.2||MC3R1.R9.3||MC3R1.R9.4||MC3R1.R9.5" +-service_selector=3D{clean_guidelines_common, "MC3R1.D1.1||MC3R1.D2.1||MC3= R1.D4.1||MC3R1.D4.11||MC3R1.D4.14||MC3R1.R11.7||MC3R1.R11.9||MC3R1.R12.5||M= C3R1.R1.1||MC3R1.R1.3||MC3R1.R1.4||MC3R1.R14.1||MC3R1.R16.7||MC3R1.R17.1||M= C3R1.R17.3||MC3R1.R17.4||MC3R1.R17.5||MC3R1.R17.6||MC3R1.R20.13||MC3R1.R20.= 14||MC3R1.R20.4||MC3R1.R20.9||MC3R1.R21.10||MC3R1.R21.13||MC3R1.R21.19||MC3= R1.R21.21||MC3R1.R21.9||MC3R1.R2.2||MC3R1.R22.2||MC3R1.R22.4||MC3R1.R22.5||= MC3R1.R22.6||MC3R1.R2.6||MC3R1.R3.1||MC3R1.R3.2||MC3R1.R4.1||MC3R1.R4.2||MC= 3R1.R5.1||MC3R1.R5.2||MC3R1.R5.4||MC3R1.R5.6||MC3R1.R6.1||MC3R1.R6.2||MC3R1= .R7.1||MC3R1.R7.2||MC3R1.R7.4||MC3R1.R8.1||MC3R1.R8.10||MC3R1.R8.12||MC3R1.= R8.14||MC3R1.R8.2||MC3R1.R8.5||MC3R1.R8.6||MC3R1.R8.8||MC3R1.R9.2||MC3R1.R9= .3||MC3R1.R9.4||MC3R1.R9.5" } =20 -setq=3Dtarget,getenv("XEN_TARGET_ARCH") diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst index 161134771c77..b5450c38f66c 100644 --- a/docs/misra/deviations.rst +++ b/docs/misra/deviations.rst @@ -411,6 +411,24 @@ Deviations related to MISRA C:2012 Rules: construct is deviated only in Translation Units that present a viol= ation of the Rule due to uses of this macro. - Tagged as `deliberate` for ECLAIR. + =20 + * - R21.9 + - Xen does not use the `bsearch` and `qsort` functions provided by th= e C + Standard Library, but provides in source form its own implementatio= n, + therefore any unspecified or undefined behavior associated to the + functions provided by the Standard Library does not apply. Any such + behavior that may exist in such functions is therefore under the + jurisdiction of other MISRA C rules. + - Project-wide deviation, tagged as `deliberate` for ECLAIR. + + * - R21.10 + - Xen does not use the facilities provided by the `\` provid= ed by the C + Standard Library, but provides in source form its own implementatio= n, + therefore any unspecified, undefined or implementation-defined beha= vior + associated to the functions provided by the Standard Library does n= ot + apply. Any such behavior that may exist in such functions is theref= ore + under the jurisdiction of other MISRA C rules. + - Project-wide deviation, tagged as `deliberate` for ECLAIR. =20 Other deviations: ----------------- --=20 2.34.1