Re: [edk2-devel] regarding calling UEFI runtime services (mainly SetVariable) from linux or android OS which is running on xen+tianocore UEFI

2023-02-06 Thread ritul guru
ohh, it should retains value on VM reboot.

//
// Allocate storage for NV variables early on so it will be
// at a consistent address. Since VM memory is preserved
// across reboots, this allows the NV variable storage to survive
// a VM reboot.
//



*Thanks & RegardsRitul Guru+91-9916513186*


On Mon, Feb 6, 2023 at 11:55 PM ritul guru  wrote:

> Thanks,
> so as it is memory, does it mean if anything written in variable store,
> and VM reboot happens then variable store will be flushed?
>
>
>
> *Thanks & RegardsRitul Guru+91-9916513186*
>
>
> On Mon, Feb 6, 2023 at 11:47 PM Andrew (EFI) Fish  wrote:
>
>>
>>
>> On Feb 6, 2023, at 8:06 AM, ritul guru  wrote:
>>
>> Hi,
>>
>> I have been using xen hypervisor and tianocore uefi BIOS on xen to boot
>> to ubuntu OS on virtualized disk.
>> 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,
>> 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?
>> If so, where does this variable gets stored? is it in some virtualized
>> disk as there is no virtualized SPIROM available to VM.
>>
>>
>>
>> I don’t know the Xen specifics, but the firmware maps in a Flash Device
>> (FD) here:
>>
>> [image: edk2.png]
>>
>> edk2/OvmfXen.fdf at master · tianocore/edk2
>> 
>> github.com
>> 
>> 
>>
>> Oh looks like it uses an emulated variable store that is just memory. See
>> ReserveEmuVariableNvStore().
>>
>> [image: edk2.png]
>>
>> edk2/Platform.c at master · tianocore/edk2
>> 
>> github.com
>> 
>>
>> 
>>
>> Thanks,
>>
>> Andrew Fish
>>
>>
>> https://wiki.osdev.org/Using_UEFI_Runtime_Services_in_your_Kernel
>>
>>
>>
>> *Thanks & RegardsRitul Guru+91-9916513186*
>> 
>>
>>
>>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#99696): https://edk2.groups.io/g/devel/message/99696
Mute This Topic: https://groups.io/mt/96789290/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] regarding calling UEFI runtime services (mainly SetVariable) from linux or android OS which is running on xen+tianocore UEFI

2023-02-06 Thread Andrew Fish via groups.io


> On Feb 6, 2023, at 10:25 AM, ritul guru  wrote:
> 
> Thanks,
> so as it is memory, does it mean if anything written in variable store, and 
> VM reboot happens then variable store will be flushed?
> 

It looks like it is saved if you do an S3. S3 is ACPI speak for a sleep state 
that puts RAM into self refresh. On a cold boot it allocates the memory, so you 
are starting over.

Sorry I’ve never looked at the Xen code before so I’m sight reading.

Thanks,

Andrew Fish

> Thanks & Regards
> Ritul Guru
> +91-9916513186
> 
> 
> On Mon, Feb 6, 2023 at 11:47 PM Andrew (EFI) Fish  > wrote:
>> 
>> 
>>> On Feb 6, 2023, at 8:06 AM, ritul guru >> > wrote:
>>> 
>>> Hi,
>>> 
>>> I have been using xen hypervisor and tianocore uefi BIOS on xen to boot to 
>>> ubuntu OS on virtualized disk.
>>> 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,
>>> 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? 
>>> If so, where does this variable gets stored? is it in some virtualized disk 
>>> as there is no virtualized SPIROM available to VM.
>>> 
>>> 
>> 
>> I don’t know the Xen specifics, but the firmware maps in a Flash Device (FD) 
>> here:
>> 
>> 
>> edk2/OvmfXen.fdf at master · tianocore/edk2
>> github.com
>>  
>> edk2/OvmfXen.fdf
>>  at master · tianocore/edk2 
>> 
>> github.com 
>> 
>> 
>> Oh looks like it uses an emulated variable store that is just memory. See 
>> ReserveEmuVariableNvStore().
>> 
>> 
>> edk2/Platform.c at master · tianocore/edk2
>> github.com
>>  
>> edk2/Platform.c
>>  at master · tianocore/edk2 
>> 
>> github.com 
>> 
>> 
>> Thanks,
>> 
>> Andrew Fish
>> 
>>> 
>>> https://wiki.osdev.org/Using_UEFI_Runtime_Services_in_your_Kernel
>>> 
>>> Thanks & Regards
>>> Ritul Guru
>>> +91-9916513186
>>> 
>> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#99694): https://edk2.groups.io/g/devel/message/99694
Mute This Topic: https://groups.io/mt/96789290/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] regarding calling UEFI runtime services (mainly SetVariable) from linux or android OS which is running on xen+tianocore UEFI

2023-02-06 Thread ritul guru
Hi,

I have been using xen hypervisor and tianocore uefi BIOS on xen to boot to
ubuntu OS on virtualized disk.
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,
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?
If so, where does this variable gets stored? is it in some virtualized disk
as there is no virtualized SPIROM available to VM.



https://wiki.osdev.org/Using_UEFI_Runtime_Services_in_your_Kernel



*Thanks & RegardsRitul Guru+91-9916513186*


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#99692): https://edk2.groups.io/g/devel/message/99692
Mute This Topic: https://groups.io/mt/96789290/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-