<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">The max variable size is a build time configurable option. For those that produce binary compatible drivers/OpROMs which need to work both with TianoCore and other vendor provided UEFI PI implementations, the luxury of recompiling the entire
 BIOS image or dictating the platform’s choice for PcdMaxVariableSize image may not exist.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Bret Barkelew <Bret.Barkelew@microsoft.com> <br>
<b>Sent:</b> Monday, April 5, 2021 12:31 PM<br>
<b>To:</b> devel@edk2.groups.io; Oram, Isaac W <isaac.w.oram@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com><br>
<b>Cc:</b> Chiu, Chasel <chasel.chiu@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Dong, Eric <eric.dong@intel.com>; Michael Kubacki <Michael.Kubacki@microsoft.com><br>
<b>Subject:</b> RE: [edk2-platforms] [PATCH v2 0/4] Add Large Variable Libraries<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Naïve question: if max variable size is not already configurable, why not just do that?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">- Bret <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From: </b><a href="mailto:isaac.w.oram=intel.com@groups.io">Oram, Isaac W via groups.io</a><br>
<b>Sent: </b>Monday, April 5, 2021 12:27 PM<br>
<b>To: </b><a href="mailto:nathaniel.l.desimone@intel.com">Desimone, Nathaniel L</a>;
<a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a><br>
<b>Cc: </b><a href="mailto:chasel.chiu@intel.com">Chiu, Chasel</a>; <a href="mailto:gaoliming@byosoft.com.cn">
Liming Gao</a>; <a href="mailto:eric.dong@intel.com">Dong, Eric</a>; <a href="mailto:Michael.Kubacki@microsoft.com">
Michael Kubacki</a><br>
<b>Subject: </b>[EXTERNAL] Re: [edk2-devel] [edk2-platforms] [PATCH v2 0/4] Add Large Variable Libraries<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Series Reviewed-by: Isaac Oram <<a href="mailto:isaac.w.oram@intel.com">isaac.w.oram@intel.com</a>><br>
<br>
-----Original Message-----<br>
From: Desimone, Nathaniel L <<a href="mailto:nathaniel.l.desimone@intel.com">nathaniel.l.desimone@intel.com</a>>
<br>
Sent: Sunday, April 4, 2021 2:41 AM<br>
To: <a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a><br>
Cc: Chiu, Chasel <<a href="mailto:chasel.chiu@intel.com">chasel.chiu@intel.com</a>>; Liming Gao <<a href="mailto:gaoliming@byosoft.com.cn">gaoliming@byosoft.com.cn</a>>; Dong, Eric <<a href="mailto:eric.dong@intel.com">eric.dong@intel.com</a>>; Michael Kubacki
 <<a href="mailto:michael.kubacki@microsoft.com">michael.kubacki@microsoft.com</a>>; Oram, Isaac W <<a href="mailto:isaac.w.oram@intel.com">isaac.w.oram@intel.com</a>><br>
Subject: [edk2-platforms] [PATCH v2 0/4] Add Large Variable Libraries<br>
<br>
Changes from V1:<br>
 - Changed prefix from "Min" to "VarLib"<br>
 - Better comments<br>
 - Added more whitespace for readability<br>
 - Removed unused INF sections<br>
 - Better debug messages<br>
<br>
This patch series introduces libaries that enable large data sets to be stored using the UEFI Variable Services. At present, most UEFI Variable Services implementations have a maximum variable size of <=64KB. The exact value varies depending on platform.<br>
<br>
These libaries enable a data set to use as much space as needed, up to the remaining space in the UEFI Variable non-volatile storage.<br>
<br>
To implement this, I have broken the problem down into two parts:<br>
<br>
 1. Phase angostic UEFI Variable access.<br>
 2. Storage of data across multiple UEFI Variables.<br>
<br>
For the first part, I have created two new LibraryClasses:<br>
VariableReadLib and VariableWriteLib. I have provided implementation instances of VariableReadLib for PEI, DXE, and SMM.<br>
For VariableWriteLib, I have provided implementation instances for DXE and SMM. This enables code that accesses UEFI variables to be written in a matter than is phase agnostic, so the same code can be used in PEI, DXE, or SMM without modification.<br>
<br>
The second part involves another two new LibaryClasses:<br>
LargeVariableReadLib and LargeVariableWriteLib. Only one BASE implementation is needed for both of these as the phase dependent code was seperated out in the first piece. These libraries provide logic to calculate the maximum size of an individual UEFI variable
 and split the data into as many smaller pieces as needed to store the entire data set in the UEFI Variable storage. They also provide the ability to stitch the data back together when it is read.<br>
Deleting the data will delete all variables used to store it.<br>
<br>
Cc: Chasel Chiu <<a href="mailto:chasel.chiu@intel.com">chasel.chiu@intel.com</a>><br>
Cc: Liming Gao <<a href="mailto:gaoliming@byosoft.com.cn">gaoliming@byosoft.com.cn</a>><br>
Cc: Eric Dong <<a href="mailto:eric.dong@intel.com">eric.dong@intel.com</a>><br>
Cc: Michael Kubacki <<a href="mailto:michael.kubacki@microsoft.com">michael.kubacki@microsoft.com</a>><br>
Cc: Isaac Oram <<a href="mailto:isaac.w.oram@intel.com">isaac.w.oram@intel.com</a>><br>
Signed-off-by: Nate DeSimone <<a href="mailto:nathaniel.l.desimone@intel.com">nathaniel.l.desimone@intel.com</a>><br>
<br>
Nate DeSimone (4):<br>
  MinPlatformPkg: Add VariableReadLib<br>
  MinPlatformPkg: Add VariableWriteLib<br>
  MinPlatformPkg: Add LargeVariableReadLib<br>
  MinPlatformPkg: Add LargeVariableWriteLib<br>
<br>
 .../Include/Dsc/CoreCommonLib.dsc             |   6 +-<br>
 .../MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc |  12 +-<br>
 .../MinPlatformPkg/Include/Dsc/CorePeiLib.dsc |   9 +-<br>
 .../Include/Library/LargeVariableReadLib.h    |  50 ++<br>
 .../Include/Library/LargeVariableWriteLib.h   |  58 +++<br>
 .../Include/Library/VariableReadLib.h         |  87 ++++<br>
 .../Include/Library/VariableWriteLib.h        | 129 +++++<br>
 .../BaseLargeVariableReadLib.inf              |  44 ++<br>
 .../LargeVariableReadLib.c                    | 199 ++++++++<br>
 .../BaseLargeVariableWriteLib.inf             |  44 ++<br>
 .../LargeVariableWriteLib.c                   | 479 ++++++++++++++++++<br>
 .../DxeRuntimeVariableReadLib.c               | 115 +++++<br>
 .../DxeRuntimeVariableReadLib.inf             |  41 ++<br>
 .../DxeRuntimeVariableWriteLib.c              | 256 ++++++++++<br>
 .../DxeRuntimeVariableWriteLib.inf            |  49 ++<br>
 .../PeiVariableReadLib/PeiVariableReadLib.c   | 153 ++++++<br>
 .../PeiVariableReadLib/PeiVariableReadLib.inf |  42 ++<br>
 .../SmmVariableReadCommon.c                   | 114 +++++<br>
 .../StandaloneMmVariableReadLib.inf           |  50 ++<br>
 .../StandaloneMmVariableReadLibConstructor.c  |  48 ++<br>
 .../TraditionalMmVariableReadLib.inf          |  49 ++<br>
 .../TraditionalMmVariableReadLibConstructor.c |  48 ++<br>
 .../SmmVariableWriteCommon.c                  | 167 ++++++<br>
 .../StandaloneMmVariableWriteLib.inf          |  45 ++<br>
 .../StandaloneMmVariableWriteLibConstructor.c |  48 ++<br>
 .../TraditionalMmVariableWriteLib.inf         |  44 ++<br>
 ...TraditionalMmVariableWriteLibConstructor.c |  48 ++<br>
 .../Intel/MinPlatformPkg/MinPlatformPkg.dsc   |   4 +-<br>
 28 files changed, 2428 insertions(+), 10 deletions(-)  create mode 100644 Platform/Intel/MinPlatformPkg/Include/Library/LargeVariableReadLib.h<br>
 create mode 100644 Platform/Intel/MinPlatformPkg/Include/Library/LargeVariableWriteLib.h<br>
 create mode 100644 Platform/Intel/MinPlatformPkg/Include/Library/VariableReadLib.h<br>
 create mode 100644 Platform/Intel/MinPlatformPkg/Include/Library/VariableWriteLib.h<br>
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/BaseLargeVariableReadLib/BaseLargeVariableReadLib.inf<br>
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/BaseLargeVariableReadLib/LargeVariableReadLib.c<br>
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/BaseLargeVariableWriteLib/BaseLargeVariableWriteLib.inf<br>
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/BaseLargeVariableWriteLib/LargeVariableWriteLib.c<br>
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/DxeRuntimeVariableReadLib/DxeRuntimeVariableReadLib.c<br>
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/DxeRuntimeVariableReadLib/DxeRuntimeVariableReadLib.inf<br>
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/DxeRuntimeVariableWriteLib/DxeRuntimeVariableWriteLib.c<br>
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/DxeRuntimeVariableWriteLib/DxeRuntimeVariableWriteLib.inf<br>
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/PeiVariableReadLib/PeiVariableReadLib.c<br>
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/PeiVariableReadLib/PeiVariableReadLib.inf<br>
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableReadLib/SmmVariableReadCommon.c<br>
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableReadLib/StandaloneMmVariableReadLib.inf<br>
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableReadLib/StandaloneMmVariableReadLibConstructor.c<br>
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableReadLib/TraditionalMmVariableReadLib.inf<br>
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableReadLib/TraditionalMmVariableReadLibConstructor.c<br>
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/SmmVariableWriteCommon.c<br>
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/StandaloneMmVariableWriteLib.inf<br>
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/StandaloneMmVariableWriteLibConstructor.c<br>
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/TraditionalMmVariableWriteLib.inf<br>
 create mode 100644 Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/TraditionalMmVariableWriteLibConstructor.c<br>
<br>
--<br>
2.27.0.windows.1<br>
<br>
<br>
<br>
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>


 <div width="1" style="color:white;clear:both">_._,_._,_</div> <hr> Groups.io Links:<p>   You receive all messages sent to this group.    <p> <a target="_blank" href="https://edk2.groups.io/g/devel/message/73699">View/Reply Online (#73699)</a> |    |  <a target="_blank" href="https://groups.io/mt/81841052/1813853">Mute This Topic</a>  | <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>    <a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> | <a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |  <a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>  [edk2-devel-archive@redhat.com]<br> <div width="1" style="color:white;clear:both">_._,_._,_</div>