From patchwork Wed Jun 26 09:27:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13712478 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 31A45C3065A for ; Wed, 26 Jun 2024 09:28:25 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.748583.1156336 (Exim 4.92) (envelope-from ) id 1sMOwp-0004lO-I5; Wed, 26 Jun 2024 09:28:15 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 748583.1156336; Wed, 26 Jun 2024 09:28:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sMOwp-0004lH-Ei; Wed, 26 Jun 2024 09:28:15 +0000 Received: by outflank-mailman (input) for mailman id 748583; Wed, 26 Jun 2024 09:28:14 +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 1sMOwo-0004l0-0u for xen-devel@lists.xenproject.org; Wed, 26 Jun 2024 09:28:14 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 68f45ac6-339e-11ef-90a3-e314d9c70b13; Wed, 26 Jun 2024 11:28:13 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [78.209.199.41]) by support.bugseng.com (Postfix) with ESMTPSA id 5D0344EE0755; Wed, 26 Jun 2024 11:28:12 +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: 68f45ac6-339e-11ef-90a3-e314d9c70b13 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Simone Ballarin , Doug Goldstein , Stefano Stabellini , Jan Beulich Subject: [XEN PATCH v3 01/12] automation/eclair: fix deviation of MISRA C Rule 16.3 Date: Wed, 26 Jun 2024 11:27:54 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Escape the final dot of the comment and extend the search of a fallthrough comment up to 2 lines after the last statement. Fixes: a128d8da913b ("automation/eclair: add deviations for MISRA C:2012 Rule 16.3") Reported-by: Jan Beulich Signed-off-by: Federico Serafini Acked-by: Stefano Stabellini --- Changes in v3: - truncate to 12 digits. Changes in v2: - instead of introducing the hypened fallthrough, insert the missing escape. --- automation/eclair_analysis/ECLAIR/deviations.ecl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl index c8bff0e057..9b994be63d 100644 --- a/automation/eclair_analysis/ECLAIR/deviations.ecl +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl @@ -416,7 +416,7 @@ safe." -doc_end -doc_begin="Switch clauses ending with an explicit comment indicating the fallthrough intention are safe." --config=MC3R1.R16.3,reports+={safe, "any_area(end_loc(any_exp(text(^(?s).*/\\* [fF]all ?through.? \\*/.*$,0..1))))"} +-config=MC3R1.R16.3,reports+={safe, "any_area(end_loc(any_exp(text(^(?s).*/\\* [fF]all ?through\\.? \\*/.*$,0..2))))"} -doc_end -doc_begin="Switch statements having a controlling expression of enum type deliberately do not have a default case: gcc -Wall enables -Wswitch which warns (and breaks the build as we use -Werror) if one of the enum labels is missing from the switch." From patchwork Wed Jun 26 09:27:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13712476 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 2AC25C27C4F for ; Wed, 26 Jun 2024 09:28:23 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.748585.1156346 (Exim 4.92) (envelope-from ) id 1sMOwq-0004si-3U; Wed, 26 Jun 2024 09:28:16 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 748585.1156346; Wed, 26 Jun 2024 09:28:16 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sMOwp-0004rH-Tl; Wed, 26 Jun 2024 09:28:15 +0000 Received: by outflank-mailman (input) for mailman id 748585; Wed, 26 Jun 2024 09:28:14 +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 1sMOwo-0004l0-Mn for xen-devel@lists.xenproject.org; Wed, 26 Jun 2024 09:28:14 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 696bcd6f-339e-11ef-90a3-e314d9c70b13; Wed, 26 Jun 2024 11:28:14 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [78.209.199.41]) by support.bugseng.com (Postfix) with ESMTPSA id 1C6724EE0756; Wed, 26 Jun 2024 11:28:13 +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: 696bcd6f-339e-11ef-90a3-e314d9c70b13 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini Subject: [XEN PATCH v3 02/12] x86/cpuid: use fallthrough pseudo keyword Date: Wed, 26 Jun 2024 11:27:55 +0200 Message-Id: <64ecc15337a4d325dda610608f599dc99a6bc7f5.1719383180.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 The current comment making explicit the fallthrough intention does not follow the agreed syntax: replace it with the pseduo keyword. No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- xen/arch/x86/cpuid.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xen/arch/x86/cpuid.c b/xen/arch/x86/cpuid.c index a822e80c7e..2a777436ee 100644 --- a/xen/arch/x86/cpuid.c +++ b/xen/arch/x86/cpuid.c @@ -97,9 +97,8 @@ void guest_cpuid(const struct vcpu *v, uint32_t leaf, if ( is_viridian_domain(d) ) return cpuid_viridian_leaves(v, leaf, subleaf, res); + fallthrough; /* - * Fallthrough. - * * Intel reserve up until 0x4fffffff for hypervisor use. AMD reserve * only until 0x400000ff, but we already use double that. */ From patchwork Wed Jun 26 09:27:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13712477 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 5855BC41513 for ; Wed, 26 Jun 2024 09:28:24 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.748586.1156365 (Exim 4.92) (envelope-from ) id 1sMOwr-0005Qb-Ab; Wed, 26 Jun 2024 09:28:17 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 748586.1156365; Wed, 26 Jun 2024 09:28:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sMOwr-0005Pp-5u; Wed, 26 Jun 2024 09:28:17 +0000 Received: by outflank-mailman (input) for mailman id 748586; Wed, 26 Jun 2024 09:28:16 +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 1sMOwq-0004l5-7n for xen-devel@lists.xenproject.org; Wed, 26 Jun 2024 09:28:16 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 69e90dc5-339e-11ef-b4bb-af5377834399; Wed, 26 Jun 2024 11:28:14 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [78.209.199.41]) by support.bugseng.com (Postfix) with ESMTPSA id DB06D4EE0754; Wed, 26 Jun 2024 11:28:13 +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: 69e90dc5-339e-11ef-b4bb-af5377834399 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini Subject: [XEN PATCH v3 03/12] x86/domctl: address a violation of MISRA C Rule 16.3 Date: Wed, 26 Jun 2024 11:27:56 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Add missing break statement to address a violation of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- xen/arch/x86/domctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index 9190e11faa..68b5b46d1a 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -517,6 +517,7 @@ long arch_do_domctl( default: ret = -ENOSYS; + break; } break; } From patchwork Wed Jun 26 09:27:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13712479 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 B9E15C30653 for ; Wed, 26 Jun 2024 09:28:25 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.748587.1156375 (Exim 4.92) (envelope-from ) id 1sMOws-0005js-Kb; Wed, 26 Jun 2024 09:28:18 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 748587.1156375; Wed, 26 Jun 2024 09:28:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sMOws-0005jX-HK; Wed, 26 Jun 2024 09:28:18 +0000 Received: by outflank-mailman (input) for mailman id 748587; Wed, 26 Jun 2024 09:28:16 +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 1sMOwq-0004l5-Sp for xen-devel@lists.xenproject.org; Wed, 26 Jun 2024 09:28:16 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 6a4dbec0-339e-11ef-b4bb-af5377834399; Wed, 26 Jun 2024 11:28:15 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [78.209.199.41]) by support.bugseng.com (Postfix) with ESMTPSA id B95384EE0757; Wed, 26 Jun 2024 11:28:14 +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: 6a4dbec0-339e-11ef-b4bb-af5377834399 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Subject: [XEN PATCH v3 04/12] x86/vpmu: address violations of MISRA C Rule 16.3 Date: Wed, 26 Jun 2024 11:27:57 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Add missing break statements to address violations of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini Reviewed-by: Jan Beulich --- Changes in v3: - addressed all violations of R16.3 in vpmu_intel.c --- xen/arch/x86/cpu/vpmu.c | 3 +++ xen/arch/x86/cpu/vpmu_intel.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/cpu/vpmu.c index a7bc0cd1fc..b2ba999412 100644 --- a/xen/arch/x86/cpu/vpmu.c +++ b/xen/arch/x86/cpu/vpmu.c @@ -663,6 +663,8 @@ long do_xenpmu_op( if ( pmu_params.version.maj != XENPMU_VER_MAJ ) return -EINVAL; + + break; } switch ( op ) @@ -776,6 +778,7 @@ long do_xenpmu_op( default: ret = -EINVAL; + break; } return ret; diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c index cd414165df..26dd3a9358 100644 --- a/xen/arch/x86/cpu/vpmu_intel.c +++ b/xen/arch/x86/cpu/vpmu_intel.c @@ -666,6 +666,7 @@ static int cf_check core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content) xen_pmu_cntr_pair[tmp].control = msr_content; } + break; } if ( type != MSR_TYPE_GLOBAL ) @@ -713,6 +714,7 @@ static int cf_check core2_vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content) break; default: rdmsrl(msr, *msr_content); + break; } } else if ( msr == MSR_IA32_MISC_ENABLE ) From patchwork Wed Jun 26 09:27:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13712481 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 19141C27C4F for ; Wed, 26 Jun 2024 09:28:27 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.748589.1156387 (Exim 4.92) (envelope-from ) id 1sMOwt-0005sV-JY; Wed, 26 Jun 2024 09:28:19 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 748589.1156387; Wed, 26 Jun 2024 09:28:19 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sMOwt-0005qp-7o; Wed, 26 Jun 2024 09:28:19 +0000 Received: by outflank-mailman (input) for mailman id 748589; Wed, 26 Jun 2024 09:28:17 +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 1sMOwr-0004l5-HO for xen-devel@lists.xenproject.org; Wed, 26 Jun 2024 09:28:17 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 6ab1bf4f-339e-11ef-b4bb-af5377834399; Wed, 26 Jun 2024 11:28:16 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [78.209.199.41]) by support.bugseng.com (Postfix) with ESMTPSA id 6178F4EE0758; Wed, 26 Jun 2024 11:28:15 +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: 6ab1bf4f-339e-11ef-b4bb-af5377834399 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Subject: [XEN PATCH v3 05/12] x86/traps: address violations of MISRA C Rule 16.3 Date: Wed, 26 Jun 2024 11:27:58 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Add break or pseudo keyword fallthrough to address violations of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- Changes in v3: - use break instead of fallthrough. --- xen/arch/x86/traps.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 9906e874d5..d62598a4c2 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -1186,6 +1186,7 @@ void cpuid_hypervisor_leaves(const struct vcpu *v, uint32_t leaf, default: ASSERT_UNREACHABLE(); + break; } } @@ -1748,6 +1749,7 @@ static void io_check_error(const struct cpu_user_regs *regs) { case 'd': /* 'dom0' */ nmi_hwdom_report(_XEN_NMIREASON_io_error); + break; case 'i': /* 'ignore' */ break; default: /* 'fatal' */ @@ -1768,6 +1770,7 @@ static void unknown_nmi_error(const struct cpu_user_regs *regs, { case 'd': /* 'dom0' */ nmi_hwdom_report(_XEN_NMIREASON_unknown); + break; case 'i': /* 'ignore' */ break; default: /* 'fatal' */ From patchwork Wed Jun 26 09:27:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13712483 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 C8C6DC30653 for ; Wed, 26 Jun 2024 09:28:29 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.748588.1156382 (Exim 4.92) (envelope-from ) id 1sMOwt-0005pa-7h; Wed, 26 Jun 2024 09:28:19 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 748588.1156382; Wed, 26 Jun 2024 09:28:19 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sMOws-0005pP-TI; Wed, 26 Jun 2024 09:28:18 +0000 Received: by outflank-mailman (input) for mailman id 748588; Wed, 26 Jun 2024 09:28:17 +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 1sMOwr-0004l0-9m for xen-devel@lists.xenproject.org; Wed, 26 Jun 2024 09:28:17 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 6b1b2581-339e-11ef-90a3-e314d9c70b13; Wed, 26 Jun 2024 11:28:16 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [78.209.199.41]) by support.bugseng.com (Postfix) with ESMTPSA id 087084EE0738; Wed, 26 Jun 2024 11:28:15 +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: 6b1b2581-339e-11ef-90a3-e314d9c70b13 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini Subject: [XEN PATCH v3 06/12] x86/mce: address violations of MISRA C Rule 16.3 Date: Wed, 26 Jun 2024 11:27:59 +0200 Message-Id: <7c1a5865fa00b873296ba0870d620070371bcd22.1719383180.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Add missing break statements to address violations of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- xen/arch/x86/cpu/mcheck/mce_amd.c | 1 + xen/arch/x86/cpu/mcheck/mce_intel.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/xen/arch/x86/cpu/mcheck/mce_amd.c b/xen/arch/x86/cpu/mcheck/mce_amd.c index 3318b8204f..4f06a3153b 100644 --- a/xen/arch/x86/cpu/mcheck/mce_amd.c +++ b/xen/arch/x86/cpu/mcheck/mce_amd.c @@ -201,6 +201,7 @@ static void mcequirk_amd_apply(enum mcequirk_amd_flags flags) default: ASSERT(flags == MCEQUIRK_NONE); + break; } } diff --git a/xen/arch/x86/cpu/mcheck/mce_intel.c b/xen/arch/x86/cpu/mcheck/mce_intel.c index dd812f4b8a..9574dedbfd 100644 --- a/xen/arch/x86/cpu/mcheck/mce_intel.c +++ b/xen/arch/x86/cpu/mcheck/mce_intel.c @@ -896,6 +896,8 @@ static void intel_init_ppin(const struct cpuinfo_x86 *c) ppin_msr = 0; else if ( c == &boot_cpu_data ) ppin_msr = MSR_PPIN; + + break; } } From patchwork Wed Jun 26 09:28:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13712487 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 969F1C41513 for ; Wed, 26 Jun 2024 09:28:30 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.748590.1156395 (Exim 4.92) (envelope-from ) id 1sMOwu-00066X-Fo; Wed, 26 Jun 2024 09:28:20 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 748590.1156395; Wed, 26 Jun 2024 09:28:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sMOwu-00064P-0T; Wed, 26 Jun 2024 09:28:20 +0000 Received: by outflank-mailman (input) for mailman id 748590; Wed, 26 Jun 2024 09:28:18 +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 1sMOws-0004l0-4Z for xen-devel@lists.xenproject.org; Wed, 26 Jun 2024 09:28:18 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 6b8dcf0b-339e-11ef-90a3-e314d9c70b13; Wed, 26 Jun 2024 11:28:17 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [78.209.199.41]) by support.bugseng.com (Postfix) with ESMTPSA id B85024EE0757; Wed, 26 Jun 2024 11:28:16 +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: 6b8dcf0b-339e-11ef-90a3-e314d9c70b13 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Subject: [XEN PATCH v3 07/12] x86/hvm: address violations of MISRA C Rule 16.3 Date: Wed, 26 Jun 2024 11:28:00 +0200 Message-Id: <87cfe4d3e75c3a7d4174393a31aaaf80e0e60633.1719383180.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 MISRA C Rule 16.3 states that "An unconditional `break' statement shall terminate every switch-clause". Add pseudo keyword fallthrough or missing break statement to address violations of the rule. As a defensive measure, return -EOPNOTSUPP in case an unreachable return statement is reached. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini --- Changes in v3: - squashed here modifications of pmtimer.c; - no blank line after fallthrough; - better indentation of fallthrough. --- xen/arch/x86/hvm/emulate.c | 9 ++++++--- xen/arch/x86/hvm/hvm.c | 5 +++++ xen/arch/x86/hvm/hypercall.c | 1 + xen/arch/x86/hvm/irq.c | 1 + xen/arch/x86/hvm/pmtimer.c | 1 + 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c index 02e378365b..f5dd08f510 100644 --- a/xen/arch/x86/hvm/emulate.c +++ b/xen/arch/x86/hvm/emulate.c @@ -339,7 +339,7 @@ static int hvmemul_do_io( } case X86EMUL_UNIMPLEMENTED: ASSERT_UNREACHABLE(); - /* Fall-through */ + fallthrough; default: BUG(); } @@ -2674,6 +2674,7 @@ static int _hvm_emulate_one(struct hvm_emulate_ctxt *hvmemul_ctxt, default: ASSERT_UNREACHABLE(); + break; } if ( hvmemul_ctxt->ctxt.retire.singlestep ) @@ -2764,6 +2765,7 @@ int hvm_emulate_one_mmio(unsigned long mfn, unsigned long gla) /* fallthrough */ default: hvm_emulate_writeback(&ctxt); + break; } return rc; @@ -2798,11 +2800,12 @@ void hvm_emulate_one_vm_event(enum emul_kind kind, unsigned int trapnr, hvio->mmio_insn_bytes = sizeof(hvio->mmio_insn); memcpy(hvio->mmio_insn, curr->arch.vm_event->emul.insn.data, hvio->mmio_insn_bytes); + fallthrough; } - /* Fall-through */ default: ctx.set_context = (kind == EMUL_KIND_SET_CONTEXT_DATA); rc = hvm_emulate_one(&ctx, VIO_no_completion); + break; } switch ( rc ) @@ -2818,7 +2821,7 @@ void hvm_emulate_one_vm_event(enum emul_kind kind, unsigned int trapnr, case X86EMUL_UNIMPLEMENTED: if ( hvm_monitor_emul_unimplemented() ) return; - /* fall-through */ + fallthrough; case X86EMUL_UNHANDLEABLE: hvm_dump_emulation_state(XENLOG_G_DEBUG, "Mem event", &ctx, rc); hvm_inject_hw_exception(trapnr, errcode); diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 7f4b627b1f..d7f195ba9a 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -4919,6 +4919,8 @@ static int do_altp2m_op( default: ASSERT_UNREACHABLE(); + rc = -EOPNOTSUPP; + break; } out: @@ -5020,6 +5022,8 @@ static int compat_altp2m_op( default: ASSERT_UNREACHABLE(); + rc = -EOPNOTSUPP; + break; } return rc; @@ -5283,6 +5287,7 @@ void hvm_get_segment_register(struct vcpu *v, enum x86_segment seg, * %cs and %tr are unconditionally present. SVM ignores these present * bits and will happily run without them set. */ + fallthrough; case x86_seg_cs: reg->p = 1; break; diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c index 7fb3136f0c..2271afe02a 100644 --- a/xen/arch/x86/hvm/hypercall.c +++ b/xen/arch/x86/hvm/hypercall.c @@ -111,6 +111,7 @@ int hvm_hypercall(struct cpu_user_regs *regs) case 8: eax = regs->rax; /* Fallthrough to permission check. */ + fallthrough; case 4: case 2: if ( currd->arch.monitor.guest_request_userspace_enabled && diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c index 210cebb0e6..1eab44defc 100644 --- a/xen/arch/x86/hvm/irq.c +++ b/xen/arch/x86/hvm/irq.c @@ -282,6 +282,7 @@ static void hvm_set_callback_irq_level(struct vcpu *v) __hvm_pci_intx_assert(d, pdev, pintx); else __hvm_pci_intx_deassert(d, pdev, pintx); + break; default: break; } diff --git a/xen/arch/x86/hvm/pmtimer.c b/xen/arch/x86/hvm/pmtimer.c index 97099ac305..87a7a01c9f 100644 --- a/xen/arch/x86/hvm/pmtimer.c +++ b/xen/arch/x86/hvm/pmtimer.c @@ -185,6 +185,7 @@ static int cf_check handle_evt_io( gdprintk(XENLOG_WARNING, "Bad ACPI PM register write: %x bytes (%x) at %x\n", bytes, *val, port); + break; } } /* Fix up the SCI state to match the new register state */ From patchwork Wed Jun 26 09:28:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13712484 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 59FF5C27C4F for ; Wed, 26 Jun 2024 09:28:30 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.748592.1156407 (Exim 4.92) (envelope-from ) id 1sMOwv-0006Ql-Lu; Wed, 26 Jun 2024 09:28:21 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 748592.1156407; Wed, 26 Jun 2024 09:28:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sMOwv-0006OF-5b; Wed, 26 Jun 2024 09:28:21 +0000 Received: by outflank-mailman (input) for mailman id 748592; Wed, 26 Jun 2024 09:28:19 +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 1sMOwt-0004l5-LL for xen-devel@lists.xenproject.org; Wed, 26 Jun 2024 09:28:19 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 6bf588f8-339e-11ef-b4bb-af5377834399; Wed, 26 Jun 2024 11:28:18 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [78.209.199.41]) by support.bugseng.com (Postfix) with ESMTPSA id 7E24C4EE0755; Wed, 26 Jun 2024 11:28:17 +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: 6bf588f8-339e-11ef-b4bb-af5377834399 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Subject: [XEN PATCH v3 08/12] x86/vpt: address a violation of MISRA C Rule 16.3 Date: Wed, 26 Jun 2024 11:28:01 +0200 Message-Id: <453ef39f5a2a1871d8b0c74d921ed6a413b179b4.1719383180.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Add pseudo keyword fallthrough to meet the requirements to deviate a violation of MISRA C Rule 16.3 ("An unconditional `break' statement shall terminate every switch-clause"). No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini --- Changes in v3: - better indentation of fallthrough. --- xen/arch/x86/hvm/vpt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c index e1d6845a28..ab06bea33e 100644 --- a/xen/arch/x86/hvm/vpt.c +++ b/xen/arch/x86/hvm/vpt.c @@ -118,9 +118,11 @@ static int pt_irq_masked(struct periodic_time *pt) return 0; gsi = hvm_isa_irq_to_gsi(pt->irq); + + /* Fallthrough to check if the interrupt is masked on the IO APIC. */ + fallthrough; } - /* Fallthrough to check if the interrupt is masked on the IO APIC. */ case PTSRC_ioapic: { int mask = vioapic_get_mask(v->domain, gsi); From patchwork Wed Jun 26 09:28:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13712482 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 94AB6C3065B for ; Wed, 26 Jun 2024 09:28:27 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.748591.1156398 (Exim 4.92) (envelope-from ) id 1sMOwu-0006Eq-SD; Wed, 26 Jun 2024 09:28:20 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 748591.1156398; Wed, 26 Jun 2024 09:28:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sMOwu-0006Cz-Ie; Wed, 26 Jun 2024 09:28:20 +0000 Received: by outflank-mailman (input) for mailman id 748591; Wed, 26 Jun 2024 09:28:19 +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 1sMOwt-0004l0-EE for xen-devel@lists.xenproject.org; Wed, 26 Jun 2024 09:28:19 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 6c632e85-339e-11ef-90a3-e314d9c70b13; Wed, 26 Jun 2024 11:28:19 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [78.209.199.41]) by support.bugseng.com (Postfix) with ESMTPSA id 264DB4EE0754; Wed, 26 Jun 2024 11:28:18 +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: 6c632e85-339e-11ef-90a3-e314d9c70b13 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Subject: [XEN PATCH v3 09/12] x86/mm: add defensive return Date: Wed, 26 Jun 2024 11:28:02 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Add defensive return statement at the end of an unreachable default case. Other than improve safety, this meets the requirements to deviate a violation of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". Signed-off-by: Federico Serafini Reviewed-by: Jan Beulich --- Changes in v3: - do not return 0 (success). Al least this version returns an error code but I am not sure about which one to use. --- xen/arch/x86/mm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 648d6dd475..a1e28b3360 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -916,6 +916,7 @@ get_page_from_l1e( return 0; default: ASSERT_UNREACHABLE(); + return -EPERM; } } else if ( l1f & _PAGE_RW ) From patchwork Wed Jun 26 09:28:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13712485 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 8A82EC3065C for ; Wed, 26 Jun 2024 09:28:30 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.748593.1156420 (Exim 4.92) (envelope-from ) id 1sMOww-0006nM-R3; Wed, 26 Jun 2024 09:28:22 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 748593.1156420; Wed, 26 Jun 2024 09:28:22 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sMOww-0006kw-EK; Wed, 26 Jun 2024 09:28:22 +0000 Received: by outflank-mailman (input) for mailman id 748593; Wed, 26 Jun 2024 09:28:20 +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 1sMOwu-0004l0-3u for xen-devel@lists.xenproject.org; Wed, 26 Jun 2024 09:28:20 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 6ccb1ce6-339e-11ef-90a3-e314d9c70b13; Wed, 26 Jun 2024 11:28:19 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [78.209.199.41]) by support.bugseng.com (Postfix) with ESMTPSA id DFE424EE0759; Wed, 26 Jun 2024 11:28:18 +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: 6ccb1ce6-339e-11ef-90a3-e314d9c70b13 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini Subject: [XEN PATCH v3 10/12] x86/mpparse: address a violation of MISRA C Rule 16.3 Date: Wed, 26 Jun 2024 11:28:03 +0200 Message-Id: <84bd2be6bfb12bc6bf87ecc0f195e2f74fa5f45f.1719383180.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Add a missing break statement to address a violation of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- xen/arch/x86/mpparse.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x86/mpparse.c b/xen/arch/x86/mpparse.c index d8ccab2449..306d8ed97a 100644 --- a/xen/arch/x86/mpparse.c +++ b/xen/arch/x86/mpparse.c @@ -544,6 +544,7 @@ static inline void __init construct_default_ISA_mptable(int mpc_default_type) case 4: case 7: memcpy(bus.mpc_bustype, "MCA ", 6); + break; } MP_bus_info(&bus); if (mpc_default_type > 4) { From patchwork Wed Jun 26 09:28:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13712486 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 71EEFC3065B for ; Wed, 26 Jun 2024 09:28:31 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.748597.1156429 (Exim 4.92) (envelope-from ) id 1sMOwx-0006zL-Qt; Wed, 26 Jun 2024 09:28:23 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 748597.1156429; Wed, 26 Jun 2024 09:28:23 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sMOwx-0006vX-9z; Wed, 26 Jun 2024 09:28:23 +0000 Received: by outflank-mailman (input) for mailman id 748597; Wed, 26 Jun 2024 09:28:22 +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 1sMOwv-0004l5-OB for xen-devel@lists.xenproject.org; Wed, 26 Jun 2024 09:28:21 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 6d34cf97-339e-11ef-b4bb-af5377834399; Wed, 26 Jun 2024 11:28:20 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [78.209.199.41]) by support.bugseng.com (Postfix) with ESMTPSA id 8A8134EE0755; Wed, 26 Jun 2024 11:28:19 +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: 6d34cf97-339e-11ef-b4bb-af5377834399 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini Subject: [XEN PATCH v3 11/12] x86/vPIC: address a violation of MISRA C Rule 16.3 Date: Wed, 26 Jun 2024 11:28:04 +0200 Message-Id: <68c8dbc10a0e78caae75d86fef571b1c1622a468.1719383180.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Add pseudokeyword fallthrough to meet the requirements to deviate a violation of MISRA C Rul 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- xen/arch/x86/hvm/vpic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x86/hvm/vpic.c b/xen/arch/x86/hvm/vpic.c index 7c3b5c7254..6427b08086 100644 --- a/xen/arch/x86/hvm/vpic.c +++ b/xen/arch/x86/hvm/vpic.c @@ -309,6 +309,7 @@ static void vpic_ioport_write( if ( !(vpic->init_state & 8) ) break; /* CASCADE mode: wait for write to ICW3. */ /* SNGL mode: fall through (no ICW3). */ + fallthrough; case 2: /* ICW3 */ vpic->init_state++; From patchwork Wed Jun 26 09:28:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13712488 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 24766C27C4F for ; Wed, 26 Jun 2024 09:28:34 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.748598.1156439 (Exim 4.92) (envelope-from ) id 1sMOwz-0007K0-0O; Wed, 26 Jun 2024 09:28:25 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 748598.1156439; Wed, 26 Jun 2024 09:28:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sMOwy-0007GT-Dx; Wed, 26 Jun 2024 09:28:24 +0000 Received: by outflank-mailman (input) for mailman id 748598; Wed, 26 Jun 2024 09:28:23 +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 1sMOww-0004l5-M5 for xen-devel@lists.xenproject.org; Wed, 26 Jun 2024 09:28:22 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 6db3eddd-339e-11ef-b4bb-af5377834399; Wed, 26 Jun 2024 11:28:21 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [78.209.199.41]) by support.bugseng.com (Postfix) with ESMTPSA id 3F0B44EE073D; Wed, 26 Jun 2024 11:28:20 +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: 6db3eddd-339e-11ef-b4bb-af5377834399 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini Subject: [XEN PATCH v3 12/12] x86/vlapic: address a violation of MISRA C Rule 16.3 Date: Wed, 26 Jun 2024 11:28:05 +0200 Message-Id: <8cc3a42c2c73b21bb08d9140b274a7350c3b2d0b.1719383180.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Add missing break statement to address a violation of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- xen/arch/x86/hvm/vlapic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c index 9cfc82666a..2ec9594271 100644 --- a/xen/arch/x86/hvm/vlapic.c +++ b/xen/arch/x86/hvm/vlapic.c @@ -367,6 +367,7 @@ static void vlapic_accept_irq(struct vcpu *v, uint32_t icr_low) gdprintk(XENLOG_ERR, "TODO: unsupported delivery mode in ICR %x\n", icr_low); domain_crash(v->domain); + break; } }