From patchwork Thu Oct 17 14:07:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Fleming X-Patchwork-Id: 3061111 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 580079F3E2 for ; Thu, 17 Oct 2013 14:08:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 495C820459 for ; Thu, 17 Oct 2013 14:08:19 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 88CF42045B for ; Thu, 17 Oct 2013 14:08:14 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VWoFG-0001lV-9I; Thu, 17 Oct 2013 14:08:10 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VWoFD-0006Lv-Rv; Thu, 17 Oct 2013 14:08:07 +0000 Received: from arkanian.console-pimps.org ([212.110.184.194]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VWoFA-0006KI-Qx for linux-arm-kernel@lists.infradead.org; Thu, 17 Oct 2013 14:08:05 +0000 Received: by arkanian.console-pimps.org (Postfix, from userid 1002) id 879CF6C06F; Thu, 17 Oct 2013 15:07:42 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from localhost (97e08eb7.skybroadband.com [151.224.142.183]) by arkanian.console-pimps.org (Postfix) with ESMTPSA id DE73A6C055; Thu, 17 Oct 2013 15:07:40 +0100 (BST) Date: Thu, 17 Oct 2013 15:07:39 +0100 From: Matt Fleming To: Leif Lindholm Subject: Re: [PATCH v2 2/3] arm: Add [U]EFI runtime services support Message-ID: <20131017140739.GI10834@console-pimps.org> References: <1380799481-5470-1-git-send-email-leif.lindholm@linaro.org> <1380799481-5470-3-git-send-email-leif.lindholm@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1380799481-5470-3-git-send-email-leif.lindholm@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131017_100805_124533_B8230560 X-CRM114-Status: GOOD ( 16.32 ) X-Spam-Score: -2.3 (--) Cc: roy.franz@linaro.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, grant.likely@secretlab.ca, matt.fleming@intel.com, msalter@redhat.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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-Virus-Scanned: ClamAV using ClamSMTP On Thu, 03 Oct, at 12:24:40PM, Leif Lindholm wrote: > +/* > + * If you need to (temporarily) support buggy firmware. > + */ > +#define KEEP_BOOT_SERVICES_REGIONS Have you seen firmware that requires this? I'm just curious more than anything else. > +/* > + * Returns 1 if 'facility' is enabled, 0 otherwise. > + */ > +int efi_enabled(int facility) > +{ > + return test_bit(facility, &arm_efi_facility) != 0; > +} > +EXPORT_SYMBOL(efi_enabled); This should move to drivers/firmware/efi/efi.c. Let me write a patch that moves the x86 stuff out of arch/x86 and means you can get rid of this hunk. > +/* > + * Called explicitly from init/mm.c > + */ That's init/main.c. > +void __init efi_enter_virtual_mode(void) > +{ > + efi_status_t status; > + > + if (!efi_enabled(EFI_BOOT)) { > + pr_info("EFI services will not be available.\n"); > + return; This is dead code as PATCH 3 does, diff --git a/init/main.c b/init/main.c index af310af..ec6d76e 100644 --- a/init/main.c +++ b/init/main.c @@ -875,6 +875,10 @@ static noinline void __init kernel_init_freeable(void) smp_prepare_cpus(setup_max_cpus); do_pre_smp_initcalls(); + + if (IS_ENABLED(CONFIG_ARM) && efi_enabled(EFI_BOOT)) + efi_enter_virtual_mode(); +