From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754487AbcA0LU7 (ORCPT ); Wed, 27 Jan 2016 06:20:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42662 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751938AbcA0LU4 (ORCPT ); Wed, 27 Jan 2016 06:20:56 -0500 Date: Wed, 27 Jan 2016 19:20:44 +0800 From: Dave Young To: linux-efi@vger.kernel.org Cc: kexec@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] x86/efi: skip bgrt init for kexec reboot Message-ID: <20160127112044.GA2961@dhcp-128-65.nay.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For kexec reboot the bgrt image address could contains random data because we have freed boot service areas in 1st kernel boot phase. One possible result is kmalloc fail in efi_bgrt_init due to large random image size. So change efi_late_init to avoid efi_bgrt_init in case kexec boot. Signed-off-by: Dave Young --- arch/x86/platform/efi/efi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- linux-x86.orig/arch/x86/platform/efi/efi.c +++ linux-x86/arch/x86/platform/efi/efi.c @@ -531,7 +531,8 @@ void __init efi_init(void) void __init efi_late_init(void) { - efi_bgrt_init(); + if (!efi_setup) + efi_bgrt_init(); } void __init efi_set_executable(efi_memory_desc_t *md, bool executable)