aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/platform/efi/efi.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/platform/efi/efi.c')
-rw-r--r--arch/x86/platform/efi/efi.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 7d627a02ed82..d9026538cfdb 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -210,6 +210,9 @@ int __init efi_memblock_x86_reserve_range(void)
210 struct efi_info *e = &boot_params.efi_info; 210 struct efi_info *e = &boot_params.efi_info;
211 unsigned long pmap; 211 unsigned long pmap;
212 212
213 if (efi_enabled(EFI_PARAVIRT))
214 return 0;
215
213#ifdef CONFIG_X86_32 216#ifdef CONFIG_X86_32
214 /* Can't handle data above 4GB at this time */ 217 /* Can't handle data above 4GB at this time */
215 if (e->efi_memmap_hi) { 218 if (e->efi_memmap_hi) {
@@ -422,14 +425,24 @@ static int __init efi_runtime_init(void)
422 * the runtime services table so that we can grab the physical 425 * the runtime services table so that we can grab the physical
423 * address of several of the EFI runtime functions, needed to 426 * address of several of the EFI runtime functions, needed to
424 * set the firmware into virtual mode. 427 * set the firmware into virtual mode.
428 *
429 * When EFI_PARAVIRT is in force then we could not map runtime
430 * service memory region because we do not have direct access to it.
431 * However, runtime services are available through proxy functions
432 * (e.g. in case of Xen dom0 EFI implementation they call special
433 * hypercall which executes relevant EFI functions) and that is why
434 * they are always enabled.
425 */ 435 */
426 if (efi_enabled(EFI_64BIT))
427 rv = efi_runtime_init64();
428 else
429 rv = efi_runtime_init32();
430 436
431 if (rv) 437 if (!efi_enabled(EFI_PARAVIRT)) {
432 return rv; 438 if (efi_enabled(EFI_64BIT))
439 rv = efi_runtime_init64();
440 else
441 rv = efi_runtime_init32();
442
443 if (rv)
444 return rv;
445 }
433 446
434 set_bit(EFI_RUNTIME_SERVICES, &efi.flags); 447 set_bit(EFI_RUNTIME_SERVICES, &efi.flags);
435 448
@@ -438,6 +451,9 @@ static int __init efi_runtime_init(void)
438 451
439static int __init efi_memmap_init(void) 452static int __init efi_memmap_init(void)
440{ 453{
454 if (efi_enabled(EFI_PARAVIRT))
455 return 0;
456
441 /* Map the EFI memory map */ 457 /* Map the EFI memory map */
442 memmap.map = early_memremap((unsigned long)memmap.phys_map, 458 memmap.map = early_memremap((unsigned long)memmap.phys_map,
443 memmap.nr_map * memmap.desc_size); 459 memmap.nr_map * memmap.desc_size);
@@ -914,6 +930,9 @@ static void __init __efi_enter_virtual_mode(void)
914 930
915void __init efi_enter_virtual_mode(void) 931void __init efi_enter_virtual_mode(void)
916{ 932{
933 if (efi_enabled(EFI_PARAVIRT))
934 return;
935
917 if (efi_setup) 936 if (efi_setup)
918 kexec_enter_virtual_mode(); 937 kexec_enter_virtual_mode();
919 else 938 else