linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: linux-efi@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Ard Biesheuvel <ardb@kernel.org>,
	nivedita@alum.mit.edu, x86@kernel.org
Subject: [PATCH 08/18] efi/ia64: use existing helpers to locate ESI table
Date: Sun, 16 Feb 2020 19:23:24 +0100	[thread overview]
Message-ID: <20200216182334.8121-9-ardb@kernel.org> (raw)
In-Reply-To: <20200216182334.8121-1-ardb@kernel.org>

Instead of iterating over the EFI config table array manually,
declare it as an arch table so it gets picked up by the existing
config table handling code.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 arch/ia64/kernel/efi.c |  6 ++++++
 arch/ia64/kernel/esi.c | 21 ++++----------------
 2 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
index 292fe354158d..74fad89ae209 100644
--- a/arch/ia64/kernel/efi.c
+++ b/arch/ia64/kernel/efi.c
@@ -45,13 +45,19 @@
 
 #define EFI_DEBUG	0
 
+#define ESI_TABLE_GUID					\
+    EFI_GUID(0x43EA58DC, 0xCF28, 0x4b06, 0xB3,		\
+	     0x91, 0xB7, 0x50, 0x59, 0x34, 0x2B, 0xD4)
+
 static unsigned long mps_phys = EFI_INVALID_TABLE_ADDR;
 static __initdata unsigned long palo_phys;
 
+unsigned long __initdata esi_phys = EFI_INVALID_TABLE_ADDR;
 unsigned long hcdp_phys = EFI_INVALID_TABLE_ADDR;
 unsigned long sal_systab_phys = EFI_INVALID_TABLE_ADDR;
 
 static __initdata efi_config_table_type_t arch_tables[] = {
+	{ESI_TABLE_GUID, "ESI", &esi_phys},
 	{HCDP_TABLE_GUID, "HCDP", &hcdp_phys},
 	{MPS_TABLE_GUID, "MPS", &mps_phys},
 	{PROCESSOR_ABSTRACTION_LAYER_OVERWRITE_GUID, "PALO", &palo_phys},
diff --git a/arch/ia64/kernel/esi.c b/arch/ia64/kernel/esi.c
index cb514126ef7f..4df57c93e0a8 100644
--- a/arch/ia64/kernel/esi.c
+++ b/arch/ia64/kernel/esi.c
@@ -19,10 +19,6 @@ MODULE_LICENSE("GPL");
 
 #define MODULE_NAME	"esi"
 
-#define ESI_TABLE_GUID					\
-    EFI_GUID(0x43EA58DC, 0xCF28, 0x4b06, 0xB3,		\
-	     0x91, 0xB7, 0x50, 0x59, 0x34, 0x2B, 0xD4)
-
 enum esi_systab_entry_type {
 	ESI_DESC_ENTRY_POINT = 0
 };
@@ -48,27 +44,18 @@ struct pdesc {
 
 static struct ia64_sal_systab *esi_systab;
 
+extern unsigned long esi_phys;
+
 static int __init esi_init (void)
 {
-	efi_config_table_t *config_tables;
 	struct ia64_sal_systab *systab;
-	unsigned long esi = 0;
 	char *p;
 	int i;
 
-	config_tables = __va(efi.systab->tables);
-
-	for (i = 0; i < (int) efi.systab->nr_tables; ++i) {
-		if (efi_guidcmp(config_tables[i].guid, ESI_TABLE_GUID) == 0) {
-			esi = config_tables[i].table;
-			break;
-		}
-	}
-
-	if (!esi)
+	if (esi_phys == EFI_INVALID_TABLE_ADDR)
 		return -ENODEV;
 
-	systab = __va(esi);
+	systab = __va(esi_phys);
 
 	if (strncmp(systab->signature, "ESIT", 4) != 0) {
 		printk(KERN_ERR "bad signature in ESI system table!");
-- 
2.17.1


  parent reply	other threads:[~2020-02-16 18:24 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-16 18:23 [PATCH 00/18] efi: clean up contents of struct efi Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 01/18] efi: drop handling of 'boot_info' configuration table Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 02/18] efi/ia64: move HCDP and MPS table handling into IA64 arch code Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 03/18] efi: move UGA and PROP table handling to x86 code Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 04/18] efi: make rng_seed table handling local to efi.c Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 05/18] efi: move mem_attr_table out of struct efi Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 06/18] efi: make memreserve table handling local to efi.c Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 07/18] efi: merge EFI system table revision and vendor checks Ard Biesheuvel
2020-02-16 18:23 ` Ard Biesheuvel [this message]
2020-02-16 18:23 ` [PATCH 09/18] efi/ia64: use local variable for EFI system table address Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 10/18] efi/ia64: switch to efi_config_parse_tables() Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 11/18] efi: make efi_config_init() x86 only Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 12/18] efi: clean up config_parse_tables() Ard Biesheuvel
2020-02-16 19:12   ` Arvind Sankar
2020-02-17  8:32     ` Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 13/18] efi/x86: remove runtime table address from kexec EFI setup data Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 14/18] efi/x86: make fw_vendor, config_table and runtime sysfs nodes x86 specific Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 15/18] efi/x86: merge assignments of efi.runtime_version Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 16/18] efi: add 'runtime' pointer to struct efi Ard Biesheuvel
2020-03-03 16:03   ` Guenter Roeck
2020-03-03 16:39     ` Ard Biesheuvel
2020-03-03 17:53       ` Guenter Roeck
2020-03-03 18:01         ` Ard Biesheuvel
2020-03-03 18:14           ` Ard Biesheuvel
2020-03-03 20:30             ` Guenter Roeck
2020-03-03 21:40               ` Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 17/18] efi/arm: drop unnecessary references to efi.systab Ard Biesheuvel
2020-02-16 18:23 ` [PATCH 18/18] efi/x86: drop 'systab' member from struct efi Ard Biesheuvel
2020-02-16 18:31 ` [PATCH 00/18] efi: clean up contents of " Ard Biesheuvel
2020-02-18 19:46   ` Luck, Tony
2020-02-18 22:08     ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200216182334.8121-9-ardb@kernel.org \
    --to=ardb@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nivedita@alum.mit.edu \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).