From patchwork Mon Mar 18 11:53:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Vetrini X-Patchwork-Id: 13595312 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 C4612C54E71 for ; Mon, 18 Mar 2024 11:54:19 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.694608.1083485 (Exim 4.92) (envelope-from ) id 1rmBZ5-0001FL-Cg; Mon, 18 Mar 2024 11:54:03 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 694608.1083485; Mon, 18 Mar 2024 11:54:03 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rmBZ5-0001FE-A1; Mon, 18 Mar 2024 11:54:03 +0000 Received: by outflank-mailman (input) for mailman id 694608; Mon, 18 Mar 2024 11:54:02 +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 1rmBZ4-0001F3-96 for xen-devel@lists.xenproject.org; Mon, 18 Mar 2024 11:54:02 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 3548f086-e51e-11ee-afdd-a90da7624cb6; Mon, 18 Mar 2024 12:54:00 +0100 (CET) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id 6D7E04EE0742; Mon, 18 Mar 2024 12:53:59 +0100 (CET) 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: 3548f086-e51e-11ee-afdd-a90da7624cb6 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, Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Wei Liu Subject: [XEN PATCH 01/10] x86/cpufeature: add parentheses to comply with Rule 20.7 Date: Mon, 18 Mar 2024 12:53:44 +0100 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". 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/arch/x86/include/asm/cpufeatureset.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/include/asm/cpufeatureset.h b/xen/arch/x86/include/asm/cpufeatureset.h index f179229f192f..a9c51bc514a8 100644 --- a/xen/arch/x86/include/asm/cpufeatureset.h +++ b/xen/arch/x86/include/asm/cpufeatureset.h @@ -5,7 +5,7 @@ #include -#define XEN_CPUFEATURE(name, value) X86_FEATURE_##name = value, +#define XEN_CPUFEATURE(name, value) X86_FEATURE_##name = (value), enum { #include #include From patchwork Mon Mar 18 11:53:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Vetrini X-Patchwork-Id: 13595316 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 8961EC54E79 for ; Mon, 18 Mar 2024 11:54:20 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.694611.1083512 (Exim 4.92) (envelope-from ) id 1rmBZ7-0001lK-7T; Mon, 18 Mar 2024 11:54:05 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 694611.1083512; Mon, 18 Mar 2024 11:54:05 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rmBZ7-0001kp-08; Mon, 18 Mar 2024 11:54:05 +0000 Received: by outflank-mailman (input) for mailman id 694611; Mon, 18 Mar 2024 11:54:03 +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 1rmBZ5-0001F2-KM for xen-devel@lists.xenproject.org; Mon, 18 Mar 2024 11:54:03 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 3594ff97-e51e-11ee-a1ee-f123f15fe8a2; Mon, 18 Mar 2024 12:54:00 +0100 (CET) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id 17AE44EE073F; Mon, 18 Mar 2024 12:54:00 +0100 (CET) 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: 3594ff97-e51e-11ee-a1ee-f123f15fe8a2 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, Jan Beulich , Andrew Cooper Subject: [XEN PATCH 02/10] AMD/IOMMU: guest: address violations of MISRA C Rule 20.7 Date: Mon, 18 Mar 2024 12:53:45 +0100 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". 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 --- This local helper may disappear as a follow-up to [1], if the function that remains there after the cleanup ends up being removed, so this patch has a slight dependency on what follows up from that thread (in which case it can be dropped). [1] https://lore.kernel.org/xen-devel/alpine.DEB.2.22.394.2403151724380.853156@ubuntu-linux-20-04-desktop/T/#m9474ad4f35830345a22acd4a665245f7085d4b46 --- xen/drivers/passthrough/amd/iommu_guest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/drivers/passthrough/amd/iommu_guest.c b/xen/drivers/passthrough/amd/iommu_guest.c index 4c4252eea116..5bfaa48d9d65 100644 --- a/xen/drivers/passthrough/amd/iommu_guest.c +++ b/xen/drivers/passthrough/amd/iommu_guest.c @@ -30,7 +30,7 @@ #define GUEST_ADDRESS_SIZE_6_LEVEL 0x2 #define HOST_ADDRESS_SIZE_6_LEVEL 0x2 -#define reg_to_u64(reg) (((uint64_t)reg.hi << 32) | reg.lo ) +#define reg_to_u64(reg) (((uint64_t)((reg).hi << 32)) | (reg).lo ) #define u64_to_reg(reg, val) \ do \ { \ From patchwork Mon Mar 18 11:53:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Vetrini X-Patchwork-Id: 13595313 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 47E64C54E5D for ; Mon, 18 Mar 2024 11:54:20 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.694609.1083492 (Exim 4.92) (envelope-from ) id 1rmBZ5-0001Hx-Mk; Mon, 18 Mar 2024 11:54:03 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 694609.1083492; Mon, 18 Mar 2024 11:54:03 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rmBZ5-0001HD-Gc; Mon, 18 Mar 2024 11:54:03 +0000 Received: by outflank-mailman (input) for mailman id 694609; Mon, 18 Mar 2024 11:54:02 +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 1rmBZ4-0001F3-UO for xen-devel@lists.xenproject.org; Mon, 18 Mar 2024 11:54:02 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 35d9b533-e51e-11ee-afdd-a90da7624cb6; Mon, 18 Mar 2024 12:54:01 +0100 (CET) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id 92BBE4EE0745; Mon, 18 Mar 2024 12:54:00 +0100 (CET) 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: 35d9b533-e51e-11ee-afdd-a90da7624cb6 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, "Daniel P. Smith" Subject: [XEN PATCH 03/10] xen/xsm: add parentheses to comply with MISRA C Rule 20.7 Date: Mon, 18 Mar 2024 12:53:46 +0100 Message-Id: <4eeb9be581e3fa07378f5a7deb23c9066474638b.1710762555.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: Stefano Stabellini --- xen/include/xsm/dummy.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h index 8671af1ba4d3..88039fdd227c 100644 --- a/xen/include/xsm/dummy.h +++ b/xen/include/xsm/dummy.h @@ -58,7 +58,7 @@ void __xsm_action_mismatch_detected(void); #define XSM_DEFAULT_ARG /* */ #define XSM_DEFAULT_VOID void -#define XSM_ASSERT_ACTION(def) xsm_default_t action = def; (void)action +#define XSM_ASSERT_ACTION(def) xsm_default_t action = (def); (void)action #else /* CONFIG_XSM */ @@ -71,7 +71,7 @@ void __xsm_action_mismatch_detected(void); #define XSM_INLINE always_inline #define XSM_DEFAULT_ARG xsm_default_t action, #define XSM_DEFAULT_VOID xsm_default_t action -#define XSM_ASSERT_ACTION(def) LINKER_BUG_ON(def != action) +#define XSM_ASSERT_ACTION(def) LINKER_BUG_ON((def) != action) #endif /* CONFIG_XSM */ From patchwork Mon Mar 18 11:53:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Vetrini X-Patchwork-Id: 13595310 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 0818DC54E73 for ; Mon, 18 Mar 2024 11:54:19 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.694612.1083516 (Exim 4.92) (envelope-from ) id 1rmBZ7-0001sM-F5; Mon, 18 Mar 2024 11:54:05 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 694612.1083516; Mon, 18 Mar 2024 11:54:05 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rmBZ7-0001qM-Ac; Mon, 18 Mar 2024 11:54:05 +0000 Received: by outflank-mailman (input) for mailman id 694612; Mon, 18 Mar 2024 11:54:03 +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 1rmBZ5-0001F2-R8 for xen-devel@lists.xenproject.org; Mon, 18 Mar 2024 11:54:03 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 361da749-e51e-11ee-a1ee-f123f15fe8a2; Mon, 18 Mar 2024 12:54:01 +0100 (CET) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id 0C6044EE0746; Mon, 18 Mar 2024 12:54:01 +0100 (CET) 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: 361da749-e51e-11ee-a1ee-f123f15fe8a2 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, Julien Grall Subject: [XEN PATCH 04/10] xen/device_tree: address violations of MISRA C Rule 20.7 Date: Mon, 18 Mar 2024 12:53:47 +0100 Message-Id: <3845d2a318bdaab242a7fd67473b05198db1b111.1710762555.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: Stefano Stabellini --- This patch uniforms the way these macros use parentheses, skipping the already deviated cases of the lhs of an assignment. In principle, all three could have the parentheses on the macro argument in the lhs added. --- xen/include/xen/device_tree.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h index 6fe2fa8b2123..e6287305a7b5 100644 --- a/xen/include/xen/device_tree.h +++ b/xen/include/xen/device_tree.h @@ -250,7 +250,7 @@ dt_find_interrupt_controller(const struct dt_device_match *matches); for ( pp = (dn)->properties; (pp) != NULL; pp = (pp)->next ) #define dt_for_each_device_node(dt, dn) \ - for ( dn = dt; (dn) != NULL; dn = (dn)->allnext ) + for ( dn = (dt); (dn) != NULL; dn = (dn)->allnext ) #define dt_for_each_child_node(dt, dn) \ for ( dn = (dt)->child; (dn) != NULL; dn = (dn)->sibling ) From patchwork Mon Mar 18 11:53:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Vetrini X-Patchwork-Id: 13595317 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 928CCC54E78 for ; Mon, 18 Mar 2024 11:54:20 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.694613.1083528 (Exim 4.92) (envelope-from ) id 1rmBZ8-00023l-4n; Mon, 18 Mar 2024 11:54:06 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 694613.1083528; Mon, 18 Mar 2024 11:54: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 1rmBZ7-00023G-R3; Mon, 18 Mar 2024 11:54:05 +0000 Received: by outflank-mailman (input) for mailman id 694613; Mon, 18 Mar 2024 11:54:04 +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 1rmBZ6-0001F2-QP for xen-devel@lists.xenproject.org; Mon, 18 Mar 2024 11:54:04 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 368b82dd-e51e-11ee-a1ee-f123f15fe8a2; Mon, 18 Mar 2024 12:54:02 +0100 (CET) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id 7C43A4EE0747; Mon, 18 Mar 2024 12:54:01 +0100 (CET) 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: 368b82dd-e51e-11ee-a1ee-f123f15fe8a2 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, Jan Beulich Subject: [XEN PATCH 05/10] EFI: address violations of MISRA C Rule 20.7 Date: Mon, 18 Mar 2024 12:53:48 +0100 Message-Id: <66095ff2496d9b2be701877a3df762293fc8708b.1710762555.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 --- This file is matched by exclude-list.json, but the fix is rather trivial and actually benefits code that is in scope for compliance. --- xen/include/efi/efierr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/include/efi/efierr.h b/xen/include/efi/efierr.h index dfd3d3cf4867..2ecde0b31302 100644 --- a/xen/include/efi/efierr.h +++ b/xen/include/efi/efierr.h @@ -22,7 +22,7 @@ Revision History #define EFIWARN(a) (a) -#define EFI_ERROR(a) (((INTN) a) < 0) +#define EFI_ERROR(a) (((INTN)(a)) < 0) #define EFI_SUCCESS 0 From patchwork Mon Mar 18 11:53:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Vetrini X-Patchwork-Id: 13595308 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 A463CC54E69 for ; Mon, 18 Mar 2024 11:54:19 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.694614.1083543 (Exim 4.92) (envelope-from ) id 1rmBZ9-0002W4-8z; Mon, 18 Mar 2024 11:54:07 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 694614.1083543; Mon, 18 Mar 2024 11:54:07 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rmBZ9-0002V4-2A; Mon, 18 Mar 2024 11:54:07 +0000 Received: by outflank-mailman (input) for mailman id 694614; Mon, 18 Mar 2024 11:54: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 1rmBZ7-0001F2-QQ for xen-devel@lists.xenproject.org; Mon, 18 Mar 2024 11:54:05 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 3701a563-e51e-11ee-a1ee-f123f15fe8a2; Mon, 18 Mar 2024 12:54:03 +0100 (CET) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id 4620D4EE0744; Mon, 18 Mar 2024 12:54:02 +0100 (CET) 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: 3701a563-e51e-11ee-a1ee-f123f15fe8a2 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, Julien Grall , Rahul Singh , Bertrand Marquis , Volodymyr Babchuk Subject: [XEN PATCH 06/10] xen/arm: smmu: address violations of MISRA C Rule 20.7 Date: Mon, 18 Mar 2024 12:53:49 +0100 Message-Id: <50ec3074772b0c58bef446d1c06aa41db04a66d0.1710762555.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: Stefano Stabellini --- xen/drivers/passthrough/arm/smmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c index 83196057a937..f2cee82f553a 100644 --- a/xen/drivers/passthrough/arm/smmu.c +++ b/xen/drivers/passthrough/arm/smmu.c @@ -326,7 +326,7 @@ static struct iommu_group *iommu_group_get(struct device *dev) */ #define ARM_SMMU_GR0_NS(smmu) \ ((smmu)->base + \ - ((smmu->options & ARM_SMMU_OPT_SECURE_CFG_ACCESS) \ + (((smmu)->options & ARM_SMMU_OPT_SECURE_CFG_ACCESS) \ ? 0x400 : 0)) /* Page table bits */ From patchwork Mon Mar 18 11:53:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Vetrini X-Patchwork-Id: 13595314 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 250A3C54E74 for ; Mon, 18 Mar 2024 11:54:20 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.694615.1083556 (Exim 4.92) (envelope-from ) id 1rmBZA-0002v7-KF; Mon, 18 Mar 2024 11:54:08 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 694615.1083556; Mon, 18 Mar 2024 11:54:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rmBZA-0002uf-Eu; Mon, 18 Mar 2024 11:54:08 +0000 Received: by outflank-mailman (input) for mailman id 694615; Mon, 18 Mar 2024 11:54:06 +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 1rmBZ8-0001F2-QW for xen-devel@lists.xenproject.org; Mon, 18 Mar 2024 11:54:06 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 37a10472-e51e-11ee-a1ee-f123f15fe8a2; Mon, 18 Mar 2024 12:54:04 +0100 (CET) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id 0A9304EE0748; Mon, 18 Mar 2024 12:54:02 +0100 (CET) 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: 37a10472-e51e-11ee-a1ee-f123f15fe8a2 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, Julien Grall , Bertrand Marquis , Volodymyr Babchuk , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Wei Liu Subject: [XEN PATCH 07/10] xen/efi: efibind: address violations of MISRA C Rule 20.7 Date: Mon, 18 Mar 2024 12:53:50 +0100 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". 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 --- This file is matched by exclude-list.json, but the fix is rather trivial and impacts code that in under the scope of MISRA compliance. --- xen/arch/arm/include/asm/arm64/efibind.h | 4 ++-- xen/arch/x86/include/asm/x86_64/efibind.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/include/asm/arm64/efibind.h b/xen/arch/arm/include/asm/arm64/efibind.h index f13eadd4f0ab..a1323d452e2e 100644 --- a/xen/arch/arm/include/asm/arm64/efibind.h +++ b/xen/arch/arm/include/asm/arm64/efibind.h @@ -22,9 +22,9 @@ Revision History #pragma pack() #endif -#define EFIERR(a) (0x8000000000000000ULL | a) +#define EFIERR(a) (0x8000000000000000ULL | (a)) #define EFI_ERROR_MASK 0x8000000000000000ULL -#define EFIERR_OEM(a) (0xc000000000000000ULL | a) +#define EFIERR_OEM(a) (0xc000000000000000ULL | (a)) #define BAD_POINTER 0xFBFBFBFBFBFBFBFBULL #define MAX_ADDRESS 0xFFFFFFFFFFFFFFFFULL diff --git a/xen/arch/x86/include/asm/x86_64/efibind.h b/xen/arch/x86/include/asm/x86_64/efibind.h index e23cd16cb6a0..28bc18c24bb3 100644 --- a/xen/arch/x86/include/asm/x86_64/efibind.h +++ b/xen/arch/x86/include/asm/x86_64/efibind.h @@ -117,9 +117,9 @@ typedef uint64_t UINTN; #endif #endif -#define EFIERR(a) (0x8000000000000000 | a) +#define EFIERR(a) (0x8000000000000000 | (a)) #define EFI_ERROR_MASK 0x8000000000000000 -#define EFIERR_OEM(a) (0xc000000000000000 | a) +#define EFIERR_OEM(a) (0xc000000000000000 | (a)) #define BAD_POINTER 0xFBFBFBFBFBFBFBFB From patchwork Mon Mar 18 11:53:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Vetrini X-Patchwork-Id: 13595315 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 8504FC54E77 for ; Mon, 18 Mar 2024 11:54:20 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.694617.1083567 (Exim 4.92) (envelope-from ) id 1rmBZB-000350-GS; Mon, 18 Mar 2024 11:54:09 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 694617.1083567; Mon, 18 Mar 2024 11:54:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rmBZB-000335-5h; Mon, 18 Mar 2024 11:54:09 +0000 Received: by outflank-mailman (input) for mailman id 694617; Mon, 18 Mar 2024 11:54:07 +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 1rmBZ9-0001F2-Qm for xen-devel@lists.xenproject.org; Mon, 18 Mar 2024 11:54:07 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 3846bc1c-e51e-11ee-a1ee-f123f15fe8a2; Mon, 18 Mar 2024 12:54:05 +0100 (CET) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id 192424EE0749; Mon, 18 Mar 2024 12:54:04 +0100 (CET) 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: 3846bc1c-e51e-11ee-a1ee-f123f15fe8a2 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 , Wei Liu Subject: [XEN PATCH 08/10] xen/notifier: address violations of MISRA C Rule 20.7 Date: Mon, 18 Mar 2024 12:53:51 +0100 Message-Id: <5ea6d48a2af93c54693364eb5bfa7e575eb717a3.1710762555.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/notifier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/include/xen/notifier.h b/xen/include/xen/notifier.h index 2a952484df43..05359e8a850d 100644 --- a/xen/include/xen/notifier.h +++ b/xen/include/xen/notifier.h @@ -34,7 +34,7 @@ struct notifier_head { }; #define NOTIFIER_HEAD(name) \ - struct notifier_head name = { .head = LIST_HEAD_INIT(name.head) } + struct notifier_head name = { .head = LIST_HEAD_INIT((name).head) } void notifier_chain_register( From patchwork Mon Mar 18 11:53:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Vetrini X-Patchwork-Id: 13595318 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 D3B41C54E58 for ; Mon, 18 Mar 2024 11:54:21 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.694616.1083559 (Exim 4.92) (envelope-from ) id 1rmBZA-0002z3-Um; Mon, 18 Mar 2024 11:54:08 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 694616.1083559; Mon, 18 Mar 2024 11:54:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rmBZA-0002xt-Nl; Mon, 18 Mar 2024 11:54:08 +0000 Received: by outflank-mailman (input) for mailman id 694616; Mon, 18 Mar 2024 11:54:06 +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 1rmBZ8-0001F3-PA for xen-devel@lists.xenproject.org; Mon, 18 Mar 2024 11:54:06 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 38e8a27b-e51e-11ee-afdd-a90da7624cb6; Mon, 18 Mar 2024 12:54:06 +0100 (CET) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id 338494EE074B; Mon, 18 Mar 2024 12:54:05 +0100 (CET) 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: 38e8a27b-e51e-11ee-afdd-a90da7624cb6 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 , Wei Liu Subject: [XEN PATCH 09/10] xen/wait: address violations of MISRA C Rule 20.7 Date: Mon, 18 Mar 2024 12:53:52 +0100 Message-Id: <1d9f79590a224b4007f34a609b8024b36dd44a04.1710762555.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/wait.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/include/xen/wait.h b/xen/include/xen/wait.h index 6eb7667d9c7f..1c68bc564b09 100644 --- a/xen/include/xen/wait.h +++ b/xen/include/xen/wait.h @@ -40,12 +40,12 @@ do { \ if ( condition ) \ break; \ for ( ; ; ) { \ - prepare_to_wait(&wq); \ + prepare_to_wait(&(wq)); \ if ( condition ) \ break; \ wait(); \ } \ - finish_wait(&wq); \ + finish_wait(&(wq)); \ } while (0) /* Private functions. */ From patchwork Mon Mar 18 11:53:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Vetrini X-Patchwork-Id: 13595311 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 C466FC54E72 for ; Mon, 18 Mar 2024 11:54:19 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.694618.1083582 (Exim 4.92) (envelope-from ) id 1rmBZC-0003Zo-Rk; Mon, 18 Mar 2024 11:54:10 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 694618.1083582; Mon, 18 Mar 2024 11:54:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rmBZC-0003YJ-JQ; Mon, 18 Mar 2024 11:54:10 +0000 Received: by outflank-mailman (input) for mailman id 694618; Mon, 18 Mar 2024 11:54:08 +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 1rmBZA-0001F2-Qm for xen-devel@lists.xenproject.org; Mon, 18 Mar 2024 11:54:08 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 396893e5-e51e-11ee-a1ee-f123f15fe8a2; Mon, 18 Mar 2024 12:54:07 +0100 (CET) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id 3870D4EE0C8A; Mon, 18 Mar 2024 12:54:06 +0100 (CET) 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: 396893e5-e51e-11ee-a1ee-f123f15fe8a2 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, George Dunlap , Dario Faggioli Subject: [XEN PATCH 10/10] xen/sched: address violations of MISRA C Rule 20.7 Date: Mon, 18 Mar 2024 12:53:53 +0100 Message-Id: <0c584c738f744a583497f1fb862d753836d8b249.1710762555.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: George Dunlap --- xen/common/sched/private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/common/sched/private.h b/xen/common/sched/private.h index 459d1dfb11a5..c0e7c96d24f4 100644 --- a/xen/common/sched/private.h +++ b/xen/common/sched/private.h @@ -540,7 +540,7 @@ static inline void sched_unit_unpause(const struct sched_unit *unit) } #define REGISTER_SCHEDULER(x) static const struct scheduler *x##_entry \ - __used_section(".data.schedulers") = &x + __used_section(".data.schedulers") = &(x) struct cpupool {