From nobody Sat Sep 21 05:31:32 2024 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+98404+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+98404+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1673568888; cv=none; d=zohomail.com; s=zohoarc; b=SasmrxaIyVKUhsu+itsw870eQ0lNx4hK0IvzemTfJj4RnPZshHlNVBxB6prKuyBXlJLX99x8lKXpXgPrTBVKcXH5AH6Wh87bGCbYzMX56w1fbbqnPVJQJSGvNc1sMb5c/JUzbKIu1ha6Z1WzJ08QKUg8zvhBd0R1Y+dJfKnKrZ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673568888; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=6Khkr5DYtrI1PVxNtD/cu99wyK7IsjONosOisuA5/gU=; b=UqbEdrz9BdiwXYckunHoyuwbNORSWOPWicQFsBZgfo18WMFmeAntkXPBu3v41DNMxFNI71Etk8nPXYh5dcQag7/8JjEEk9PoO9MgHSTDBB9NMclKE1l/tuK7vh8HonSBs0L0sdTHV8DxNhZViQGj2aCGdXFo0W3ScuVJEZQ4a2g= 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+98404+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1673568888799171.47419015700984; Thu, 12 Jan 2023 16:14:48 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id SMI9YY1788612xPSPaZyMR7L; Thu, 12 Jan 2023 16:14:48 -0800 X-Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) by mx.groups.io with SMTP id smtpd.web10.73512.1673568887825865822 for ; Thu, 12 Jan 2023 16:14:47 -0800 X-Received: by mail-yb1-f201.google.com with SMTP id n203-20020a2572d4000000b0078f09db9888so21056968ybc.18 for ; Thu, 12 Jan 2023 16:14:47 -0800 (PST) X-Gm-Message-State: SSTDMZn5QJVsLMft7UBMdGdCx1787277AA= X-Google-Smtp-Source: AMrXdXsZux/wW9iKD0rDS1Scj73klVryYIAcUUDzmyZ5T27pePthrVrUZul7zIkySUUdNVeleqt7J6rp64aVAYy5AQ== X-Received: from dionnaglaze.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2ee6]) (user=dionnaglaze job=sendgmr) by 2002:a05:6902:11c6:b0:6fe:3d7f:d04a with SMTP id n6-20020a05690211c600b006fe3d7fd04amr8202121ybu.617.1673568887042; Thu, 12 Jan 2023 16:14:47 -0800 (PST) Date: Fri, 13 Jan 2023 00:14:17 +0000 In-Reply-To: <20230113001419.2519031-1-dionnaglaze@google.com> Mime-Version: 1.0 References: <20230113001419.2519031-1-dionnaglaze@google.com> Message-ID: <20230113001419.2519031-3-dionnaglaze@google.com> Subject: [edk2-devel] [PATCH v9 2/4] MdePkg: Introduce the MemoryAcceptance protocol From: "Dionna Glaze via groups.io" To: devel@edk2.groups.io Cc: Dionna Glaze , Gerd Hoffmann , James Bottomley , Jiewen Yao , Tom Lendacky , Ard Biesheuvel , "Min M. Xu" , Andrew Fish , "Michael D. Kinney" Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,dionnaglaze@google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1673568888; bh=FbpGv5heP5jmfhoFRBLy3kXY4DaoOdewpfJ+e0GiCes=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=G3vr3i64Lau+XMkz/ZBUNyt+j8bk1jE4PwXU7/4nAxly0GLvxU9C6usIbFlxoRTJ6P6 5rS46RFBfRccj5qy27tJTPJqwtVgB5OXMVCeRYDeANqiMBiPKQR16OsyBqBTGXVwaH4KY 1zt0o9CHqVqBEtxreBw0U2U7pSNAIEpG8Mw= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1673568889799100011 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The default behavior for unaccepted memory is to accept all memory when ExitBootServices is called. An OS loader can use this protocol to disable this behavior to assume responsibility for memory acceptance and to affirm that the OS can handle the unaccepted memory type. This is a candidate for standardization. Cc: Gerd Hoffmann Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Ard Biesheuvel Cc: "Min M. Xu" Cc: Andrew Fish Cc: "Michael D. Kinney" Signed-off-by: Dionna Glaze --- MdePkg/Include/Protocol/MemoryAcceptance.h | 40 ++++++++++++++++++++++ MdePkg/MdePkg.dec | 3 ++ 2 files changed, 43 insertions(+) create mode 100644 MdePkg/Include/Protocol/MemoryAcceptance.h diff --git a/MdePkg/Include/Protocol/MemoryAcceptance.h b/MdePkg/Include/Pr= otocol/MemoryAcceptance.h new file mode 100644 index 0000000000..0b305b016f --- /dev/null +++ b/MdePkg/Include/Protocol/MemoryAcceptance.h @@ -0,0 +1,40 @@ +/** @file + The file provides the protocol that disables the behavior that all memory + gets accepted at ExitBootServices(). This protocol is only meant to be c= alled + by the OS loader, and not EDK2 itself. + + Copyright (c) 2022, Google LLC. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef MEMORY_ACCEPTANCE_H_ +#define MEMORY_ACCEPTANCE_H_ + +#define BZ3987_MEMORY_ACCEPTANCE_PROTOCOL_GUID \ + {0xc5a010fe, \ + 0x38a7, \ + 0x4531, \ + {0x8a, 0x4a, 0x05, 0x00, 0xd2, 0xfd, 0x16, 0x49}} + +typedef struct _BZ3987_MEMORY_ACCEPTANCE_PROTOCOL BZ3987_MEMORY_ACCEPTANCE= _PROTOCOL; + +/** + @param This A pointer to a BZ3987_MEMORY_ACCEPTANCE_PROTOCOL. +**/ +typedef + EFI_STATUS +(EFIAPI *BZ3987_ALLOW_UNACCEPTED_MEMORY)( + IN BZ3987_MEMORY_ACCEPTANCE_PROTOCOL *This + ); + +/// +/// The BZ3987_MEMORY_ACCEPTANCE_PROTOCOL allows the OS loader to +/// indicate to EDK2 that ExitBootServices should not accept all memory. +/// +struct _BZ3987_MEMORY_ACCEPTANCE_PROTOCOL { + BZ3987_ALLOW_UNACCEPTED_MEMORY AllowUnacceptedMemory; +}; + +extern EFI_GUID gBz3987MemoryAcceptanceProtocolGuid; + +#endif diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 3d08f20d15..bc3d897248 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -1031,6 +1031,9 @@ gEfiPeiDelayedDispatchPpiGuid =3D { 0x869c711d, 0x649c, 0x44fe, { 0x8b,= 0x9e, 0x2c, 0xbb, 0x29, 0x11, 0xc3, 0xe6 }} =20 [Protocols] + ## Include/Protocol/Bz3987MemoryAcceptance.h + gBz3987MemoryAcceptanceProtocolGuid =3D { 0xc5a010fe, 0x38a7, 0x4531, {0= x8a, 0x4a, 0x05, 0x00, 0xd2, 0xfd, 0x16, 0x49 }} + ## Include/Protocol/MemoryAccept.h gEdkiiMemoryAcceptProtocolGuid =3D { 0x38c74800, 0x5590, 0x4db4, { 0xa0,= 0xf3, 0x67, 0x5d, 0x9b, 0x8e, 0x80, 0x26 }} =20 --=20 2.39.0.314.g84b9a713c41-goog -=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 (#98404): https://edk2.groups.io/g/devel/message/98404 Mute This Topic: https://groups.io/mt/96236150/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-