From nobody Sun Feb 8 22:07:58 2026 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 169105821436695.23096461983448; Thu, 3 Aug 2023 03:23:34 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.576177.902038 (Exim 4.92) (envelope-from ) id 1qRVUG-0004pY-3z; Thu, 03 Aug 2023 10:23:20 +0000 Received: by outflank-mailman (output) from mailman id 576177.902038; Thu, 03 Aug 2023 10:23: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 1qRVUG-0004pR-0J; Thu, 03 Aug 2023 10:23:20 +0000 Received: by outflank-mailman (input) for mailman id 576177; Thu, 03 Aug 2023 10:23:19 +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 1qRVUF-0004Rp-Cw for xen-devel@lists.xenproject.org; Thu, 03 Aug 2023 10:23:19 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id c3c9bffb-31e7-11ee-b268-6b7b168915f2; Thu, 03 Aug 2023 12:23:18 +0200 (CEST) Received: from beta.station (net-188-218-251-179.cust.vodafonedsl.it [188.218.251.179]) by support.bugseng.com (Postfix) with ESMTPSA id 509D94EE0737; Thu, 3 Aug 2023 12:23:18 +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: c3c9bffb-31e7-11ee-b268-6b7b168915f2 From: Simone Ballarin To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Gianluca Luparini , Jan Beulich , Andrew Cooper , Simone Ballarin Subject: [XEN PATCH 01/13] AMD/IOMMU: address violations of MISRA C:2012 Rule 7.3 Date: Thu, 3 Aug 2023 12:22:16 +0200 Message-Id: <2af1f76d2c002dd9f0b01eebf7af516d86bfe91e.1691053438.git.simone.ballarin@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: 1691058216767100001 Content-Type: text/plain; charset="utf-8" From: Gianluca Luparini The xen sources contain violations of MISRA C:2012 Rule 7.3 whose headline states: "The lowercase character 'l' shall not be used in a literal suffix". Use the "L" suffix instead of the "l" suffix, to avoid potential ambiguity. If the "u" suffix is used near "L", use the "U" suffix instead, for consist= ency. The changes in this patch are mechanical. Signed-off-by: Gianluca Luparini Signed-off-by: Simone Ballarin Acked-by: Jan Beulich Reviewed-by: Stefano Stabellini --- xen/drivers/passthrough/amd/iommu_guest.c | 2 +- xen/drivers/passthrough/amd/iommu_map.c | 2 +- xen/drivers/passthrough/amd/pci_amd_iommu.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/drivers/passthrough/amd/iommu_guest.c b/xen/drivers/passth= rough/amd/iommu_guest.c index 47a912126a..80d289b8bf 100644 --- a/xen/drivers/passthrough/amd/iommu_guest.c +++ b/xen/drivers/passthrough/amd/iommu_guest.c @@ -87,7 +87,7 @@ static uint64_t dte_get_gcr3_table(const struct amd_iommu= _dte *dte) static void dte_set_gcr3_table(struct amd_iommu_dte *dte, uint16_t dom_id, uint64_t addr, bool gv, uint8_t glx) { -#define GCR3_MASK(hi, lo) (((1ul << ((hi) + 1)) - 1) & ~((1ul << (lo)) - 1= )) +#define GCR3_MASK(hi, lo) (((1UL << ((hi) + 1)) - 1) & ~((1UL << (lo)) - 1= )) =20 /* I bit must be set when gcr3 is enabled */ dte->i =3D true; diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthro= ugh/amd/iommu_map.c index 993bac6f88..daa24a4858 100644 --- a/xen/drivers/passthrough/amd/iommu_map.c +++ b/xen/drivers/passthrough/amd/iommu_map.c @@ -838,7 +838,7 @@ int cf_check amd_iommu_quarantine_init(struct pci_dev *= pdev, bool scratch_page) { struct domain_iommu *hd =3D dom_iommu(dom_io); unsigned long end_gfn =3D - 1ul << (DEFAULT_DOMAIN_ADDRESS_WIDTH - PAGE_SHIFT); + 1UL << (DEFAULT_DOMAIN_ADDRESS_WIDTH - PAGE_SHIFT); unsigned int level =3D amd_iommu_get_paging_mode(end_gfn); unsigned int req_id =3D get_dma_requestor_id(pdev->seg, pdev->sbdf.bdf= ); const struct ivrs_mappings *ivrs_mappings =3D get_ivrs_mappings(pdev->= seg); diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/pass= through/amd/pci_amd_iommu.c index 94e3775506..bea70db4b7 100644 --- a/xen/drivers/passthrough/amd/pci_amd_iommu.c +++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c @@ -368,7 +368,7 @@ static int cf_check amd_iommu_domain_init(struct domain= *d) */ hd->arch.amd.paging_mode =3D max(amd_iommu_get_paging_mode( is_hvm_domain(d) - ? 1ul << (DEFAULT_DOMAIN_ADDRESS_WIDTH - PAGE_SHIFT) + ? 1UL << (DEFAULT_DOMAIN_ADDRESS_WIDTH - PAGE_SHIFT) : get_upper_mfn_bound() + 1), amd_iommu_min_paging_mode); =20 --=20 2.34.1