[tip:efi/urgent] efi: Don't issue error message when booted under Xen

From: tip-bot for Juergen Gross
Date: Sun May 28 2017 - 05:49:41 EST


Commit-ID: 1ea34adb87c969b89dfd83f1905a79161e9ada26
Gitweb: http://git.kernel.org/tip/1ea34adb87c969b89dfd83f1905a79161e9ada26
Author: Juergen Gross <jgross@xxxxxxxx>
AuthorDate: Fri, 26 May 2017 12:36:47 +0100
Committer: Ingo Molnar <mingo@xxxxxxxxxx>
CommitDate: Sun, 28 May 2017 11:06:16 +0200

efi: Don't issue error message when booted under Xen

When booted as Xen dom0 there won't be an EFI memmap allocated. Avoid
issuing an error message in this case:

[ 0.144079] efi: Failed to allocate new EFI memmap

Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
Signed-off-by: Matt Fleming <matt@xxxxxxxxxxxxxxxxxxx>
Cc: <stable@xxxxxxxxxxxxxxx> # v4.9+
Cc: Ard Biesheuvel <ard.biesheuvel@xxxxxxxxxx>
Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: linux-efi@xxxxxxxxxxxxxxx
Link: http://lkml.kernel.org/r/20170526113652.21339-2-matt@xxxxxxxxxxxxxxxxxxx
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
---
arch/x86/platform/efi/quirks.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c
index 2661599..e0cf95a 100644
--- a/arch/x86/platform/efi/quirks.c
+++ b/arch/x86/platform/efi/quirks.c
@@ -360,6 +360,9 @@ void __init efi_free_boot_services(void)
free_bootmem_late(start, size);
}

+ if (!num_entries)
+ return;
+
new_size = efi.memmap.desc_size * num_entries;
new_phys = efi_memmap_alloc(num_entries);
if (!new_phys) {