From patchwork Wed Aug 6 08:38:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Young X-Patchwork-Id: 4684431 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D8198C0338 for ; Wed, 6 Aug 2014 08:40:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 201BD20125 for ; Wed, 6 Aug 2014 08:40:56 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5E05720123 for ; Wed, 6 Aug 2014 08:40:55 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XEwkQ-00068D-Pe; Wed, 06 Aug 2014 08:39:02 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XEwkN-0005tJ-9o for linux-arm-kernel@lists.infradead.org; Wed, 06 Aug 2014 08:38:59 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s768cWmA009602 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 6 Aug 2014 04:38:32 -0400 Received: from dhcp-16-198.nay.redhat.com (dhcp-16-104.nay.redhat.com [10.66.16.104]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s768cQBq000645 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 6 Aug 2014 04:38:28 -0400 Date: Wed, 6 Aug 2014 16:38:25 +0800 From: Dave Young To: catalin.marinas@arm.com, will.deacon@arm.com, matt.fleming@intel.com, leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, msalter@redhat.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] UEFI arm64: add noefi boot param Message-ID: <20140806083825.GA31711@dhcp-16-198.nay.redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140806_013859_403903_B6194821 X-CRM114-Status: GOOD ( 14.12 ) X-Spam-Score: -5.7 (-----) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Adding a noefi boot param like in X86 to disable efi runtime services support. This will be useful for debugging uefi problems. Also it will be useful for later kexec/kdump work. Kexec on uefi support in X86 depends on a fixed vm area specific for uefi runtime 1:1 mapping, kernel will switch to a different page table for any uefi runtime callback in virtual mode. In arm64 similar work probably is necessary. But kexec boot will just works with 'noefi' with the limitaion of lacking runtime services. The runtime services is not critical for kdump kernel for now. So as for kexec/kdump just leave the 1:1 mapping a future work. Signed-off-by: Dave Young --- arch/arm64/kernel/efi.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) Index: linux-2.6/arch/arm64/kernel/efi.c =================================================================== --- linux-2.6.orig/arch/arm64/kernel/efi.c +++ linux-2.6/arch/arm64/kernel/efi.c @@ -31,6 +31,14 @@ static efi_runtime_services_t *runtime; static u64 efi_system_table; +static bool disable_runtime __initdata = false; +static int __init setup_noefi(char *arg) +{ + disable_runtime = true; + return 0; +} +early_param("noefi", setup_noefi); + static int uefi_debug __initdata; static int __init uefi_debug_setup(char *str) { @@ -391,11 +399,14 @@ static int __init arm64_enter_virtual_mo return -1; } - pr_info("Remapping and enabling EFI services.\n"); - - /* replace early memmap mapping with permanent mapping */ mapsize = memmap.map_end - memmap.map; early_memunmap(memmap.map, mapsize); + + if (disable_runtime) + return -ENODEV; + + pr_info("Remapping and enabling EFI services.\n"); + /* replace early memmap mapping with permanent mapping */ memmap.map = (__force void *)ioremap_cache((phys_addr_t)memmap.phys_map, mapsize); memmap.map_end = memmap.map + mapsize;