From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757303AbcLUNLp (ORCPT ); Wed, 21 Dec 2016 08:11:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49436 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757049AbcLUNLl (ORCPT ); Wed, 21 Dec 2016 08:11:41 -0500 From: Petr Oros To: matt@codeblueprint.co.uk Cc: ard.biesheuvel@linaro.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] x86/efi Fix regression in efi_arch_mem_reserve Date: Wed, 21 Dec 2016 14:11:38 +0100 Message-Id: <20161221131138.10512-1-poros@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 21 Dec 2016 13:11:41 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Booting on EFI with ESRT table has been stop since commit: 8e80632 efi/esrt: Use efi_mem_reserve() and avoid a kmalloc() This is caused by this commit: 816e761 efi: Allow drivers to reserve boot services forever Problem is, that efi_memmap_insert need memory aligned on EFI_PAGE_SIZE. If memory not aligned, efi_memmap_insert just return and let efi.memmap in inconsistent state. This breaking boot. Tested in my machine, which stop booting after upgrade to 4.9 Signed-off-by: Petr Oros --- arch/x86/platform/efi/quirks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c index 10aca63..7678857 100644 --- a/arch/x86/platform/efi/quirks.c +++ b/arch/x86/platform/efi/quirks.c @@ -214,7 +214,7 @@ void __init efi_arch_mem_reserve(phys_addr_t addr, u64 size) new_size = efi.memmap.desc_size * num_entries; - new_phys = memblock_alloc(new_size, 0); + new_phys = memblock_alloc(new_size, EFI_PAGE_SIZE); if (!new_phys) { pr_err("Could not allocate boot services memmap\n"); return; -- 2.10.2