From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f73.google.com (mail-oa1-f73.google.com [209.85.160.73]) by mx.groups.io with SMTP id smtpd.web12.443.1665002028695765467 for ; Wed, 05 Oct 2022 13:33:48 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@google.com header.s=20210112 header.b=g6EG4tHc; spf=pass (domain: flex--dionnaglaze.bounces.google.com, ip: 209.85.160.73, mailfrom: 3k-o9ywskbrg16cbby49yn24cc492.0ca12j29218q.4fcidg.6c@flex--dionnaglaze.bounces.google.com) Received: by mail-oa1-f73.google.com with SMTP id 586e51a60fabf-132693a4072so5999221fac.4 for ; Wed, 05 Oct 2022 13:33:48 -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=7xbrcNFo3paGwMWgB0zN6TmTmNFxpqMHRuMfMwBCpnE=; b=g6EG4tHcuqz+bUtVA4hXmAOP4w7Sj/uJNor7j0nHQ69gX6cChVJ8yptJ05ZNZArMS0 Li7ARxv8vMazsXDHjSlNAY44Lqbvh3t+0V8QPolSJtQ7mxQjTTTv5RdW9hYtTm1X58CA SgVHNpypQl8R54u3ZdLpXZjhK6oETATmLEli4VW2sqwhVKvwJJAvHd5COsHi8jUTxz1i JBxKtvlOTP2cRAuDR/avWHZCvD0nwFx68dTdCEszfcY0+nEm11xaGoTh+WBIhSJeg4lk +zyE6c13U7CMG6SiTWH9TC5lcUlS32EWaZry2Tsg3zkNjH9WW3xGe9QY2S3PDBvhH4qB Tflg== 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=7xbrcNFo3paGwMWgB0zN6TmTmNFxpqMHRuMfMwBCpnE=; b=nLXmHthUQekGiMQipSdrketHJaKWF7DbWzxYU4nIjfKbl5190fAIWpwzwxa97xc0KU JjG/AAUN/gBUekZ4T3+599ClIfoy9xftIdUXcrHv4r/BgkemJ7woDc+E0aQInSTbAGmY 8UGR5IYQoolDqhW4v6Oi3Up+4C/VkTe5DNEnR76UrIP2BK2y201g+dC7+1F93fttt4Du Qhqb0c+BG7GJYtec7eucND1QawAChZhyguJw8Cb5jPb0YorVGEWhDwJAqp9UXBxzlb6W 2jhi1n48RhWvd8dNiaQhQkN+hah1vSAKKZL4VtEmwyyKST6lwpYkX7ktItkdCnqmiVnH MxrA== X-Gm-Message-State: ACrzQf1VNAzk7H33m69PkAD697/bvN79t/D3JMcBgC5gYI178EXAbh8W HQM5Y5jTjQdoV3tIheRhV7+2yEL1cKdvGcmY0VsqqaiZPquV6ZOkNX/ug8wc+MznCqnF/S9uAWM 9hQfPxav2lfv1zwZXDGFPjzfBT+tjiUqCiAMlUvfViKaWFuRTj6dVW4heaSVzSjS92MhRYRTZ X-Google-Smtp-Source: AMsMyM7PvxRynJgqJ2M+zOa0pkVj0E3Vo1N37vo+RB7LL6H/xEEedpyLmr8f215ZYYKYADpPDwqxSIQB8A5i5Uzt5A== X-Received: from dionnaglaze.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2ee6]) (user=dionnaglaze job=sendgmr) by 2002:a05:6870:34d:b0:127:cb87:a169 with SMTP id n13-20020a056870034d00b00127cb87a169mr713168oaf.87.1665002027978; Wed, 05 Oct 2022 13:33:47 -0700 (PDT) Date: Wed, 5 Oct 2022 20:33:27 +0000 In-Reply-To: <20221005203329.469866-1-dionnaglaze@google.com> Mime-Version: 1.0 References: <20221005203329.469866-1-dionnaglaze@google.com> X-Mailer: git-send-email 2.38.0.rc1.362.ged0d419d3c-goog Message-ID: <20221005203329.469866-6-dionnaglaze@google.com> Subject: [PATCH v7 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 32c3501e66..a453b67b7e 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -1022,6 +1022,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