From nobody Mon Nov 25 03:26:43 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 1718614673342279.89803425199796; Mon, 17 Jun 2024 01:57:53 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.741918.1148602 (Exim 4.92) (envelope-from ) id 1sJ8B8-0005X4-LO; Mon, 17 Jun 2024 08:57:30 +0000 Received: by outflank-mailman (output) from mailman id 741918.1148602; Mon, 17 Jun 2024 08:57: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 1sJ8B8-0005WY-HS; Mon, 17 Jun 2024 08:57:30 +0000 Received: by outflank-mailman (input) for mailman id 741918; Mon, 17 Jun 2024 08:57: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 1sJ8B6-0005Fp-HW for xen-devel@lists.xenproject.org; Mon, 17 Jun 2024 08:57:28 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 9e0686b7-2c87-11ef-90a3-e314d9c70b13; Mon, 17 Jun 2024 10:57:25 +0200 (CEST) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id 08EF34EE0757; Mon, 17 Jun 2024 10:57: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: 9e0686b7-2c87-11ef-90a3-e314d9c70b13 From: Nicola Vetrini To: 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, Nicola Vetrini , Simone Ballarin , Doug Goldstein Subject: [XEN PATCH v2 1/6][RESEND] automation/eclair: address violations of MISRA C Rule 20.7 Date: Mon, 17 Jun 2024 10:57:13 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1718614674161100010 Content-Type: text/plain; charset="utf-8" MISRA C Rule 20.7 states: "Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses". The helper macro bitmap_switch has parameters that cannot be parenthesized in order to comply with the rule, as that would break its functionality. Moreover, the risk of misuse due developer confusion is deemed not substantial enough to warrant a more involved refactor, thus the macro is deviated for this rule. No functional change. Signed-off-by: Nicola Vetrini Acked-by: Stefano Stabellini --- automation/eclair_analysis/ECLAIR/deviations.ecl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/= eclair_analysis/ECLAIR/deviations.ecl index 447c1e6661d1..c2698e7074aa 100644 --- a/automation/eclair_analysis/ECLAIR/deviations.ecl +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl @@ -463,6 +463,14 @@ of this macro do not lead to developer confusion, and = can thus be deviated." -config=3DMC3R1.R20.7,reports+=3D{safe, "any_area(any_loc(any_exp(macro(^c= ount_args_$))))"} -doc_end =20 +-doc_begin=3D"The arguments of macro bitmap_switch macro can't be parenthe= sized as +the rule would require, without breaking the functionality of the macro. T= his is +a specialized local helper macro only used within the bitmap.h header, so = it is +less likely to lead to developer confusion and it is deemed better to devi= ate it." +-file_tag+=3D{xen_bitmap_h, "^xen/include/xen/bitmap\\.h$"} +-config=3DMC3R1.R20.7,reports+=3D{safe, "any_area(any_loc(any_exp(macro(lo= c(file(xen_bitmap_h))&&^bitmap_switch$))))"} +-doc_end + -doc_begin=3D"Uses of variadic macros that have one of their arguments def= ined as a macro and used within the body for both ordinary parameter expansion and= as an operand to the # or ## operators have a behavior that is well-understood a= nd --=20 2.34.1 From nobody Mon Nov 25 03:26:43 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 1718614669216960.6859778841402; Mon, 17 Jun 2024 01:57:49 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.741919.1148610 (Exim 4.92) (envelope-from ) id 1sJ8B9-0005ef-1f; Mon, 17 Jun 2024 08:57:31 +0000 Received: by outflank-mailman (output) from mailman id 741919.1148610; Mon, 17 Jun 2024 08:57: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 1sJ8B8-0005df-SM; Mon, 17 Jun 2024 08:57:30 +0000 Received: by outflank-mailman (input) for mailman id 741919; Mon, 17 Jun 2024 08:57: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 1sJ8B7-0005Fp-5t for xen-devel@lists.xenproject.org; Mon, 17 Jun 2024 08:57:29 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 9e641d19-2c87-11ef-90a3-e314d9c70b13; Mon, 17 Jun 2024 10:57:26 +0200 (CEST) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id 833654EE075B; Mon, 17 Jun 2024 10:57: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: 9e641d19-2c87-11ef-90a3-e314d9c70b13 From: Nicola Vetrini To: 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, Nicola Vetrini , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall Subject: [XEN PATCH v2 2/6][RESEND] xen/self-tests: address violations of MISRA rule 20.7 Date: Mon, 17 Jun 2024 10:57:14 +0200 Message-Id: <2679cc27038689373d2d7e8abd62255bcd1b86f3.1718378539.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: 1718614670398100002 Content-Type: text/plain; charset="utf-8" MISRA C Rule 20.7 states: "Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses". Therefore, some macro definitions should gain additional parentheses to ensure that all current and future users will be safe with respect to expansions that can possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini Reviewed-by: Jan Beulich --- In this case the use of parentheses can detect misuses of the COMPILE_CHECK macro for the fn argument that happen to pass the compile-time check (see e.g. https://godbolt.org/z/n4zTdz595). An alternative would be to deviate these macros, but since they are used to check the correctness of other code it seemed the better alternative to futher ensure that all usages of the macros are safe. --- xen/include/xen/self-tests.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xen/include/xen/self-tests.h b/xen/include/xen/self-tests.h index 42a4cc4d17fe..58484fe5a8ae 100644 --- a/xen/include/xen/self-tests.h +++ b/xen/include/xen/self-tests.h @@ -19,11 +19,11 @@ #if !defined(CONFIG_CC_IS_CLANG) || CONFIG_CLANG_VERSION >=3D 80000 #define COMPILE_CHECK(fn, val, res) \ do { \ - typeof(fn(val)) real =3D fn(val); \ + typeof((fn)(val)) real =3D (fn)(val); \ \ if ( !__builtin_constant_p(real) ) \ asm ( ".error \"'" STR(fn(val)) "' not compile-time constant\"= " ); \ - else if ( real !=3D res ) \ + else if ( real !=3D (res) ) \ asm ( ".error \"Compile time check '" STR(fn(val) =3D=3D res) = "' failed\"" ); \ } while ( 0 ) #else @@ -37,9 +37,9 @@ */ #define RUNTIME_CHECK(fn, val, res) \ do { \ - typeof(fn(val)) real =3D fn(HIDE(val)); \ + typeof((fn)(val)) real =3D (fn)(HIDE(val)); \ \ - if ( real !=3D res ) \ + if ( real !=3D (res) ) \ panic("%s: %s(%s) expected %u, got %u\n", \ __func__, #fn, #val, real, res); \ } while ( 0 ) --=20 2.34.1 From nobody Mon Nov 25 03:26:43 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 1718614669749140.3332173777594; Mon, 17 Jun 2024 01:57:49 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.741917.1148598 (Exim 4.92) (envelope-from ) id 1sJ8B8-0005UZ-EB; Mon, 17 Jun 2024 08:57:30 +0000 Received: by outflank-mailman (output) from mailman id 741917.1148598; Mon, 17 Jun 2024 08:57: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 1sJ8B8-0005US-BM; Mon, 17 Jun 2024 08:57:30 +0000 Received: by outflank-mailman (input) for mailman id 741917; Mon, 17 Jun 2024 08:57:28 +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 1sJ8B6-0005Fj-Fy for xen-devel@lists.xenproject.org; Mon, 17 Jun 2024 08:57:28 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 9ebb93e2-2c87-11ef-b4bb-af5377834399; Mon, 17 Jun 2024 10:57:26 +0200 (CEST) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id 257F54EE073D; Mon, 17 Jun 2024 10:57:26 +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: 9ebb93e2-2c87-11ef-b4bb-af5377834399 From: Nicola Vetrini To: 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, Nicola Vetrini , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall Subject: [XEN PATCH v2 3/6][RESEND] xen/guest_access: address violations of MISRA rule 20.7 Date: Mon, 17 Jun 2024 10:57:15 +0200 Message-Id: <9168dac5b70f919403370844a6a3041781b82501.1718378539.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: 1718614670365100001 Content-Type: text/plain; charset="utf-8" MISRA C Rule 20.7 states: "Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses". Therefore, some macro definitions should gain additional parentheses to ensure that all current and future users will be safe with respect to expansions that can possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini Acked-by: Jan Beulich --- xen/include/xen/guest_access.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/include/xen/guest_access.h b/xen/include/xen/guest_access.h index af33ae3ab652..8bd2a124e823 100644 --- a/xen/include/xen/guest_access.h +++ b/xen/include/xen/guest_access.h @@ -49,9 +49,9 @@ ((XEN_GUEST_HANDLE(type)) { &(hnd).p->fld }) =20 #define guest_handle_from_ptr(ptr, type) \ - ((XEN_GUEST_HANDLE_PARAM(type)) { (type *)ptr }) + ((XEN_GUEST_HANDLE_PARAM(type)) { (type *)(ptr) }) #define const_guest_handle_from_ptr(ptr, type) \ - ((XEN_GUEST_HANDLE_PARAM(const_##type)) { (const type *)ptr }) + ((XEN_GUEST_HANDLE_PARAM(const_##type)) { (const type *)(ptr) }) =20 /* * Copy an array of objects to guest context via a guest handle, --=20 2.34.1 From nobody Mon Nov 25 03:26:43 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 1718614670263565.5392719537119; Mon, 17 Jun 2024 01:57:50 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.741921.1148625 (Exim 4.92) (envelope-from ) id 1sJ8B9-0005yf-T4; Mon, 17 Jun 2024 08:57:31 +0000 Received: by outflank-mailman (output) from mailman id 741921.1148625; Mon, 17 Jun 2024 08:57: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 1sJ8B9-0005tw-Mv; Mon, 17 Jun 2024 08:57:31 +0000 Received: by outflank-mailman (input) for mailman id 741921; Mon, 17 Jun 2024 08:57:30 +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 1sJ8B8-0005Fp-5w for xen-devel@lists.xenproject.org; Mon, 17 Jun 2024 08:57:30 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 9f1aff13-2c87-11ef-90a3-e314d9c70b13; Mon, 17 Jun 2024 10:57:27 +0200 (CEST) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id B22044EE0759; Mon, 17 Jun 2024 10:57:26 +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: 9f1aff13-2c87-11ef-90a3-e314d9c70b13 From: Nicola Vetrini To: 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, Nicola Vetrini , Simone Ballarin , Doug Goldstein , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall Subject: [XEN PATCH v2 4/6][RESEND] automation/eclair_analysis: address violations of MISRA C Rule 20.7 Date: Mon, 17 Jun 2024 10:57:16 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1718614672180100005 Content-Type: text/plain; charset="utf-8" MISRA C Rule 20.7 states: "Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses". The local helpers GRP2 and XADD in the x86 emulator use their first argument as the constant expression for a case label. This pattern is deviated project-wide, because it is very unlikely to induce developer confusion and result in the wrong control flow being carried out. No functional change. Signed-off-by: Nicola Vetrini Reviewed-by: Stefano Stabellini --- Changes in v2: - Introduce a deviation instead of adding parentheses --- automation/eclair_analysis/ECLAIR/deviations.ecl | 6 ++++-- docs/misra/deviations.rst | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/= eclair_analysis/ECLAIR/deviations.ecl index c2698e7074aa..fc248641dc78 100644 --- a/automation/eclair_analysis/ECLAIR/deviations.ecl +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl @@ -428,13 +428,15 @@ unexpected result when the structure is given as argu= ment to a sizeof() operator =20 -doc_begin=3D"Code violating Rule 20.7 is safe when macro parameters are u= sed: (1) as function arguments; (2) as macro arguments; (3) as array indices; (4) a= s lhs -in assignments; (5) as initializers, possibly designated, in initalizer li= sts." +in assignments; (5) as initializers, possibly designated, in initalizer li= sts; +(6) as the constant expression in a switch clause label." -config=3DMC3R1.R20.7,expansion_context=3D {safe, "context(__call_expr_arg_contexts)"}, {safe, "left_right(^[(,\\[]$,^[),\\]]$)"}, {safe, "context(skip_to(__expr_non_syntactic_contexts, stmt_child(node(arr= ay_subscript_expr), subscript)))"}, {safe, "context(skip_to(__expr_non_syntactic_contexts, stmt_child(operator= (assign), lhs)))"}, -{safe, "context(skip_to(__expr_non_syntactic_contexts, stmt_child(node(ini= t_list_expr||designated_init_expr), init)))"} +{safe, "context(skip_to(__expr_non_syntactic_contexts, stmt_child(node(ini= t_list_expr||designated_init_expr), init)))"}, +{safe, "context(skip_to(__expr_non_syntactic_contexts, stmt_child(node(cas= e_stmt), lower||upper)))"} -doc_end =20 -doc_begin=3D"Violations involving the __config_enabled macros cannot be f= ixed without diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst index 36959aa44ac9..be2cc6bf03eb 100644 --- a/docs/misra/deviations.rst +++ b/docs/misra/deviations.rst @@ -376,7 +376,8 @@ Deviations related to MISRA C:2012 Rules: (2) as macro arguments; (3) as array indices; (4) as lhs in assignments; - (5) as initializers, possibly designated, in initalizer lists. + (5) as initializers, possibly designated, in initalizer lists; + (6) as constant expressions of switch case labels. - Tagged as `safe` for ECLAIR. =20 * - R20.7 --=20 2.34.1 From nobody Mon Nov 25 03:26:43 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 1718614673038114.96597872908762; Mon, 17 Jun 2024 01:57:53 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.741920.1148616 (Exim 4.92) (envelope-from ) id 1sJ8B9-0005jd-Bu; Mon, 17 Jun 2024 08:57:31 +0000 Received: by outflank-mailman (output) from mailman id 741920.1148616; Mon, 17 Jun 2024 08:57: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 1sJ8B9-0005gd-4P; Mon, 17 Jun 2024 08:57:31 +0000 Received: by outflank-mailman (input) for mailman id 741920; Mon, 17 Jun 2024 08:57: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 1sJ8B7-0005Fj-H6 for xen-devel@lists.xenproject.org; Mon, 17 Jun 2024 08:57:29 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 9f6f1f56-2c87-11ef-b4bb-af5377834399; Mon, 17 Jun 2024 10:57:28 +0200 (CEST) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id 564B14EE075C; Mon, 17 Jun 2024 10:57: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: 9f6f1f56-2c87-11ef-b4bb-af5377834399 From: Nicola Vetrini To: 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, Nicola Vetrini , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall Subject: [XEN PATCH v2 5/6][RESEND] x86/irq: address violations of MISRA C Rule 20.7 Date: Mon, 17 Jun 2024 10:57:17 +0200 Message-Id: <58b102b7c73c342aa4e2f54b0ab5188944d97450.1718378539.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: 1718614674155100007 Content-Type: text/plain; charset="utf-8" MISRA C Rule 20.7 states: "Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses". Therefore, some macro definitions should gain additional parentheses to ensure that all current and future users will be safe with respect to expansions that can possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini Acked-by: Jan Beulich --- Note that the rule does not apply to f because that parameter is not used as an expression in the macro, but rather as an identifier. --- xen/include/xen/irq.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h index adf33547d25f..0401f06c4fca 100644 --- a/xen/include/xen/irq.h +++ b/xen/include/xen/irq.h @@ -178,7 +178,7 @@ extern struct pirq *pirq_get_info(struct domain *d, int= pirq); =20 #define pirq_field(d, p, f, def) ({ \ const struct pirq *__pi =3D pirq_info(d, p); \ - __pi ? __pi->f : def; \ + __pi ? __pi->f : (def); \ }) #define pirq_to_evtchn(d, pirq) pirq_field(d, pirq, evtchn, 0) #define pirq_masked(d, pirq) pirq_field(d, pirq, masked, 0) --=20 2.34.1 From nobody Mon Nov 25 03:26:43 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 1718614673184569.680849066885; Mon, 17 Jun 2024 01:57:53 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.741922.1148635 (Exim 4.92) (envelope-from ) id 1sJ8BA-00065T-FI; Mon, 17 Jun 2024 08:57:32 +0000 Received: by outflank-mailman (output) from mailman id 741922.1148635; Mon, 17 Jun 2024 08:57:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sJ8BA-00064K-1s; Mon, 17 Jun 2024 08:57:32 +0000 Received: by outflank-mailman (input) for mailman id 741922; Mon, 17 Jun 2024 08:57:31 +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 1sJ8B9-0005Fp-6F for xen-devel@lists.xenproject.org; Mon, 17 Jun 2024 08:57:31 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 9fb5934f-2c87-11ef-90a3-e314d9c70b13; Mon, 17 Jun 2024 10:57:28 +0200 (CEST) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id DE8B74EE0739; Mon, 17 Jun 2024 10:57: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: 9fb5934f-2c87-11ef-90a3-e314d9c70b13 From: Nicola Vetrini To: 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, Nicola Vetrini , Simone Ballarin , Doug Goldstein Subject: [XEN PATCH v2 6/6][RESEND] automation/eclair_analysis: clean ECLAIR configuration scripts Date: Mon, 17 Jun 2024 10:57:18 +0200 Message-Id: <120e7e4579b931c08d28d0a96848af1df7a07f7d.1718378539.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: 1718614674157100008 Content-Type: text/plain; charset="utf-8" Remove from the ECLAIR integration scripts an unused option, which was already ignored, and make the help texts consistent with the rest of the scripts. No functional change. Signed-off-by: Nicola Vetrini Acked-by: Stefano Stabellini Reviewed-by: Stefano Stabellini --- automation/eclair_analysis/ECLAIR/analyze.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/automation/eclair_analysis/ECLAIR/analyze.sh b/automation/ecla= ir_analysis/ECLAIR/analyze.sh index 0ea5520c93a6..e96456c3c18d 100755 --- a/automation/eclair_analysis/ECLAIR/analyze.sh +++ b/automation/eclair_analysis/ECLAIR/analyze.sh @@ -11,7 +11,7 @@ fatal() { } =20 usage() { - fatal "Usage: ${script_name} " + fatal "Usage: ${script_name} " } =20 if [[ $# -ne 2 ]]; then @@ -40,7 +40,6 @@ ECLAIR_REPORT_LOG=3D${ECLAIR_OUTPUT_DIR}/REPORT.log if [[ "$1" =3D "X86_64" ]]; then export CROSS_COMPILE=3D export XEN_TARGET_ARCH=3Dx86_64 - EXTRA_ECLAIR_ENV_OPTIONS=3D-disable=3DMC3R1.R20.7 elif [[ "$1" =3D "ARM64" ]]; then export CROSS_COMPILE=3Daarch64-linux-gnu- export XEN_TARGET_ARCH=3Darm64 --=20 2.34.1