On 15 May 2018 at 09:07, Prakhya, Sai Praneeth <sai.praneeth.prakhya@xxxxxxxxx> wrote: > Hi All, > > > > I recently noticed in UEFI spec v2.7, section 2.3.4, Calling Conventions for > X64, that “All selectors set to be flat with virtual = physical address. If > the UEFI OS loader or OS used SetVirtualAddressMap() to relocate the runtime > services in a virtual address > space, then this condition does not have to be met. My understanding of it > is as shown below. Please correct me if it’s wrong. > > 1. It’s not mandatory for the OS to call SetVirtualAddressMap() > > 2. If it’s not called, the OS can still use EFI Runtime Services in > physical mode (i.e. PA == VA). > > > > For x86_64, I did a quick test with qemu and OVMF. I have commented out call > to SetVirtualAddressMap() from kernel and noticed that everything works fine > i.e. efi variables have the normal functionality and I ran LUV (Linux UEFI > Validation). Not calling SetVirtualAddressMap() doesn’t break anything > because on x86 we have 1:1 mappings. So, could someone please let me know > why we might still need to call SetVirtualAddressMap()? > You are right, and the same applies to arm64. However, Apple Mac EFI is known not to tolerate PA==VA at runtime, and there may be other x86 firmware implementations that don't work correctly in this case, since they are only tested with MS Windows, which also calls SetVirtualAddressMap(). So the safe option is to still call it. -- To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html