From nobody Tue Feb 10 13:17:59 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+70362+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+70362+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1610691269; cv=none; d=zohomail.com; s=zohoarc; b=iOn0gAG/yRGTRAfCteoTWNE5MD0LAECvNhZTjmLZJH5qvFh86Y3On7fVn4hW3r4Bo3ugXoG2RL2j20F4FH1FCYiFhtXgMkP/C8HYPxw+7btsKnlFIwo17I+FRkeKi3LgXyqhsSXVzCnfVmFpXzKp//uAvIGs0EdxRuOpH+ss6Fg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610691269; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=XiTNiy4HXRXjmlfwZfO59oZugyiQjHvKgQGxkjIgkj0=; b=MWyOd2PTryHiP97hbTRJP3qz+P2obxDIkOFmG0efT0NqHMYv/2/3x3YVhmVhUnZsm/BCsPoK2nIY0Fqns51qd59AesEk/othTSLsJFg6nmiM+DDAu8Ds06aV9U/DPFSuLj8adexEexT66FqMkkj1L1pYtBB3DmfreEVyHEIzll8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+70362+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1610691269778794.0758899962324; Thu, 14 Jan 2021 22:14:29 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id roBtYY1788612xcflBT1kSPx; Thu, 14 Jan 2021 22:14:29 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web08.515.1610691268503626672 for ; Thu, 14 Jan 2021 22:14:28 -0800 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 33B6CED1; Thu, 14 Jan 2021 22:14:28 -0800 (PST) X-Received: from a076522.blr.arm.com (a076522.blr.arm.com [10.162.16.44]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 121293F70D; Thu, 14 Jan 2021 22:14:25 -0800 (PST) From: "Sughosh Ganu" To: devel@edk2.groups.io Cc: Sami Mujawar , Ard Biesheuvel , Leif Lindholm , Sahil Malhotra , Ilias Apalodimas , Sughosh Ganu Subject: [edk2-devel] [PATCH v3 05/13] StandaloneMmPkg: Add macros for SPM version Date: Fri, 15 Jan 2021 11:43:56 +0530 Message-Id: <20210115061404.13552-6-sughosh.ganu@linaro.org> In-Reply-To: <20210115061404.13552-1-sughosh.ganu@linaro.org> References: <20210115061404.13552-1-sughosh.ganu@linaro.org> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,sughosh.ganu@linaro.org X-Gm-Message-State: IdLJxicRLTfpznxfnuFaK5qZx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1610691269; bh=eV/4tKyTPqWEgctVeN47A6WvHTsk+saXmu60XhLklWg=; h=Cc:Date:From:Reply-To:Subject:To; b=mR3ooS1qXSOlYIWnVQR6PLNcAKEq/Y9OYAJZB3uMea5EbGS6dKIR22byyuNcvOUOhpZ McBRhFz0jvYHVCFo0x62OQc0i6rLiSWHz807VvxaIIJixowe8WmoDR4oCO6vX0rX6qWwm jKz6HakscGK9JV99WhvtUKUhXBI3FDbStfY= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Declare module wide variables for SPM major and minor versions to be used in checking the SPM version compatibility. Declare the the values of SPM major and minor versions as macros. Signed-off-by: Sughosh Ganu Reviewed-by: Sami Mujawar --- Changes since V2: * Added a STATIC storage class specifier for mSpmMajorVer and mSpmMinorVer variables ArmPkg/Include/IndustryStandard/ArmMmSvc.h = | 3 +++ StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCor= eEntryPoint.c | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ArmPkg/Include/IndustryStandard/ArmMmSvc.h b/ArmPkg/Include/In= dustryStandard/ArmMmSvc.h index ee29c2fecc..71a5398558 100644 --- a/ArmPkg/Include/IndustryStandard/ArmMmSvc.h +++ b/ArmPkg/Include/IndustryStandard/ArmMmSvc.h @@ -41,4 +41,7 @@ #define ARM_SVC_SPM_RET_DENIED -3 #define ARM_SVC_SPM_RET_NO_MEMORY -5 =20 +#define SPM_MAJOR_VERSION 0 +#define SPM_MINOR_VERSION 1 + #endif diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/Sta= ndaloneMmCoreEntryPoint.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPo= int/AArch64/StandaloneMmCoreEntryPoint.c index 3d78e8e9ae..2643473e88 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/Standalone= MmCoreEntryPoint.c +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/Standalone= MmCoreEntryPoint.c @@ -32,8 +32,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #define SPM_MINOR_VER_MASK 0x0000FFFF #define SPM_MAJOR_VER_SHIFT 16 =20 -#define SPM_MAJOR_VER 0 -#define SPM_MINOR_VER 1 +STATIC CONST UINT32 mSpmMajorVer =3D SPM_MAJOR_VERSION; +STATIC CONST UINT32 mSpmMinorVer =3D SPM_MINOR_VERSION; =20 #define BOOT_PAYLOAD_VERSION 1 =20 @@ -196,8 +196,8 @@ GetSpmVersion (VOID) // revision A must work in a compatible way with revision B. // However, it is possible for revision B to have a higher // function count than revision A. - if ((SpmMajorVersion =3D=3D SPM_MAJOR_VER) && - (SpmMinorVersion >=3D SPM_MINOR_VER)) + if ((SpmMajorVersion =3D=3D mSpmMajorVer) && + (SpmMinorVersion >=3D mSpmMinorVer)) { DEBUG ((DEBUG_INFO, "SPM Version: Major=3D0x%x, Minor=3D0x%x\n", SpmMajorVersion, SpmMinorVersion)); @@ -206,7 +206,7 @@ GetSpmVersion (VOID) else { DEBUG ((DEBUG_INFO, "Incompatible SPM Versions.\n Current Version: Maj= or=3D0x%x, Minor=3D0x%x.\n Expected: Major=3D0x%x, Minor>=3D0x%x.\n", - SpmMajorVersion, SpmMinorVersion, SPM_MAJOR_VER, SPM_MINOR_VER= )); + SpmMajorVersion, SpmMinorVersion, mSpmMajorVer, mSpmMinorVer)); Status =3D EFI_UNSUPPORTED; } =20 --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#70362): https://edk2.groups.io/g/devel/message/70362 Mute This Topic: https://groups.io/mt/79696442/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-