From patchwork Wed Jul 17 22:19:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Mostafa X-Patchwork-Id: 259787 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id C491A2C00A9 for ; Thu, 18 Jul 2013 08:20:32 +1000 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1Uza5B-0003aU-Mb; Wed, 17 Jul 2013 22:20:25 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1Uza4f-0003Xy-U4 for kernel-team@lists.ubuntu.com; Wed, 17 Jul 2013 22:19:53 +0000 Received: from c-67-160-231-162.hsd1.ca.comcast.net ([67.160.231.162] helo=fourier) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Uza4d-00075M-OH; Wed, 17 Jul 2013 22:19:52 +0000 Received: from kamal by fourier with local (Exim 4.80) (envelope-from ) id 1Uza4a-00012E-DD; Wed, 17 Jul 2013 15:19:48 -0700 From: Kamal Mostafa To: Satoru Takeuchi Subject: [ 3.8.y.z extended stable ] Patch "x86, efi: remove duplicate code in setup_arch() by using, " has been added to staging queue Date: Wed, 17 Jul 2013 15:19:48 -0700 Message-Id: <1374099588-3949-1-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 1.8.1.2 X-Extended-Stable: 3.8 Cc: Matt Fleming , Kamal Mostafa , kernel-team@lists.ubuntu.com, Ingo Molnar , "H. Peter Anvin" , Olof Johansson , Thomas Gleixner X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com This is a note to let you know that I have just added a patch titled x86, efi: remove duplicate code in setup_arch() by using, to the linux-3.8.y-queue branch of the 3.8.y.z extended stable tree which can be found at: http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.8.y-queue This patch is scheduled to be released in version 3.8.13.5. If you, or anyone else, feels it should not be added to this tree, please reply to this email. For more information about the 3.8.y.z tree, see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable Thanks. -Kamal ------ From f0a63aa28b52840359203154520a3d361e562f46 Mon Sep 17 00:00:00 2001 From: Satoru Takeuchi Date: Thu, 14 Feb 2013 09:07:35 +0900 Subject: x86, efi: remove duplicate code in setup_arch() by using, efi_is_native() commit 6b59e366e074d3962e04f01efb8acc10a33c0e1e upstream. The check, "IS_ENABLED(CONFIG_X86_64) != efi_enabled(EFI_64BIT)", in setup_arch() can be replaced by efi_is_enabled(). This change remove duplicate code and improve readability. Signed-off-by: Satoru Takeuchi Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Olof Johansson Signed-off-by: Matt Fleming [ kamal: backport to 3.8 as prereq for "Modify UEFI anti-bricking code" ] Signed-off-by: Kamal Mostafa --- arch/x86/include/asm/efi.h | 9 ++++++++- arch/x86/kernel/setup.c | 3 +-- arch/x86/platform/efi/efi.c | 5 ----- 3 files changed, 9 insertions(+), 8 deletions(-) -- 1.8.1.2 diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index 28677c5..60c89f3 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h @@ -102,7 +102,14 @@ extern void efi_call_phys_epilog(void); extern void efi_unmap_memmap(void); extern void efi_memory_uc(u64 addr, unsigned long size); -#ifndef CONFIG_EFI +#ifdef CONFIG_EFI + +static inline bool efi_is_native(void) +{ + return IS_ENABLED(CONFIG_X86_64) == efi_enabled(EFI_64BIT); +} + +#else /* * IF EFI is not configured, have the EFI calls return -ENOSYS. */ diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 8b24289..1abb796 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -1135,8 +1135,7 @@ void __init setup_arch(char **cmdline_p) * mismatched firmware/kernel archtectures since there is no * support for runtime services. */ - if (efi_enabled(EFI_BOOT) && - IS_ENABLED(CONFIG_X86_64) != efi_enabled(EFI_64BIT)) { + if (efi_enabled(EFI_BOOT) && !efi_is_native()) { pr_info("efi: Setup done, disabling due to 32/64-bit mismatch\n"); efi_unmap_memmap(); } diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index ce51ed0..27ff3b0 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c @@ -69,11 +69,6 @@ struct efi_memory_map memmap; static struct efi efi_phys __initdata; static efi_system_table_t efi_systab __initdata; -static inline bool efi_is_native(void) -{ - return IS_ENABLED(CONFIG_X86_64) == efi_enabled(EFI_64BIT); -} - unsigned long x86_efi_facility; /*