From patchwork Tue Sep 10 10:08:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13798260 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 5B194EDE998 for ; Tue, 10 Sep 2024 10:09:27 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.795231.1204447 (Exim 4.92) (envelope-from ) id 1snxoB-0006iw-ER; Tue, 10 Sep 2024 10:09:15 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 795231.1204447; Tue, 10 Sep 2024 10:09: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 1snxoB-0006ip-BK; Tue, 10 Sep 2024 10:09:15 +0000 Received: by outflank-mailman (input) for mailman id 795231; Tue, 10 Sep 2024 10:09: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 1snxoA-0006hI-Ki for xen-devel@lists.xenproject.org; Tue, 10 Sep 2024 10:09:14 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id bacea9e5-6f5c-11ef-a0b5-8be0dac302b0; Tue, 10 Sep 2024 12:09:13 +0200 (CEST) Received: from truciolo.homenet.telecomitalia.it (host-79-37-206-90.retail.telecomitalia.it [79.37.206.90]) by support.bugseng.com (Postfix) with ESMTPSA id BF93C4EE07BC; Tue, 10 Sep 2024 12:09: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: bacea9e5-6f5c-11ef-a0b5-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bugseng.com; s=mail; t=1725962953; bh=jTJA4BcdbmYwNY5PeIySmsWvB5Kagg7ddYJ45zv3smo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lgD6+TKfiAhYYmU+jw3nIUT+OXCDr+hz+1ilmmS6u9hv7mfNcN2o6UlenfgAqr278 tww83Y39WUz5VY29Eie1Uhx4lkMpfQvEzx1afY668dFnoPusz+pduZt57fdVbjzCSQ TRoR+81AgL/cB8iI3qKhG86PukRr0sFkLZpuCSrDSU13rB14ayMZfcCHiFLYgv1vAA tRsKJMzZzO1cGzbuqdCHjZ6jMdKmclvqQTqZwD8KBjT+vj2k8M+zxSIee31rTLPKaL ma83PXrzlslM0Hu/m6lBcAOQbN6QU3CjGibzL3nCsQCvm89EgM/Bi/BMfXNXGfbsdI oytlbYPLFeqJg== 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 01/12] x86/psr: address violation of MISRA C Rule 16.3 Date: Tue, 10 Sep 2024 12:08:53 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Address a violation of MISRA C:2012 Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Acked-by: Jan Beulich --- xen/arch/x86/psr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c index 0b9631ac44..5815a35335 100644 --- a/xen/arch/x86/psr.c +++ b/xen/arch/x86/psr.c @@ -276,6 +276,7 @@ static enum psr_feat_type psr_type_to_feat_type(enum psr_type type) default: ASSERT_UNREACHABLE(); + break; } return feat_type; From patchwork Tue Sep 10 10:08: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: 13798259 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 9F16EEDE999 for ; Tue, 10 Sep 2024 10:09:27 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.795233.1204462 (Exim 4.92) (envelope-from ) id 1snxoC-00070U-Sm; Tue, 10 Sep 2024 10:09:16 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 795233.1204462; Tue, 10 Sep 2024 10:09: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 1snxoC-0006ze-ON; Tue, 10 Sep 2024 10:09:16 +0000 Received: by outflank-mailman (input) for mailman id 795233; Tue, 10 Sep 2024 10:09:15 +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 1snxoB-0006in-HC for xen-devel@lists.xenproject.org; Tue, 10 Sep 2024 10:09:15 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id baf27d84-6f5c-11ef-99a1-01e77a169b0f; Tue, 10 Sep 2024 12:09:13 +0200 (CEST) Received: from truciolo.homenet.telecomitalia.it (host-79-37-206-90.retail.telecomitalia.it [79.37.206.90]) by support.bugseng.com (Postfix) with ESMTPSA id 35B174EE07BE; Tue, 10 Sep 2024 12:09: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: baf27d84-6f5c-11ef-99a1-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bugseng.com; s=mail; t=1725962953; bh=5YQfn+v1XgD0I/Amiqo2ive8DffF9F/8haS4J9ZTkAs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BTOsRaZzKlNsTReQquG8z3lo4Wj+BWd7TWUGzbi60pIBVRjDffaT6XVqhBKq4c+OH fH08OB5OmOcoIv7Wwhc0tZN8pmm4PV5I7sxz66SqKudTKnMgNhb4fequY18u9XAy3x iDeZtYWX0D96zzm/4RJlVttLRewJDg8WozyzoSboni6ogUDoB2Xdl/j3O1pGzvXdHk E7lOTmzerPuQc3wVVmTUPNjhV+jfi0/VjaQQGk9r7QiGVXnSkJKqPFWYdcSC6sP2mj XJoIJ30+n8TRqwwoysPjJKv00LnUurlrMkVGde0Gwg4aceoF09Gdd9siVlDhqbTEg2 FclhX2rYmdTQQ== 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 02/12] x86/time: address violations of MISRA C Rule 16.3 Date: Tue, 10 Sep 2024 12:08:54 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Address violations of MISRA C:2012 Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Acked-by: Jan Beulich --- xen/arch/x86/time.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c index f37300946e..d79b0a6ab9 100644 --- a/xen/arch/x86/time.c +++ b/xen/arch/x86/time.c @@ -1477,6 +1477,7 @@ unsigned int rtc_guest_read(unsigned int port) default: ASSERT_UNREACHABLE(); + break; } return data; @@ -1529,6 +1530,7 @@ void rtc_guest_write(unsigned int port, unsigned int data) default: ASSERT_UNREACHABLE(); + break; } } From patchwork Tue Sep 10 10:08: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: 13798262 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 DBEF1EDE99A for ; Tue, 10 Sep 2024 10:09:27 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.795234.1204477 (Exim 4.92) (envelope-from ) id 1snxoE-0007Qh-1t; Tue, 10 Sep 2024 10:09:18 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 795234.1204477; Tue, 10 Sep 2024 10:09: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 1snxoD-0007QU-Ut; Tue, 10 Sep 2024 10:09:17 +0000 Received: by outflank-mailman (input) for mailman id 795234; Tue, 10 Sep 2024 10:09:16 +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 1snxoC-0006hI-2u for xen-devel@lists.xenproject.org; Tue, 10 Sep 2024 10:09:16 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id bb55668f-6f5c-11ef-a0b5-8be0dac302b0; Tue, 10 Sep 2024 12:09:14 +0200 (CEST) Received: from truciolo.homenet.telecomitalia.it (host-79-37-206-90.retail.telecomitalia.it [79.37.206.90]) by support.bugseng.com (Postfix) with ESMTPSA id 948624EE07BF; Tue, 10 Sep 2024 12:09: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: bb55668f-6f5c-11ef-a0b5-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bugseng.com; s=mail; t=1725962954; bh=MaOKWAN8/iHkSkxPEna4IofkZpedWnhaY89MZEeE3co=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jgHfikcoR4ZMGX2PA869SFMOKlxagBEL9HZX8QiMnq70BklAx7qbyPZu4gCeR9JBM on2OTlk6KV+/X5xZG1/uyQ9/mNj2TRFch7dXxq06t7SLOe/OT1DhD2KrptKeEmP5hT 3dRXnmKmHjyLCLsO2+HzxAMA0yPnbVD+V/QZG5luHJFUQc+bWrddz7QCCBmt9PsDQY NXwMkpGmIV1h3ZoqLOfUi4cfDvffxt5+AOX/8Az+8tRK49GWkx5iX1CnxeAZJm3NXu cM6qL5B5wt/ktcpBkMwZRkTRcbSFY4fvIErPWvCmCObl5mx8lF/5zga10qN1yRwtmV +JAn1Y7kO75HA== From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Tamas K Lengyel , Alexandru Isaila , Petre Pircalabu , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Subject: [XEN PATCH 03/12] x86/vm_event: address violation of MISRA C Rule 16.3 Date: Tue, 10 Sep 2024 12:08:55 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Address a violation of MISRA C:2012 Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Acked-by: Tamas K Lengyel --- xen/arch/x86/vm_event.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x86/vm_event.c b/xen/arch/x86/vm_event.c index e6c7ad5337..0d15d363c3 100644 --- a/xen/arch/x86/vm_event.c +++ b/xen/arch/x86/vm_event.c @@ -190,6 +190,7 @@ static void vm_event_pack_segment_register(enum x86_segment segment, default: ASSERT_UNREACHABLE(); + break; } } #endif From patchwork Tue Sep 10 10:08: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: 13798265 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 E6D4DEDE99D for ; Tue, 10 Sep 2024 10:09:27 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.795235.1204482 (Exim 4.92) (envelope-from ) id 1snxoE-0007UG-DJ; Tue, 10 Sep 2024 10:09:18 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 795235.1204482; Tue, 10 Sep 2024 10:09: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 1snxoE-0007Ts-7b; Tue, 10 Sep 2024 10:09:18 +0000 Received: by outflank-mailman (input) for mailman id 795235; Tue, 10 Sep 2024 10:09: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 1snxoC-0006in-7B for xen-devel@lists.xenproject.org; Tue, 10 Sep 2024 10:09:16 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id bb837fce-6f5c-11ef-99a1-01e77a169b0f; Tue, 10 Sep 2024 12:09:14 +0200 (CEST) Received: from truciolo.homenet.telecomitalia.it (host-79-37-206-90.retail.telecomitalia.it [79.37.206.90]) by support.bugseng.com (Postfix) with ESMTPSA id 2598F4EE07BD; Tue, 10 Sep 2024 12:09: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: bb837fce-6f5c-11ef-99a1-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bugseng.com; s=mail; t=1725962954; bh=0ikbd1ETLLKX3eXMS2E9IBv3xVhKz2tDs8iBpqTgxFs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yM4X6JwReqK7YaxCAt5D+XnGr3bcg7n7orUUsG5xusg078Z49zZ2DfWHqHPjnVI1i 7H1QBO1ZtKjnNlFmTOw5vMXuex8lR02y0+ppAHh8pxl3v/BRwRscSrnhihJ6ir/S1B RWrr/8ioRhxLSJ/vhv6zT6185hV09wtC9iXx5+Tgi6j8eLbsKNHCRv5QmKjl4pNJO9 SWc8ODAqvZ9hokJdHiIM9U57doInWPzy4Sbl7+c7Gm430/VjIGXh/cRyA92i1Yz9OB LYb/+fk6Qqhaz4btPAmHri4DChLNSJB31BF0P7Cx9KDkRDACM4dBN+Kkra6dH0vDs+ FUlMY/U1/Loeg== 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 04/12] x86/hypercall: address violations of MISRA C Rule 16.3 Date: Tue, 10 Sep 2024 12:08:56 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Address violations of MISRA C:2012 Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Acked-by: Jan Beulich --- xen/arch/x86/include/asm/hypercall.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/include/asm/hypercall.h b/xen/arch/x86/include/asm/hypercall.h index 389fa62af2..f6e9e2313b 100644 --- a/xen/arch/x86/include/asm/hypercall.h +++ b/xen/arch/x86/include/asm/hypercall.h @@ -55,7 +55,7 @@ static inline void clobber_regs64(struct cpu_user_regs *regs, case 4: regs->r10 = 0xdeadbeefdeadf00dUL; fallthrough; case 3: regs->rdx = 0xdeadbeefdeadf00dUL; fallthrough; case 2: regs->rsi = 0xdeadbeefdeadf00dUL; fallthrough; - case 1: regs->rdi = 0xdeadbeefdeadf00dUL; + case 1: regs->rdi = 0xdeadbeefdeadf00dUL; break; } #endif } @@ -71,7 +71,7 @@ static inline void clobber_regs32(struct cpu_user_regs *regs, case 4: regs->esi = 0xdeadf00dU; fallthrough; case 3: regs->edx = 0xdeadf00dU; fallthrough; case 2: regs->ecx = 0xdeadf00dU; fallthrough; - case 1: regs->ebx = 0xdeadf00dU; + case 1: regs->ebx = 0xdeadf00dU; break; } #endif } From patchwork Tue Sep 10 10:08: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: 13798257 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 09BEDECE564 for ; Tue, 10 Sep 2024 10:09:27 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.795236.1204488 (Exim 4.92) (envelope-from ) id 1snxoE-0007Zm-Tk; Tue, 10 Sep 2024 10:09:18 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 795236.1204488; Tue, 10 Sep 2024 10:09: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 1snxoE-0007XC-Jc; Tue, 10 Sep 2024 10:09:18 +0000 Received: by outflank-mailman (input) for mailman id 795236; Tue, 10 Sep 2024 10:09: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 1snxoD-0006hI-3E for xen-devel@lists.xenproject.org; Tue, 10 Sep 2024 10:09:17 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id bbe4c126-6f5c-11ef-a0b5-8be0dac302b0; Tue, 10 Sep 2024 12:09:15 +0200 (CEST) Received: from truciolo.homenet.telecomitalia.it (host-79-37-206-90.retail.telecomitalia.it [79.37.206.90]) by support.bugseng.com (Postfix) with ESMTPSA id 854064EE07C0; Tue, 10 Sep 2024 12:09: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: bbe4c126-6f5c-11ef-a0b5-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bugseng.com; s=mail; t=1725962955; bh=+464nsW1HRBa4piEv0WIwfEOU6bTSrq7mNRHB28EwBM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cosY1Ij8KuLU8paMtYMWZYLxSPXziHsHz9q6yQ8ePtUUE+eTILbpb/ppQy2A8ZvG3 QQdtcvXKJEO/InQV2C7D0b+c4ZG129nEYhgAPiYTdGy1A9bi86HjowZNMmgbyqASpH xxbc53iuBKpaTBTui0iKcfpDkzanynW0USVPK2WX7bkmQMJ9n+q7ZRiNcRYgxjRkPu 9SGCnobSHjkGPM7huA5cEm2FZsWecVOCOytqnc0POMSTBv7U/4yx/xDuIBUnrK8RmT SSh7zlWlrV9m8wB9KpCjRT8grRCsRZZZFxoQOIdqOZatY3KYDMDUhgqDDiakZ+5BFJ j74WjOwx2xMQw== From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Tamas K Lengyel , Alexandru Isaila , Petre Pircalabu , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Subject: [XEN PATCH 05/12] x86/monitor: address violation of MISRA C Rule 16.3 Date: Tue, 10 Sep 2024 12:08:57 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Address a violation of MISRA C:2012 Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Acked-by: Tamas K Lengyel --- xen/arch/x86/include/asm/monitor.h | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x86/include/asm/monitor.h b/xen/arch/x86/include/asm/monitor.h index 96e6a9d0d8..3c64d8258f 100644 --- a/xen/arch/x86/include/asm/monitor.h +++ b/xen/arch/x86/include/asm/monitor.h @@ -65,6 +65,7 @@ int arch_monitor_domctl_op(struct domain *d, struct xen_domctl_monitor_op *mop) default: rc = -EOPNOTSUPP; + break; } return rc; From patchwork Tue Sep 10 10:08: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: 13798261 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 2F2EBECE58D for ; Tue, 10 Sep 2024 10:09:27 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.795237.1204493 (Exim 4.92) (envelope-from ) id 1snxoF-0007lp-Co; Tue, 10 Sep 2024 10:09:19 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 795237.1204493; Tue, 10 Sep 2024 10:09: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 1snxoF-0007ge-3B; Tue, 10 Sep 2024 10:09:19 +0000 Received: by outflank-mailman (input) for mailman id 795237; Tue, 10 Sep 2024 10:09: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 1snxoD-0006in-8N for xen-devel@lists.xenproject.org; Tue, 10 Sep 2024 10:09:17 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id bc116e4f-6f5c-11ef-99a1-01e77a169b0f; Tue, 10 Sep 2024 12:09:15 +0200 (CEST) Received: from truciolo.homenet.telecomitalia.it (host-79-37-206-90.retail.telecomitalia.it [79.37.206.90]) by support.bugseng.com (Postfix) with ESMTPSA id 170314EE07BB; Tue, 10 Sep 2024 12:09: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: bc116e4f-6f5c-11ef-99a1-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bugseng.com; s=mail; t=1725962955; bh=4YJCnP58zIp/0pTRunzm9AkmIlx7TkkO1ZpWoUscNoo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s9ClveXE7mU4vBe7fJEjEl3cdzNCrlpaLLdciLxacR/z8dsGnaeceG++Rm8Ba4BK0 kUzCA76P4YcW2slLQjpxJR9JHbaAeQ3FFUqN0w7VRtDJSuJyN+meUMb/a0XOpHfTVZ iNxp8HhKabnYW/9gd5cyODkIjrXaZ1nVl9gIQmX9rN8SQQCDjmr+SkTUL++x201R25 k3CSRHyVjoO/fI2E+RubxWqIx7eF/lPZV74v1QcpqopyB93xAP0Z/RGrVEJfBPbYeK AwdjfLJo/pQgQxrJ86R8bx1dbjIwWzmEZS9D6+f2qGsioQCO6PSHGSl4ZviiTuajcw ZcFI2NKBvrVPw== 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 06/12] x86/mm: address violations of MISRA C Rule 16.3 Date: Tue, 10 Sep 2024 12:08:58 +0200 Message-Id: <0773f4b5678ee340af201b454e37178e750cbd8d.1725958416.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Address violations of MISRA C:2012 Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Acked-by: Jan Beulich --- xen/arch/x86/mm/guest_walk.c | 1 + xen/arch/x86/mm/hap/hap.c | 2 +- xen/arch/x86/mm/hap/nested_hap.c | 1 + xen/arch/x86/mm/paging.c | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/mm/guest_walk.c b/xen/arch/x86/mm/guest_walk.c index fe7393334f..bc032d697c 100644 --- a/xen/arch/x86/mm/guest_walk.c +++ b/xen/arch/x86/mm/guest_walk.c @@ -497,6 +497,7 @@ guest_walk_tables(const struct vcpu *v, struct p2m_domain *p2m, paging_mark_dirty(d, gw->l4mfn); hvmemul_write_cache(v, l4gpa, &gw->l4e, sizeof(gw->l4e)); } + break; #endif } diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c index d2011fde24..ec5043a8aa 100644 --- a/xen/arch/x86/mm/hap/hap.c +++ b/xen/arch/x86/mm/hap/hap.c @@ -652,7 +652,7 @@ int hap_domctl(struct domain *d, struct xen_domctl_shadow_op *sc, return rc; case XEN_DOMCTL_SHADOW_OP_GET_ALLOCATION: sc->mb = hap_get_allocation(d); - /* Fall through... */ + fallthrough; case XEN_DOMCTL_SHADOW_OP_OFF: return 0; default: diff --git a/xen/arch/x86/mm/hap/nested_hap.c b/xen/arch/x86/mm/hap/nested_hap.c index 080b60adf0..cc7bc6e5ea 100644 --- a/xen/arch/x86/mm/hap/nested_hap.c +++ b/xen/arch/x86/mm/hap/nested_hap.c @@ -217,6 +217,7 @@ int nestedhvm_hap_nested_page_fault( p2ma_10 = p2m_access_n; /* For safety, remove all permissions. */ gdprintk(XENLOG_ERR, "Unhandled p2m access type:%d\n", p2ma_10); + break; } /* Use minimal permission for nested p2m. */ p2ma_10 &= (p2m_access_t)p2ma_21; diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c index dd47bde5ce..c77f4c1dac 100644 --- a/xen/arch/x86/mm/paging.c +++ b/xen/arch/x86/mm/paging.c @@ -726,7 +726,7 @@ int paging_domctl(struct domain *d, struct xen_domctl_shadow_op *sc, case XEN_DOMCTL_SHADOW_OP_ENABLE: if ( !(sc->mode & XEN_DOMCTL_SHADOW_ENABLE_LOG_DIRTY) ) break; - /* Else fall through... */ + fallthrough; case XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY: return paging_log_dirty_enable(d); From patchwork Tue Sep 10 10:08: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: 13798264 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 19DA5EDE99E for ; Tue, 10 Sep 2024 10:09:29 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.795238.1204504 (Exim 4.92) (envelope-from ) id 1snxoG-00081j-AW; Tue, 10 Sep 2024 10:09:20 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 795238.1204504; Tue, 10 Sep 2024 10:09: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 1snxoG-000801-0l; Tue, 10 Sep 2024 10:09:20 +0000 Received: by outflank-mailman (input) for mailman id 795238; Tue, 10 Sep 2024 10:09:18 +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 1snxoE-0006in-7M for xen-devel@lists.xenproject.org; Tue, 10 Sep 2024 10:09:18 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id bc53b0c0-6f5c-11ef-99a1-01e77a169b0f; Tue, 10 Sep 2024 12:09:16 +0200 (CEST) Received: from truciolo.homenet.telecomitalia.it (host-79-37-206-90.retail.telecomitalia.it [79.37.206.90]) by support.bugseng.com (Postfix) with ESMTPSA id 76D014EE07C1; Tue, 10 Sep 2024 12:09: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: bc53b0c0-6f5c-11ef-99a1-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bugseng.com; s=mail; t=1725962955; bh=TsJsXtd4r9xjmbF6+cJgP+YCx8JcIm1qmbkTjh4sQ5s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uwM8yz1fk+JApAYno/Xlf3i19qPtgqfR5C1AeMgzmGkHbCpYY+Te+6X9HV9zAkshS wdyusJe1fBLS8POq+8S8Vc3+yalVk6hWXQOb9/mImaArrQv1wu6CC+SMIms+1bcdBq t8YuMaWW7H+9z2bATKokDe+jEvCcGpXc0ZwMktWgP8jsSeGTE6QCALwFsLUlTkdAcA OL6lfz4DbVD5+VG6HAf1mg59viPwmmvpvwQ16ccntflw82wGxVyD3+DbncJnrmGJDM lKdxlCr4ZBM/DrzJkMnHegXAEBjYnZNVT2g+bLz54RvYfR8c/0Orp/vfFcNeTzdD54 s8cBxcmmUI5RA== 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 07/12] x86/mmcfg: address violation of MISRA C Rule 16.3 Date: Tue, 10 Sep 2024 12:08:59 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Address a violation of MISRA C:2012 Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Acked-by: Jan Beulich --- xen/arch/x86/x86_64/mmconfig-shared.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x86/x86_64/mmconfig-shared.c b/xen/arch/x86/x86_64/mmconfig-shared.c index b3b2da7362..77ba1e28f1 100644 --- a/xen/arch/x86/x86_64/mmconfig-shared.c +++ b/xen/arch/x86/x86_64/mmconfig-shared.c @@ -112,6 +112,7 @@ static const char *__init cf_check pci_mmcfg_intel_945(void) break; default: pci_mmcfg_config_num = 0; + break; } /* Errata #2, things break when not aligned on a 256Mb boundary */ From patchwork Tue Sep 10 10:09: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: 13798266 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 6F5C4ECE582 for ; Tue, 10 Sep 2024 10:09:30 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.795240.1204520 (Exim 4.92) (envelope-from ) id 1snxoH-0008FZ-Is; Tue, 10 Sep 2024 10:09:21 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 795240.1204520; Tue, 10 Sep 2024 10:09: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 1snxoH-0008Cb-0k; Tue, 10 Sep 2024 10:09:21 +0000 Received: by outflank-mailman (input) for mailman id 795240; Tue, 10 Sep 2024 10:09: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 1snxoF-0006in-7M for xen-devel@lists.xenproject.org; Tue, 10 Sep 2024 10:09:19 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id bc8f407b-6f5c-11ef-99a1-01e77a169b0f; Tue, 10 Sep 2024 12:09:16 +0200 (CEST) Received: from truciolo.homenet.telecomitalia.it (host-79-37-206-90.retail.telecomitalia.it [79.37.206.90]) by support.bugseng.com (Postfix) with ESMTPSA id E10C04EE0CC2; Tue, 10 Sep 2024 12:09: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: bc8f407b-6f5c-11ef-99a1-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bugseng.com; s=mail; t=1725962956; bh=7STVOBIhCgKWpEDLBjJ3I3pd4DCbTs6VnI7lN8dRmpo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NF75lBMMwFAKjJlCteFveEQkKfAAauNEwayIQPtDG4Zpta6Q5xTzOMoSNJ8SBTHWn KLDgdfAWHo+ohBzitH+cGqA1/xgmE0iwBs14q1VlFMhk+E11NWzVM9pRRQM7DhA/3Z xiVcCkpuF6C+TvkxWF/9c92T0jjjvDSxTI39zGTdvp1D9wgwaGEhwk+r1A54kfYYIl UAfFEZQCCrp1eX/2b979PNqS6Dnh38XYdYmlPHOta0lR+v65oYlvfeQwowX5CNfX/K WN68ZXCo5IaKbjbFGmQ6AcRh50JGIpAHZr3CvCQte4yQENrjb+lHknFVAYx2akS77y V9T39h1uLgt1w== 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 08/12] x86/emul: add defensive code Date: Tue, 10 Sep 2024 12:09:00 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Add defensive code after unreachable program points. This also meets the requirements to deviate a violation of MISRA C:2012 Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". Signed-off-by: Federico Serafini --- xen/arch/x86/x86_emulate/x86_emulate.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c index e12fbe3100..2b03d65fce 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -6831,6 +6831,8 @@ x86_emulate( break; default: ASSERT_UNREACHABLE(); + rc = X86EMUL_UNHANDLEABLE; + goto done; } break; #ifdef HAVE_AS_SSE4_2 @@ -6859,6 +6861,8 @@ x86_emulate( # endif default: ASSERT_UNREACHABLE(); + rc = X86EMUL_UNHANDLEABLE; + goto done; } break; #endif From patchwork Tue Sep 10 10:09: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: 13798267 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 AEDDAECE564 for ; Tue, 10 Sep 2024 10:09:30 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.795241.1204529 (Exim 4.92) (envelope-from ) id 1snxoI-0008VL-AZ; Tue, 10 Sep 2024 10:09:22 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 795241.1204529; Tue, 10 Sep 2024 10:09: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 1snxoH-0008SZ-NF; Tue, 10 Sep 2024 10:09:21 +0000 Received: by outflank-mailman (input) for mailman id 795241; Tue, 10 Sep 2024 10:09:20 +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 1snxoG-0006in-7K for xen-devel@lists.xenproject.org; Tue, 10 Sep 2024 10:09:20 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id bccaf5ba-6f5c-11ef-99a1-01e77a169b0f; Tue, 10 Sep 2024 12:09:16 +0200 (CEST) Received: from truciolo.homenet.telecomitalia.it (host-79-37-206-90.retail.telecomitalia.it [79.37.206.90]) by support.bugseng.com (Postfix) with ESMTPSA id 4BEED4EE07BE; Tue, 10 Sep 2024 12:09: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: bccaf5ba-6f5c-11ef-99a1-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bugseng.com; s=mail; t=1725962956; bh=uy8RzmNPWe8sN7uF0NONIzcrXeo4qTykXjJvLpaUdFY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j9uWRD21docJyr5AGSepOo5zOUTZXlr3xMf3M7p44ORvblAyhRkDy/i40/WvA6RJs DMPUGn2NUqw7aIFJIEQ1wuzYpNdX+xQZMn/TR5XEPeiTvDbEq+ZLxRLYqqV1YuItwJ ShLhJxrCVN9TUNNd3/H/pFF89yQ7kK8dm3n9OUD2YIiNPM7YAsdv0k3nkt+K+c65oZ WpKPHKSi7pqUXzO9mLnZzlz8jCj9MKK3OyxtoSaWuYziEZhRQLp7VSPqW1SMJy1E+k FAcV70IXvs3Sxo8uve2NyblWLFCtKy7lOMqrh5ycQVV9LZF0Y45VwvCFPX8irrgSzX ZvMmh2yFbLm8w== 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 09/12] x86/emul: address violations of MISRA C Rule 16.3 Date: Tue, 10 Sep 2024 12:09:01 +0200 Message-Id: <0fa68b9aee5a7a3f1b696bfc6b18ecc826663212.1725958417.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Address violations of MISRA C:2012 Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/x86_emulate/fpu.c | 4 ++++ xen/arch/x86/x86_emulate/x86_emulate.c | 1 + 2 files changed, 5 insertions(+) diff --git a/xen/arch/x86/x86_emulate/fpu.c b/xen/arch/x86/x86_emulate/fpu.c index 480d879657..3351f549e7 100644 --- a/xen/arch/x86/x86_emulate/fpu.c +++ b/xen/arch/x86/x86_emulate/fpu.c @@ -218,6 +218,7 @@ int x86emul_fpu(struct x86_emulate_state *s, */ if ( dst->type == OP_MEM && !s->fpu_ctrl && !fpu_check_write() ) dst->type = OP_NONE; + break; } break; @@ -296,6 +297,7 @@ int x86emul_fpu(struct x86_emulate_state *s, default: generate_exception(X86_EXC_UD); } + break; } break; @@ -386,6 +388,7 @@ int x86emul_fpu(struct x86_emulate_state *s, */ if ( dst->type == OP_MEM && !s->fpu_ctrl && !fpu_check_write() ) dst->type = OP_NONE; + break; } break; @@ -457,6 +460,7 @@ int x86emul_fpu(struct x86_emulate_state *s, case 7: /* fistp m64i */ goto fpu_memdst64; } + break; } break; diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c index 2b03d65fce..9fb316e0d7 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -8297,6 +8297,7 @@ x86_emulate( } if ( rc != 0 ) goto done; + break; default: break; } From patchwork Tue Sep 10 10:09: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: 13798268 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 95D90EDE99B for ; Tue, 10 Sep 2024 10:09:31 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.795242.1204541 (Exim 4.92) (envelope-from ) id 1snxoJ-0000d7-R5; Tue, 10 Sep 2024 10:09:23 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 795242.1204541; Tue, 10 Sep 2024 10:09: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 1snxoJ-0000a2-Im; Tue, 10 Sep 2024 10:09:23 +0000 Received: by outflank-mailman (input) for mailman id 795242; Tue, 10 Sep 2024 10:09:21 +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 1snxoH-0006in-7W for xen-devel@lists.xenproject.org; Tue, 10 Sep 2024 10:09:21 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id bd0603c7-6f5c-11ef-99a1-01e77a169b0f; Tue, 10 Sep 2024 12:09:17 +0200 (CEST) Received: from truciolo.homenet.telecomitalia.it (host-79-37-206-90.retail.telecomitalia.it [79.37.206.90]) by support.bugseng.com (Postfix) with ESMTPSA id AB63D4EE07BF; Tue, 10 Sep 2024 12:09: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: bd0603c7-6f5c-11ef-99a1-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bugseng.com; s=mail; t=1725962957; bh=0WA5TNOak9DHiUvT2R0QjGNY4akxGWSuMkA+27BsZOo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xj7QyxZIHcQgACVj658oqOuFJHdjfzr6Ug0bc0xSufGg9hOhCdN8pPUY1/qVQpWb/ HNVEAmk+6RKnPODopuMtLrcl6KqtaTOwDOQfJwW/Bqp2z5CVSMQX9gGoyGy8Swtdz9 AFd96ovXptUAmcexCgOL8pi5/F/Muek4Cm29jXAUrKp29osOw9ZvVGkdHLVVd959WU QZX8bWSD7YN6IcUYosL7zN7O72lD9tYKd8Af8xKreBEQ7tegJKWlVj3m7baZZbxGam CDEvO5CfNhDdNP1l2r7uPqcfWZlIzucelBKQv0NoGYT3h0f7ojCW/pAJtlaAAyEql/ HK18F0LyHE35A== From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , "Daniel P. Smith" , =?utf-8?q?Marek_Marczykow?= =?utf-8?q?ski-G=C3=B3recki?= , Jan Beulich Subject: [XEN PATCH 10/12] efi: address violation of MISRA C Rule 16.3 Date: Tue, 10 Sep 2024 12:09:02 +0200 Message-Id: <302110f2f41f6b7f74fcb90f8902137b0a619082.1725958417.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Use agreed syntax for pseudo-keyword fallthrough to meet the requirements to deviate a violation of MISRA C:2012 Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini --- xen/common/efi/runtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c index d03e5c90ce..376fcbd8e1 100644 --- a/xen/common/efi/runtime.c +++ b/xen/common/efi/runtime.c @@ -691,7 +691,7 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op) if ( !efi_enabled(EFI_RS) || (efi_rs->Hdr.Revision >> 16) < 2 ) return -EOPNOTSUPP; - /* XXX fall through for now */ + fallthrough; /* XXX fall through for now */ default: return -ENOSYS; } From patchwork Tue Sep 10 10:09: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: 13798269 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 B8556ECE582 for ; Tue, 10 Sep 2024 10:09:34 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.795243.1204552 (Exim 4.92) (envelope-from ) id 1snxoK-0000nH-Ud; Tue, 10 Sep 2024 10:09:24 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 795243.1204552; Tue, 10 Sep 2024 10:09: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 1snxoK-0000io-5x; Tue, 10 Sep 2024 10:09:24 +0000 Received: by outflank-mailman (input) for mailman id 795243; Tue, 10 Sep 2024 10:09: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 1snxoI-0006in-7Y for xen-devel@lists.xenproject.org; Tue, 10 Sep 2024 10:09:22 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id bd35b6c8-6f5c-11ef-99a1-01e77a169b0f; Tue, 10 Sep 2024 12:09:17 +0200 (CEST) Received: from truciolo.homenet.telecomitalia.it (host-79-37-206-90.retail.telecomitalia.it [79.37.206.90]) by support.bugseng.com (Postfix) with ESMTPSA id 15E9C4EE07A5; Tue, 10 Sep 2024 12:09: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: bd35b6c8-6f5c-11ef-99a1-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bugseng.com; s=mail; t=1725962957; bh=w6dJg0N0Gwxpq3+C0w0/DqhPaRkVVEdL4S1X1KOxgVw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ME5hvuBvJq2k9ROgoGEt6BEY0aKD6A3zaSHZXK4gz+k+Gm8YD7dNOp6D+z+x2NK/V xpygvp88SnGTFHWs+BR5DCUStrqhbXHlr+n1Kz3YClEKH2uNtti+FIA/Kr8s5TO0/Y KYPybob31mGlgIILtUKLMopiQNtsCTzvD/WnHOguWWbaaSWsyBBGO7kaVSIz79mdkO wUiJ1acLbhJuSnR1f5zScmmXWPzexfivVtdTZ1ItCWS3Fse2otqEG0qpt+1M9xJRse 6p6RB0jmBxSdX4LYiuGx66Qx7JSFzZ4/OMeC5wUBFNVzWiOhEpCnr0pJYske+dWq+D NibmBa9wn3nBA== From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Subject: [XEN PATCH 11/12] xen/vpci: add defensive code Date: Tue, 10 Sep 2024 12:09:03 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Add defensive code in unreachable program points. This also meets the requirements to deviate a violation of MISRA C:2012 Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". Signed-off-by: Federico Serafini --- xen/drivers/vpci/msix.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c index fbe710ab92..037f9a0449 100644 --- a/xen/drivers/vpci/msix.c +++ b/xen/drivers/vpci/msix.c @@ -364,6 +364,8 @@ static int adjacent_read(const struct domain *d, const struct vpci_msix *msix, default: ASSERT_UNREACHABLE(); + spin_unlock(&vpci->lock); + return X86EMUL_UNHANDLEABLE; } spin_unlock(&vpci->lock); @@ -512,6 +514,8 @@ static int adjacent_write(const struct domain *d, const struct vpci_msix *msix, default: ASSERT_UNREACHABLE(); + spin_unlock(&vpci->lock); + return X86EMUL_UNHANDLEABLE; } spin_unlock(&vpci->lock); From patchwork Tue Sep 10 10:09: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: 13798263 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 E3FB3EDE99C for ; Tue, 10 Sep 2024 10:09:27 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.795239.1204511 (Exim 4.92) (envelope-from ) id 1snxoG-00088I-SP; Tue, 10 Sep 2024 10:09:20 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 795239.1204511; Tue, 10 Sep 2024 10:09: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 1snxoG-000874-GU; Tue, 10 Sep 2024 10:09:20 +0000 Received: by outflank-mailman (input) for mailman id 795239; Tue, 10 Sep 2024 10:09: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 1snxoE-0006hI-AU for xen-devel@lists.xenproject.org; Tue, 10 Sep 2024 10:09:18 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id bd7ee6d3-6f5c-11ef-a0b5-8be0dac302b0; Tue, 10 Sep 2024 12:09:18 +0200 (CEST) Received: from truciolo.homenet.telecomitalia.it (host-79-37-206-90.retail.telecomitalia.it [79.37.206.90]) by support.bugseng.com (Postfix) with ESMTPSA id 623FC4EE07BC; Tue, 10 Sep 2024 12:09: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: bd7ee6d3-6f5c-11ef-a0b5-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bugseng.com; s=mail; t=1725962957; bh=Wzd19j+5sdHV5ycixT7bH8d010X065zNVcpGpfr7Qh8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yQcXn6UqvvTYA/+d8iwzKMdvnAAyAabOwroyHaI81cEKFydQtk4qejFgWX7Qzx2z2 zrsEdFJq6RJjcZ1/GAZSEQ9nmjOv59fxaLZ6ez8ng7bHGOB7aHuMCp7UkwSgTraDDc UtKdY06Ad5+s/Hy3is5k7rwiPULRpZFvhqlOer9G7Q0WRvKE7Q4HRHpnBRTQPyul25 8Zu6OtKMzg/pCIcKotbKE7lTxun4YNcKYIHDaQr8ToPKGUKxEcLo6ZEp6J1RbLg3DB CQok6PkqcAWYaRm1g8yJ8J0/2gOtbOuQlKtnT2z6lKcfT7QByqZmShNd1ovmb0IS4j dWP5QZrdKmI3g== From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Subject: [XEN PATCH 12/12] xen/pci: address a violation of MISRA C Rule 16.3 Date: Tue, 10 Sep 2024 12:09:04 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Address violations of MISRA C:2012 Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini --- xen/drivers/passthrough/pci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c index 5a446d3dce..a5705def3f 100644 --- a/xen/drivers/passthrough/pci.c +++ b/xen/drivers/passthrough/pci.c @@ -170,8 +170,10 @@ static int __init cf_check parse_phantom_dev(const char *str) { case 1: case 2: case 4: if ( *s ) - default: return -EINVAL; + break; + default: + return -EINVAL; } phantom_devs[nr_phantom_devs++] = phantom;