From nobody Sun May 19 03:12:44 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=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1692830421; cv=none; d=zohomail.com; s=zohoarc; b=im3cho0j0S5/lo9TaXVTBgORfCt2Xbt2RUgbjBr5sR8c/Gb7YFEtsPVVS3xkNnZ/AMN0YkUuZKi7XvtnqmsR1aU1d/RZVO8Tb/b39bcgKThZ9fLcss5nbHPP0ogUyFPUrvwDU3wp6YpggXl4m7x/45jq5GBsYpm7JS28HEGNZUw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692830421; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=CjiNPrMbUrm3aOQPBDa064bN+canf3k2T3+QmozbPTs=; b=LFtBesbh51Ly24VZdY0zC/kBoyezGHLjvjahS/oolmnOuc90Aq+nC8rRMGpAXSSlAC71L6KdTXFstrUfwfqeVimqi/CrCwdPdAeVY7LFU4CVhYgdpTHR30/xxfuZ3HYalUun0lAO6Zn1pgUNDY0DfdQrvG0HerjLKr7g26++JAI= 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 1692830421454446.4187094131905; Wed, 23 Aug 2023 15:40:21 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.589668.921647 (Exim 4.92) (envelope-from ) id 1qYwW2-0006a1-G8; Wed, 23 Aug 2023 22:39:54 +0000 Received: by outflank-mailman (output) from mailman id 589668.921647; Wed, 23 Aug 2023 22:39: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 1qYwW2-0006Zu-CS; Wed, 23 Aug 2023 22:39:54 +0000 Received: by outflank-mailman (input) for mailman id 589668; Wed, 23 Aug 2023 22:39: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 1qYwW0-0006YH-9k for xen-devel@lists.xenproject.org; Wed, 23 Aug 2023 22:39:52 +0000 Received: from dfw.source.kernel.org (dfw.source.kernel.org [2604:1380:4641:c500::1]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id f753d59c-4205-11ee-9b0c-b553b5be7939; Thu, 24 Aug 2023 00:39:49 +0200 (CEST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DD4E560FAD; Wed, 23 Aug 2023 22:39:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AFE03C433C7; Wed, 23 Aug 2023 22:39:45 +0000 (UTC) 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: f753d59c-4205-11ee-9b0c-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692830387; bh=E9W2QjNI6ycZiWfJtdywMvws2mKzbaJYzNzgODHfcXE=; h=From:To:Cc:Subject:Date:From; b=NYQWQOGeRY8HS9AhqMVQKvygbAeS1EjBZgwClaVUYnaP0BF9zRK+g+NN7EdDocQra ZY1exZqUf3tcFmVypqAKJp9Pxx1RmOuaHrFiro4X5RcF3JLr3FPoYxFOiX9bwo3Trx vRnvZITotpZOCNkYi1C3SDrZWvBkbtZjlRwx3ER+pAhHTqPJHf/Dd2neAHzZs3fPwY c27aXLv72l7fVAnuudPN9WQZ0g7+AJl+zNFyNQIYVjSxeygYHExU+C4/aoAibPByWJ MkjIOzPZlcm/W1PEo7ndDRZNpnm0Twlivh8XrndhBEYOfHNSkpwmN+YWCx1Y5sI9YL ucwu6ZmG0nMZg== From: Stefano Stabellini To: xen-devel@lists.xenproject.org Cc: jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com, julien@xen.org, sstabellini@kernel.org, george.dunlap@citrix.com, bertrand.marquis@arm.com, nicola.vetrini@bugseng.com, Stefano Stabellini Subject: [PATCH v2] docs/misra: add rule 2.1 exceptions Date: Wed, 23 Aug 2023 15:39:42 -0700 Message-Id: <20230823223942.2981782-1-sstabellini@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1692830422968100001 Content-Type: text/plain; charset="utf-8" From: Stefano Stabellini During the discussions that led to the acceptance of Rule 2.1, we decided on a few exceptions that were not properly recorded in rules.rst. Add them now. Signed-off-by: Stefano Stabellini Acked-by: Jan Beulich Acked-by: Bertrand Marquis --- Note that safe.json and the codebase are not yet updated with an appropriate tag for BUG, panic and friends. v2: - fix typo in commit message - use "only referenced from assembly" - use "Deliberate unreachability caused by" - add "See safe.json" - add acked-by (although I also added "See safe.json") --- docs/misra/rules.rst | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst index 8f0e4d3f25..4f33ed4ba6 100644 --- a/docs/misra/rules.rst +++ b/docs/misra/rules.rst @@ -106,7 +106,18 @@ maintainers if you want to suggest a change. * - `Rule 2.1 `_ - Required - A project shall not contain unreachable code - - + - The following are allowed: + - Invariantly constant conditions, e.g. if(IS_ENABLED(CONFIG_HVM)= ) { S; } + - Switch with a controlling value statically determined not to + match one or more case statements + - Functions that are intended to be referenced only from + assembly code (e.g. 'do_trap_fiq') + - Deliberate unreachability caused by certain macros/functions, + e.g. BUG, assert_failed, panic, etc. See safe.json. + - asm-offsets.c, as they are not linked deliberately, because + they are used to generate definitions for asm modules + - Declarations without initializer are safe, as they are not + executed =20 * - `Rule 2.6 `_ - Advisory --=20 2.25.1