From nobody Sun May 19 01:43:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1703070223747641.0936831156009; Wed, 20 Dec 2023 03:03:43 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.657633.1026628 (Exim 4.92) (envelope-from ) id 1rFuME-0005CK-2j; Wed, 20 Dec 2023 11:03:22 +0000 Received: by outflank-mailman (output) from mailman id 657633.1026628; Wed, 20 Dec 2023 11:03: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 1rFuMD-0005Ba-T5; Wed, 20 Dec 2023 11:03:21 +0000 Received: by outflank-mailman (input) for mailman id 657633; Wed, 20 Dec 2023 11:03: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 1rFuMC-00054g-JY for xen-devel@lists.xenproject.org; Wed, 20 Dec 2023 11:03:20 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 61969488-9f27-11ee-9b0f-b553b5be7939; Wed, 20 Dec 2023 12:03:18 +0100 (CET) Received: from Dell.bugseng.com (unknown [37.161.218.228]) by support.bugseng.com (Postfix) with ESMTPSA id 6169E4EE0C99; Wed, 20 Dec 2023 12:03:17 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 61969488-9f27-11ee-9b0f-b553b5be7939 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk Subject: [XEN PATCH 1/7] xen/arm: gic-v3: address violations of MISRA C:2012 Rule 16.3 Date: Wed, 20 Dec 2023 12:03:01 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1703070224463100005 Content-Type: text/plain; charset="utf-8" Add the pseudo-keyword fallthrough to meet the requirements to deviate Rule 16.3 ("An unconditional `break' statement shall terminate every switch-clause"). No functional change. Signed-off-by: Federico Serafini Acked-by: Julien Grall --- xen/arch/arm/gic-v3.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c index 18289cd645..bf0e5c1b75 100644 --- a/xen/arch/arm/gic-v3.c +++ b/xen/arch/arm/gic-v3.c @@ -65,34 +65,49 @@ static inline void gicv3_save_lrs(struct vcpu *v) { case 16: v->arch.gic.v3.lr[15] =3D READ_SYSREG_LR(15); + fallthrough; case 15: v->arch.gic.v3.lr[14] =3D READ_SYSREG_LR(14); + fallthrough; case 14: v->arch.gic.v3.lr[13] =3D READ_SYSREG_LR(13); + fallthrough; case 13: v->arch.gic.v3.lr[12] =3D READ_SYSREG_LR(12); + fallthrough; case 12: v->arch.gic.v3.lr[11] =3D READ_SYSREG_LR(11); + fallthrough; case 11: v->arch.gic.v3.lr[10] =3D READ_SYSREG_LR(10); + fallthrough; case 10: v->arch.gic.v3.lr[9] =3D READ_SYSREG_LR(9); + fallthrough; case 9: v->arch.gic.v3.lr[8] =3D READ_SYSREG_LR(8); + fallthrough; case 8: v->arch.gic.v3.lr[7] =3D READ_SYSREG_LR(7); + fallthrough; case 7: v->arch.gic.v3.lr[6] =3D READ_SYSREG_LR(6); + fallthrough; case 6: v->arch.gic.v3.lr[5] =3D READ_SYSREG_LR(5); + fallthrough; case 5: v->arch.gic.v3.lr[4] =3D READ_SYSREG_LR(4); + fallthrough; case 4: v->arch.gic.v3.lr[3] =3D READ_SYSREG_LR(3); + fallthrough; case 3: v->arch.gic.v3.lr[2] =3D READ_SYSREG_LR(2); + fallthrough; case 2: v->arch.gic.v3.lr[1] =3D READ_SYSREG_LR(1); + fallthrough; case 1: v->arch.gic.v3.lr[0] =3D READ_SYSREG_LR(0); break; @@ -112,34 +127,49 @@ static inline void gicv3_restore_lrs(const struct vcp= u *v) { case 16: WRITE_SYSREG_LR(v->arch.gic.v3.lr[15], 15); + fallthrough; case 15: WRITE_SYSREG_LR(v->arch.gic.v3.lr[14], 14); + fallthrough; case 14: WRITE_SYSREG_LR(v->arch.gic.v3.lr[13], 13); + fallthrough; case 13: WRITE_SYSREG_LR(v->arch.gic.v3.lr[12], 12); + fallthrough; case 12: WRITE_SYSREG_LR(v->arch.gic.v3.lr[11], 11); + fallthrough; case 11: WRITE_SYSREG_LR(v->arch.gic.v3.lr[10], 10); + fallthrough; case 10: WRITE_SYSREG_LR(v->arch.gic.v3.lr[9], 9); + fallthrough; case 9: WRITE_SYSREG_LR(v->arch.gic.v3.lr[8], 8); + fallthrough; case 8: WRITE_SYSREG_LR(v->arch.gic.v3.lr[7], 7); + fallthrough; case 7: WRITE_SYSREG_LR(v->arch.gic.v3.lr[6], 6); + fallthrough; case 6: WRITE_SYSREG_LR(v->arch.gic.v3.lr[5], 5); + fallthrough; case 5: WRITE_SYSREG_LR(v->arch.gic.v3.lr[4], 4); + fallthrough; case 4: WRITE_SYSREG_LR(v->arch.gic.v3.lr[3], 3); + fallthrough; case 3: WRITE_SYSREG_LR(v->arch.gic.v3.lr[2], 2); + fallthrough; case 2: WRITE_SYSREG_LR(v->arch.gic.v3.lr[1], 1); + fallthrough; case 1: WRITE_SYSREG_LR(v->arch.gic.v3.lr[0], 0); break; --=20 2.34.1 From nobody Sun May 19 01:43:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 17030702207801010.7178866876945; Wed, 20 Dec 2023 03:03:40 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.657632.1026621 (Exim 4.92) (envelope-from ) id 1rFuMD-00058e-MF; Wed, 20 Dec 2023 11:03:21 +0000 Received: by outflank-mailman (output) from mailman id 657632.1026621; Wed, 20 Dec 2023 11:03: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 1rFuMD-00057L-J2; Wed, 20 Dec 2023 11:03:21 +0000 Received: by outflank-mailman (input) for mailman id 657632; Wed, 20 Dec 2023 11:03:20 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rFuMC-0004rG-59 for xen-devel@lists.xenproject.org; Wed, 20 Dec 2023 11:03:20 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 6227cee9-9f27-11ee-98eb-6d05b1d4d9a1; Wed, 20 Dec 2023 12:03:19 +0100 (CET) Received: from Dell.bugseng.com (unknown [37.161.218.228]) by support.bugseng.com (Postfix) with ESMTPSA id 8BE794EE0C9A; Wed, 20 Dec 2023 12:03:18 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 6227cee9-9f27-11ee-98eb-6d05b1d4d9a1 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk Subject: [XEN PATCH 2/7] xen/arm: traps: address violations of MISRA C:2012 Rule 16.3 Date: Wed, 20 Dec 2023 12:03:02 +0100 Message-Id: <90c6cdb780ff7b75aada2a8a8a2df5d9e8b94b78.1703066935.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1703070223224100002 Content-Type: text/plain; charset="utf-8" MISRA C:2012 Rule 16.3 states: "An unconditional `break' statement shall terminate every switch-clause". Add missing break statements to address violations of Rule 16.3. Add pseudo-keyword "fallthrough" to make explicit the intended behavior and satisfy the requirements to deviate Rule 16.3. No functional change. Signed-off-by: Federico Serafini Acked-by: Julien Grall --- xen/arch/arm/traps.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index 77220ba092..9c10e8f78c 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -1414,10 +1414,18 @@ static void do_trap_hypercall(struct cpu_user_regs = *regs, register_t *nr, { /* Deliberately corrupt parameter regs used by this hypercall. */ switch ( hypercall_args[*nr] ) { - case 5: HYPERCALL_ARG5(regs) =3D 0xDEADBEEFU; - case 4: HYPERCALL_ARG4(regs) =3D 0xDEADBEEFU; - case 3: HYPERCALL_ARG3(regs) =3D 0xDEADBEEFU; - case 2: HYPERCALL_ARG2(regs) =3D 0xDEADBEEFU; + case 5: + HYPERCALL_ARG5(regs) =3D 0xDEADBEEFU; + fallthrough; + case 4: + HYPERCALL_ARG4(regs) =3D 0xDEADBEEFU; + fallthrough; + case 3: + HYPERCALL_ARG3(regs) =3D 0xDEADBEEFU; + fallthrough; + case 2: + HYPERCALL_ARG2(regs) =3D 0xDEADBEEFU; + fallthrough; case 1: /* Don't clobber x0/r0 -- it's the return value */ case 0: /* -ENOSYS case */ break; @@ -1929,6 +1937,7 @@ static void do_trap_stage2_abort_guest(struct cpu_use= r_regs *regs, gprintk(XENLOG_WARNING, "Unsupported FSC: HSR=3D%#"PRIregister" DFSC=3D%#x\n", hsr.bits, xabt.fsc); + break; } =20 inject_abt: @@ -2136,6 +2145,7 @@ void asmlinkage do_trap_guest_sync(struct cpu_user_re= gs *regs) "Unknown Guest Trap. HSR=3D%#"PRIregister" EC=3D0x%x IL=3D= %x Syndrome=3D0x%"PRIx32"\n", hsr.bits, hsr.ec, hsr.len, hsr.iss); inject_undef_exception(regs, hsr); + break; } } =20 --=20 2.34.1 From nobody Sun May 19 01:43:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1703070221133725.1800875355254; Wed, 20 Dec 2023 03:03:41 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.657634.1026636 (Exim 4.92) (envelope-from ) id 1rFuME-0005OV-Ii; Wed, 20 Dec 2023 11:03:22 +0000 Received: by outflank-mailman (output) from mailman id 657634.1026636; Wed, 20 Dec 2023 11:03: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 1rFuME-0005M8-DR; Wed, 20 Dec 2023 11:03:22 +0000 Received: by outflank-mailman (input) for mailman id 657634; Wed, 20 Dec 2023 11:03:21 +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 1rFuMD-0004rG-Au for xen-devel@lists.xenproject.org; Wed, 20 Dec 2023 11:03:21 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 62dd09f4-9f27-11ee-98eb-6d05b1d4d9a1; Wed, 20 Dec 2023 12:03:20 +0100 (CET) Received: from Dell.bugseng.com (unknown [37.161.218.228]) by support.bugseng.com (Postfix) with ESMTPSA id 7FE1C4EE0C9B; Wed, 20 Dec 2023 12:03:19 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 62dd09f4-9f27-11ee-98eb-6d05b1d4d9a1 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk Subject: [XEN PATCH 3/7] xen/arm: guest_walk: address violations of MISRA C:2012 Rule 16.3 Date: Wed, 20 Dec 2023 12:03:03 +0100 Message-Id: <98175f394c2c8078a864071aacef04b8d9e1cb6a.1703066935.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1703070223223100001 Content-Type: text/plain; charset="utf-8" Add missing break statements to address violations of Rule 16.3 ("An unconditional `break' statement shall terminate every switch-clause"). No functional change. Signed-off-by: Federico Serafini Acked-by: Julien Grall --- xen/arch/arm/guest_walk.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xen/arch/arm/guest_walk.c b/xen/arch/arm/guest_walk.c index d99b411f3b..2f7d3a0da7 100644 --- a/xen/arch/arm/guest_walk.c +++ b/xen/arch/arm/guest_walk.c @@ -165,6 +165,8 @@ static bool guest_walk_sd(const struct vcpu *v, *perms |=3D GV2M_WRITE; if ( !pte.sec.xn ) *perms |=3D GV2M_EXEC; + + break; } =20 return true; @@ -260,6 +262,7 @@ static bool get_ttbr_and_gran_64bit(uint64_t *ttbr, uns= igned int *gran, * fall back to 4K by default. */ *gran =3D GRANULE_SIZE_INDEX_4K; + break; } =20 /* Use TTBR0 for GVA to IPA translation. */ @@ -291,6 +294,7 @@ static bool get_ttbr_and_gran_64bit(uint64_t *ttbr, uns= igned int *gran, * fall back to 4K by default. */ *gran =3D GRANULE_SIZE_INDEX_4K; + break; } =20 /* Use TTBR1 for GVA to IPA translation. */ --=20 2.34.1 From nobody Sun May 19 01:43:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1703070225863184.30716247120893; Wed, 20 Dec 2023 03:03:45 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.657635.1026652 (Exim 4.92) (envelope-from ) id 1rFuMG-0005ux-Qb; Wed, 20 Dec 2023 11:03:24 +0000 Received: by outflank-mailman (output) from mailman id 657635.1026652; Wed, 20 Dec 2023 11:03: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 1rFuMG-0005uq-N0; Wed, 20 Dec 2023 11:03:24 +0000 Received: by outflank-mailman (input) for mailman id 657635; Wed, 20 Dec 2023 11:03:23 +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 1rFuMF-0004rG-1F for xen-devel@lists.xenproject.org; Wed, 20 Dec 2023 11:03:23 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 63ddd643-9f27-11ee-98eb-6d05b1d4d9a1; Wed, 20 Dec 2023 12:03:22 +0100 (CET) Received: from Dell.bugseng.com (unknown [37.161.218.228]) by support.bugseng.com (Postfix) with ESMTPSA id DD4674EE0C9C; Wed, 20 Dec 2023 12:03:20 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 63ddd643-9f27-11ee-98eb-6d05b1d4d9a1 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Tamas K Lengyel , Alexandru Isaila , Petre Pircalabu , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk Subject: [XEN PATCH 4/7] xen/arm: mem_access: address violations of MISRA C:2012 Rule 16.3 Date: Wed, 20 Dec 2023 12:03:04 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1703070226455100009 Content-Type: text/plain; charset="utf-8" Refactor of the code to have a break statement at the end of the switch-clause. This addresses violations of Rule 16.3 ("An unconditional `break' statement shall terminate every switch-clause"). No functional change. Signed-off-by: Federico Serafini --- xen/arch/arm/mem_access.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xen/arch/arm/mem_access.c b/xen/arch/arm/mem_access.c index 31db846354..fbcb5471f7 100644 --- a/xen/arch/arm/mem_access.c +++ b/xen/arch/arm/mem_access.c @@ -168,10 +168,10 @@ p2m_mem_access_check_and_get_page(vaddr_t gva, unsign= ed long flag, * If this was a read then it was because of mem_access, but if it= was * a write then the original get_page_from_gva fault was correct. */ - if ( flag =3D=3D GV2M_READ ) - break; - else + if ( flag !=3D GV2M_READ ) goto err; + + break; case XENMEM_access_rx2rw: case XENMEM_access_rx: case XENMEM_access_r: @@ -179,10 +179,10 @@ p2m_mem_access_check_and_get_page(vaddr_t gva, unsign= ed long flag, * If this was a write then it was because of mem_access, but if i= t was * a read then the original get_page_from_gva fault was correct. */ - if ( flag =3D=3D GV2M_WRITE ) - break; - else + if ( flag !=3D GV2M_WRITE ) goto err; + + break; } =20 /* --=20 2.34.1 From nobody Sun May 19 01:43:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1703070232494790.2365904742005; Wed, 20 Dec 2023 03:03:52 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.657636.1026662 (Exim 4.92) (envelope-from ) id 1rFuMI-0006DE-63; Wed, 20 Dec 2023 11:03:26 +0000 Received: by outflank-mailman (output) from mailman id 657636.1026662; Wed, 20 Dec 2023 11:03:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rFuMI-0006D3-1a; Wed, 20 Dec 2023 11:03:26 +0000 Received: by outflank-mailman (input) for mailman id 657636; Wed, 20 Dec 2023 11:03:24 +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 1rFuMG-0004rG-2S for xen-devel@lists.xenproject.org; Wed, 20 Dec 2023 11:03:24 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 647b579b-9f27-11ee-98eb-6d05b1d4d9a1; Wed, 20 Dec 2023 12:03:23 +0100 (CET) Received: from Dell.bugseng.com (unknown [37.161.218.228]) by support.bugseng.com (Postfix) with ESMTPSA id 75AB84EE0C92; Wed, 20 Dec 2023 12:03:22 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 647b579b-9f27-11ee-98eb-6d05b1d4d9a1 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk Subject: [XEN PATCH 5/7] xen/arm: v{cp,sys}reg: address violations of MISRA C:2012 Rule 16.3 Date: Wed, 20 Dec 2023 12:03:05 +0100 Message-Id: <541bc4fd47d26b12ea131590bf0c49f7c92d9368.1703066935.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1703070234459100001 Content-Type: text/plain; charset="utf-8" Refactor of the switch-clauses to have a return statement at the end. This satisfies the requirements to deviate Rule 16.3 ("An unconditional `break' statement shall terminate every switch-clause). No functional change. Signed-off-by: Federico Serafini Acked-by: Julien Grall --- xen/arch/arm/arm64/vsysreg.c | 4 ++-- xen/arch/arm/vcpreg.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/arm64/vsysreg.c b/xen/arch/arm/arm64/vsysreg.c index b5d54c569b..247f08ad8d 100644 --- a/xen/arch/arm/arm64/vsysreg.c +++ b/xen/arch/arm/arm64/vsysreg.c @@ -210,8 +210,8 @@ void do_sysreg(struct cpu_user_regs *regs, /* RO at EL0. RAZ/WI at EL1 */ if ( regs_mode_is_user(regs) ) return handle_ro_raz(regs, regidx, hsr.sysreg.read, hsr, 0); - else - return handle_raz_wi(regs, regidx, hsr.sysreg.read, hsr, 1); + + return handle_raz_wi(regs, regidx, hsr.sysreg.read, hsr, 1); case HSR_SYSREG_PMCR_EL0: case HSR_SYSREG_PMCNTENSET_EL0: case HSR_SYSREG_PMCNTENCLR_EL0: diff --git a/xen/arch/arm/vcpreg.c b/xen/arch/arm/vcpreg.c index a2d0500704..685609f825 100644 --- a/xen/arch/arm/vcpreg.c +++ b/xen/arch/arm/vcpreg.c @@ -289,8 +289,8 @@ void do_cp15_32(struct cpu_user_regs *regs, const union= hsr hsr) /* RO at EL0. RAZ/WI at EL1 */ if ( regs_mode_is_user(regs) ) return handle_ro_raz(regs, regidx, cp32.read, hsr, 0); - else - return handle_raz_wi(regs, regidx, cp32.read, hsr, 1); + + return handle_raz_wi(regs, regidx, cp32.read, hsr, 1); case HSR_CPREG32(PMINTENSET): case HSR_CPREG32(PMINTENCLR): /* EL1 only, however MDCR_EL2.TPM=3D=3D1 means EL0 may trap here a= lso. */ --=20 2.34.1 From nobody Sun May 19 01:43:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1703070225466406.22561063507055; Wed, 20 Dec 2023 03:03:45 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.657637.1026667 (Exim 4.92) (envelope-from ) id 1rFuMI-0006Gb-Ky; Wed, 20 Dec 2023 11:03:26 +0000 Received: by outflank-mailman (output) from mailman id 657637.1026667; Wed, 20 Dec 2023 11:03:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rFuMI-0006Fe-C5; Wed, 20 Dec 2023 11:03:26 +0000 Received: by outflank-mailman (input) for mailman id 657637; Wed, 20 Dec 2023 11:03:25 +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 1rFuMH-0004rG-42 for xen-devel@lists.xenproject.org; Wed, 20 Dec 2023 11:03:25 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 651db1ee-9f27-11ee-98eb-6d05b1d4d9a1; Wed, 20 Dec 2023 12:03:24 +0100 (CET) Received: from Dell.bugseng.com (unknown [37.161.218.228]) by support.bugseng.com (Postfix) with ESMTPSA id 6ED4C4EE0C99; Wed, 20 Dec 2023 12:03:23 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 651db1ee-9f27-11ee-98eb-6d05b1d4d9a1 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk Subject: [XEN PATCH 6/7] xen/arm: mmu: address a violations of MISRA C:2012 Rule 16.3 Date: Wed, 20 Dec 2023 12:03:06 +0100 Message-Id: <92740a979c4d3a19d7c76ff69b90ab211049448e.1703066935.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1703070226446100007 Content-Type: text/plain; charset="utf-8" Add missing break at the end of the switch-clause to 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: Julien Grall --- xen/arch/arm/mmu/p2m.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/arm/mmu/p2m.c b/xen/arch/arm/mmu/p2m.c index 6a5a080307..41fcca011c 100644 --- a/xen/arch/arm/mmu/p2m.c +++ b/xen/arch/arm/mmu/p2m.c @@ -657,6 +657,7 @@ static lpae_t mfn_to_p2m_entry(mfn_t mfn, p2m_type_t t,= p2m_access_t a) default: e.p2m.mattr =3D MATTR_MEM; e.p2m.sh =3D LPAE_SH_INNER; + break; } =20 p2m_set_permission(&e, t, a); --=20 2.34.1 From nobody Sun May 19 01:43:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 170307022868131.277995434725312; Wed, 20 Dec 2023 03:03:48 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.657638.1026680 (Exim 4.92) (envelope-from ) id 1rFuMJ-0006hE-TA; Wed, 20 Dec 2023 11:03:27 +0000 Received: by outflank-mailman (output) from mailman id 657638.1026680; Wed, 20 Dec 2023 11:03:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rFuMJ-0006gg-P2; Wed, 20 Dec 2023 11:03:27 +0000 Received: by outflank-mailman (input) for mailman id 657638; Wed, 20 Dec 2023 11:03:26 +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 1rFuMI-0004rG-92 for xen-devel@lists.xenproject.org; Wed, 20 Dec 2023 11:03:26 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 65d1acf7-9f27-11ee-98eb-6d05b1d4d9a1; Wed, 20 Dec 2023 12:03:25 +0100 (CET) Received: from Dell.bugseng.com (unknown [37.161.218.228]) by support.bugseng.com (Postfix) with ESMTPSA id 9D39F4EE0C9A; Wed, 20 Dec 2023 12:03:24 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 65d1acf7-9f27-11ee-98eb-6d05b1d4d9a1 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Bertrand Marquis , Rahul Singh , Stefano Stabellini , Julien Grall , Michal Orzel , Volodymyr Babchuk Subject: [XEN PATCH 7/7] xen/arm: smmu-v3: address violations of MISRA C:2012 Rule 16.3 Date: Wed, 20 Dec 2023 12:03:07 +0100 Message-Id: <93d32bf20bb85b93618be5140edb1be527606b77.1703066935.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1703070230411100001 Content-Type: text/plain; charset="utf-8" Add a break statement at the end of the switch-clauses to address violations of MISRA C:2012 Rule 16.3 ("An unconditional `break' statement shall terminate every switch-clause"). No funtional change. Signed-off-by: Federico Serafini Acked-by: Julien Grall Reviewed-by: Bertrand Marquis features |=3D ARM_SMMU_FEAT_STALLS; + break; } =20 if (reg & IDR0_S2P) @@ -2301,6 +2302,7 @@ static int arm_smmu_device_hw_probe(struct arm_smmu_d= evice *smmu) fallthrough; case IDR5_OAS_48_BIT: smmu->oas =3D 48; + break; } =20 smmu->oas =3D min_t(unsigned long, PADDR_BITS, smmu->oas); --=20 2.34.1