From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f201.google.com (mail-pg1-f201.google.com [209.85.215.201]) by mx.groups.io with SMTP id smtpd.web10.1458.1664823248375447311 for ; Mon, 03 Oct 2022 11:54:08 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@google.com header.s=20210112 header.b=BH2ZROO0; spf=pass (domain: flex--dionnaglaze.bounces.google.com, ip: 209.85.215.201, mailfrom: 3zy87ywskbtwbgmllyejyxcemmejc.amkbctcjcbi0.epmsnq.gm@flex--dionnaglaze.bounces.google.com) Received: by mail-pg1-f201.google.com with SMTP id r126-20020a632b84000000b004393806c06eso7450067pgr.4 for ; Mon, 03 Oct 2022 11:54:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date; bh=XP42uled2jFncsexDCtsSNv5lhAK5kz7TIy4kGw2zCk=; b=BH2ZROO0lIlPScSA79esGsN4UPfN7W/A1EkYk9K0dtreSmEj3uMwKDvjBUsP+7ayyW 5VgHit/DzQxRukhIWyCgOpk8Z7wqGxHmrvTHY8jzzudDmwRZBaDm7P2tP3/g4DIKlhmD xJDHDsUU/oxzQ86Kp6HeBzEWRb4MTalprsOTRGWHbfy3M6/ueGL14fxubfJltjQcL4NR KnwS77e1LLFkh/WLJYfSsR4OSmrShs0kXm/OMMSCXak9xKhNhyhbP57NnEu9rFu4fxfq 5R2R0jsF76YfGIJE+k38QwDRPMoPpP8XbjLcR5SaqF6/XGZwBKGo8DyrrlbAHF1mnB4M PyDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date; bh=XP42uled2jFncsexDCtsSNv5lhAK5kz7TIy4kGw2zCk=; b=2GlODI4jMGZIP50vZ911p+eEeNG9sbPocJmJ1Nb7eIhJtBC+d5m/+jG+GnqYlNo4h2 v0zIAkfjz22q/4qwkLTyJXT6rJW3yI0/gG8af/E8SBR63WTRBb+w+7csCJTH9EOtRf92 jIZGW8xWH5ujlORy4nI1z2rZOwDcEBhs8xovVNuDgWC7045YkLrVTUHpSTYJfxpHljJ3 Ujdm35rSLx0pgONDBZrogB+SnPOda9ZaGYemClVm2PICHY/7nxiKCk+DsL5jxxWmuDMg NQ+gVhdbImBPs8LtalYLykI7ER32nxwOJ4FHVaqB7BZnwkqSnBz0HPkefzVbt3I3oswN gfsg== X-Gm-Message-State: ACrzQf3Xj607gRbIVwkjKzSM0Nuxqra45DGK511Stgufd/28ULxEGlq5 B61C9AClLaRU2wANua8ncqAfXJb4x90sJr6X0aNqiWYciDM4TfH1XE77efuUc+mdfwbn7GgNwiq dGqgDcZ5gZqYL6BjRy5Wi22EDLWYfeFAzytX7pAV45uc3aSxZZBi/IIZogrkTjoyOacknFuB3 X-Google-Smtp-Source: AMsMyM4/NofS+psLkaVWuXgQrz7vZfcRiYrcDj5WeLdpEcCBrPBZeKPVp43rG3IXX4lNQLlcVcH3zFOLl1vTFrThdg== X-Received: from dionnaglaze.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2ee6]) (user=dionnaglaze job=sendgmr) by 2002:a17:90b:1c12:b0:200:b623:455d with SMTP id oc18-20020a17090b1c1200b00200b623455dmr13384081pjb.88.1664823247821; Mon, 03 Oct 2022 11:54:07 -0700 (PDT) Date: Mon, 3 Oct 2022 18:53:50 +0000 In-Reply-To: <20221003185352.3969999-1-dionnaglaze@google.com> Mime-Version: 1.0 References: <20221003185352.3969999-1-dionnaglaze@google.com> X-Mailer: git-send-email 2.38.0.rc1.362.ged0d419d3c-goog Message-ID: <20221003185352.3969999-6-dionnaglaze@google.com> Subject: [PATCH v6 5/7] MdePkg: Introduce the AcceptAllUnacceptedMemory protocol From: "Dionna Glaze" 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" 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/Bz3987AcceptAllUnacceptedMemory.h | 40 ++++++++++++++++++++ MdePkg/MdePkg.dec | 3 ++ 2 files changed, 43 insertions(+) diff --git a/MdePkg/Include/Protocol/Bz3987AcceptAllUnacceptedMemory.h b/MdePkg/Include/Protocol/Bz3987AcceptAllUnacceptedMemory.h new file mode 100644 index 0000000000..e50831836c --- /dev/null +++ b/MdePkg/Include/Protocol/Bz3987AcceptAllUnacceptedMemory.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 called + by the OS loader, and not EDK2 itself. + + Copyright (c) 2022, Google LLC. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _ACCEPT_ALL_UNACCEPTED_MEMORY_H_ +#define _ACCEPT_ALL_UNACCEPTED_MEMORY_H_ + +#define BZ3987_ACCEPT_ALL_UNACCEPTED_MEMORY_PROTOCOL_GUID \ + {0xc5a010fe, \ + 0x38a7, \ + 0x4531, \ + {0x8a, 0x4a, 0x05, 0x00, 0xd2, 0xfd, 0x16, 0x49}} + +typedef struct _BZ3987_ACCEPT_ALL_UNACCEPTED_MEMORY_PROTOCOL + BZ3987_ACCEPT_ALL_UNACCEPTED_MEMORY_PROTOCOL; + +/** + @param This A pointer to a BZ3987_ACCEPT_ALL_UNACCEPTED_MEMORY_PROTOCOL. +**/ +typedef +EFI_STATUS +(EFIAPI *BZ3987_DISABLE_ACCEPT_ALL_UNACCEPTED_MEMORY)( + IN BZ3987_ACCEPT_ALL_UNACCEPTED_MEMORY_PROTOCOL *This + ); + +/// +/// The BZ3987_ACCEPT_ALL_UNACCEPTED_MEMORY_PROTOCOL allows the OS loader to +/// indicate to EDK2 that ExitBootServices should not accept all memory. +/// +struct _BZ3987_ACCEPT_ALL_UNACCEPTED_MEMORY_PROTOCOL { + BZ3987_DISABLE_ACCEPT_ALL_UNACCEPTED_MEMORY Disable; +}; + +extern EFI_GUID gBz3987AcceptAllUnacceptedMemoryProtocolGuid; + +#endif diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index de3c56758b..b6b108586e 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/Bz3987AcceptAllUnacceptedMemory.h + gBz3987AcceptAllUnacceptedMemoryProtocolGuid = { 0xc5a010fe, 0x38a7, 0x4531, {0x8a, 0x4a, 0x05, 0x00, 0xd2, 0xfd, 0x16, 0x49 }} + ## Include/Protocol/MemoryAccept.h gEfiMemoryAcceptProtocolGuid = { 0x38c74800, 0x5590, 0x4db4, { 0xa0, 0xf3, 0x67, 0x5d, 0x9b, 0x8e, 0x80, 0x26 }} -- 2.38.0.rc1.362.ged0d419d3c-goog