From patchwork Mon Jun 17 08:57:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Vetrini X-Patchwork-Id: 13700334 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8A690C41513 for ; Mon, 17 Jun 2024 08:57:41 +0000 (UTC) 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 X-Outflank-Mailman: Message body and most headers restored to incoming version 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-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 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=MC3R1.R20.7,reports+={safe, "any_area(any_loc(any_exp(macro(^count_args_$))))"} -doc_end +-doc_begin="The arguments of macro bitmap_switch macro can't be parenthesized as +the rule would require, without breaking the functionality of the macro. This 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 deviate it." +-file_tag+={xen_bitmap_h, "^xen/include/xen/bitmap\\.h$"} +-config=MC3R1.R20.7,reports+={safe, "any_area(any_loc(any_exp(macro(loc(file(xen_bitmap_h))&&^bitmap_switch$))))"} +-doc_end + -doc_begin="Uses of variadic macros that have one of their arguments defined 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 and From patchwork Mon Jun 17 08:57:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Vetrini X-Patchwork-Id: 13700331 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 581FEC27C6E for ; Mon, 17 Jun 2024 08:57:41 +0000 (UTC) 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 X-Outflank-Mailman: Message body and most headers restored to incoming version 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-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 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 >= 80000 #define COMPILE_CHECK(fn, val, res) \ do { \ - typeof(fn(val)) real = fn(val); \ + typeof((fn)(val)) real = (fn)(val); \ \ if ( !__builtin_constant_p(real) ) \ asm ( ".error \"'" STR(fn(val)) "' not compile-time constant\"" ); \ - else if ( real != res ) \ + else if ( real != (res) ) \ asm ( ".error \"Compile time check '" STR(fn(val) == res) "' failed\"" ); \ } while ( 0 ) #else @@ -37,9 +37,9 @@ */ #define RUNTIME_CHECK(fn, val, res) \ do { \ - typeof(fn(val)) real = fn(HIDE(val)); \ + typeof((fn)(val)) real = (fn)(HIDE(val)); \ \ - if ( real != res ) \ + if ( real != (res) ) \ panic("%s: %s(%s) expected %u, got %u\n", \ __func__, #fn, #val, real, res); \ } while ( 0 ) From patchwork Mon Jun 17 08:57:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Vetrini X-Patchwork-Id: 13700336 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8A032C2BA1A for ; Mon, 17 Jun 2024 08:57:42 +0000 (UTC) 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 X-Outflank-Mailman: Message body and most headers restored to incoming version 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-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 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 }) #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) }) /* * Copy an array of objects to guest context via a guest handle, From patchwork Mon Jun 17 08:57:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Vetrini X-Patchwork-Id: 13700330 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8465CC27C7B for ; Mon, 17 Jun 2024 08:57:41 +0000 (UTC) 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 X-Outflank-Mailman: Message body and most headers restored to incoming version 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-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 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 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 argument to a sizeof() operator -doc_begin="Code violating Rule 20.7 is safe when macro parameters are used: (1) as function arguments; (2) as macro arguments; (3) as array indices; (4) as lhs -in assignments; (5) as initializers, possibly designated, in initalizer lists." +in assignments; (5) as initializers, possibly designated, in initalizer lists; +(6) as the constant expression in a switch clause label." -config=MC3R1.R20.7,expansion_context= {safe, "context(__call_expr_arg_contexts)"}, {safe, "left_right(^[(,\\[]$,^[),\\]]$)"}, {safe, "context(skip_to(__expr_non_syntactic_contexts, stmt_child(node(array_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(init_list_expr||designated_init_expr), init)))"} +{safe, "context(skip_to(__expr_non_syntactic_contexts, stmt_child(node(init_list_expr||designated_init_expr), init)))"}, +{safe, "context(skip_to(__expr_non_syntactic_contexts, stmt_child(node(case_stmt), lower||upper)))"} -doc_end -doc_begin="Violations involving the __config_enabled macros cannot be fixed 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. * - R20.7 From patchwork Mon Jun 17 08:57:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Vetrini X-Patchwork-Id: 13700333 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 89FE5C2BA18 for ; Mon, 17 Jun 2024 08:57:42 +0000 (UTC) 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 X-Outflank-Mailman: Message body and most headers restored to incoming version 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-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 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); #define pirq_field(d, p, f, def) ({ \ const struct pirq *__pi = 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) From patchwork Mon Jun 17 08:57:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Vetrini X-Patchwork-Id: 13700332 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 939A6C2BA16 for ; Mon, 17 Jun 2024 08:57:41 +0000 (UTC) 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 X-Outflank-Mailman: Message body and most headers restored to incoming version 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-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 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/eclair_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() { } usage() { - fatal "Usage: ${script_name} " + fatal "Usage: ${script_name} " } if [[ $# -ne 2 ]]; then @@ -40,7 +40,6 @@ ECLAIR_REPORT_LOG=${ECLAIR_OUTPUT_DIR}/REPORT.log if [[ "$1" = "X86_64" ]]; then export CROSS_COMPILE= export XEN_TARGET_ARCH=x86_64 - EXTRA_ECLAIR_ENV_OPTIONS=-disable=MC3R1.R20.7 elif [[ "$1" = "ARM64" ]]; then export CROSS_COMPILE=aarch64-linux-gnu- export XEN_TARGET_ARCH=arm64