From nobody Tue Feb 10 04:13:28 2026 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+99051+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+99051+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1674694617; cv=none; d=zohomail.com; s=zohoarc; b=geTj3mERtIL23wiwjkPn/p4KsIT0qfzdm9+0xmz6fpHNGIK0FAzsvRFd0VVCMblLXsLqEUGS0rR1HOSXG04b87jOhfNFB55JzJPhIB5HNRMAZ9lF6BKYYiW3P2SNdZiaiscJWgg14Q8Rs/wANv5pNJ9QmS57KomsElPQ5vnwcbo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674694617; 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=B4JGNzMKpe6q/cgIDzRbXz7fUpTgcrbFYs8rX7VFXn8=; b=TOTMSUvNTQTeEuZDAj5s3c0n+CS0cPSl0lYGZdrsWe0VkuEGU+KepGWFKdwIWXpaKj13PbBKX6noiZhhfuT5coSN+j/XKNHFB2rZk6PTajstoYAe9dqoMeoW8niq5+hLoD/bnS0nLdFCUnjUOTrs72/RMTw11qKdVLieLFUIpwI= 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+99051+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1674694617884939.7988020370972; Wed, 25 Jan 2023 16:56:57 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id aB25YY1788612x0Zy5tzVr5w; Wed, 25 Jan 2023 16:56:57 -0800 X-Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.201]) by mx.groups.io with SMTP id smtpd.web11.63461.1674694617004374831 for ; Wed, 25 Jan 2023 16:56:57 -0800 X-Received: by mail-pl1-f201.google.com with SMTP id u6-20020a170903124600b00188cd4769bcso309293plh.0 for ; Wed, 25 Jan 2023 16:56:56 -0800 (PST) X-Gm-Message-State: 3OqI0Kp9JJoxJRI7m1U4WKP1x1787277AA= X-Google-Smtp-Source: AK7set+HZZ3WBudomVIexNEciM2uHgY4mc20Jyq6R3PlDHmDXQcLqGILsaM4i7WwDwVigFJt19OsZU0LVFJ4QjWv5g== X-Received: from dionnaglaze.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2ee6]) (user=dionnaglaze job=sendgmr) by 2002:a17:90b:fc7:b0:226:9980:67f3 with SMTP id gd7-20020a17090b0fc700b00226998067f3mr2501pjb.1.1674694616062; Wed, 25 Jan 2023 16:56:56 -0800 (PST) Date: Thu, 26 Jan 2023 00:56:45 +0000 In-Reply-To: <20230126005647.3019225-1-dionnaglaze@google.com> Mime-Version: 1.0 References: <20230126005647.3019225-1-dionnaglaze@google.com> Message-ID: <20230126005647.3019225-3-dionnaglaze@google.com> Subject: [edk2-devel] [PATCH v10 2/4] MdePkg: Introduce the SevMemoryAcceptance 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=1674694617; bh=IqokhUHMHVZGxqFa85bewjgrREf1Is6JeVBXtKFrsik=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=p8EldyNRrPyY2cdQ+FS0yLdF8gP4eRDxqH8OoyN04Z0QT83PLVTsMlmbuEK6DQReIwY +aK158yZ2sdvstiNOvgM68HkiJILVy/YPjMn4MDCkr6aU+nrHsbPZKb8ygyR7pZdYyLNM ixHNe8qQpONYwD8Sz+gWiY9lR6GdOcInaDE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1674694618074100006 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The default behavior for unaccepted memory in SEV-SNP 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/Bz3987SevMemoryAcceptance.h | 44 +++++++++++++++++= +++ MdePkg/MdePkg.dec | 3 ++ 2 files changed, 47 insertions(+) diff --git a/MdePkg/Include/Protocol/Bz3987SevMemoryAcceptance.h b/MdePkg/I= nclude/Protocol/Bz3987SevMemoryAcceptance.h new file mode 100644 index 0000000000..c3691e1c93 --- /dev/null +++ b/MdePkg/Include/Protocol/Bz3987SevMemoryAcceptance.h @@ -0,0 +1,44 @@ +/** @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. The SEV naming is due to the coin= cidence + that only SEV-SNP needs this protocol, since SEV-SNP kernel support rele= ased + before kernel support for unaccepted memory. The technology enablement t= hus + does not strictly imply support for the unaccepted memory type. + + Copyright (c) 2023, Google LLC. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef SEV_MEMORY_ACCEPTANCE_H_ +#define SEV_MEMORY_ACCEPTANCE_H_ + +#define BZ3987_SEV_MEMORY_ACCEPTANCE_PROTOCOL_GUID \ + {0xc5a010fe, \ + 0x38a7, \ + 0x4531, \ + {0x8a, 0x4a, 0x05, 0x00, 0xd2, 0xfd, 0x16, 0x49}} + +typedef struct _BZ3987_SEV_MEMORY_ACCEPTANCE_PROTOCOL \ + BZ3987_SEV_MEMORY_ACCEPTANCE_PROTOCOL; + +/** + @param This A pointer to a BZ3987_SEV_MEMORY_ACCEPTANCE_PROTOCOL. +**/ +typedef + EFI_STATUS +(EFIAPI *BZ3987_SEV_ALLOW_UNACCEPTED_MEMORY)( + IN BZ3987_SEV_MEMORY_ACCEPTANCE_PROTOCOL *This + ); + +/// +/// The BZ3987_SEV_MEMORY_ACCEPTANCE_PROTOCOL allows the OS loader to +/// indicate to EDK2 that ExitBootServices should not accept all memory. +/// +struct _BZ3987_SEV_MEMORY_ACCEPTANCE_PROTOCOL { + BZ3987_SEV_ALLOW_UNACCEPTED_MEMORY AllowUnacceptedMemory; +}; + +extern EFI_GUID gBz3987SevMemoryAcceptanceProtocolGuid; + +#endif diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 3d08f20d15..b82d6e46a4 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/Bz3987SevMemoryAcceptance.h + gBz3987SevMemoryAcceptanceProtocolGuid =3D { 0xc5a010fe, 0x38a7, 0x4531,= {0x8a, 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.1.456.gfc5497dd1b-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 (#99051): https://edk2.groups.io/g/devel/message/99051 Mute This Topic: https://groups.io/mt/96534753/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-