| #
1.1 |
|
24-Sep-2022 |
riastradh |
x86: Support EFI runtime services.
This creates a special pmap, efi_runtime_pmap, which avoids setting PTE_U but allows mappings to lie in what would normally be user VM -- this way we don't fall afoul of SMAP/SMEP when executing EFI runtime services from CPL 0. SVS does not apply to the EFI runtime pmap.
The mechanism is intended to work with either physical addressing or virtual addressing; currently the bootloader does physical addressing but in principle it could be modified to do virtual addressing instead, if it allocated virtual pages, assigned them in the memory map, and issued RT->SetVirtualAddressMap.
Not sure pmap_activate_sync and pmap_deactivate_sync are correct, need more review from an x86 wizard.
If this causes fallout, it can be disabled temporarily without reverting anything by just making efi_runtime_init return immediately without doing anything, or by removing options EFI_RUNTIME.
amd64-only for now pending type fixes and testing on i386.
|