diff options
author | Demi Marie Obenour <demi@invisiblethingslab.com> | 2023-01-19 14:04:00 -0500 |
---|---|---|
committer | Ard Biesheuvel <ardb@kernel.org> | 2023-01-23 11:33:24 +0100 |
commit | fa7bee867db1913560435a7486d17d95500a62dc (patch) | |
tree | 34397278a5cf2f32519aa3e85028cdaf8d2a1170 /drivers/firmware | |
parent | 01de145dc7fbb5e6aba98655c062908a74fa511c (diff) |
efi: Warn if trying to reserve memory under Xen
Doing so cannot work and should never happen.
Signed-off-by: Demi Marie Obenour <demi@invisiblethingslab.com>
Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'drivers/firmware')
-rw-r--r-- | drivers/firmware/efi/efi.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index 19c1191e6210..d4023ea1ccff 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -541,6 +541,10 @@ void __init __weak efi_arch_mem_reserve(phys_addr_t addr, u64 size) {} */ void __init efi_mem_reserve(phys_addr_t addr, u64 size) { + /* efi_mem_reserve() does not work under Xen */ + if (WARN_ON_ONCE(efi_enabled(EFI_PARAVIRT))) + return; + if (!memblock_is_region_reserved(addr, size)) memblock_reserve(addr, size); |