public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Yao, Jiewen" <jiewen.yao@intel.com>
To: Dionna Glaze <dionnaglaze@google.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: Gerd Hoffmann <kraxel@redhat.com>,
	James Bottomley <jejb@linux.ibm.com>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	Ard Biesheuvel <ardb@kernel.org>,
	"Xu, Min M" <min.m.xu@intel.com>, Andrew Fish <afish@apple.com>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>
Subject: Re: [PATCH v10 2/4] MdePkg: Introduce the SevMemoryAcceptance protocol
Date: Thu, 26 Jan 2023 01:24:05 +0000	[thread overview]
Message-ID: <MW4PR11MB58725FD249811C898D5DF2CC8CCF9@MW4PR11MB5872.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20230126005647.3019225-3-dionnaglaze@google.com>

I don’t think MdePkg is the right place. MdePkg only includes the approved industry standard.

As Gerd and I discussed before, this protocol should be in OvmfPkg.
Please move to https://github.com/tianocore/edk2/tree/master/OvmfPkg/Include/Protocol

Thank you
Yao, Jiewen

> -----Original Message-----
> From: Dionna Glaze <dionnaglaze@google.com>
> Sent: Thursday, January 26, 2023 8:57 AM
> To: devel@edk2.groups.io
> Cc: Dionna Glaze <dionnaglaze@google.com>; Gerd Hoffmann
> <kraxel@redhat.com>; James Bottomley <jejb@linux.ibm.com>; Yao, Jiewen
> <jiewen.yao@intel.com>; Tom Lendacky <thomas.lendacky@amd.com>; Ard
> Biesheuvel <ardb@kernel.org>; Xu, Min M <min.m.xu@intel.com>; Andrew Fish
> <afish@apple.com>; Kinney, Michael D <michael.d.kinney@intel.com>
> Subject: [PATCH v10 2/4] MdePkg: Introduce the SevMemoryAcceptance
> protocol
> 
> 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 <kraxel@redhat.com>
> Cc: James Bottomley <jejb@linux.ibm.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Tom Lendacky <thomas.lendacky@amd.com>
> Cc: Ard Biesheuvel <ardb@kernel.org>
> Cc: "Min M. Xu" <min.m.xu@intel.com>
> Cc: Andrew Fish <afish@apple.com>
> Cc: "Michael D. Kinney" <michael.d.kinney@intel.com>
> 
> Signed-off-by: Dionna Glaze <dionnaglaze@google.com>
> ---
>  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/Include/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 called
> +  by the OS loader, and not EDK2 itself. The SEV naming is due to the
> coincidence
> +  that only SEV-SNP needs this protocol, since SEV-SNP kernel support released
> +  before kernel support for unaccepted memory. The technology enablement
> thus
> +  does not strictly imply support for the unaccepted memory type.
> +
> +  Copyright (c) 2023, Google LLC. All rights reserved.<BR>
> +  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  = { 0x869c711d, 0x649c, 0x44fe, { 0x8b, 0x9e,
> 0x2c, 0xbb, 0x29, 0x11, 0xc3, 0xe6 }}
> 
>  [Protocols]
> +  ## Include/Protocol/Bz3987SevMemoryAcceptance.h
> +  gBz3987SevMemoryAcceptanceProtocolGuid = { 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.39.1.456.gfc5497dd1b-goog


  reply	other threads:[~2023-01-26  1:24 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-26  0:56 [PATCH v10 0/4] Add safe unaccepted memory behavior Dionna Glaze
2023-01-26  0:56 ` [PATCH v10 1/4] OvmfPkg: Add memory acceptance event in AmdSevDxe Dionna Glaze
2023-01-26 10:30   ` Ard Biesheuvel
2023-01-26 16:04     ` Dionna Glaze
2023-02-09 13:35   ` [edk2-devel] " Gupta, Pankaj
2023-02-09 16:52     ` Dionna Glaze
2023-02-09 21:27       ` Dionna Glaze
2023-02-10  8:00         ` Gupta, Pankaj
2023-02-10 11:12           ` Ard Biesheuvel
2023-02-10 11:34             ` Gupta, Pankaj
2023-02-10 13:56         ` Gupta, Pankaj
2023-02-10 17:05           ` Dionna Glaze
2023-02-13 14:38             ` Gupta, Pankaj
2023-02-13 16:53               ` Dionna Glaze
2023-02-13 17:56                 ` Gupta, Pankaj
2023-02-13 18:31                   ` Dionna Glaze
2023-02-13 19:33                     ` Lendacky, Thomas
2023-02-13 19:33                     ` Gupta, Pankaj
2023-02-13 21:44                       ` Dionna Glaze
2023-02-14 12:51                         ` Gupta, Pankaj
2023-02-14 12:55                           ` Gupta, Pankaj
2023-02-14 20:44                             ` Dionna Glaze
2023-02-14 20:46                               ` Gupta, Pankaj
     [not found]                           ` <1743B21FF9509E5F.2641@groups.io>
2023-02-14 14:00                             ` Gupta, Pankaj
2023-02-14  9:12                 ` Gerd Hoffmann
2023-02-14 17:28                   ` Dionna Glaze
2023-02-14 22:44                     ` Lendacky, Thomas
2023-02-15  9:38                     ` Gerd Hoffmann
2023-01-26  0:56 ` [PATCH v10 2/4] MdePkg: Introduce the SevMemoryAcceptance protocol Dionna Glaze
2023-01-26  1:24   ` Yao, Jiewen [this message]
2023-01-26 17:04     ` Dionna Glaze
2023-01-26 17:19       ` Ard Biesheuvel
2023-01-26  0:56 ` [PATCH v10 3/4] OvmfPkg: Implement AcceptAllUnacceptedMemory in AmdSevDxe Dionna Glaze
2023-01-26  0:56 ` [PATCH v10 4/4] OvmfPkg/PlatformPei: SEV-SNP make >=4GB unaccepted Dionna Glaze

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MW4PR11MB58725FD249811C898D5DF2CC8CCF9@MW4PR11MB5872.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox