Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3544720imu; Fri, 30 Nov 2018 02:02:05 -0800 (PST) X-Google-Smtp-Source: AFSGD/XaDyzGO2wc2V0x5F2ZrLRmC6JsawrzAgiZ6dleMjZ2Jsst04yzDI05hiiiT2lHnNGi4I2h X-Received: by 2002:a17:902:b78b:: with SMTP id e11mr5092775pls.90.1543572125828; Fri, 30 Nov 2018 02:02:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543572125; cv=none; d=google.com; s=arc-20160816; b=psdcFzsYJJHOBU3HCX+a4Ruid1FKLv8Z4GE93XaIPF6kYf+2FCwGlAP6p8Fq/dakAN SjvZTX4evVLrrsSw4NtYWYobrkYMrRSEltuWD6w80d9krNeMOg+j4d4q3Em5zBNv+XUO nIOBn6md1DQJyeR/KjH2C1b1mZ4tc2q/4An1EgiZFC7wUl5Q9VrwukuycYo0FhDbf18g /Jx7vlBZJ57BlX61XDt1kpHPjCqITxIv2xVo7Zgr4cL3qOr69BGzKtONeUQo5uaijc+P XFOgu3udqlbnCcHkm4TVe6b1OZ2YSLUD4nYov95vxuZByWfs3jISWS3kCTU1ohkIJukX tyGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date; bh=rhwm5IEdW0HVn/1Zhx1oFZiGSUEaM43RAeHKgGi3Q5o=; b=lmXU6VBOYQr8Qs7V0059GTEEVNgGGAmHKXrEjCArgxy7u9vUA/I48muoUcuZczJEd/ rd2Zn8GkOVTxtdOtWmqewT2qZ6DX3UUUaQui6wVHNWiUN3YovTCA9+Ixf8al6diPeG3F QC5zvZLN+0nsdXgTfC+Qv8hXxaf3VCyPoGJYq+cet5vFjwHLkumn8ewQCEfqrqjklD8c PCVAOVvMA1LlRij5ujn8usEE95IjeDBLlRBhUArNuMQQFssFNkX+kyf7L3TgrajK0GA4 +hlHz3YfkpI3OHMBxtBAhiBG/MoydvKnRSGd0P84mabrHn5EbJg1T2sDRfOpuiU5qflT 0+SQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a11si5472591pla.20.2018.11.30.02.01.50; Fri, 30 Nov 2018 02:02:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726736AbeK3VIp (ORCPT + 99 others); Fri, 30 Nov 2018 16:08:45 -0500 Received: from terminus.zytor.com ([198.137.202.136]:50705 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726469AbeK3VIp (ORCPT ); Fri, 30 Nov 2018 16:08:45 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id wAU9xDJl3262035 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 30 Nov 2018 01:59:13 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id wAU9xDPx3262032; Fri, 30 Nov 2018 01:59:13 -0800 Date: Fri, 30 Nov 2018 01:59:13 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Sai Praneeth Prakhya Message-ID: Cc: dave.hansen@intel.com, julien.thierry@arm.com, matt@codeblueprint.co.uk, mingo@kernel.org, hpa@zytor.com, torvalds@linux-foundation.org, bp@alien8.de, jonathanh@nvidia.com, eric.snowberg@oracle.com, sedat.dilek@gmail.com, peterz@infradead.org, tglx@linutronix.de, marc.zyngier@arm.com, luto@kernel.org, linux-kernel@vger.kernel.org, sai.praneeth.prakhya@intel.com, hdegoede@redhat.com, joe@perches.com, arend.vanspriel@broadcom.com, natechancellor@gmail.com, bhsharma@redhat.com, zhuyifei1999@gmail.com, ard.biesheuvel@linaro.org Reply-To: sedat.dilek@gmail.com, tglx@linutronix.de, peterz@infradead.org, marc.zyngier@arm.com, luto@kernel.org, linux-kernel@vger.kernel.org, joe@perches.com, hdegoede@redhat.com, sai.praneeth.prakhya@intel.com, bhsharma@redhat.com, arend.vanspriel@broadcom.com, natechancellor@gmail.com, ard.biesheuvel@linaro.org, zhuyifei1999@gmail.com, dave.hansen@intel.com, julien.thierry@arm.com, mingo@kernel.org, matt@codeblueprint.co.uk, torvalds@linux-foundation.org, hpa@zytor.com, jonathanh@nvidia.com, eric.snowberg@oracle.com, bp@alien8.de In-Reply-To: <20181129171230.18699-7-ard.biesheuvel@linaro.org> References: <20181129171230.18699-7-ard.biesheuvel@linaro.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:efi/core] x86/efi: Move efi__boot_services() to arch/x86 Git-Commit-ID: 47c33a095e1fae376d74b4160a0d73c1a4e73969 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=1.6 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_48_96,FREEMAIL_FORGED_REPLYTO, FREEMAIL_REPLYTO_END_DIGIT autolearn=no autolearn_force=no version=3.4.2 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 47c33a095e1fae376d74b4160a0d73c1a4e73969 Gitweb: https://git.kernel.org/tip/47c33a095e1fae376d74b4160a0d73c1a4e73969 Author: Sai Praneeth Prakhya AuthorDate: Thu, 29 Nov 2018 18:12:25 +0100 Committer: Ingo Molnar CommitDate: Fri, 30 Nov 2018 09:10:31 +0100 x86/efi: Move efi__boot_services() to arch/x86 efi__boot_services() are x86 specific quirks and as such should be in asm/efi.h, so move them from linux/efi.h. Also, call efi_free_boot_services() from __efi_enter_virtual_mode() as it is x86 specific call and ideally shouldn't be part of init/main.c Signed-off-by: Sai Praneeth Prakhya Signed-off-by: Ard Biesheuvel Acked-by: Thomas Gleixner Cc: Andy Lutomirski Cc: Arend van Spriel Cc: Bhupesh Sharma Cc: Borislav Petkov Cc: Dave Hansen Cc: Eric Snowberg Cc: Hans de Goede Cc: Joe Perches Cc: Jon Hunter Cc: Julien Thierry Cc: Linus Torvalds Cc: Marc Zyngier Cc: Matt Fleming Cc: Nathan Chancellor Cc: Peter Zijlstra Cc: Sedat Dilek Cc: YiFei Zhu Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/20181129171230.18699-7-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar --- arch/x86/include/asm/efi.h | 2 ++ arch/x86/platform/efi/efi.c | 2 ++ include/linux/efi.h | 3 --- init/main.c | 4 ---- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index eea40d52ca78..d1e64ac80b9c 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h @@ -141,6 +141,8 @@ extern int __init efi_reuse_config(u64 tables, int nr_tables); extern void efi_delete_dummy_variable(void); extern void efi_switch_mm(struct mm_struct *mm); extern void efi_recover_from_page_fault(unsigned long phys_addr); +extern void efi_free_boot_services(void); +extern void efi_reserve_boot_services(void); struct efi_setup_data { u64 fw_vendor; diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index 7ae939e353cd..e1cb01a22fa8 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c @@ -993,6 +993,8 @@ static void __init __efi_enter_virtual_mode(void) panic("EFI call to SetVirtualAddressMap() failed!"); } + efi_free_boot_services(); + /* * Now that EFI is in virtual mode, update the function * pointers in the runtime service table to the new virtual addresses. diff --git a/include/linux/efi.h b/include/linux/efi.h index 100ce4a4aff6..2b3b33c83b05 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -1000,13 +1000,11 @@ extern void efi_memmap_walk (efi_freemem_callback_t callback, void *arg); extern void efi_gettimeofday (struct timespec64 *ts); extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if possible */ #ifdef CONFIG_X86 -extern void efi_free_boot_services(void); extern efi_status_t efi_query_variable_store(u32 attributes, unsigned long size, bool nonblocking); extern void efi_find_mirror(void); #else -static inline void efi_free_boot_services(void) {} static inline efi_status_t efi_query_variable_store(u32 attributes, unsigned long size, @@ -1046,7 +1044,6 @@ extern void efi_mem_reserve(phys_addr_t addr, u64 size); extern int efi_mem_reserve_persistent(phys_addr_t addr, u64 size); extern void efi_initialize_iomem_resources(struct resource *code_resource, struct resource *data_resource, struct resource *bss_resource); -extern void efi_reserve_boot_services(void); extern int efi_get_fdt_params(struct efi_fdt_params *params); extern struct kobject *efi_kobj; diff --git a/init/main.c b/init/main.c index ee147103ba1b..ccefcd8e855f 100644 --- a/init/main.c +++ b/init/main.c @@ -737,10 +737,6 @@ asmlinkage __visible void __init start_kernel(void) arch_post_acpi_subsys_init(); sfi_init_late(); - if (efi_enabled(EFI_RUNTIME_SERVICES)) { - efi_free_boot_services(); - } - /* Do the rest non-__init'ed, we're now alive */ arch_call_rest_init(); }