From patchwork Thu Jun 20 13:51:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13705539 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 E1A71C2BA18 for ; Thu, 20 Jun 2024 13:52:13 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.744506.1151549 (Exim 4.92) (envelope-from ) id 1sKICk-0008CZ-GZ; Thu, 20 Jun 2024 13:51:58 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 744506.1151549; Thu, 20 Jun 2024 13:51:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sKICk-0008CB-BM; Thu, 20 Jun 2024 13:51:58 +0000 Received: by outflank-mailman (input) for mailman id 744506; Thu, 20 Jun 2024 13:51:57 +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 1sKICj-0008AK-6R for xen-devel@lists.xenproject.org; Thu, 20 Jun 2024 13:51:57 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 40fe713c-2f0c-11ef-b4bb-af5377834399; Thu, 20 Jun 2024 15:51:55 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [78.208.165.219]) by support.bugseng.com (Postfix) with ESMTPSA id 1B2714EE0738; Thu, 20 Jun 2024 15:51:53 +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: 40fe713c-2f0c-11ef-b4bb-af5377834399 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini Subject: [XEN PATCH 01/13] automation/eclair: consider also hypened fall-through Date: Thu, 20 Jun 2024 15:51:35 +0200 Message-Id: <10af9145252a2f5c31ea0f13cbb67cbe76a8ba3a.1718890095.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Update ECLAIR configuration: - allow to deviate MISRA C Rule 16.3 using different version of hypened fall-through; - search for the comment for 2 lines after the last statement. Signed-off-by: Federico Serafini --- automation/eclair_analysis/ECLAIR/deviations.ecl | 2 +- docs/misra/deviations.rst | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl index b8f9155267..b99a6b8a92 100644 --- a/automation/eclair_analysis/ECLAIR/deviations.ecl +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl @@ -400,7 +400,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." diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst index 41cdfbe5f5..411e1fed3d 100644 --- a/docs/misra/deviations.rst +++ b/docs/misra/deviations.rst @@ -353,6 +353,10 @@ Deviations related to MISRA C:2012 Rules: However, the use of such comments in new code is deprecated: the pseudo-keyword "fallthrough" shall be used. - Tagged as `safe` for ECLAIR. The accepted comments are: + - /\* fall-through \*/ + - /\* fall-through. \*/ + - /\* Fall-through \*/ + - /\* Fall-through. \*/ - /\* fall through \*/ - /\* fall through. \*/ - /\* fallthrough \*/ From patchwork Thu Jun 20 13:51:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13705549 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 D74F5C30653 for ; Thu, 20 Jun 2024 13:52:17 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.744507.1151552 (Exim 4.92) (envelope-from ) id 1sKICk-0008FQ-Lv; Thu, 20 Jun 2024 13:51:58 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 744507.1151552; Thu, 20 Jun 2024 13:51:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sKICk-0008EJ-HW; Thu, 20 Jun 2024 13:51:58 +0000 Received: by outflank-mailman (input) for mailman id 744507; Thu, 20 Jun 2024 13:51:57 +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 1sKICj-0008AK-Rw for xen-devel@lists.xenproject.org; Thu, 20 Jun 2024 13:51:57 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 412d62f4-2f0c-11ef-b4bb-af5377834399; Thu, 20 Jun 2024 15:51:55 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [78.208.165.219]) by support.bugseng.com (Postfix) with ESMTPSA id A051E4EE073D; Thu, 20 Jun 2024 15:51:54 +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: 412d62f4-2f0c-11ef-b4bb-af5377834399 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini Subject: [XEN PATCH 02/13] x86/cpuid: use fallthrough pseudo keyword Date: Thu, 20 Jun 2024 15:51:36 +0200 Message-Id: <23fa8f1061b894d4dd121bc9c2fcaf2c3ad312f3.1718890095.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <10af9145252a2f5c31ea0f13cbb67cbe76a8ba3a.1718890095.git.federico.serafini@bugseng.com> References: <10af9145252a2f5c31ea0f13cbb67cbe76a8ba3a.1718890095.git.federico.serafini@bugseng.com> 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 --- 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 Thu Jun 20 13:51:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13705541 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 B8AECC41513 for ; Thu, 20 Jun 2024 13:52:15 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.744505.1151544 (Exim 4.92) (envelope-from ) id 1sKICk-0008Ah-8F; Thu, 20 Jun 2024 13:51:58 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 744505.1151544; Thu, 20 Jun 2024 13:51:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sKICk-0008Aa-4i; Thu, 20 Jun 2024 13:51:58 +0000 Received: by outflank-mailman (input) for mailman id 744505; Thu, 20 Jun 2024 13:51:56 +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 1sKICi-0008AF-Ot for xen-devel@lists.xenproject.org; Thu, 20 Jun 2024 13:51:56 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 4185b786-2f0c-11ef-90a3-e314d9c70b13; Thu, 20 Jun 2024 15:51:55 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [78.208.165.219]) by support.bugseng.com (Postfix) with ESMTPSA id 384184EE0739; Thu, 20 Jun 2024 15:51:55 +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: 4185b786-2f0c-11ef-90a3-e314d9c70b13 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini Subject: [XEN PATCH 03/13] x86/domctl: address a violation of MISRA C Rule 16.3 Date: Thu, 20 Jun 2024 15:51:37 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: <10af9145252a2f5c31ea0f13cbb67cbe76a8ba3a.1718890095.git.federico.serafini@bugseng.com> References: <10af9145252a2f5c31ea0f13cbb67cbe76a8ba3a.1718890095.git.federico.serafini@bugseng.com> 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 --- 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 Thu Jun 20 13:51:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13705540 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 0C784C2BBCA for ; Thu, 20 Jun 2024 13:52:15 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.744509.1151581 (Exim 4.92) (envelope-from ) id 1sKICm-0000bC-CM; Thu, 20 Jun 2024 13:52:00 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 744509.1151581; Thu, 20 Jun 2024 13:52:00 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sKICm-0000Zq-8k; Thu, 20 Jun 2024 13:52:00 +0000 Received: by outflank-mailman (input) for mailman id 744509; Thu, 20 Jun 2024 13:51:58 +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 1sKICk-0008AK-Ry for xen-devel@lists.xenproject.org; Thu, 20 Jun 2024 13:51:58 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 41d3483f-2f0c-11ef-b4bb-af5377834399; Thu, 20 Jun 2024 15:51:56 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [78.208.165.219]) by support.bugseng.com (Postfix) with ESMTPSA id C30204EE0754; Thu, 20 Jun 2024 15:51:55 +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: 41d3483f-2f0c-11ef-b4bb-af5377834399 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini Subject: [XEN PATCH 04/13] x86/vpmu: address violations of MISRA C Rule 16.3 Date: Thu, 20 Jun 2024 15:51:38 +0200 Message-Id: <2b08ef10fb4907255688d5fb38b5928e972407e9.1718890095.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <10af9145252a2f5c31ea0f13cbb67cbe76a8ba3a.1718890095.git.federico.serafini@bugseng.com> References: <10af9145252a2f5c31ea0f13cbb67cbe76a8ba3a.1718890095.git.federico.serafini@bugseng.com> 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 --- xen/arch/x86/cpu/vpmu.c | 3 +++ xen/arch/x86/cpu/vpmu_intel.c | 1 + 2 files changed, 4 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..46f3ff86e7 100644 --- a/xen/arch/x86/cpu/vpmu_intel.c +++ b/xen/arch/x86/cpu/vpmu_intel.c @@ -713,6 +713,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 Thu Jun 20 13:51:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13705543 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 3E315C27C79 for ; Thu, 20 Jun 2024 13:52:16 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.744512.1151597 (Exim 4.92) (envelope-from ) id 1sKICn-0000sg-Cb; Thu, 20 Jun 2024 13:52:01 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 744512.1151597; Thu, 20 Jun 2024 13:52:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sKICn-0000pI-6p; Thu, 20 Jun 2024 13:52:01 +0000 Received: by outflank-mailman (input) for mailman id 744512; Thu, 20 Jun 2024 13:51:59 +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 1sKICl-0008AK-Rz for xen-devel@lists.xenproject.org; Thu, 20 Jun 2024 13:51:59 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 42289b38-2f0c-11ef-b4bb-af5377834399; Thu, 20 Jun 2024 15:51:56 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [78.208.165.219]) by support.bugseng.com (Postfix) with ESMTPSA id 497F44EE0739; Thu, 20 Jun 2024 15:51:56 +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: 42289b38-2f0c-11ef-b4bb-af5377834399 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini Subject: [XEN PATCH 05/13] x86/traps: address violations of MISRA C Rule 16.3 Date: Thu, 20 Jun 2024 15:51:39 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: <10af9145252a2f5c31ea0f13cbb67cbe76a8ba3a.1718890095.git.federico.serafini@bugseng.com> References: <10af9145252a2f5c31ea0f13cbb67cbe76a8ba3a.1718890095.git.federico.serafini@bugseng.com> 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 --- 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..cbcec3fafb 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); + fallthrough; 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); + fallthrough; case 'i': /* 'ignore' */ break; default: /* 'fatal' */ From patchwork Thu Jun 20 13:51:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13705538 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 B7D71C2BA1A for ; Thu, 20 Jun 2024 13:52:13 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.744508.1151559 (Exim 4.92) (envelope-from ) id 1sKICk-0008Mh-VF; Thu, 20 Jun 2024 13:51:58 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 744508.1151559; Thu, 20 Jun 2024 13:51:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sKICk-0008Jo-Pq; Thu, 20 Jun 2024 13:51:58 +0000 Received: by outflank-mailman (input) for mailman id 744508; Thu, 20 Jun 2024 13:51:58 +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 1sKICk-0008AF-0s for xen-devel@lists.xenproject.org; Thu, 20 Jun 2024 13:51:58 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 42782e75-2f0c-11ef-90a3-e314d9c70b13; Thu, 20 Jun 2024 15:51:57 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [78.208.165.219]) by support.bugseng.com (Postfix) with ESMTPSA id CCA504EE073D; Thu, 20 Jun 2024 15:51:56 +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: 42782e75-2f0c-11ef-90a3-e314d9c70b13 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini Subject: [XEN PATCH 06/13] x86/mce: address violations of MISRA C Rule 16.3 Date: Thu, 20 Jun 2024 15:51:40 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: <10af9145252a2f5c31ea0f13cbb67cbe76a8ba3a.1718890095.git.federico.serafini@bugseng.com> References: <10af9145252a2f5c31ea0f13cbb67cbe76a8ba3a.1718890095.git.federico.serafini@bugseng.com> 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 --- 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 Thu Jun 20 13:51:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13705542 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 98491C2BD09 for ; Thu, 20 Jun 2024 13:52:15 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.744513.1151617 (Exim 4.92) (envelope-from ) id 1sKICp-0001PU-40; Thu, 20 Jun 2024 13:52:03 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 744513.1151617; Thu, 20 Jun 2024 13:52: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 1sKICo-0001Ns-Ol; Thu, 20 Jun 2024 13:52:02 +0000 Received: by outflank-mailman (input) for mailman id 744513; Thu, 20 Jun 2024 13:52:00 +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 1sKICm-0008AK-S6 for xen-devel@lists.xenproject.org; Thu, 20 Jun 2024 13:52:00 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 42cf13a2-2f0c-11ef-b4bb-af5377834399; Thu, 20 Jun 2024 15:51:58 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [78.208.165.219]) by support.bugseng.com (Postfix) with ESMTPSA id 619DB4EE0738; Thu, 20 Jun 2024 15:51:57 +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: 42cf13a2-2f0c-11ef-b4bb-af5377834399 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini Subject: [XEN PATCH 07/13] x86/hvm: address violations of MISRA C Rule 16.3 Date: Thu, 20 Jun 2024 15:51:41 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: <10af9145252a2f5c31ea0f13cbb67cbe76a8ba3a.1718890095.git.federico.serafini@bugseng.com> References: <10af9145252a2f5c31ea0f13cbb67cbe76a8ba3a.1718890095.git.federico.serafini@bugseng.com> MIME-Version: 1.0 MISRA C Rule 16.3 states that "An unconditional `break' statement shall terminate every switch-clause". Add pseudo keyword fallthrough and 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 --- xen/arch/x86/hvm/emulate.c | 3 +++ xen/arch/x86/hvm/hvm.c | 6 ++++++ xen/arch/x86/hvm/hypercall.c | 1 + xen/arch/x86/hvm/irq.c | 1 + 4 files changed, 11 insertions(+) diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c index 02e378365b..6d0fba9285 100644 --- a/xen/arch/x86/hvm/emulate.c +++ b/xen/arch/x86/hvm/emulate.c @@ -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; @@ -2803,6 +2805,7 @@ void hvm_emulate_one_vm_event(enum emul_kind kind, unsigned int trapnr, default: ctx.set_context = (kind == EMUL_KIND_SET_CONTEXT_DATA); rc = hvm_emulate_one(&ctx, VIO_no_completion); + break; } switch ( rc ) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 7f4b627b1f..c263e562ff 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,8 @@ 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; } From patchwork Thu Jun 20 13:51:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13705537 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 00551C27C79 for ; Thu, 20 Jun 2024 13:52:12 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.744510.1151587 (Exim 4.92) (envelope-from ) id 1sKICm-0000g4-Mk; Thu, 20 Jun 2024 13:52:00 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 744510.1151587; Thu, 20 Jun 2024 13:52:00 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sKICm-0000eg-Id; Thu, 20 Jun 2024 13:52:00 +0000 Received: by outflank-mailman (input) for mailman id 744510; Thu, 20 Jun 2024 13:51:59 +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 1sKICk-0008AF-VW for xen-devel@lists.xenproject.org; Thu, 20 Jun 2024 13:51:58 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 4314fd0d-2f0c-11ef-90a3-e314d9c70b13; Thu, 20 Jun 2024 15:51:58 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [78.208.165.219]) by support.bugseng.com (Postfix) with ESMTPSA id DFE794EE073D; Thu, 20 Jun 2024 15:51:57 +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: 4314fd0d-2f0c-11ef-90a3-e314d9c70b13 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini Subject: [XEN PATCH 08/13] x86/vpt: address a violation of MISRA C Rule 16.3 Date: Thu, 20 Jun 2024 15:51:42 +0200 Message-Id: <5b9dbf5595a0aa8d7454dcd7be9fae3a12bf2630.1718890095.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <10af9145252a2f5c31ea0f13cbb67cbe76a8ba3a.1718890095.git.federico.serafini@bugseng.com> References: <10af9145252a2f5c31ea0f13cbb67cbe76a8ba3a.1718890095.git.federico.serafini@bugseng.com> 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 --- xen/arch/x86/hvm/vpt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c index e1d6845a28..c76a9a272b 100644 --- a/xen/arch/x86/hvm/vpt.c +++ b/xen/arch/x86/hvm/vpt.c @@ -121,6 +121,8 @@ static int pt_irq_masked(struct periodic_time *pt) } /* Fallthrough to check if the interrupt is masked on the IO APIC. */ + fallthrough; + case PTSRC_ioapic: { int mask = vioapic_get_mask(v->domain, gsi); From patchwork Thu Jun 20 13:51:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13705544 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 5D2CFC2D0D0 for ; Thu, 20 Jun 2024 13:52:16 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.744511.1151594 (Exim 4.92) (envelope-from ) id 1sKICn-0000mM-3t; Thu, 20 Jun 2024 13:52:01 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 744511.1151594; Thu, 20 Jun 2024 13:52:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sKICm-0000ko-Sw; Thu, 20 Jun 2024 13:52:00 +0000 Received: by outflank-mailman (input) for mailman id 744511; Thu, 20 Jun 2024 13:51:59 +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 1sKICl-0008AF-G5 for xen-devel@lists.xenproject.org; Thu, 20 Jun 2024 13:51:59 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 436bee80-2f0c-11ef-90a3-e314d9c70b13; Thu, 20 Jun 2024 15:51:59 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [78.208.165.219]) by support.bugseng.com (Postfix) with ESMTPSA id 6075A4EE0754; Thu, 20 Jun 2024 15:51:58 +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: 436bee80-2f0c-11ef-90a3-e314d9c70b13 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini Subject: [XEN PATCH 09/13] x86/mm: add defensive return Date: Thu, 20 Jun 2024 15:51:43 +0200 Message-Id: <282da9981826370ca839503477fb515af14ff4b5.1718890095.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <10af9145252a2f5c31ea0f13cbb67cbe76a8ba3a.1718890095.git.federico.serafini@bugseng.com> References: <10af9145252a2f5c31ea0f13cbb67cbe76a8ba3a.1718890095.git.federico.serafini@bugseng.com> 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. Signed-off-by: Federico Serafini --- 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..2e19ced15e 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 0; } } else if ( l1f & _PAGE_RW ) From patchwork Thu Jun 20 13:51:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13705547 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 84A37C2D0CF for ; Thu, 20 Jun 2024 13:52:16 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.744515.1151626 (Exim 4.92) (envelope-from ) id 1sKICq-0001e6-3f; Thu, 20 Jun 2024 13:52:04 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 744515.1151626; Thu, 20 Jun 2024 13:52:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sKICp-0001bU-Q1; Thu, 20 Jun 2024 13:52:03 +0000 Received: by outflank-mailman (input) for mailman id 744515; Thu, 20 Jun 2024 13:52:02 +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 1sKICn-0008AK-S7 for xen-devel@lists.xenproject.org; Thu, 20 Jun 2024 13:52:01 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 43d5c31b-2f0c-11ef-b4bb-af5377834399; Thu, 20 Jun 2024 15:51:59 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [78.208.165.219]) by support.bugseng.com (Postfix) with ESMTPSA id 063B24EE073D; Thu, 20 Jun 2024 15:51:58 +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: 43d5c31b-2f0c-11ef-b4bb-af5377834399 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini Subject: [XEN PATCH 10/13] x86/mpparse: address a violation of MISRA C Rule Date: Thu, 20 Jun 2024 15:51:44 +0200 Message-Id: <317de680730ffebaae490be5841a7d413c420a54.1718890095.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <10af9145252a2f5c31ea0f13cbb67cbe76a8ba3a.1718890095.git.federico.serafini@bugseng.com> References: <10af9145252a2f5c31ea0f13cbb67cbe76a8ba3a.1718890095.git.federico.serafini@bugseng.com> 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 --- 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 Thu Jun 20 13:51:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13705546 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 5D36DC2D0D1 for ; Thu, 20 Jun 2024 13:52:16 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.744517.1151644 (Exim 4.92) (envelope-from ) id 1sKICr-00020w-NL; Thu, 20 Jun 2024 13:52:05 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 744517.1151644; Thu, 20 Jun 2024 13:52: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 1sKICr-0001vf-3A; Thu, 20 Jun 2024 13:52:05 +0000 Received: by outflank-mailman (input) for mailman id 744517; Thu, 20 Jun 2024 13:52: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 1sKICo-0008AK-ST for xen-devel@lists.xenproject.org; Thu, 20 Jun 2024 13:52:02 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 444fefa2-2f0c-11ef-b4bb-af5377834399; Thu, 20 Jun 2024 15:52:00 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [78.208.165.219]) by support.bugseng.com (Postfix) with ESMTPSA id E5AC14EE0739; Thu, 20 Jun 2024 15:51:59 +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: 444fefa2-2f0c-11ef-b4bb-af5377834399 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini Subject: [XEN PATCH 11/13] x86/pmtimer: address a violation of MISRA C Rule 16.3 Date: Thu, 20 Jun 2024 15:51:45 +0200 Message-Id: <3cdd3de1e1d91fb9fbef173f3f1a3470e7dadbca.1718890095.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <10af9145252a2f5c31ea0f13cbb67cbe76a8ba3a.1718890095.git.federico.serafini@bugseng.com> References: <10af9145252a2f5c31ea0f13cbb67cbe76a8ba3a.1718890095.git.federico.serafini@bugseng.com> 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 --- xen/arch/x86/hvm/pmtimer.c | 1 + 1 file changed, 1 insertion(+) 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 Thu Jun 20 13:51:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13705545 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 41E36C2D0CE for ; Thu, 20 Jun 2024 13:52:16 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.744514.1151623 (Exim 4.92) (envelope-from ) id 1sKICp-0001V6-MM; Thu, 20 Jun 2024 13:52:03 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 744514.1151623; Thu, 20 Jun 2024 13:52: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 1sKICp-0001TU-9t; Thu, 20 Jun 2024 13:52:03 +0000 Received: by outflank-mailman (input) for mailman id 744514; Thu, 20 Jun 2024 13:52:01 +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 1sKICn-0008AF-Hp for xen-devel@lists.xenproject.org; Thu, 20 Jun 2024 13:52:01 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 44a2e37d-2f0c-11ef-90a3-e314d9c70b13; Thu, 20 Jun 2024 15:52:01 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [78.208.165.219]) by support.bugseng.com (Postfix) with ESMTPSA id 7671F4EE0754; Thu, 20 Jun 2024 15:52:00 +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: 44a2e37d-2f0c-11ef-90a3-e314d9c70b13 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini Subject: [XEN PATCH 12/13] x86/vPIC: address a violation of MISRA C Rule 16.3 Date: Thu, 20 Jun 2024 15:51:46 +0200 Message-Id: <22c3d314f769b683241f8bdabf006225714aa07a.1718890095.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <10af9145252a2f5c31ea0f13cbb67cbe76a8ba3a.1718890095.git.federico.serafini@bugseng.com> References: <10af9145252a2f5c31ea0f13cbb67cbe76a8ba3a.1718890095.git.federico.serafini@bugseng.com> 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 --- 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 Thu Jun 20 13:51:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13705548 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 BB7F0C2BA1A for ; Thu, 20 Jun 2024 13:52:16 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.744516.1151637 (Exim 4.92) (envelope-from ) id 1sKICq-0001nO-RF; Thu, 20 Jun 2024 13:52:04 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 744516.1151637; Thu, 20 Jun 2024 13:52:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sKICq-0001kv-Dc; Thu, 20 Jun 2024 13:52:04 +0000 Received: by outflank-mailman (input) for mailman id 744516; Thu, 20 Jun 2024 13:52: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 1sKICo-0008AF-18 for xen-devel@lists.xenproject.org; Thu, 20 Jun 2024 13:52:02 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 44ec8317-2f0c-11ef-90a3-e314d9c70b13; Thu, 20 Jun 2024 15:52:01 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [78.208.165.219]) by support.bugseng.com (Postfix) with ESMTPSA id 098864EE0738; Thu, 20 Jun 2024 15:52:00 +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: 44ec8317-2f0c-11ef-90a3-e314d9c70b13 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini Subject: [XEN PATCH 13/13] x86/vlapic: address a violation of MISRA C Rule 16.3 Date: Thu, 20 Jun 2024 15:51:47 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: <10af9145252a2f5c31ea0f13cbb67cbe76a8ba3a.1718890095.git.federico.serafini@bugseng.com> References: <10af9145252a2f5c31ea0f13cbb67cbe76a8ba3a.1718890095.git.federico.serafini@bugseng.com> 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 --- 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; } }