<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#000099">ohh,

it should retains value on VM reboot.

</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#000099"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#000099"><table class="gmail-highlight gmail-tab-size gmail-js-file-line-container gmail-js-code-nav-container gmail-js-tagsearch-file" style="border-spacing:0px;border-collapse:collapse;color:rgb(36,41,47);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><tbody style="box-sizing:border-box"><tr style="box-sizing:border-box"><td id="gmail-LC371" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;white-space:pre"> <span class="gmail-pl-c" style="box-sizing:border-box"><span class="gmail-pl-c" style="box-sizing:border-box">//</span></span></td></tr><tr style="box-sizing:border-box;background-color:transparent"><td id="gmail-L372" class="gmail-blob-num gmail-js-line-number gmail-js-code-nav-line-number gmail-js-blob-rnum" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;line-height:20px;text-align:right;white-space:nowrap;vertical-align:top"></td><td id="gmail-LC372" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;white-space:pre">  <span class="gmail-pl-c" style="box-sizing:border-box"><span class="gmail-pl-c" style="box-sizing:border-box">//</span> Allocate storage for NV variables early on so it will be</span></td></tr><tr style="box-sizing:border-box"><td id="gmail-L373" class="gmail-blob-num gmail-js-line-number gmail-js-code-nav-line-number gmail-js-blob-rnum" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;line-height:20px;text-align:right;white-space:nowrap;vertical-align:top"></td><td id="gmail-LC373" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;white-space:pre">  <span class="gmail-pl-c" style="box-sizing:border-box"><span class="gmail-pl-c" style="box-sizing:border-box">//</span> at a consistent address.  Since VM memory is preserved</span></td></tr><tr style="box-sizing:border-box;background-color:transparent"><td id="gmail-L374" class="gmail-blob-num gmail-js-line-number gmail-js-code-nav-line-number gmail-js-blob-rnum" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;line-height:20px;text-align:right;white-space:nowrap;vertical-align:top"></td><td id="gmail-LC374" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;white-space:pre">  <span class="gmail-pl-c" style="box-sizing:border-box"><span class="gmail-pl-c" style="box-sizing:border-box">//</span> across reboots, this allows the NV variable storage to survive</span></td></tr><tr style="box-sizing:border-box"><td id="gmail-L375" class="gmail-blob-num gmail-js-line-number gmail-js-code-nav-line-number gmail-js-blob-rnum" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;line-height:20px;text-align:right;white-space:nowrap;vertical-align:top"></td><td id="gmail-LC375" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;white-space:pre">  <span class="gmail-pl-c" style="box-sizing:border-box"><span class="gmail-pl-c" style="box-sizing:border-box">//</span> a VM reboot.</span></td></tr><tr style="box-sizing:border-box;background-color:transparent"><td id="gmail-L376" class="gmail-blob-num gmail-js-line-number gmail-js-code-nav-line-number gmail-js-blob-rnum" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;line-height:20px;text-align:right;white-space:nowrap;vertical-align:top"></td><td id="gmail-LC376" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;white-space:pre">  <span class="gmail-pl-c" style="box-sizing:border-box"><span class="gmail-pl-c" style="box-sizing:border-box">//



</span></span></td></tr></tbody></table></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#000099"><br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><b><font size="2" face="verdana, sans-serif"><span style="color:rgb(0,0,153)">Thanks & Regards<br>Ritul Guru<br>+91<font size="2">-</font>9916513186</span></font></b></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 6, 2023 at 11:55 PM ritul guru <<a href="mailto:ritul.bits@gmail.com">ritul.bits@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(0,0,153)">Thanks,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(0,0,153)">so as it is memory, does it mean if anything written in variable store, and VM reboot happens then variable store will be flushed?</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(0,0,153)"><br></div><div><div dir="ltr"><div dir="ltr"><b><font size="2" face="verdana, sans-serif"><span style="color:rgb(0,0,153)">Thanks & Regards<br>Ritul Guru<br>+91<font size="2">-</font>9916513186</span></font></b></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 6, 2023 at 11:47 PM Andrew (EFI) Fish <<a href="mailto:afish@apple.com" target="_blank">afish@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><br><div><br><blockquote type="cite"><div>On Feb 6, 2023, at 8:06 AM, ritul guru <<a href="mailto:ritul.bits@gmail.com" target="_blank">ritul.bits@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(0,0,153)">Hi,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(0,0,153)"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(0,0,153)">I have been using xen hypervisor and tianocore uefi BIOS on xen to boot to ubuntu OS on virtualized disk.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(0,0,153)">and want to set a UEFI variable with UEFI runtime service SetVariable() to a value and the same wants to read from UEFI bootloader either grubx64.efi or botmgfw.efi,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(0,0,153)">So, Is it possible to use runtime services to do such an operation for OS running on VM when booted with OVMF/tianocore BIOS on VM guest? </div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(0,0,153)">If so, where does this variable gets stored? is it in some virtualized disk as there is no virtualized SPIROM available to VM.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(0,0,153)"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(0,0,153)"><br></div></div></div></blockquote><div><br></div><div>I don’t know the Xen specifics, but the firmware maps in a Flash Device (FD) here:</div><div><br></div><div><div style="display:block"><div style="display:inline-block" role="link"><a style="border-radius:10px;font-family:-apple-system,Helvetica,Arial,sans-serif;display:block;width:300px;overflow:hidden;text-decoration:none" rel="nofollow" href="https://github.com/tianocore/edk2/blob/master/OvmfPkg/OvmfXen.fdf" dir="ltr" role="button" width="300" target="_blank"><table style="table-layout:fixed;border-collapse:collapse;width:300px;background-color:rgb(229,230,233);font-family:-apple-system,Helvetica,Arial,sans-serif" cellpadding="0" cellspacing="0" border="0" width="300"><tbody><tr><td align="center"><img style="width: 300px; height: 150px;" width="300" height="150" alt="edk2.png" src="cid:18627f95fb55f3396411"></td></tr><tr><td><table bgcolor="#E5E6E9" cellpadding="0" cellspacing="0" width="300" style="font-family:-apple-system,Helvetica,Arial,sans-serif;table-layout:fixed;background-color:rgb(229,230,233)"><tbody><tr><td style="padding:8px 0px"><div style="max-width:100%;margin:0px 16px;overflow:hidden"><div style="font-weight:500;font-size:12px;overflow:hidden;text-overflow:ellipsis;text-align:left"><a rel="nofollow" href="https://github.com/tianocore/edk2/blob/master/OvmfPkg/OvmfXen.fdf" style="text-decoration:none" target="_blank"><font color="#272727" style="color:rgba(0,0,0,0.847)">edk2/OvmfXen.fdf at master · tianocore/edk2</font></a></div><div style="font-weight:400;font-size:11px;overflow:hidden;text-overflow:ellipsis;text-align:left"><a rel="nofollow" href="https://github.com/tianocore/edk2/blob/master/OvmfPkg/OvmfXen.fdf" style="text-decoration:none" target="_blank"><font color="#808080" style="color:rgba(0,0,0,0.498)">github.com</font></a></div></div></td></tr></tbody></table></td></tr></tbody></table></a></div></div></div><div><br></div><div>Oh looks like it uses an emulated variable store that is just memory. See <span style="color:rgb(5,80,174);font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;white-space:pre-wrap;background-color:rgb(255,255,255)">ReserveEmuVariableNvStore</span>().</div><div><br></div><div><div style="display:block"><div style="display:inline-block" role="link"><a style="border-radius:10px;font-family:-apple-system,Helvetica,Arial,sans-serif;display:block;width:300px;overflow:hidden;text-decoration:none" rel="nofollow" href="https://github.com/tianocore/edk2/blob/master/OvmfPkg/XenPlatformPei/Platform.c#L365" dir="ltr" role="button" width="300" target="_blank"><table style="table-layout:fixed;border-collapse:collapse;width:300px;background-color:rgb(229,230,233);font-family:-apple-system,Helvetica,Arial,sans-serif" cellpadding="0" cellspacing="0" border="0" width="300"><tbody><tr><td align="center"><img style="width: 300px; height: 150px;" width="300" height="150" alt="edk2.png"></td></tr><tr><td><table bgcolor="#E5E6E9" cellpadding="0" cellspacing="0" width="300" style="font-family:-apple-system,Helvetica,Arial,sans-serif;table-layout:fixed;background-color:rgb(229,230,233)"><tbody><tr><td style="padding:8px 0px"><div style="max-width:100%;margin:0px 16px;overflow:hidden"><div style="font-weight:500;font-size:12px;overflow:hidden;text-overflow:ellipsis;text-align:left"><a rel="nofollow" href="https://github.com/tianocore/edk2/blob/master/OvmfPkg/XenPlatformPei/Platform.c#L365" style="text-decoration:none" target="_blank"><font color="#272727" style="color:rgba(0,0,0,0.847)">edk2/Platform.c at master · tianocore/edk2</font></a></div><div style="font-weight:400;font-size:11px;overflow:hidden;text-overflow:ellipsis;text-align:left"><a rel="nofollow" href="https://github.com/tianocore/edk2/blob/master/OvmfPkg/XenPlatformPei/Platform.c#L365" style="text-decoration:none" target="_blank"><font color="#808080" style="color:rgba(0,0,0,0.498)">github.com</font></a></div></div></td></tr></tbody></table></td></tr></tbody></table></a></div></div></div><div><br></div><div>Thanks,</div><div><br></div><div>Andrew Fish</div><br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(0,0,153)"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(0,0,153)"><a href="https://wiki.osdev.org/Using_UEFI_Runtime_Services_in_your_Kernel" target="_blank">https://wiki.osdev.org/Using_UEFI_Runtime_Services_in_your_Kernel</a><br clear="all"></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(0,0,153)"><br></div><div><div dir="ltr"><div dir="ltr"><b><font size="2" face="verdana, sans-serif"><span style="color:rgb(0,0,153)">Thanks & Regards<br>Ritul Guru<br>+91<font size="2">-</font>9916513186</span></font></b></div></div></div></div>




</div></blockquote></div><br></div></blockquote></div>
</blockquote></div>


<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/99696">View/Reply Online (#99696)</a> |


  

|

  <a target="_blank" href="https://groups.io/mt/96789290/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>