Laszlo, The translation from physical to virtual is described in an EFI Memory Map. Each memory map entry in the EFI Memory Map provides a base address and a length. SetVirtualAddressMap() can not break up the memory map entries into smaller entries. This means if an array larger than one 4KB page is allocated from contiguous physical address space, it will be described by a single EFI Memory Map entry, which means it will be in contiguous virtual address space.
Best regards, Mike -----Original Message----- From: Laszlo Ersek [mailto:ler...@redhat.com] Sent: Wednesday, July 24, 2013 4:27 AM To: Andrew Fish Cc: edk2-devel@lists.sourceforge.net Subject: Re: [edk2] runtime service address translation On 07/24/13 01:36, Andrew Fish wrote: > EFI requests mappings for physical address ranges in the memory map by > setting the attribute bit EFI_MEMORY_RUNTIME. The OS (or loader > depending on the OS design), after ExitBootServices() calls > SetVirtualAddressMap() to provide the firmware with the virtual mapping > for the physical address ranges. Prior to the SetVirtualAddressMap() EFI > Runtime Services are only called in physical mode, after > SetVirtualAddressMap() runtime services may only be called in virtual mode. > > You can read up on this in the UEFI 2.4 spec. I was recently thinking about this (my first (and to time, only) encounter has been svn r14425) -- how do you convert an array that's bigger than one page? The base pointer can be converted, but code using the array assumes the array is contiguous in address space (by way of the subscript operator []), which may not be true for virtual addresses if the array is bigger than one page. One of Matthew Garrett's presentations mentioned this problem/question IIRC... Apologies if it has come up before on the list, I can't remember the answer. Thanks! Laszlo ------------------------------------------------------------------------------ See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel ------------------------------------------------------------------------------ See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel