From nobody Mon Feb 9 14:34:32 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 1689158060431234.8796360495328; Wed, 12 Jul 2023 03:34:20 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.562203.878811 (Exim 4.92) (envelope-from ) id 1qJXAN-0006aK-Tg; Wed, 12 Jul 2023 10:33:51 +0000 Received: by outflank-mailman (output) from mailman id 562203.878811; Wed, 12 Jul 2023 10:33: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 1qJXAN-0006Zi-Ox; Wed, 12 Jul 2023 10:33:51 +0000 Received: by outflank-mailman (input) for mailman id 562203; Wed, 12 Jul 2023 10:33: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 1qJXAM-0006Dd-Nu for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:33:50 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 96d0c3b8-209f-11ee-b239-6b7b168915f2; Wed, 12 Jul 2023 12:33:49 +0200 (CEST) Received: from beta.bugseng.com (unknown [37.161.151.90]) by support.bugseng.com (Postfix) with ESMTPSA id 7E7F34EE0C8A; Wed, 12 Jul 2023 12:33:48 +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: 96d0c3b8-209f-11ee-b239-6b7b168915f2 From: Simone Ballarin To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Gianluca Luparini , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu , Stefano Stabellini , Michal Orzel , Xenia Ragiadakou , Ayan Kumar Halder , Simone Ballarin Subject: [XEN PATCH v3 03/15] x86/svm: fix violations of MISRA C:2012 Rule 7.2 Date: Wed, 12 Jul 2023 12:32:04 +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: 1689158062536100013 Content-Type: text/plain; charset="utf-8" From: Gianluca Luparini The xen sources contains violations of MISRA C:2012 Rule 7.2 whose headline states: "A 'u' or 'U' suffix shall be applied to all integer constants that are represented in an unsigned type". Add the 'U' suffix to integers literals with unsigned type and also to other literals used in the same contexts or near violations, when their positive nature is immediately clear. The latter changes are done for the sake of uniformity. Signed-off-by: Gianluca Luparini Signed-off-by: Simone Ballarin Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- Changes in v3: - change 'Signed-off-by' ordering Changes in v2: - change commit title to make it unique - change commit message --- xen/arch/x86/hvm/svm/asid.c | 2 +- xen/arch/x86/hvm/svm/svm.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/hvm/svm/asid.c b/xen/arch/x86/hvm/svm/asid.c index 09f8c23fd9..56306d1a16 100644 --- a/xen/arch/x86/hvm/svm/asid.c +++ b/xen/arch/x86/hvm/svm/asid.c @@ -16,7 +16,7 @@ void svm_asid_init(const struct cpuinfo_x86 *c) =20 /* Check for erratum #170, and leave ASIDs disabled if it's present. */ if ( !cpu_has_amd_erratum(c, AMD_ERRATUM_170) ) - nasids =3D cpuid_ebx(0x8000000A); + nasids =3D cpuid_ebx(0x8000000AU); =20 hvm_asid_init(nasids); } diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index 59a6e88dff..56cb2f61bb 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -269,9 +269,9 @@ svm_msrbit(unsigned long *msr_bitmap, uint32_t msr) */ if ( msr <=3D 0x1fff ) msr_bit =3D msr_bitmap + 0x0000 / BYTES_PER_LONG; - else if ( (msr >=3D 0xc0000000) && (msr <=3D 0xc0001fff) ) + else if ( (msr >=3D 0xc0000000U) && (msr <=3D 0xc0001fffU) ) msr_bit =3D msr_bitmap + 0x0800 / BYTES_PER_LONG; - else if ( (msr >=3D 0xc0010000) && (msr <=3D 0xc0011fff) ) + else if ( (msr >=3D 0xc0010000U) && (msr <=3D 0xc0011fffU) ) msr_bit =3D msr_bitmap + 0x1000 / BYTES_PER_LONG; =20 return msr_bit; @@ -2539,8 +2539,8 @@ const struct hvm_function_table * __init start_svm(vo= id) =20 setup_vmcb_dump(); =20 - if ( boot_cpu_data.extended_cpuid_level >=3D 0x8000000a ) - svm_feature_flags =3D cpuid_edx(0x8000000a); + if ( boot_cpu_data.extended_cpuid_level >=3D 0x8000000aU ) + svm_feature_flags =3D cpuid_edx(0x8000000aU); =20 printk("SVM: Supported advanced features:\n"); =20 --=20 2.41.0