From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web10.579.1655931728135073380 for ; Wed, 22 Jun 2022 14:02:08 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@linux.microsoft.com header.s=default header.b=A5+Ygx/M; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: mikuback@linux.microsoft.com) Received: from [192.168.4.22] (unknown [47.195.228.134]) by linux.microsoft.com (Postfix) with ESMTPSA id 2997C20C6379; Wed, 22 Jun 2022 14:02:06 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 2997C20C6379 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1655931727; bh=u+i8tv2dXIq0p5AIe8LqjETy31ZRnQbDqSutY9Ov0vA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=A5+Ygx/MTphhLT4DTFp+R8Wvqai96DqWjlUvuTsMgXnXQQhJPQpBVGMb+PXD3Yb/w UcnyOLC8G1r06xZByW9isQ5ub9UBrkDtvihFqo7zh6V/xoYHKzXkTZbYuNXdPUTQCV mdcusbMGnHaBz0iShG54p2qFS8iBK6NnsfYpbQdM= Message-ID: Date: Wed, 22 Jun 2022 17:02:05 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [edk2-devel] [PATCH V1 1/1] MdeModulePkg: Add Definition of EDKII_PEI_VARIABLE_PPI To: devel@edk2.groups.io, brian.johnson@hpe.com, nathaniel.l.desimone@intel.com, "Yao, Jiewen" , "michael.kubacki@outlook.com" Cc: "Wang, Jian J" , "Gao, Liming" , "Kinney, Michael D" , "Oram, Isaac W" , "Chiu, Chasel" , "Cheng, Gao" , "Zhang, Di" , "Bu, Daocheng" , "Kubacki, Michael" References: <20220610011705.5148-1-nathaniel.l.desimone@intel.com> <20220610011705.5148-2-nathaniel.l.desimone@intel.com> <0b274bdc-e9dc-3808-21bb-9cf488fcd195@hpe.com> From: "Michael Kubacki" In-Reply-To: <0b274bdc-e9dc-3808-21bb-9cf488fcd195@hpe.com> Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable There's a lot of major pending changes I'm aware of in the variable=20 stack. At least: 1. "Variable Protection" - Extensions for encryption and replay protectio= n https://github.com/judahvang/edk2/tree/rpmc-update 2. "Storage Agnostic Variables / UEFI Variable Router" https://github.com/makubacki/edk2/tree/storage_agnostic_uefi_variables_w_= runtime_cache I've rebased this a few times and probably will again. 3. "PEI write support" This email thread 4. Host-based UEFI variable testing we are working on at Microsoft Each of these capabilities is nice but, the reality is, the UEFI=20 variable driver already has so much technical debt that each of these=20 individually are going to significantly impact others. From what I've=20 observed, most large variable contributions tend to fix similar problems=20 that affect their code - duplicated helper logic between PEI and DXE=20 drivers, lack of modularity so individual functions are difficult to=20 test and reuse, etc. Major vendors often have driver overrides because=20 variables have evolved over the years and they need improved=20 traceability, data offload, security features, etc. (4) is an attempt to manage some of the integration complexity to some=20 extent by increasing test coverage in an quick and controlled manner. Since these are all mostly new features, I would prefer to build them in=20 a new clean design that considers modern use cases upfront rather than=20 continuing to bolt onto the existing code (and at the minimum, introduce=20 a lot of merge conflicts between everyone in the process). It could reuse a lot of preexisting work but integrate things more=20 cohesively and with better testing infrastructure in place. Does anyone think a workstream or feature branch for that would be a=20 better approach? Thanks, Michael On 6/22/2022 3:51 PM, Brian J. Johnson wrote: > Nate, >=20 > FWIW I welcome having a standard interface to write EFI variables in=20 > PEI.=C2=A0 Not all platforms store variables in flash, so they don't al= l have=20 > tricky issues with fault-tolerant writes to h/w which is also being use= d=20 > for code fetches.=C2=A0 And writing variables early makes it possible t= o=20 > modify settings in response to h/w changes and external requests,=20 > without having to boot all the way to DXE, write the variables, then=20 > trigger a reset. >=20 > Brian J. Johnson > -------- Original Message -------- > From: Nate DeSimone [mailto:nathaniel.l.desimone@intel.com] > Sent: Monday, June 13, 2022, 4:31 PM > To: Yao, Jiewen , devel@edk2.groups.io=20 > , michael.kubacki@outlook.com=20 > > Cc: Wang, Jian J , Gao, Liming=20 > , Kinney, Michael D=20 > , Oram, Isaac W ,=20 > Chiu, Chasel , Cheng, Gao ,= =20 > Zhang, Di , Bu, Daocheng ,=20 > Kubacki, Michael > Subject: [edk2-devel] [PATCH V1 1/1] MdeModulePkg: Add Definition of=20 > EDKII_PEI_VARIABLE_PPI >=20 > Hi Jiewen, >=20 > I am fine with deferring the submission of this to edk2 until the=20 > implementation is ready for review. I just wanted to get feedback on th= e=20 > API so that once the implementation patch series arrives we will at=20 > least that that piece of the review done. I would say this thread=20 > achieved that goal. Thank you for the pointer to the protected variable= =20 > code, we will review it and make sure that no issues would arise from=20 > the pre-memory PEI implementation. >=20 > Thanks, > Nate >=20 > -----Original Message----- > From: Yao, Jiewen > Sent: Friday, June 10, 2022 6:09 PM > To: Desimone, Nathaniel L ;=20 > devel@edk2.groups.io; michael.kubacki@outlook.com > Cc: Wang, Jian J ; Gao, Liming=20 > ; Kinney, Michael D=20 > ; Oram, Isaac W ;=20 > Chiu, Chasel ; Cheng, Gao ;= =20 > Zhang, Di ; Bu, Daocheng ;=20 > Kubacki, Michael > Subject: RE: [edk2-devel] [PATCH V1 1/1] MdeModulePkg: Add Definition o= f=20 > EDKII_PEI_VARIABLE_PPI >=20 > Thanks for the response. >=20 > 1) Why we need "enable UEFI variable write before permanent memory is=20 > available"? >=20 > 2) If the implementation is not ready, I do have concern to add it so=20 > early in EDKII. > If I don=E2=80=99t have a big picture, I am not sure how to review the=20 > completeness. >=20 > Can we put it to EDKII-staging=20 > (https://github.com/tianocore/edk2-staging) for a moment? > I don=E2=80=99t see the need to add the interface now for work-in-progr= ess=20 > feature, since there is no consumer and no producer. >=20 > Another reason is that I happen to know other feature (in EDKII stage)=20 > is impacting variable driver. > https://github.com/tianocore/edk2-staging/tree/ProtectedVariable/libs >=20 > Please do consider that as well - how to write a protected variable in=20 > PEI phase. >=20 > Thank you > Yao Jiewen >=20 >> -----Original Message----- >> From: Desimone, Nathaniel L >> Sent: Saturday, June 11, 2022 5:49 AM >> To: Yao, Jiewen ; devel@edk2.groups.io; >> michael.kubacki@outlook.com >> Cc: Wang, Jian J ; Gao, Liming >> ; Kinney, Michael D >> ; Oram, Isaac W ; >> Chiu, Chasel ; Cheng, Gao >> ; Zhang, Di ; Bu, Daocheng >> ; Kubacki, Michael >> >> Subject: RE: [edk2-devel] [PATCH V1 1/1] MdeModulePkg: Add Definition >> of EDKII_PEI_VARIABLE_PPI >> >> Hi Jiewen, >> >> Thanks for the feedback, per your questions: >> >> 1. The primary use case for this is to enable UEFI variable writes >> before permanent memory is available. >> 2. The implementation is a work in progress. We will provide it >> shortly. As this will be a rather large patch set, I would like to get >> this piece in place beforehand so that the reviewers can focus on the >> implementation separate from the API definition. >> 3. No impact to secure boot. We are not going to support writing to >> authenticated variables in PEI. As mentioned in the comments, if a >> PEIM wishes to update any of the authenticated variables it must use >> the existing HOB mechanism to have a later DXE phase perform the updat= e. >> 4. With regard to atomicity, we have a complete implementation of the >> fault tolerant write services operational in Pre-Memory PEI. >> 5. Good point on the S3 resume, we will need to add an SMI to have the >> variable services re-initialize the mNvVariableCache. >> >> Hope that helps, >> Nate >> >> -----Original Message----- >> From: Yao, Jiewen >> Sent: Friday, June 10, 2022 9:56 AM >> To: devel@edk2.groups.io; michael.kubacki@outlook.com; Desimone, >> Nathaniel L >> Cc: Wang, Jian J ; Gao, Liming >> ; Kinney, Michael D >> ; Oram, Isaac W ; >> Chiu, Chasel ; Cheng, Gao >> ; Zhang, Di ; Bu, Daocheng >> ; Kubacki, Michael >> >> Subject: RE: [edk2-devel] [PATCH V1 1/1] MdeModulePkg: Add Definition >> of EDKII_PEI_VARIABLE_PPI >> >> Hi >> >> I am curious why we need this interface. Why we need write variable >> capability in PEI phase? >> >> Where is the implementation of this? I prefer to see an implementation >> submitted together with header file. >> For example, what is the impact to secure boot related feature, how to >> write auth variable in PEI, how PEI write variable cowork with SMM >> version in S3 resume phase, how to support variable atomicity, etc. >> >> Thank you >> Yao Jiewen >> >> >>> -----Original Message----- >>> From: devel@edk2.groups.io On Behalf Of >>> Michael Kubacki >>> Sent: Friday, June 10, 2022 10:00 AM >>> To: devel@edk2.groups.io; Desimone, Nathaniel L >>> >>> Cc: Wang, Jian J ; Gao, Liming >>> ; Kinney, Michael D >>> ; Oram, Isaac W >>> ; Chiu, Chasel ; >>> Cheng, Gao ; Zhang, Di ; >>> Bu, Daocheng ; Kubacki, Michael >>> >>> Subject: Re: [edk2-devel] [PATCH V1 1/1] MdeModulePkg: Add >>> Definition of EDKII_PEI_VARIABLE_PPI >>> >>> Is this change just adding the interface to Tianocore or is there >>> additional implementation planned as well? >>> >>> --- >>> >>> I thought we were following this convention now: >>> >>> "#ifndef __PEI_VARIABLE_PPI_H_" -> "#ifndef PEI_VARIABLE_PPI_H_" >>> >>> Some other comments are inline. >>> >>> Regards, >>> Michael >>> >>> On 6/9/2022 9:17 PM, Nate DeSimone wrote: >>>> Adds definition of EDKII_PEI_VARIABLE_PPI, a pre-cursor to >>>> enabling variable writes in the PEI environment. >>>> >>>> Cc: Jian J Wang >>>> Cc: Liming Gao >>>> Cc: Michael D Kinney >>>> Cc: Isaac Oram >>>> Cc: Chasel Chiu >>>> Cc: Gao Cheng >>>> Cc: Di Zhang >>>> Cc: Daocheng Bu >>>> Cc: Michael Kubacki >>>> Signed-off-by: Nate DeSimone >>>> --- >>>> =C2=A0=C2=A0 MdeModulePkg/Include/Ppi/Variable.h | 189 >>> ++++++++++++++++++++++++++++ >>>> =C2=A0=C2=A0 MdeModulePkg/MdeModulePkg.dec=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 |=C2=A0=C2=A0 3 + >>>> =C2=A0=C2=A0 2 files changed, 192 insertions(+) >>>> =C2=A0=C2=A0 create mode 100644 MdeModulePkg/Include/Ppi/Variable.h >>>> >>>> diff --git a/MdeModulePkg/Include/Ppi/Variable.h >>> b/MdeModulePkg/Include/Ppi/Variable.h >>>> new file mode 100644 >>>> index 0000000000..97dc7ceefa >>>> --- /dev/null >>>> +++ b/MdeModulePkg/Include/Ppi/Variable.h >>>> @@ -0,0 +1,189 @@ >>>> +/** @file >>>> +=C2=A0 EDKII PEI Variable Protocol provides an implementation of >>>> +variables >>> >>> [MK] Was "EDKII PEI Variable PPI" intended? >>> >>>> +=C2=A0 intended for use as a means to store data in the PEI environ= ment. >>>> + >>>> +=C2=A0 Copyright (c) 2022, Intel Corporation. All rights reserved.<= BR> >>>> +=C2=A0 SPDX-License-Identifier: BSD-2-Clause-Patent >>>> + >>>> +**/ >>>> + >>>> +#ifndef __PEI_VARIABLE_PPI_H_ >>>> +#define __PEI_VARIABLE_PPI_H_ >>>> + >>>> +#define EDKII_PEI_VARIABLE_PPI_GUID \ >>>> +=C2=A0 { \ >>>> +=C2=A0=C2=A0=C2=A0 0xe7b2cd04, 0x4b14, 0x44c2, { 0xb7, 0x48, 0xce, = 0xaf, 0x2b, >>>> +0x66, 0x4a, >>> 0xb0 } \ >>>> +=C2=A0 } >>>> + >>>> +typedef struct _EDKII_PEI_VARIABLE_PPI EDKII_PEI_VARIABLE_PPI; >>>> + >>>> +/** >>>> +=C2=A0 This service retrieves a variable's value using its name and= GUID. >>>> + >>>> +=C2=A0 Read the specified variable from the UEFI variable store. If >>>> + the Data=C2=A0 buffer is too small to hold the contents of the >>>> + variable, the error EFI_BUFFER_TOO_SMALL is returned and >>>> + DataSize is set to the=C2=A0 required buffer size to obtain the da= ta. >>>> + >>>> +=C2=A0 @param[in]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 This=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= A pointer to this instance of=20 >>>> the >>> EDKII_PEI_VARIABLE_PPI. >>>> +=C2=A0 @param[in]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Variabl= eName=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 A pointer to a=20 >>>> null-terminated string that >>> is the variable's name. >>>> +=C2=A0 @param[in]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Variabl= eGuid=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 A pointer to an EFI_GUID that=20 >>>> is the >>> variable's GUID. The combination of >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 VariableGuid and VariableName=20 >>>> must be unique. >>>> +=C2=A0 @param[out]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Attributes=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 If non-NULL, on return,=20 >>>> points to the >>> variable's attributes. >>>> +=C2=A0 @param[in, out]=C2=A0=C2=A0 DataSize=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 On entry, points to the size=20 >>>> in bytes of the >>> Data buffer. >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 On return, points to the >>>> + size of the data returned in >> Data. >>>> +=C2=A0 @param[out]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Data=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Poi= nts to the buffer which=20 >>>> will hold the >>> returned variable value. >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 May be NULL with a zero >>>> + DataSize in order to determine >>> the size of the >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 buffer needed. >>>> + >>>> +=C2=A0 @retval EFI_SUCCESS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 The variable was r= ead=20 >>>> successfully. >>>> +=C2=A0 @retval EFI_NOT_FOUND=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 The variable was not found. >>>> +=C2=A0 @retval EFI_BUFFER_TOO_SMALL=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 The DataSize is too small for=20 >>>> the >>> resulting data. >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 DataSize is updated with the=20 >>>> size required for >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 the specified variable. >>>> +=C2=A0 @retval EFI_INVALID_PARAMETER=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 VariableName, VariableGuid, >>> DataSize or Data is NULL. >>>> +=C2=A0 @retval EFI_DEVICE_ERROR=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 The variable could not be=20 >>>> retrieved >>> because of a device error. >>>> + >>>> +**/ >>>> +typedef >>>> +EFI_STATUS >>>> +(EFIAPI *EDKII_PEI_GET_VARIABLE)( >>>> +=C2=A0 IN CONST=C2=A0 EDKII_PEI_VARIABLE_PPI=C2=A0=C2=A0=C2=A0 *Thi= s, >>>> +=C2=A0 IN CONST=C2=A0 CHAR16=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= *VariableName, >>>> +=C2=A0 IN CONST=C2=A0 EFI_GUID=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *Variable= Guid, >>>> +=C2=A0 OUT=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 UINT32=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 *Attributes, >>> >>> [MK] Based on the description, Attributes should be marked "OPTIONAL"= . >>> >>>> +=C2=A0 IN OUT=C2=A0=C2=A0=C2=A0 UINTN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 *DataSize, >>>> +=C2=A0 OUT=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 VOID=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *Data OPTIONAL >>>> +=C2=A0 ); >>>> + >>>> +/** >>>> +=C2=A0 Return the next variable name and GUID. >>>> + >>>> +=C2=A0 This function is called multiple times to retrieve the >>>> + VariableName=C2=A0 and VariableGuid of all variables currently >>>> + available in the >> system. >>>> +=C2=A0 On each call, the previous results are passed into the >>>> + interface, and, on return, the interface returns the data for >>>> + the next interface. When the entire variable list has been >>>> + returned, EFI_NOT_FOUND is returned. >>>> + >>> >>> [MK] I know other descriptions don't usually have it but it would be >>> nice to describe the initial calling values expected. >>> >>>> +=C2=A0 @param[in]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 This=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= A pointer to this instance of=20 >>>> the >>> EDKII_PEI_VARIABLE_PPI. >>>> +=C2=A0 @param[in, out]=C2=A0=C2=A0 VariableNameSize=C2=A0 On entry,= points to the size=20 >>>> of the >>> buffer pointed to by VariableName. >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 On return, the size of the=20 >>>> variable name buffer. >>>> +=C2=A0 @param[in, out]=C2=A0=C2=A0 VariableName=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 On entry, a pointer to a null- >> terminated >>> string that is the variable's name. >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 On return, points to the >>>> + next variable's null-terminated >>> name string. >>>> +=C2=A0 @param[in, out]=C2=A0=C2=A0 VariableGuid=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 On entry, a pointer to an=20 >>>> EFI_GUID that >> is >>> the variable's GUID. >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 On return, a pointer to the=20 >>>> next variable's GUID. >>>> + >>>> +=C2=A0 @retval EFI_SUCCESS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 The variable was r= ead=20 >>>> successfully. >>>> +=C2=A0 @retval EFI_NOT_FOUND=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 The variable could not be f= ound. >>>> +=C2=A0 @retval EFI_BUFFER_TOO_SMALL=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 The VariableNameSize is too=20 >>>> small >> for >>> the resulting >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 data. VariableNameSize is=20 >>>> updated with the size >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 required for the specified=20 >>>> variable. >>>> +=C2=A0 @retval EFI_INVALID_PARAMETER=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 VariableName, VariableGuid or >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 VariableNameSize is NULL. >>>> +=C2=A0 @retval EFI_DEVICE_ERROR=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 The variable could not be=20 >>>> retrieved >>> because of a device error. >>>> + >>>> +**/ >>>> +typedef >>>> +EFI_STATUS >>>> +(EFIAPI *EDKII_PEI_GET_NEXT_VARIABLE_NAME)( >>>> +=C2=A0 IN CONST=C2=A0 EDKII_PEI_VARIABLE_PPI=C2=A0=C2=A0=C2=A0 *Thi= s, >>>> +=C2=A0 IN OUT=C2=A0=C2=A0=C2=A0 UINTN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 *VariableNameSize, >>>> +=C2=A0 IN OUT=C2=A0=C2=A0=C2=A0 CHAR16=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 *VariableName, >>>> +=C2=A0 IN OUT=C2=A0=C2=A0=C2=A0 EFI_GUID=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= *VariableGuid >>>> +=C2=A0 ); >>>> + >>>> +/** >>>> +=C2=A0 Sets the value of a variable. >>>> + >>>> +=C2=A0 @param[in]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 This=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= A pointer to this instance of=20 >>>> the >>> EDKII_PEI_VARIABLE_PPI. >>>> +=C2=A0 @param[in]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Variabl= eName=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 A Null-terminated string that=20 >>>> is the name >>> of the vendor's variable. >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 Each VariableName is unique=20 >>>> for each VendorGuid. >>> VariableName must >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 contain 1 or more characters. >>>> + If VariableName is an >>> empty string, >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 then EFI_INVALID_PARAMETER is=20 >>>> returned. >>>> +=C2=A0 @param[in]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 VendorG= uid=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 A unique identifier for the= =20 >>>> vendor. >>>> +=C2=A0 @param[in]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Attribu= tes=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Attributes bitmask to set f= or=20 >>>> the variable. >>>> +=C2=A0 @param[in]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DataSiz= e=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 The size in bytes= of the Data=20 >>>> buffer. Unless >>> the EFI_VARIABLE_APPEND_WRITE >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 attribute is set, a size of >>>> + zero causes the variable to be >>> deleted. When the >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 EFI_VARIABLE_APPEND_WRITE >>>> + attribute is set, then a >>> SetVariable() call with a >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 DataSize of zero will not >>>> + cause any change to the >>> variable value. >>>> +=C2=A0 @param[in]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Data=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= The contents for the variable. >>>> + >>>> +=C2=A0 @retval EFI_SUCCESS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 The firmware has s= uccessfully=20 >>>> stored the >>> variable and its data as >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 defined by the Attributes. >>>> +=C2=A0 @retval EFI_INVALID_PARAMETER=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 An invalid combination of=20 >>>> attribute >>> bits, name, and GUID was supplied, or the >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 DataSize exceeds the maximum=20 >>>> allowed. >>>> +=C2=A0 @retval EFI_INVALID_PARAMETER=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 VariableName is an empty string. >>>> +=C2=A0 @retval EFI_OUT_OF_RESOURCES=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 Not enough storage is=20 >>>> available to >>> hold the variable and its data. >>>> +=C2=A0 @retval EFI_DEVICE_ERROR=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 The variable could not be=20 >>>> retrieved due >>> to a hardware error. >>>> +=C2=A0 @retval EFI_WRITE_PROTECTED=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 The variable in question is=20 >>>> read-only. >>>> +=C2=A0 @retval EFI_WRITE_PROTECTED=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 The variable in question=20 >>>> cannot be >>> deleted. >>>> +=C2=A0 @retval EFI_SECURITY_VIOLATION=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= The variable could not be=20 >>>> written >> due >>> to EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS, >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 or >>> EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS, or >>>> + >>>> + EFI_VARIABLE_ENHANCED_AUTHENTICATED_ACCESS >>> being set. Writing to authenticated >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 variables is not supported in=20 >>>> the PEI environment. >>> Updates to authenticated >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 variables can be requested >>>> + during PEI via the >>> EFI_AUTHENTICATED_VARIABLE_HOB, but >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 these updates won't be >>>> + written to non-volatile storage >>> until later in DXE. See >>>> + >>>> + MdeModulePkg/Include/Guid/VariableFormat.h for >>> more details on >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 EFI_AUTHENTICATED_VARIABLE_HOB. >>> >>> [MK] I didn't see "EFI_AUTHENTICATED_VARIABLE_HOB" mentioned in >>> VariableFormat.h. >>> >>> [MK] It seems that if a contract for producing and then consuming >>> this HOB is going to be defined between the HOB producer and >>> consumer phase, it should be described in something like the PI Spec. >>> >>>> +=C2=A0 @retval EFI_NOT_FOUND=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 The variable trying to be=20 >>>> updated or >>> deleted was not found. >>>> + >>>> +**/ >>>> +typedef >>>> +EFI_STATUS >>>> +(EFIAPI *EDKII_PEI_SET_VARIABLE)( >>>> +=C2=A0 IN CONST=C2=A0 EDKII_PEI_VARIABLE_PPI=C2=A0=C2=A0=C2=A0 *Thi= s, >>>> +=C2=A0 IN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 CHAR16=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *VariableName, >>>> +=C2=A0 IN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 EFI_GUID=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 *VendorGuid, >>>> +=C2=A0 IN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 UINT32=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Attributes, >>>> +=C2=A0 IN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 UINTN=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DataSize, >>>> +=C2=A0 IN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 VOID=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *Data >>>> +=C2=A0 ); >>>> + >>>> +/** >>>> +=C2=A0 Returns information about the UEFI variables. >>>> + >>>> +=C2=A0 @param[in]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 This=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = A pointer to this=20 >>>> instance of the >>> EDKII_PEI_VARIABLE_PPI. >>>> +=C2=A0 @param[in]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Attribu= tes=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Attributes=20 >>>> bitmask to specify the type >>> of variables on >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= which to return=20 >>>> information. >>>> +=C2=A0 @param[out]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 MaximumVaria= bleStorageSize=C2=A0=C2=A0=C2=A0 On output the=20 >>>> maximum >>> size of the storage space >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= available for >>>> + the EFI variables associated with >> the >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= attributes=20 >>>> specified. >>>> +=C2=A0 @param[out]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 RemainingVar= iableStorageSize=C2=A0 Returns the=20 >>>> remaining >> size >>> of the storage space >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= available for >>>> + the EFI variables associated with >> the >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= attributes=20 >>>> specified. >>>> +=C2=A0 @param[out]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 MaximumVaria= bleSize=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Retur= ns the=20 >>>> maximum size of >>> the individual EFI >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= variables >>>> + associated with the attributes >> specified. >>>> + >>>> +=C2=A0 @retval EFI_SUCCESS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Valid answer=20 >>>> returned. >>>> +=C2=A0 @retval EFI_INVALID_PARAMETER=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= An invalid=20 >>>> combination of >>> attribute bits was supplied >>>> +=C2=A0 @retval EFI_UNSUPPORTED=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 The attribute is=20 >>>> not supported >> on >>> this platform, and the >>>> + >>>> + MaximumVariableStorageSize, >>>> + >>>> + RemainingVariableStorageSize, >>> MaximumVariableSize >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= are undefined. >>>> + >>>> +**/ >>>> +typedef >>>> +EFI_STATUS >>>> +(EFIAPI *EDKII_PEI_QUERY_VARIABLE_INFO)( >>>> +=C2=A0 IN CONST=C2=A0 EDKII_PEI_VARIABLE_PPI=C2=A0=C2=A0=C2=A0 *Thi= s, >>>> +=C2=A0 IN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 UINT32=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Attributes, >>>> +=C2=A0 OUT=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 UINT64=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 *MaximumVariableStorageSize, >>>> +=C2=A0 OUT=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 UINT64=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 *RemainingVariableStorageSize, >>>> +=C2=A0 OUT=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 UINT64=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 *MaximumVariableSize >>>> +=C2=A0 ); >>>> + >>>> +/// >>>> +/// PEI Variable Protocol is intended for use as a means >>> >>> [MK] Was "PEI Variable PPI" intended? >>> >>>> +/// to store data in the PEI environment. >>>> +/// >>>> +struct _EDKII_PEI_VARIABLE_PPI { >>>> +=C2=A0 EDKII_PEI_GET_VARIABLE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 GetVariable; >>>> +=C2=A0 EDKII_PEI_GET_NEXT_VARIABLE_NAME=C2=A0 GetNextVariableName; >>>> +=C2=A0 EDKII_PEI_SET_VARIABLE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 SetVariable; >>>> +=C2=A0 EDKII_PEI_QUERY_VARIABLE_INFO=C2=A0=C2=A0=C2=A0=C2=A0 QueryV= ariableInfo; >>>> +}; >>>> + >>>> +extern EFI_GUID=C2=A0 gEdkiiPeiVariablePpiGuid; >>>> + >>>> +#endif >>>> diff --git a/MdeModulePkg/MdeModulePkg.dec >>> b/MdeModulePkg/MdeModulePkg.dec >>>> index 2bcb9f9453..4f4c48b81f 100644 >>>> --- a/MdeModulePkg/MdeModulePkg.dec >>>> +++ b/MdeModulePkg/MdeModulePkg.dec >>>> @@ -513,6 +513,9 @@ >>>> =C2=A0=C2=A0=C2=A0=C2=A0 gEdkiiPeiCapsuleOnDiskPpiGuid=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D { 0x71a9ea6= 1,=20 >>>> 0x5a35, 0x4a5d, >>> { 0xac, 0xef, 0x9c, 0xf8, 0x6d, 0x6d, 0x67, 0xe0 } } >>>> =C2=A0=C2=A0=C2=A0=C2=A0 gEdkiiPeiBootInCapsuleOnDiskModePpiGuid=C2=A0= =C2=A0 =3D { 0xb08a11e4, 0xe2b7, >>> 0x4b75, { 0xb5, 0x15, 0xaf, 0x61, 0x6, 0x68, 0xbf, 0xd1=C2=A0 } } >>>> >>>> +=C2=A0 ## Include/Ppi/Variable.h >>>> +=C2=A0 gEdkiiPeiVariablePpiGuid=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D { = 0xe7b2cd04, 0x4b14,=20 >>>> 0x44c2, { 0xb7, >>> 0x48, 0xce, 0xaf, 0x2b, 0x66, 0x4a, 0xb0 } } >>>> + >>>> =C2=A0=C2=A0 [Protocols] >>>> =C2=A0=C2=A0=C2=A0=C2=A0 ## Load File protocol provides capability t= o load and unload >>>> EFI image into >>> memory and execute it. >>>> =C2=A0=C2=A0=C2=A0=C2=A0 #=C2=A0 Include/Protocol/LoadPe32Image.h >>> >>> >>> >>> >=20 >=20 >=20 >=20 >=20 >=20 >=20 >=20