If unsure, say Y.
+config EFI_SET_VIRTUAL_ADDRESS_MAP
+ bool "EFI: call SetVirtualAddressMap()" if EXPERT = "y"
+ ---help---
+ Call EFI SetVirtualAddressMap() runtime service to setup memory map for
+ further runtime services. According to UEFI spec, it isn't strictly
+ necessary, but many UEFI implementations misbehave when this call is
+ missing.
+
+ If unsure, say N.
+
config XENOPROF
def_bool y
prompt "Xen Oprofile Support" if EXPERT = "y"
efi_arch_video_init(gop, info_size, mode_info);
}
+#define INVALID_VIRTUAL_ADDRESS (0xBAAADUL << \
+ (EFI_PAGE_SHIFT + BITS_PER_LONG - 32))
+
static void __init efi_exit_boot(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
{
EFI_STATUS status;
UINTN info_size = 0, map_key;
bool retry;
+#ifdef CONFIG_EFI_SET_VIRTUAL_ADDRESS_MAP
+ unsigned int i;
+#endif
efi_bs->GetMemoryMap(&info_size, NULL, &map_key,
&efi_mdesc_size, &mdesc_ver);
if ( EFI_ERROR(status) )
PrintErrMesg(L"Cannot exit boot services", status);
+#ifdef CONFIG_EFI_SET_VIRTUAL_ADDRESS_MAP
+ for ( i = 0; i < efi_memmap_size; i += efi_mdesc_size )
+ {
+ EFI_MEMORY_DESCRIPTOR *desc = efi_memmap + i;
+
+ if ( desc->Attribute & EFI_MEMORY_RUNTIME )
+ desc->VirtualStart = desc->PhysicalStart;
+ else
+ desc->VirtualStart = INVALID_VIRTUAL_ADDRESS;
+ }
+ status = efi_rs->SetVirtualAddressMap(efi_memmap_size, efi_mdesc_size,
+ mdesc_ver, efi_memmap);
+ if ( status != EFI_SUCCESS )
+ {
+ printk(XENLOG_ERR "EFI: SetVirtualAddressMap() failed (%#lx), disabling runtime services\n",
+ status);
+ __clear_bit(EFI_RS, &efi_flags);
+ }
+#endif
+
/* Adjust pointers into EFI. */
efi_ct = (void *)efi_ct + DIRECTMAP_VIRT_START;
efi_memmap = (void *)efi_memmap + DIRECTMAP_VIRT_START;
return true;
}
-#define INVALID_VIRTUAL_ADDRESS (0xBAAADUL << \
- (EFI_PAGE_SHIFT + BITS_PER_LONG - 32))
void __init efi_init_memory(void)
{
return;
}
- /* Set up 1:1 page tables to do runtime calls in "physical" mode. */
+ /*
+ * Set up 1:1 page tables for runtime calls. See SetVirtualAddressMap() in
+ * efi_exit_boot().
+ */
efi_l4_pgtable = alloc_xen_pagetable();
BUG_ON(!efi_l4_pgtable);
clear_page(efi_l4_pgtable);