From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web09.27883.1654484468358335759 for ; Sun, 05 Jun 2022 20:01:09 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=OJ9f+k7M; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: min.m.xu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654484469; x=1686020469; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WiWNGqWQrodcJXJTVW+IWYUR6+HKHKVnIdad3B0ebmk=; b=OJ9f+k7MWY15LGP4Zm8uyZP9zPHeaCXM86U67O2nK0X6wN5GrYFjpD8X Gw7og8/teu883STmyWRQ7anK25B9zc35wI+Uz8fxsSgKmi/rK3Etl5piz Zg16OBaghTOwX95+Dcur8ENTedVrjjO75rmFOegsMj6/HN84vgw8PFE10 r27Z2FQz0gv4iLl7p9tdJgkxTshUhMJQ75x+CNDYDnwvLdWnlIdt7yRHA s4zpe+yBXPSbUkT4bxsr00Csn5Urhdze/B066QxYQoo4wI2Gna3gRWRZP rnZxMG8cWA1p+yE2qKdsJl3QubfzUtZgo4B5d9XVN3LsriKKkBqxekVwn A==; X-IronPort-AV: E=McAfee;i="6400,9594,10369"; a="276458168" X-IronPort-AV: E=Sophos;i="5.91,280,1647327600"; d="scan'208";a="276458168" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2022 20:00:48 -0700 X-IronPort-AV: E=Sophos;i="5.91,280,1647327600"; d="scan'208";a="647285852" Received: from mxu9-mobl1.ccr.corp.intel.com ([10.255.29.66]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2022 20:00:45 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Jiaqi Gao , Michael D Kinney , Liming Gao , Zhiguang Liu , Erdem Aktas , Gerd Hoffmann , James Bottomley , Jiewen Yao , Tom Lendacky , Min Xu Subject: [PATCH 12/14] MdePkg: The prototype definition of EfiMemoryAcceptProtocol Date: Mon, 6 Jun 2022 11:00:00 +0800 Message-Id: X-Mailer: git-send-email 2.29.2.windows.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Jiaqi Gao RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3937 EfiMemoryAcceptProtocol is defined in MdePkg, the method AcceptMemory() can be called when memory needs to be accepted. EfiMemoryAcceptProtocol can be installed by architecture-specific drivers such as TdxDxe.This allows different isolation architectures to realize their own low-level methods to accept memory. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Erdem Aktas Cc: Gerd Hoffmann Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Signed-off-by: Jiaqi Gao Signed-off-by: Min Xu --- MdePkg/Include/Protocol/MemoryAccept.h | 37 ++++++++++++++++++++++++++ MdePkg/MdePkg.dec | 3 +++ 2 files changed, 40 insertions(+) create mode 100644 MdePkg/Include/Protocol/MemoryAccept.h diff --git a/MdePkg/Include/Protocol/MemoryAccept.h b/MdePkg/Include/Protocol/MemoryAccept.h new file mode 100644 index 000000000000..27b43ce81126 --- /dev/null +++ b/MdePkg/Include/Protocol/MemoryAccept.h @@ -0,0 +1,37 @@ +/** @file + The file provides the protocol to provide interface to accept memory. + + Copyright (c) 2021 - 2022, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef MEMORY_ACCEPT_H_ +#define MEMORY_ACCEPT_H_ + +#define EFI_MEMORY_ACCEPT_PROTOCOL_GUID \ + { 0x38c74800, 0x5590, 0x4db4, { 0xa0, 0xf3, 0x67, 0x5d, 0x9b, 0x8e, 0x80, 0x26 } }; + +typedef struct _EFI_MEMORY_ACCEPT_PROTOCOL EFI_MEMORY_ACCEPT_PROTOCOL; + +/** + @param This A pointer to a MEMORY_ACCEPT_PROTOCOL. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_ACCEPT_MEMORY)( + IN EFI_MEMORY_ACCEPT_PROTOCOL *This, + IN EFI_PHYSICAL_ADDRESS StartAddress, + IN UINTN Size + ); + +/// +/// The MEMORY_ACCEPT_PROTOCOL provides the ability for memory services +/// to accept memory. +/// +struct _EFI_MEMORY_ACCEPT_PROTOCOL { + EFI_ACCEPT_MEMORY AcceptMemory; +}; + +extern EFI_GUID gEfiMemoryAcceptProtocolGuid; + +#endif diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index f1ebf9e251c1..de3c56758b95 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -1019,6 +1019,9 @@ gEfiPeiDelayedDispatchPpiGuid = { 0x869c711d, 0x649c, 0x44fe, { 0x8b, 0x9e, 0x2c, 0xbb, 0x29, 0x11, 0xc3, 0xe6 }} [Protocols] + ## Include/Protocol/MemoryAccept.h + gEfiMemoryAcceptProtocolGuid = { 0x38c74800, 0x5590, 0x4db4, { 0xa0, 0xf3, 0x67, 0x5d, 0x9b, 0x8e, 0x80, 0x26 }} + ## Include/Protocol/Pcd.h gPcdProtocolGuid = { 0x11B34006, 0xD85B, 0x4D0A, { 0xA2, 0x90, 0xD5, 0xA5, 0x71, 0x31, 0x0E, 0xF7 }} -- 2.29.2.windows.2