From nobody Fri Nov 22 02:32:51 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; dkim=pass; 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; dmarc=pass(p=none dis=none) header.from=bugseng.com ARC-Seal: i=1; a=rsa-sha256; t=1727700622; cv=none; d=zohomail.com; s=zohoarc; b=Hd5o95G8QKZvVr/KCoCJ2kBxAZITO8f4enohF563OsakyyWr5KsuBlWA2OGtRr7//X95g6/AX36E3bCJn3Az5CcNgd+3Q13mcyOuFWi0iBXHKEaGhrhrILPdaLAOKSzKTetpFvnnsfd4DXx1SRg6Vk9x89QNm9ZEnbHmjleuEDM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727700622; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=AtRtYV5OSNgSJW2LSO7Zh1hDHs7wLUdZjYqcX4Qr6tw=; b=CDxhnGais/O1Jc8XXEztSA4kqP/U6TfapanTqrX3lgeK0Bm9X1xq9FxbbfYQbgrY2ddnUZgsMTc2GV2ek7HxWWutD00jslGQkHYI/GFjBzoRyTKYi6LPL1Ot0FcUsX9P24vVEBcPNhc2kz+RoocxM1SWgCwxvvCs/sqPCrWFFWY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1727700622679188.2042059186274; Mon, 30 Sep 2024 05:50:22 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.807348.1218742 (Exim 4.92) (envelope-from ) id 1svFqZ-0005gP-S1; Mon, 30 Sep 2024 12:49:51 +0000 Received: by outflank-mailman (output) from mailman id 807348.1218742; Mon, 30 Sep 2024 12:49:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1svFqZ-0005gI-PU; Mon, 30 Sep 2024 12:49:51 +0000 Received: by outflank-mailman (input) for mailman id 807348; Mon, 30 Sep 2024 12:49:50 +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 1svFqX-0005M5-Vk for xen-devel@lists.xenproject.org; Mon, 30 Sep 2024 12:49:50 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 7aa7dad5-7f2a-11ef-a0ba-8be0dac302b0; Mon, 30 Sep 2024 14:49:49 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [37.161.44.57]) by support.bugseng.com (Postfix) with ESMTPSA id 86F224EE0746; Mon, 30 Sep 2024 14:49:47 +0200 (CEST) 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: 7aa7dad5-7f2a-11ef-a0ba-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bugseng.com; s=mail; t=1727700589; bh=QeRq5WatM5/gynhxqWft0r5yBBUgCUUQ3Qn003k14R0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F2S5X2u1gO2RIoVnDJLQE2s1VuP3OmT57wAOwC51Lbs5wJ2TwvrrlmuDBAaxR7ypG LHQnkUq0vQqmulVdxcox1DXj8M32lActpeOB9RoJT4Bmc2ianwWVn6+iRbu+9jvvKK BODpWPz8C9zigzTwJak1zE9YHOgQIsfPtw3EzjOLuxHsIX7jbcEzv1JbejDNkmMnpg 5TVD0xVp3KBxQt2H5aXbbGLvzr2KL6JmmO4XtRuCbooYgDLjRPBJWMrG8MpYaMXM9K W9EXToQhI3fUrprZ2tScNMK9eOTgOAV0hkf+F1KRvJe9aA8BITrdZtaDp2Uf87AUxV AapPGP0Usim8A== From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , "Daniel P. Smith" , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Jan Beulich , Stefano Stabellini , Andrew Cooper Subject: [XEN PATCH v2 1/3] EFI: address a violation of MISRA C Rule 13.6 Date: Mon, 30 Sep 2024 14:49:15 +0200 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @bugseng.com) X-ZM-MESSAGEID: 1727700623913116600 Content-Type: text/plain; charset="utf-8" guest_handle_ok()'s expansion contains a sizeof() involving its first argument which is guest_handle_cast(). The expansion of the latter, in turn, contains a variable initialization. Since MISRA considers the initialization (even of a local variable) a side effect, the chain of expansions mentioned above violates MISRA C:2012 Rule 13.6 (The operand of the `sizeof' operator shall not contain any expression which has potential side effect). Refactor the code to address the rule violation. Suggested-by: Andrew Cooper Signed-off-by: Federico Serafini Acked-by: Marek Marczykowski-G=C3=B3recki Reviewed-by: Stefano Stabellini --- Changes in v2: - better description. --- xen/common/efi/runtime.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c index d03e5c90ce..acf08dcaa3 100644 --- a/xen/common/efi/runtime.c +++ b/xen/common/efi/runtime.c @@ -250,14 +250,20 @@ int efi_get_info(uint32_t idx, union xenpf_efi_info *= info) info->cfg.addr =3D __pa(efi_ct); info->cfg.nent =3D efi_num_ct; break; + case XEN_FW_EFI_VENDOR: + { + XEN_GUEST_HANDLE_PARAM(CHAR16) vendor_name =3D + guest_handle_cast(info->vendor.name, CHAR16); + if ( !efi_fw_vendor ) return -EOPNOTSUPP; + info->vendor.revision =3D efi_fw_revision; n =3D info->vendor.bufsz / sizeof(*efi_fw_vendor); - if ( !guest_handle_okay(guest_handle_cast(info->vendor.name, - CHAR16), n) ) + if ( !guest_handle_okay(vendor_name, n) ) return -EFAULT; + for ( i =3D 0; i < n; ++i ) { if ( __copy_to_guest_offset(info->vendor.name, i, @@ -267,6 +273,8 @@ int efi_get_info(uint32_t idx, union xenpf_efi_info *in= fo) break; } break; + } + case XEN_FW_EFI_MEM_INFO: for ( i =3D 0; i < efi_memmap_size; i +=3D efi_mdesc_size ) { --=20 2.43.0 From nobody Fri Nov 22 02:32:51 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; dkim=pass; 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; dmarc=pass(p=none dis=none) header.from=bugseng.com ARC-Seal: i=1; a=rsa-sha256; t=1727700613; cv=none; d=zohomail.com; s=zohoarc; b=k4vVGXMG2FeqhLd70IF6uVm8MdYNUXOXis2t5TVZP3Ma01XoXpWwE7aLE8N+ig4uIi3xkvR0X7C7/dZp4CXPFo1sOvwpMgg5j9axndyH42fDqLiGMeFPEYSSKrPPbTcU/fhTy4Xf/Y8lc+C5pCgqs5P4I926MKFgBlUnLBT/e34= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727700613; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UbNNtyJC1hP1jyTRfqVwS9wsqN1qktUK9pWOSaNqDA4=; b=JgReWC6VYqG/e2QBQ+9Bl/5SvdSMyAs1oeTdZw8C+cNKqWC4nOwEYzc0m0UD5Nc0WgtEmEoMWMiwnjQuIiISv6gJkUrstGJp++S5kIYPha+sWJsxv0IDhT4T5cSnk6YBDnWLqxm9yNWkPR940+Yn04WJECNpj5xbSNGsyaltDYs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1727700613267359.1797302771864; Mon, 30 Sep 2024 05:50:13 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.807350.1218763 (Exim 4.92) (envelope-from ) id 1svFqc-0006BF-Br; Mon, 30 Sep 2024 12:49:54 +0000 Received: by outflank-mailman (output) from mailman id 807350.1218763; Mon, 30 Sep 2024 12:49:54 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1svFqc-0006B8-8B; Mon, 30 Sep 2024 12:49:54 +0000 Received: by outflank-mailman (input) for mailman id 807350; Mon, 30 Sep 2024 12:49:52 +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 1svFqa-0005el-DJ for xen-devel@lists.xenproject.org; Mon, 30 Sep 2024 12:49:52 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 7b738270-7f2a-11ef-99a2-01e77a169b0f; Mon, 30 Sep 2024 14:49:51 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [37.161.44.57]) by support.bugseng.com (Postfix) with ESMTPSA id 8E5524EE074C; Mon, 30 Sep 2024 14:49:49 +0200 (CEST) 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: 7b738270-7f2a-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bugseng.com; s=mail; t=1727700590; bh=tAlH5qx3tE+Jaw9OwhxZVte9uodMsa8rU6Z7XQGTGJU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u3kEpWfdlOTNaxngRs6M4fiXbraQFOJoW1z9LpehVzN30ejy7IH0qIhKVkSoXPcuF O64OCK9wymMLkdpbhbuA3R1Wt5prdinNMm1tsWl4zNUSzt6xWFyV7eGLqH0fGXoCto JQ0LIV/uPGoBfM+oAcKBrnV/fHf9Uqyiru5+sX35nmasde1EsUtcJs85Bge3BUwoL6 /Y0PkOqHNxakut4CAUdGe0tKJ4L8OX5aIXElC3Qjbo/1yNl8SgkUKxx9BbHviEBXyp 1ZsUCtvkx1A58MLDIh9EZuD9f8Nk0wEkr/TO2gnnxXgwiJlZ9iakwAPxTZ3/pF+Vuo OMrK/E1pqxwQg== From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Andrew Cooper , Jan Beulich , Julien Grall , Stefano Stabellini Subject: [XEN PATCH v2 2/3] xen/gnttab: address a violation of MISRA C Rule 13.6 Date: Mon, 30 Sep 2024 14:49:16 +0200 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @bugseng.com) X-ZM-MESSAGEID: 1727700613877116600 Content-Type: text/plain; charset="utf-8" guest_handle_ok()'s expansion contains a sizeof() involving its first argument guest_handle_cast(). The expansion of the latter, in turn, contains a variable initialization. Since MISRA considers the initialization (even of a local variable) a side effect, the chain of expansions mentioned above violates MISRA C:2012 Rule 13.6 (The operand of the `sizeof' operator shall not contain any expression which has potential side effect). Refactor the code to address the rule violation. Suggested-by: Andrew Cooper Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini --- Changes in v2: - better description; - preserved original indentation. --- xen/common/compat/grant_table.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/xen/common/compat/grant_table.c b/xen/common/compat/grant_tabl= e.c index 5ad0debf96..bbb717bf64 100644 --- a/xen/common/compat/grant_table.c +++ b/xen/common/compat/grant_table.c @@ -78,12 +78,15 @@ int compat_grant_table_op( cmd_op =3D cmd; switch ( cmd_op ) { -#define CASE(name) \ - case GNTTABOP_##name: \ - if ( unlikely(!guest_handle_okay(guest_handle_cast(uop, \ - gnttab_##name##= _compat_t), \ - count)) ) \ - rc =3D -EFAULT; \ +#define CASE(name) \ + case GNTTABOP_ ## name: \ + { \ + XEN_GUEST_HANDLE_PARAM(gnttab_ ## name ## _compat_t) h =3D \ + guest_handle_cast(uop, gnttab_ ## name ## _compat_t); \ + \ + if ( unlikely(!guest_handle_okay(h, count)) ) \ + rc =3D -EFAULT; \ + } \ break =20 #ifndef CHECK_gnttab_map_grant_ref --=20 2.43.0 From nobody Fri Nov 22 02:32:52 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; dkim=pass; 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; dmarc=pass(p=none dis=none) header.from=bugseng.com ARC-Seal: i=1; a=rsa-sha256; t=1727700620; cv=none; d=zohomail.com; s=zohoarc; b=SaSUMRit/u5qWmLH8hfrFCQO+pGpqpj3xpv9Va+EzkQmQMm9iftPEy9iosBTEowS1wFDBd+neyHdzrnvr/Bp6sKwOAX6+NaPrPuw+u23eetjLf3HqSJcAaYkaW1XhD9h5728N6bCWQ1hSkoSyVqKZQUpyqtTGp0Pi8Ja7BK5fZU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727700620; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=GWjwWII10r1k/VvEJCt9YlTIwbGf20d1ikOmcwpDx/U=; b=PqknyFrd+dPf613aQXwXqWqD4Oh5wpHkIKqPORg4QHxQFWAX2A4K+MKkUefOjaftbceLrfG0A0ym3hLUsn8fONp8dy0pEHXhSNuNEefk1MzbqnhoHgqONPfUZ7UhNe36RFQLCYMutIuhnXdDOW3LuSTX2UG/8tIQ3YxNaqHS8aE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1727700620175609.2759930958467; Mon, 30 Sep 2024 05:50:20 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.807351.1218769 (Exim 4.92) (envelope-from ) id 1svFqc-0006EP-MO; Mon, 30 Sep 2024 12:49:54 +0000 Received: by outflank-mailman (output) from mailman id 807351.1218769; Mon, 30 Sep 2024 12:49:54 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1svFqc-0006Dh-GT; Mon, 30 Sep 2024 12:49:54 +0000 Received: by outflank-mailman (input) for mailman id 807351; Mon, 30 Sep 2024 12:49:53 +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 1svFqb-0005M5-31 for xen-devel@lists.xenproject.org; Mon, 30 Sep 2024 12:49:53 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 7c7aae3a-7f2a-11ef-a0ba-8be0dac302b0; Mon, 30 Sep 2024 14:49:52 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [37.161.44.57]) by support.bugseng.com (Postfix) with ESMTPSA id 0C6974EE0745; Mon, 30 Sep 2024 14:49:50 +0200 (CEST) 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: 7c7aae3a-7f2a-11ef-a0ba-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bugseng.com; s=mail; t=1727700592; bh=5nXjp14WwdGFVxbaAzt/3eS1ERiyeHcNMStdfmx1zgg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nqGFUTUSTT/aL7/3B2Tgkz6MPCGQl7p9PYF06zX2IyD6KF7rFlbP+kHmkYIdGwsIr OUzOBrpFzJG85chMJLyMds/H2Yy8qXfaIZ7qER+UONMfD4T6IGphsIMOmaQyUM24xb SfPOADVxJwntUT+Mb5yJ0yJSJjkeodb/6flflVwvWDpzt+58/bE+91zjoq7TLLnrr8 hrMK69OF40Wuz3DMPJazRC/KRrKCFB6rYfK5HFgmG0EmK7A1khjB3x/tdVyKYJlk6n vjaHizzrnlI4YSdLybUMZIFtmM/Qs9OxkUGSDplxJCv58ywLZ+6YwvmpQSJb6/569k UakNOa0fS1rMg== From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Simone Ballarin , Doug Goldstein , Stefano Stabellini Subject: [XEN PATCH v2 3/3] automation/eclair: tag Rule 13.6 as clean Date: Mon, 30 Sep 2024 14:49:17 +0200 Message-ID: <8fc4fe3f0ef744ef0c379bf76b8425deac40088c.1727690180.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @bugseng.com) X-ZM-MESSAGEID: 1727700621646116600 Content-Type: text/plain; charset="utf-8" Update ECLAIR configuration to consider Rule 13.6 as clean: new violations of this rule will cause a failure of the CI pipeline. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini --- automation/eclair_analysis/ECLAIR/tagging.ecl | 1 + 1 file changed, 1 insertion(+) diff --git a/automation/eclair_analysis/ECLAIR/tagging.ecl b/automation/ecl= air_analysis/ECLAIR/tagging.ecl index b8448938e6..76032b1fe1 100644 --- a/automation/eclair_analysis/ECLAIR/tagging.ecl +++ b/automation/eclair_analysis/ECLAIR/tagging.ecl @@ -60,6 +60,7 @@ MC3R1.R11.6|| MC3R1.R11.7|| MC3R1.R11.9|| MC3R1.R12.5|| +MC3R1.R13.6|| MC3R1.R14.1|| MC3R1.R14.3|| MC3R1.R14.4|| --=20 2.43.0