From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) by mx.groups.io with SMTP id smtpd.web09.1381.1666644095305006215 for ; Mon, 24 Oct 2022 13:41:35 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@google.com header.s=20210112 header.b=jM7BbJcn; spf=pass (domain: flex--dionnaglaze.bounces.google.com, ip: 209.85.219.201, mailfrom: 3fvhwywskbesqvbaantynmrtbbtyr.pbzqriryrqxp.tebhcf.vb@flex--dionnaglaze.bounces.google.com) Received: by mail-yb1-f201.google.com with SMTP id w190-20020a257bc7000000b006c0d1b19526so10211890ybc.12 for ; Mon, 24 Oct 2022 13:41:35 -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:message-id:reply-to; bh=2mUOZqKxVxShv3A9m9GEkJxq3ZbhPFmmIVKQzsnx96c=; b=jM7BbJcnuGx/xcA9WiY8pygAnRDUg5mKhGOBH+hodXHnDqJ0f88MACeFs4oxVkL88i z7FOud66y0aIZcdZAccGJEMOmJjS8Rohu8k3io3ENnlcwvgArnZUHwZw+9UCMmdKIW7N ksKXQwHsARvHFMjyinAFI2QVYu86jY3kZKt9+F2s0vvobYlDbUwM0oTVz8WvGbtKJg1W QIQmWTm7ugMDt4gal9zaeHAEczja8sWemC/+GYnmo9QpvFq/Vo+ydRJod4Cz3rsncOl/ 5pAeLmcA5Ki1y0Pn0/4q/nGfmORrC8BUMmwOFUoYpnqTjcl/4eVN+tjUCuzJ09pb8R3A kOUQ== 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:message-id:reply-to; bh=2mUOZqKxVxShv3A9m9GEkJxq3ZbhPFmmIVKQzsnx96c=; b=dI/nkzjF7DMFdP2KJuQ3o5f1FLM09fASce/yd5WktiRr8cbCVjgNXh5Rtcd++BHecG 5XBqi9yU6TWUJdS6WP4iZnDtpYFqR5Lp5T99PtIDI1emiQlwMwmGGK6ZzA7oC+ekFdM5 yMnIDxRBVtuEXdzmew8oImA+XdS/xrjNN47NMfVwhNFpYZbsf5Lt66Wo8YzLiCwDgXn4 Fyw3Z8c5BsFI6x4Q8AsBDbLKBZHk+J+jOwRUQQ2/tpGeXRNmnmp4ekn2wbCqaInoGBWr KThz4/R2Rj4KI66whuH1IO7++A4hGzQpEpUPWh0wOZKTSjX2GLx07iH72n7FMdh9yqoX IgVA== X-Gm-Message-State: ACrzQf2U+LiYzo65u3OpnN3MU6wOP/Fvjd+qYM/G80XIvJsPJjsiBLt8 FLqYkqe1lamKLxCd33zfQ5j9Sy/n05WJ/JMS3+vvpXW+yT+5pVhXiWtDRV6v8RdGLeNyBChP76c FTQG/r6+hf1KqJON+gLDtIGd8XubqIaiji8X1rCs1CAANik2xuOP/BBCxyNs+0/tNlQf4XQ/l X-Google-Smtp-Source: AMsMyM6Uah5LOwrkH7kX824tXRz7sxioXz9qvpmFcHJG6rdKW1Fq5VZdcmunpUaOHXcguSrc7YuQC50A3wZWIG5lbA== X-Received: from dionnaglaze.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2ee6]) (user=dionnaglaze job=sendgmr) by 2002:a5b:f01:0:b0:6b7:b30f:54b4 with SMTP id x1-20020a5b0f01000000b006b7b30f54b4mr30816235ybr.149.1666644094526; Mon, 24 Oct 2022 13:41:34 -0700 (PDT) Date: Mon, 24 Oct 2022 20:41:12 +0000 In-Reply-To: <20221024204114.2772064-1-dionnaglaze@google.com> Mime-Version: 1.0 References: <20221024204114.2772064-1-dionnaglaze@google.com> X-Mailer: git-send-email 2.38.0.135.g90850a2211-goog Message-ID: <20221024204114.2772064-6-dionnaglaze@google.com> Subject: [PATCH v8 5/7] MdePkg: Introduce the MemoryAcceptance 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/MemoryAcceptance.h | 40 ++++++++++++++++++++ MdePkg/MdePkg.dec | 3 ++ 2 files changed, 43 insertions(+) diff --git a/MdePkg/Include/Protocol/MemoryAcceptance.h b/MdePkg/Include/Protocol/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 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 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 359a85ea10..5c639c1b98 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/Bz3987MemoryAcceptance.h + gBz3987MemoryAcceptanceProtocolGuid = { 0xc5a010fe, 0x38a7, 0x4531, {0x8a, 0x4a, 0x05, 0x00, 0xd2, 0xfd, 0x16, 0x49 }} + ## Include/Protocol/MemoryAccept.h gEdkiiMemoryAcceptProtocolGuid = { 0x38c74800, 0x5590, 0x4db4, { 0xa0, 0xf3, 0x67, 0x5d, 0x9b, 0x8e, 0x80, 0x26 }} -- 2.38.0.135.g90850a2211-goog