From nobody Mon Feb 9 06:28:00 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 1691058465112692.4164974002905; Thu, 3 Aug 2023 03:27:45 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.576204.902118 (Exim 4.92) (envelope-from ) id 1qRVY6-0000bK-Pu; Thu, 03 Aug 2023 10:27:18 +0000 Received: by outflank-mailman (output) from mailman id 576204.902118; Thu, 03 Aug 2023 10:27:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qRVY6-0000b6-MP; Thu, 03 Aug 2023 10:27:18 +0000 Received: by outflank-mailman (input) for mailman id 576204; Thu, 03 Aug 2023 10:27:18 +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 1qRVY6-0000aV-3w for xen-devel@lists.xenproject.org; Thu, 03 Aug 2023 10:27:18 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 513cee2c-31e8-11ee-8613-37d641c3527e; Thu, 03 Aug 2023 12:27:16 +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 752E24EE0737; Thu, 3 Aug 2023 12:27:15 +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: 513cee2c-31e8-11ee-8613-37d641c3527e From: Simone Ballarin To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Gianluca Luparini , Jan Beulich , Andrew Cooper , George Dunlap , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu , Simone Ballarin Subject: [XEN PATCH 09/13] x86/mm: address violations of MISRA C:2012 Rule 7.3 Date: Thu, 3 Aug 2023 12:22:24 +0200 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: 1691058465659100001 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/arch/x86/mm/p2m-pt.c | 6 +++--- xen/arch/x86/mm/p2m.c | 20 ++++++++++---------- xen/arch/x86/mm/physmap.c | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c index 6d1bb5daad..b2b14746c1 100644 --- a/xen/arch/x86/mm/p2m-pt.c +++ b/xen/arch/x86/mm/p2m-pt.c @@ -552,7 +552,7 @@ static void check_entry(mfn_t mfn, p2m_type_t new, p2m_= type_t old, if ( new =3D=3D p2m_mmio_direct ) ASSERT(!mfn_eq(mfn, INVALID_MFN) && !rangeset_overlaps_range(mmio_ro_ranges, mfn_x(mfn), - mfn_x(mfn) + (1ul << order))); + mfn_x(mfn) + (1UL << order))); else if ( p2m_allows_invalid_mfn(new) || new =3D=3D p2m_invalid || new =3D=3D p2m_mmio_dm ) ASSERT(mfn_valid(mfn) || mfn_eq(mfn, INVALID_MFN)); @@ -745,9 +745,9 @@ p2m_pt_set_entry(struct p2m_domain *p2m, gfn_t gfn_, mf= n_t mfn, if ( need_iommu_pt_sync(p2m->domain) && (iommu_old_flags !=3D iommu_pte_flags || old_mfn !=3D mfn_x(mfn))= ) rc =3D iommu_pte_flags - ? iommu_legacy_map(d, _dfn(gfn), mfn, 1ul << page_order, + ? iommu_legacy_map(d, _dfn(gfn), mfn, 1UL << page_order, iommu_pte_flags) - : iommu_legacy_unmap(d, _dfn(gfn), 1ul << page_order); + : iommu_legacy_unmap(d, _dfn(gfn), 1UL << page_order); =20 /* * Free old intermediate tables if necessary. This has to be the diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index f6df35767a..0983bd71d9 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -392,7 +392,7 @@ int p2m_set_entry(struct p2m_domain *p2m, gfn_t gfn, mf= n_t mfn, unsigned int page_order, p2m_type_t p2mt, p2m_access_t p= 2ma) { bool hap =3D hap_enabled(p2m->domain); - unsigned long todo =3D 1ul << page_order; + unsigned long todo =3D 1UL << page_order; int set_rc, rc =3D 0; =20 ASSERT(gfn_locked_by_me(p2m, gfn)); @@ -401,10 +401,10 @@ int p2m_set_entry(struct p2m_domain *p2m, gfn_t gfn, = mfn_t mfn, { unsigned long fn_mask =3D (!mfn_eq(mfn, INVALID_MFN) ? mfn_x(mfn) = : 0) | gfn_x(gfn) | todo; - unsigned int order =3D (!(fn_mask & ((1ul << PAGE_ORDER_1G) - 1)) = && + unsigned int order =3D (!(fn_mask & ((1UL << PAGE_ORDER_1G) - 1)) = && hap && hap_has_1gb) ? PAGE_ORDER_1G - : (!(fn_mask & ((1ul << PAGE_ORDER_2M) - 1)) = && + : (!(fn_mask & ((1UL << PAGE_ORDER_2M) - 1)) = && (!hap || hap_has_2mb)) ? PAGE_ORDER_2M : PAGE_ORDER_4K; =20 @@ -412,10 +412,10 @@ int p2m_set_entry(struct p2m_domain *p2m, gfn_t gfn, = mfn_t mfn, if ( set_rc ) rc =3D set_rc; =20 - gfn =3D gfn_add(gfn, 1ul << order); + gfn =3D gfn_add(gfn, 1UL << order); if ( !mfn_eq(mfn, INVALID_MFN) ) - mfn =3D mfn_add(mfn, 1ul << order); - todo -=3D 1ul << order; + mfn =3D mfn_add(mfn, 1UL << order); + todo -=3D 1UL << order; } =20 return rc; @@ -1407,7 +1407,7 @@ void np2m_flush_base(struct vcpu *v, unsigned long np= 2m_base) struct p2m_domain *p2m; unsigned int i; =20 - np2m_base &=3D ~(0xfffull); + np2m_base &=3D ~(0xfffULL); =20 nestedp2m_lock(d); for ( i =3D 0; i < MAX_NESTEDP2M; i++ ) @@ -1456,7 +1456,7 @@ p2m_get_nestedp2m_locked(struct vcpu *v) bool needs_flush =3D true; =20 /* Mask out low bits; this avoids collisions with P2M_BASE_EADDR */ - np2m_base &=3D ~(0xfffull); + np2m_base &=3D ~(0xfffULL); =20 if (nv->nv_flushp2m && nv->nv_p2m) { nv->nv_p2m =3D NULL; @@ -1614,8 +1614,8 @@ unsigned long paging_gva_to_gfn(struct vcpu *v, * Sanity check that l1_gfn can be used properly as a 4K mapping, = even * if it mapped by a nested superpage. */ - ASSERT((l2_gfn & ((1ul << l1_page_order) - 1)) =3D=3D - (l1_gfn & ((1ul << l1_page_order) - 1))); + ASSERT((l2_gfn & ((1UL << l1_page_order) - 1)) =3D=3D + (l1_gfn & ((1UL << l1_page_order) - 1))); =20 return l1_gfn; } diff --git a/xen/arch/x86/mm/physmap.c b/xen/arch/x86/mm/physmap.c index f1695e456e..098ccdf541 100644 --- a/xen/arch/x86/mm/physmap.c +++ b/xen/arch/x86/mm/physmap.c @@ -72,7 +72,7 @@ int set_identity_p2m_entry(struct domain *d, unsigned lon= g gfn, if ( !is_iommu_enabled(d) ) return 0; return iommu_legacy_map(d, _dfn(gfn), _mfn(gfn), - 1ul << PAGE_ORDER_4K, + 1UL << PAGE_ORDER_4K, p2m_access_to_iommu_flags(p2ma)); } =20 @@ -85,7 +85,7 @@ int clear_identity_p2m_entry(struct domain *d, unsigned l= ong gfn) { if ( !is_iommu_enabled(d) ) return 0; - return iommu_legacy_unmap(d, _dfn(gfn), 1ul << PAGE_ORDER_4K); + return iommu_legacy_unmap(d, _dfn(gfn), 1UL << PAGE_ORDER_4K); } =20 return p2m_remove_identity_entry(d, gfn); --=20 2.34.1