From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web08.1479.1664583357048268382 for ; Fri, 30 Sep 2022 17:15:57 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=lMXywfmT; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: ray.ni@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664583357; x=1696119357; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=deg9kAHiJmFp8eEpT0GHoDhxMHGCgbp5RHCIZiIbHxE=; b=lMXywfmTvVO1tJTznSRLYEE8fyVoR7K5UORY40G1CAdKYhQi4Z4rlxzt +Y8vp0p22W61Sa6Tk7kDyBqLd6TalzZ/y9hKDHiSdGHwnqrzc0ev4ZwYX /v3baL4WzMXvu0WL7I6eucl7cmX1YK2WK11y2Cgs2CjuHq8CtDeo1OiPs Y/DZK1aXM7sXTjqSOGE2hK3KFaA78aLY1/hz3jSYCAb3dVZO+w5GIcHU6 nDIdMa6VkuWMJuJFxR8nYe3ME2vCaQoOtK4b716WBpRC+zD69kaLjl7Jj 8r1+jkJkwFWBK4HPBzzo5eA627OFOs3Z0gbdsMPFnjfujzP+eO/XLBmch g==; X-IronPort-AV: E=McAfee;i="6500,9779,10486"; a="282687527" X-IronPort-AV: E=Sophos;i="5.93,359,1654585200"; d="scan'208";a="282687527" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Sep 2022 17:15:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10486"; a="574039509" X-IronPort-AV: E=Sophos;i="5.93,359,1654585200"; d="scan'208";a="574039509" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga003.jf.intel.com with ESMTP; 30 Sep 2022 17:15:47 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 30 Sep 2022 17:15:46 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Fri, 30 Sep 2022 17:15:46 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.109) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Fri, 30 Sep 2022 17:15:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mNmDXG73x+kWOlXToPmj6X4hFgbkiR91dzU0ymLXa5KEvcszKlbXcx6YWWKFfaA3j3sQlfKCvzzh3eoux8IZSzjQjd4Plf83SJuRBombwLM2cjxNJB+LQCVCEJW+mBv+y9W5M3YUVSsA2V5GiFqdds3xr51NxbLOJHiH2V/uCpg+b4SzhpatO7/wF6ltDMBkqe0x4cxt2tByp8sdCH1mYwqJ9yOAe+tejfvV3VtBf9pbvWlzdFZFNXzwqiBy7zhguT9PG04wNxesaTtwrUDRnFXYwC6P6qnUCGTTG2bzP8RWcJ48jNs0V6MrDwZFypuy73upS+rtL2x6028kSd8EkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fRV3V3d3PFEBawVAhqpwgGmWDKmkpCEfet35lVZoPXM=; b=nKxPrGcaS8isNaTSd+XLXivHWfWb2SpHw1YGH9CWRJrRjgX+8S4FTAeZzx7s8B8xpJlrGbPz9ZYkqi1a6pP0qMTfNHfZQ7wkqSDFLF7sYJf9Ci/igedhTTRi73N3Zzq7atHEDZV0gpbXcAvS+tNPd4n02iXPZSOp8Px1a2nU3P3Wm7rL/nadrSdOmS0Tm412nkgpfW/Auv4qTmGI+gb6orO3k1XLX7NjzFVoldrq/WobzS4x6eicXpYB1uZHOmuK4UTXu/iTwnAOTHMFmkkQLygOYCvAeOYkcaa7PRF83n0zU1P2C81/fbaTzMBCPWTqlZN8hWJExGH5Ya/as45E4g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from MWHPR11MB1631.namprd11.prod.outlook.com (2603:10b6:301:10::10) by SJ0PR11MB4911.namprd11.prod.outlook.com (2603:10b6:a03:2ad::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Sat, 1 Oct 2022 00:15:43 +0000 Received: from MWHPR11MB1631.namprd11.prod.outlook.com ([fe80::483f:4bb5:a15f:f571]) by MWHPR11MB1631.namprd11.prod.outlook.com ([fe80::483f:4bb5:a15f:f571%11]) with mapi id 15.20.5676.023; Sat, 1 Oct 2022 00:15:43 +0000 From: "Ni, Ray" To: "devel@edk2.groups.io" , "dionnaglaze@google.com" CC: Gerd Hoffmann , "Xu, Min M" , James Bottomley , "Yao, Jiewen" , Tom Lendacky , Ard Biesheuvel , Andrew Fish , "Kinney, Michael D" Subject: Re: [edk2-devel] [PATCH v5 2/7] MdePkg: Introduce ExitBootServicesCallbackProtocol Thread-Topic: [edk2-devel] [PATCH v5 2/7] MdePkg: Introduce ExitBootServicesCallbackProtocol Thread-Index: AQHY1SFemNm9mMzC2UK1EPtkAraRTa34q4Xh Date: Sat, 1 Oct 2022 00:15:42 +0000 Message-ID: References: <20220930230627.3371754-1-dionnaglaze@google.com> <20220930230627.3371754-3-dionnaglaze@google.com> In-Reply-To: <20220930230627.3371754-3-dionnaglaze@google.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MWHPR11MB1631:EE_|SJ0PR11MB4911:EE_ x-ms-office365-filtering-correlation-id: 01612684-66a6-4d43-4e88-08daa3421430 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ZY6Ey51PScnAAb2vYJ2SpqYPViDuFGiRE7GKCkXz2ueAzerdwbWZKpVW1BLuVCgVn2c30rITrIiwVaC10fMe48Qcyt9+kk4HHgvMGZvcc3Nz3dZ3jm2evB4wa7zN8F7v52M2fIoRp6BxCfY3UTww3Crngb3iHVlIvuRONI5nnot39ydMekLI5Uh94Ims74cpC8/dQVhxNYJeAJpYeEItteRR/IyJdeKOLsxXpAPcM2d2l4u6Gfd2iXONzBgCm3gi0+Dche935ep8nngUoVaA92U6Ttba3bkpyBh7NdXWOI94bcZAeniRuYeiY3ghcWWO/UBKF20kIOPmCzoS2wNwumTcyEoWTgHSxVbnpdWqf9RCMxGgQKbhL1NHTF2TFH8KF5JYH0CnMVtI3RT+Rz6V+r+4/7Ag/4LuksPEgTRt+Gh3ZHp9/MtokAvKz3QWg9vgF9jLaTjM+fQsIeUijDQgrAtvzl0RxXK/Rkw7dBS/FJ2rPGm+wc1MjJywpDcBbVkN1MMZS2Ai92y44jcegY3C5GJl+tV99lOdDFzK1f9zme1wwa8hYQSdvAkj1oHA3nZUUQdWSroCLzal2js2IeftvyZlc3W6owdNf62E6DxcBoP3H026XLLgiDQMKOizNqOxH0wqCY5t0EmqgS+RBWyJQi4krJOwEalc3oKo3WPIOQK6Gp41eAPTSFtgbRPS47cTSlJZkdBcfWTppM7LvQi0pEg3q+GT5nhenn5ToLiCTWrhBqlrdb5mdp8YklsD5pGeBrTZfVTjCbOI0eTMr4HGpgk7BM5lGZdpYZBrfyBdICKLgNR9+cQsahDHKYGnfowD3aiWmo2cVJBGsDxC0LwWmISsNe604ybOd/ek4tBib90= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR11MB1631.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(366004)(376002)(39860400002)(346002)(396003)(451199015)(107886003)(2906002)(38100700002)(26005)(8936002)(33656002)(52536014)(4326008)(91956017)(76116006)(9686003)(53546011)(54906003)(66556008)(66446008)(64756008)(8676002)(66946007)(110136005)(122000001)(86362001)(6506007)(186003)(5660300002)(316002)(7696005)(66476007)(41300700001)(478600001)(55016003)(966005)(66899015)(38070700005)(83380400001)(71200400001)(82960400001)(213903007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?V8qA9X1p4KsU7h8NN5aOgJ2pMnR/gRPuxvy+AjlJ+yh0QwNQmPsMGHIUTTMW?= =?us-ascii?Q?1EIyD9Shtd+Rc9ADvAFOS1sVrLqNklEP01jkzXv9165HxsZE60eRu1ENBsYP?= =?us-ascii?Q?Srq25I4ulvR9x+k2mvC4HGGe7TrIKX0LJZBBox4Zwa8c3SnZw/6J7UJXhnJO?= =?us-ascii?Q?m5NbvXTQffC6DqFhbmd/seUI63NZ8Od97v9mV7a117moMLn0SahC84vVjGYG?= =?us-ascii?Q?85cNe8INhtpku1bgAJLafV1lSGzkxjRY90R7SUo3KqA0uFF+w5RYWYY1IVb4?= =?us-ascii?Q?a7x5gzNugSihMU61cCJ1dcFl7B+16Roojukj6fst+67oFDO72kSVcQZ9Kuiq?=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0kqfvQNPuCWwbNNFnqRjiotN376ih?= =?us-ascii?Q?PFgQfzZaIq/no2sKEjxPqmpR3nj+UvRjVY3AXENsPSyfYMDpnHXu8hiFdh4V?= =?us-ascii?Q?nghjZ6XEAzf5t9Nm6QDt+3rYnRXSmsrvgOqmfyxIPrQCHmKOou38YQqsXnfq?= =?us-ascii?Q?9nklTyM7N4K4Xz8NzgkouLXh0TyfQXaSkYLcfBUKms/Oy4ULiSjqWdDspq//?= =?us-ascii?Q?FLuq4RRcuwIIxUEE1tBLgRhaYrLkdOIrGKMGhcGXlEJKgvCCKOBMJiqeCP44?= =?us-ascii?Q?fb/xWAxev9bGbms74joLhXYigIONVZOj2ArFv7UTjxighSZWTOQqh9i3e77z?= =?us-ascii?Q?Zb5eYBfCEWaxJMbbXog=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1631.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 01612684-66a6-4d43-4e88-08daa3421430 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Oct 2022 00:15:42.8069 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ux/3iA3YxfBPtUTf2/eTIwcmarzuL555SMK/LVslxN0gZXau/XlFHebbVADSEl2j8n3KAc3fTclI9SuWg2HWKA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4911 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Is it defined by UEFI Spec? ________________________________________ From: devel@edk2.groups.io on behalf of Dionna Glaze= via groups.io Sent: Saturday, October 1, 2022 7:06 To: devel@edk2.groups.io Cc: Dionna Glaze; Gerd Hoffmann; Xu, Min M; James Bottomley; Yao, Jiewen; T= om Lendacky; Ard Biesheuvel; Andrew Fish; Kinney, Michael D Subject: [edk2-devel] [PATCH v5 2/7] MdePkg: Introduce ExitBootServicesCall= backProtocol This introduces a callback after the time that the timer is disabled and be= fore the MemoryMap is finalized. This callback is useful to make final changes to the memory map due to prot= ocols initiated (or not initiated) by the OS loader. Cc: Gerd Hoffmann Cc: "Min M. Xu" Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Ard Biesheuvel Cc: Andrew Fish Cc: "Michael D. Kinney" Signed-off-by: Dionna Glaze --- MdePkg/Include/Protocol/ExitBootServicesCallback.h | 38 ++++++++++++++++++= ++ MdePkg/MdePkg.dec | 3 ++ 2 files changed, 41 insertions(+) diff --git a/MdePkg/Include/Protocol/ExitBootServicesCallback.h b/MdePkg/In= clude/Protocol/ExitBootServicesCallback.h new file mode 100644 index 0000000000..d21d7700f7 --- /dev/null +++ b/MdePkg/Include/Protocol/ExitBootServicesCallback.h @@ -0,0 +1,38 @@ +/** @file + The file provides the protocol that allows callbacks in ExitBootServices + immediately before TerminateMemoryMap. + + Copyright (c) 2022, Google LLC. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef EXIT_BOOT_SERVICES_CALLBACK_H_ +#define EXIT_BOOT_SERVICES_CALLBACK_H_ + +/* This protocol is internal to EDK2 only */ + +#define EDKII_EXIT_BOOT_SERVICES_CALLBACK_PROTOCOL_GUID {0xf5684799, = 0x9a33, = 0x40f7, = {0xa1, 0x5c, 0x10, 0x8e, 0x0e, 0x6b, 0x45, 0x25}} + +typedef struct _EDKII_EXIT_BOOT_SERVICES_CALLBACK_PROTOCOL + EDKII_EXIT_BOOT_SERVICES_CALLBACK_PROTOCOL; + +/** + @param This A pointer to a EDKII_EXIT_BOOT_SERVICES_CALLBACK_PROTOCOL. +**/ +typedef +EFI_STATUS +(EFIAPI *EDKII_TERMINATE_MEMORY_MAP_PREHOOK)( + IN EDKII_EXIT_BOOT_SERVICES_CALLBACK_PROTOCOL *This + ); + +/// +/// The EDKII_EXIT_BOOT_SERVICES_CALLBACK_PROTOCOL allows callbacks in +/// ExitBootServices immediately before TerminateMemoryMap. +/// +struct _EDKII_EXIT_BOOT_SERVICES_CALLBACK_PROTOCOL { + EDKII_TERMINATE_MEMORY_MAP_PREHOOK TerminateMemoryMapPrehook; + BOOLEAN Disabled; +}; + +extern EFI_GUID gEdkiiExitBootServicesCallbackProtocolGuid; + +#endif diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index de3c56758b..43b099b396 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -1019,6 +1019,9 @@ gEfiPeiDelayedDispatchPpiGuid =3D { 0x869c711d, 0x649c, 0x44fe, { 0x8b,= 0x9e, 0x2c, 0xbb, 0x29, 0x11, 0xc3, 0xe6 }} [Protocols] + ## Include/Protocol/ExitBootServicesCallback.h + gEdkiiExitBootServicesCallbackProtocolGuid =3D { 0xf5684799, 0x9a33, 0x4= 0f7, {0xa1, 0x5c, 0x10, 0x8e, 0x0e, 0x6b, 0x45, 0x25 }} + ## Include/Protocol/MemoryAccept.h gEfiMemoryAcceptProtocolGuid =3D { 0x38c74800, 0x5590, 0x4db4, { 0xa0,= 0xf3, 0x67, 0x5d, 0x9b, 0x8e, 0x80, 0x26 }} -- 2.38.0.rc1.362.ged0d419d3c-goog