From nobody Sun Nov 24 15:21:48 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 1717791233239708.5575712149814; Fri, 7 Jun 2024 13:13:53 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.736621.1142743 (Exim 4.92) (envelope-from ) id 1sFfxq-0001lf-Ol; Fri, 07 Jun 2024 20:13:30 +0000 Received: by outflank-mailman (output) from mailman id 736621.1142743; Fri, 07 Jun 2024 20:13:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sFfxq-0001kO-Jo; Fri, 07 Jun 2024 20:13:30 +0000 Received: by outflank-mailman (input) for mailman id 736621; Fri, 07 Jun 2024 20:13:29 +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 1sFfxp-0001UP-Du for xen-devel@lists.xenproject.org; Fri, 07 Jun 2024 20:13:29 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 65bb4055-250a-11ef-b4bb-af5377834399; Fri, 07 Jun 2024 22:13:26 +0200 (CEST) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id 59D804EE0743; Fri, 7 Jun 2024 22:13:24 +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: 65bb4055-250a-11ef-b4bb-af5377834399 From: Nicola Vetrini To: nicola.vetrini@bugseng.com, xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, consulting@bugseng.com, Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Oleksii Kurochko Subject: [XEN PATCH for-4.19 v2 1/3] x86/domain: deviate violation of MISRA C Rule 20.12 Date: Fri, 7 Jun 2024 22:13:16 +0200 Message-Id: <73f582e7b42e44980a79022d2f2937a33e7b37b7.1717790683.git.nicola.vetrini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1717791234394100007 Content-Type: text/plain; charset="utf-8" MISRA C Rule 20.12 states: "A macro parameter used as an operand to the # or ## operators, which is itself subject to further macro replacement, shall only be used as an operand to these operators". In this case, builds where CONFIG_COMPAT=3Dy the fpu_ctxt macro is used both as a regular macro argument and as an operand for stringification in the expansion of CHECK_FIELD_. This is deviated using a SAF-x-safe comment. No functional change. Signed-off-by: Nicola Vetrini Acked-by: Jan Beulich --- docs/misra/safe.json | 8 ++++++++ xen/arch/x86/domain.c | 1 + xen/arch/x86/domctl.c | 1 + 3 files changed, 10 insertions(+) diff --git a/docs/misra/safe.json b/docs/misra/safe.json index 9b13bcf71706..c213e0a0be3b 100644 --- a/docs/misra/safe.json +++ b/docs/misra/safe.json @@ -52,6 +52,14 @@ }, { "id": "SAF-6-safe", + "analyser": { + "eclair": "MC3R1.R20.12" + }, + "name": "MC3R1.R20.12: use of a macro argument that deliberate= ly violates the Rule", + "text": "A macro parameter that is itself a macro is intention= ally used within the macro both as a regular parameter and for text replace= ment." + }, + { + "id": "SAF-7-safe", "analyser": {}, "name": "Sentinel", "text": "Next ID to be used" diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 536542841ef5..ccadfe0c9e70 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -1084,6 +1084,7 @@ void arch_domain_creation_finished(struct domain *d) #ifdef CONFIG_COMPAT #define xen_vcpu_guest_context vcpu_guest_context #define fpu_ctxt fpu_ctxt.x +/* SAF-6-safe Rule 20.12 expansion of macro fpu_ctxt with CONFIG_COMPAT */ CHECK_FIELD_(struct, vcpu_guest_context, fpu_ctxt); #undef fpu_ctxt #undef xen_vcpu_guest_context diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index 9a72d57333e9..335aedf46d03 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -1326,6 +1326,7 @@ long arch_do_domctl( #ifdef CONFIG_COMPAT #define xen_vcpu_guest_context vcpu_guest_context #define fpu_ctxt fpu_ctxt.x +/* SAF-6-safe Rule 20.12 expansion of macro fpu_ctxt with CONFIG_COMPAT */ CHECK_FIELD_(struct, vcpu_guest_context, fpu_ctxt); #undef fpu_ctxt #undef xen_vcpu_guest_context -- 2.34.1 From nobody Sun Nov 24 15:21:48 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 1717791229925566.7904319794103; Fri, 7 Jun 2024 13:13:49 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.736619.1142728 (Exim 4.92) (envelope-from ) id 1sFfxp-0001Ud-8E; Fri, 07 Jun 2024 20:13:29 +0000 Received: by outflank-mailman (output) from mailman id 736619.1142728; Fri, 07 Jun 2024 20:13:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sFfxp-0001UW-5R; Fri, 07 Jun 2024 20:13:29 +0000 Received: by outflank-mailman (input) for mailman id 736619; Fri, 07 Jun 2024 20:13:28 +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 1sFfxo-0001UQ-DP for xen-devel@lists.xenproject.org; Fri, 07 Jun 2024 20:13:28 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 6698be71-250a-11ef-90a2-e314d9c70b13; Fri, 07 Jun 2024 22:13:27 +0200 (CEST) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id 00CB64EE0742; Fri, 7 Jun 2024 22:13:25 +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: 6698be71-250a-11ef-90a2-e314d9c70b13 From: Nicola Vetrini To: nicola.vetrini@bugseng.com, xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, consulting@bugseng.com, Simone Ballarin , Doug Goldstein , Oleksii Kurochko Subject: [XEN PATCH for-4.19 v2 2/3] automation/eclair_analysis: address remaining violations of MISRA C Rule 20.12 Date: Fri, 7 Jun 2024 22:13:17 +0200 Message-Id: <4ea119f84e075ebcdfe2669527826c269a454d0e.1717790683.git.nicola.vetrini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1717791230393100003 Content-Type: text/plain; charset="utf-8" The DEFINE macro in asm-offsets.c (for all architectures) still generates violations despite the file(s) being excluded from compliance, due to the fact that in its expansion it sometimes refers entities in non-excluded fil= es. These corner cases are deviated by the configuration. No functional change. Signed-off-by: Nicola Vetrini Acked-by: Stefano Stabellini --- automation/eclair_analysis/ECLAIR/deviations.ecl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/= eclair_analysis/ECLAIR/deviations.ecl index 447c1e6661d1..e2653f77eb2c 100644 --- a/automation/eclair_analysis/ECLAIR/deviations.ecl +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl @@ -483,6 +483,12 @@ 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 +-doc_begin=3D"The macro DEFINE is defined and used in excluded files asm-o= ffsets.c. +This may still cause violations if entities outside these files are referr= ed to +in the expansion." +-config=3DMC3R1.R20.12,macros+=3D{deliberate, "name(DEFINE)&&loc(file(asm_= offsets))"} +-doc_end + # # Series 21. # -- 2.34.1 From nobody Sun Nov 24 15:21:48 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 1717791230350428.5710291728893; Fri, 7 Jun 2024 13:13:50 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.736622.1142750 (Exim 4.92) (envelope-from ) id 1sFfxr-0001rH-41; Fri, 07 Jun 2024 20:13:31 +0000 Received: by outflank-mailman (output) from mailman id 736622.1142750; Fri, 07 Jun 2024 20:13:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sFfxq-0001p4-S5; Fri, 07 Jun 2024 20:13:30 +0000 Received: by outflank-mailman (input) for mailman id 736622; Fri, 07 Jun 2024 20:13:29 +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 1sFfxp-0001UQ-Cq for xen-devel@lists.xenproject.org; Fri, 07 Jun 2024 20:13:29 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 67727495-250a-11ef-90a2-e314d9c70b13; Fri, 07 Jun 2024 22:13:28 +0200 (CEST) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id 6A9F24EE0745; Fri, 7 Jun 2024 22:13:27 +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: 67727495-250a-11ef-90a2-e314d9c70b13 From: Nicola Vetrini To: nicola.vetrini@bugseng.com, xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, consulting@bugseng.com, Simone Ballarin , Doug Goldstein , Oleksii Kurochko Subject: [XEN PATCH for-4.19 v2 3/3] automation/eclair_analysis: add more clean MISRA guidelines Date: Fri, 7 Jun 2024 22:13:18 +0200 Message-Id: <42645b41cf9d2d8b5ef72f0b171989711edb00a1.1717790683.git.nicola.vetrini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1717791232368100005 Content-Type: text/plain; charset="utf-8" Rules 20.9, 20.12 and 14.4 are now clean on ARM and x86, so they are added to the list of clean guidelines. Some guidelines listed in the additional clean section for ARM are also clean on x86, so they can be removed from there. No functional change. Signed-off-by: Nicola Vetrini --- automation/eclair_analysis/ECLAIR/tagging.ecl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/automation/eclair_analysis/ECLAIR/tagging.ecl b/automation/ecl= air_analysis/ECLAIR/tagging.ecl index a354ff322e03..b829655ca0bc 100644 --- a/automation/eclair_analysis/ECLAIR/tagging.ecl +++ b/automation/eclair_analysis/ECLAIR/tagging.ecl @@ -60,6 +60,7 @@ MC3R1.R11.7|| MC3R1.R11.9|| MC3R1.R12.5|| MC3R1.R14.1|| +MC3R1.R14.4|| MC3R1.R16.7|| MC3R1.R17.1|| MC3R1.R17.3|| @@ -73,6 +74,7 @@ MC3R1.R20.4|| MC3R1.R20.6|| MC3R1.R20.9|| MC3R1.R20.11|| +MC3R1.R20.12|| MC3R1.R20.13|| MC3R1.R20.14|| MC3R1.R21.3|| @@ -105,7 +107,7 @@ if(string_equal(target,"x86_64"), ) if(string_equal(target,"arm64"), - service_selector({"additional_clean_guidelines","MC3R1.R14.4||MC3R1.R1= 6.6||MC3R1.R20.12||MC3R1.R2.1||MC3R1.R5.3||MC3R1.R7.2||MC3R1.R7.3||MC3R1.R8= .6||MC3R1.R9.3"}) + service_selector({"additional_clean_guidelines","MC3R1.R16.6||MC3R1.R2= .1||MC3R1.R5.3||MC3R1.R7.3"}) ) -reports+=3D{clean:added,"service(clean_guidelines_common||additional_clea= n_guidelines)"} -- 2.34.1