Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3977472ybv; Sun, 16 Feb 2020 10:25:25 -0800 (PST) X-Google-Smtp-Source: APXvYqza0vIw+pcdfhfEEzuHc/uRrIaCxL+nMoxecoJj1yar7gydTjIZWuGvim9ZJaPx4/Gnj01x X-Received: by 2002:a9d:3bc4:: with SMTP id k62mr9971509otc.186.1581877525864; Sun, 16 Feb 2020 10:25:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581877525; cv=none; d=google.com; s=arc-20160816; b=o3TBpL0oe40pAEftjwvVpZou6XSRF/z9b5RW0Cjx4+MdLtuKOsbslN5DW5E2zB4gic CW7lZae6LovQSlHuTc7Pgi7botTh5GhpkW4DT8U7lL2ZQ06qTRHdxLI4UU34hDShBRQW hL2C3VSr7CPQ65lipHQJtBBXVSsNTVbifAB7SPERiSfee89LB/VhaIqTakfsvDQG9+V/ AIyPgq354JxvYyW3FP8KN8nUxwQdkOZaAR6H/TtT2wlxS4B5dgR1EZHx5svIQwo2/9R9 XsuZvC4C5QElf5UFExAomcBLoU5qsdyvBHX/27QvLsmA6RwD17Az4aNDbidV6POgHOXa 9Dyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=DlBH8wni++CQU2HnbGe1w8acOlCViUFD2VC6do4TzKE=; b=WO4NxjxFmDu8Adf9GxkywfNTQuHejC2M2WqNxu2ma4rvfOXpxjwQGktRecdSpQQ1K9 iq6pG/I5MFyTWUUJ7/AaiPZ1wmmKPUDB1+2MHJWvicOHVO2dOKuWK/XFZZXI/dfIhxIP NojpnFFbbyEGSmbjqNBOIsICx2oDebLoPE7JYHOc1biLDzQgtNw0ieOcFIAbSquE14mZ JKl7h+J567XZzNHG+UCNfMvQLpA6sXCMR81Xzge87y9M32S6PE8f+fKrtvcjzU5mMlY0 QPRq90pjTPjDy9pHUwyv6z+YkUy0Y7z5eMiDZsEhHR7GbyNftza/ga6RTNsvRBsyVRM8 xIuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sFiyKrgO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r22si5607855oic.93.2020.02.16.10.25.14; Sun, 16 Feb 2020 10:25:25 -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; dkim=pass header.i=@kernel.org header.s=default header.b=sFiyKrgO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728243AbgBPSYl (ORCPT + 99 others); Sun, 16 Feb 2020 13:24:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:33472 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727974AbgBPSYF (ORCPT ); Sun, 16 Feb 2020 13:24:05 -0500 Received: from e123331-lin.home (amontpellier-657-1-18-247.w109-210.abo.wanadoo.fr [109.210.65.247]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BAE3624125; Sun, 16 Feb 2020 18:24:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581877445; bh=535G2Z6StN4Ag1aO0gRi6xti0zt7h38+r39I0O3lAk8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sFiyKrgOP9c19cScnbZQghLN4QA0LCqNwm75+aGlG0FUblmVzZv8FqPCDO2ubjczS Ed+qzRTyxJ5mXoRvja33ngrr8OrRohFwRgACnrScf/qSmZet864xPbdbqYn92FPQa1 OnwbKMFZ8bHrSiFCDSNdODl8UvwC3SpRWaifqMwU= From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ard Biesheuvel , nivedita@alum.mit.edu, x86@kernel.org Subject: [PATCH 11/18] efi: make efi_config_init() x86 only Date: Sun, 16 Feb 2020 19:23:27 +0100 Message-Id: <20200216182334.8121-12-ardb@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200216182334.8121-1-ardb@kernel.org> References: <20200216182334.8121-1-ardb@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The efi_config_init() routine is no longer shared with ia64 so let's move it into the x86 arch code before making further x86 specific changes to it. Signed-off-by: Ard Biesheuvel --- arch/x86/platform/efi/efi.c | 30 +++++++++++++++++++ drivers/firmware/efi/efi.c | 31 -------------------- include/linux/efi.h | 1 - 3 files changed, 30 insertions(+), 32 deletions(-) diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index 777373423a67..26d905e6b579 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c @@ -434,6 +434,36 @@ static int __init efi_systab_init(u64 phys) return 0; } +static int __init efi_config_init(efi_config_table_type_t *arch_tables) +{ + void *config_tables; + int sz, ret; + + if (efi.systab->nr_tables == 0) + return 0; + + if (efi_enabled(EFI_64BIT)) + sz = sizeof(efi_config_table_64_t); + else + sz = sizeof(efi_config_table_32_t); + + /* + * Let's see what config tables the firmware passed to us. + */ + config_tables = early_memremap(efi.systab->tables, + efi.systab->nr_tables * sz); + if (config_tables == NULL) { + pr_err("Could not map Configuration table!\n"); + return -ENOMEM; + } + + ret = efi_config_parse_tables(config_tables, efi.systab->nr_tables, sz, + arch_tables); + + early_memunmap(config_tables, efi.systab->nr_tables * sz); + return ret; +} + void __init efi_init(void) { if (IS_ENABLED(CONFIG_X86_32) && diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index 80fe0044f2e2..2bfd6c0806ce 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -601,37 +601,6 @@ int __init efi_config_parse_tables(void *config_tables, int count, int sz, return 0; } -int __init efi_config_init(efi_config_table_type_t *arch_tables) -{ - void *config_tables; - int sz, ret; - - if (efi.systab->nr_tables == 0) - return 0; - - if (efi_enabled(EFI_64BIT)) - sz = sizeof(efi_config_table_64_t); - else - sz = sizeof(efi_config_table_32_t); - - /* - * Let's see what config tables the firmware passed to us. - */ - config_tables = early_memremap(efi.systab->tables, - efi.systab->nr_tables * sz); - if (config_tables == NULL) { - pr_err("Could not map Configuration table!\n"); - return -ENOMEM; - } - - ret = efi_config_parse_tables(config_tables, efi.systab->nr_tables, sz, - arch_tables); - - early_memunmap(config_tables, efi.systab->nr_tables * sz); - return ret; -} - - int __init efi_systab_check_header(const efi_table_hdr_t *systab_hdr, int min_major_version) { diff --git a/include/linux/efi.h b/include/linux/efi.h index 287510e84dfb..d61c25fd5824 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -608,7 +608,6 @@ extern int __init efi_memmap_split_count(efi_memory_desc_t *md, extern void __init efi_memmap_insert(struct efi_memory_map *old_memmap, void *buf, struct efi_mem_range *mem); -extern int efi_config_init(efi_config_table_type_t *arch_tables); #ifdef CONFIG_EFI_ESRT extern void __init efi_esrt_init(void); #else -- 2.17.1