From patchwork Fri Oct 20 15:28:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Vetrini X-Patchwork-Id: 13430881 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 5C71FCDB474 for ; Fri, 20 Oct 2023 15:28:58 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.619832.965550 (Exim 4.92) (envelope-from ) id 1qtrQb-0005kC-O6; Fri, 20 Oct 2023 15:28:45 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 619832.965550; Fri, 20 Oct 2023 15:28:45 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qtrQb-0005k5-Kt; Fri, 20 Oct 2023 15:28:45 +0000 Received: by outflank-mailman (input) for mailman id 619832; Fri, 20 Oct 2023 15:28:44 +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 1qtrQa-0005jz-Mq for xen-devel@lists.xenproject.org; Fri, 20 Oct 2023 15:28:44 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 5a7d6fb6-6f5d-11ee-98d5-6d05b1d4d9a1; Fri, 20 Oct 2023 17:28:43 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id 303064EE073C; Fri, 20 Oct 2023 17:28:41 +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: 5a7d6fb6-6f5d-11ee-98d5-6d05b1d4d9a1 From: Nicola Vetrini To: xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, consulting@bugseng.com, jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com, Nicola Vetrini , Simone Ballarin , Doug Goldstein , George Dunlap , Julien Grall , Wei Liu , Bertrand Marquis , Volodymyr Babchuk , Paul Durrant Subject: [XEN PATCH][for-4.19 v3 0/8] address violations of MISRA C:2012 Rule 10.1 Date: Fri, 20 Oct 2023 17:28:29 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 The widely-used construct (x & -x), where x is an unsigned integer quantity represented in 2's complement, does yield the expected result. Since all architectures that are targets for compliance do fulfill such requirements, the construct is deemed safe and deviated. The use of 'DECLARE_BITMAP(features, IOMMU_FEAT_count);' is deviated, to avoid harming code readability. On the contrary, other uses of inappropriate types are changed. Changes in v3: - Patch [6/8] has already been picked up in Andrew's for-next tree Nicola Vetrini (8): xen/include: add macro LOWEST_BIT arm/bitops: encapsulate violation of MISRA C:2012 Rule 10.1 xen/pdx: amend definition of PDX_GROUP_COUNT x86_64/mm: express macro CNT using LOWEST_BIT x86/io_apic: address violation of MISRA C:2012 Rule 10.1 x86/mce: Move MC_NCLASSES into the enum mctelem_class xen/types: address Rule 10.1 for DECLARE_BITMAP use xen/compat: use BUILD_BUG_ON in CHECK_SIZE macros automation/eclair_analysis/ECLAIR/deviations.ecl | 6 ++++++ docs/misra/deviations.rst | 7 +++++++ docs/misra/safe.json | 8 ++++++++ xen/arch/arm/include/asm/bitops.h | 6 ++++-- xen/arch/x86/cpu/mcheck/mctelem.c | 2 -- xen/arch/x86/cpu/mcheck/mctelem.h | 5 +++-- xen/arch/x86/include/asm/io_apic.h | 7 ++++--- xen/arch/x86/x86_64/mm.c | 12 ++++++------ xen/include/xen/compat.h | 16 +++++++++++----- xen/include/xen/iommu.h | 1 + xen/include/xen/macros.h | 7 +++++-- xen/include/xen/pdx.h | 2 +- xen/include/xen/types.h | 15 ++++++++++----- 13 files changed, 66 insertions(+), 28 deletions(-) --- 2.34.1