Skip to contentSkip to conversation

efi: ia64: move IA64-only declarations to new asm/efi.h header

PATCH In review Ard Biesheuvel 2 participants 8 messages Jan 18, 2021 – Feb 4, 2021 EFI

lore
Share & tools
lore

Ard Biesheuvel

author maintainer
#0 lore raw

PATCH 1/1 efi: ia64: move IA64-only declarations to new asm/efi.h header

Move some EFI related declarations that are only referenced on IA64 to a new asm/efi.h arch header.

---
 arch/ia64/include/asm/efi.h      | 13 +++++++++++++
 arch/ia64/kernel/efi.c           |  1 +
 arch/ia64/kernel/machine_kexec.c |  1 +
 arch/ia64/kernel/mca.c           |  1 +
 arch/ia64/kernel/smpboot.c       |  1 +
 arch/ia64/kernel/time.c          |  1 +
 arch/ia64/kernel/uncached.c      |  4 +---
 arch/ia64/mm/contig.c            |  1 +
 arch/ia64/mm/discontig.c         |  1 +
 arch/ia64/mm/init.c              |  1 +
 include/linux/efi.h              |  6 ------
 11 files changed, 22 insertions(+), 9 deletions(-)
 create mode 100644 arch/ia64/include/asm/efi.h
arch/ia64/include/asm/efi.h new file +13 -0
new file mode 100644
index 000000000000..6a4a50d8f19a
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_EFI_H
+#define _ASM_EFI_H
+
+typedef int (*efi_freemem_callback_t) (u64 start, u64 end, void *arg);
+
+void *efi_get_pal_addr(void);
+void efi_map_pal_code(void);
+void efi_memmap_walk(efi_freemem_callback_t, void *);
+void efi_memmap_walk_uc(efi_freemem_callback_t, void *);
+void efi_gettimeofday(struct timespec64 *ts);
+
+#endif
arch/ia64/kernel/efi.c +1 -0
index f932b25fb817..dd7fd750bb93 100644
@@ -34,6 +34,7 @@
 #include <linux/kexec.h>
 #include <linux/mm.h>
 
+#include <asm/efi.h>
 #include <asm/io.h>
 #include <asm/kregs.h>
 #include <asm/meminit.h>
arch/ia64/kernel/machine_kexec.c +1 -0
index efc9b568401c..af310dc8a356 100644
@@ -16,6 +16,7 @@
 #include <linux/numa.h>
 #include <linux/mmzone.h>
 
+#include <asm/efi.h>
 #include <asm/numa.h>
 #include <asm/mmu_context.h>
 #include <asm/setup.h>
arch/ia64/kernel/mca.c +1 -0
index 2703f7795672..0fea266b4d39 100644
@@ -91,6 +91,7 @@
 #include <linux/gfp.h>
 
 #include <asm/delay.h>
+#include <asm/efi.h>
 #include <asm/meminit.h>
 #include <asm/page.h>
 #include <asm/ptrace.h>
arch/ia64/kernel/smpboot.c +1 -0
index 093040f7e626..49b488580939 100644
@@ -45,6 +45,7 @@
 #include <asm/cache.h>
 #include <asm/current.h>
 #include <asm/delay.h>
+#include <asm/efi.h>
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/mca.h>
arch/ia64/kernel/time.c +1 -0
index ed9fc3d057a6..a37f161a66b1 100644
@@ -26,6 +26,7 @@
 #include <linux/sched/cputime.h>
 
 #include <asm/delay.h>
+#include <asm/efi.h>
 #include <asm/hw_irq.h>
 #include <asm/ptrace.h>
 #include <asm/sal.h>
arch/ia64/kernel/uncached.c +1 -3
index 0750f367837d..51883a66aeb5 100644
@@ -20,14 +20,12 @@
 #include <linux/genalloc.h>
 #include <linux/gfp.h>
 #include <linux/pgtable.h>
+#include <asm/efi.h>
 #include <asm/page.h>
 #include <asm/pal.h>
 #include <linux/atomic.h>
 #include <asm/tlbflush.h>
 
-
-extern void __init efi_memmap_walk_uc(efi_freemem_callback_t, void *);
-
 struct uncached_pool {
 	struct gen_pool *pool;
 	struct mutex add_chunk_mutex;	/* serialize adding a converted chunk */
arch/ia64/mm/contig.c +1 -0
index bfc4ecd0a2ab..62fe80a16f42 100644
@@ -21,6 +21,7 @@
 #include <linux/swap.h>
 #include <linux/sizes.h>
 
+#include <asm/efi.h>
 #include <asm/meminit.h>
 #include <asm/sections.h>
 #include <asm/mca.h>
arch/ia64/mm/discontig.c +1 -0
index c7311131156e..03b3a02375ff 100644
@@ -24,6 +24,7 @@
 #include <linux/efi.h>
 #include <linux/nodemask.h>
 #include <linux/slab.h>
+#include <asm/efi.h>
 #include <asm/tlb.h>
 #include <asm/meminit.h>
 #include <asm/numa.h>
arch/ia64/mm/init.c +1 -0
index 9b5acf8fb092..24583a39fa1b 100644
@@ -27,6 +27,7 @@
 #include <linux/swiotlb.h>
 
 #include <asm/dma.h>
+#include <asm/efi.h>
 #include <asm/io.h>
 #include <asm/numa.h>
 #include <asm/patch.h>
include/linux/efi.h +0 -6
index b1ca1903b483..a81ff5047859 100644
@@ -167,8 +167,6 @@ struct capsule_info {
 
 int __efi_capsule_setup_info(struct capsule_info *cap_info);
 
-typedef int (*efi_freemem_callback_t) (u64 start, u64 end, void *arg);
-
 /*
  * Types and defines for Time Services
  */
@@ -605,10 +603,6 @@ efi_guid_to_str(efi_guid_t *guid, char *out)
 }
 
 extern void efi_init (void);
-extern void *efi_get_pal_addr (void);
-extern void efi_map_pal_code (void);
-extern void efi_memmap_walk (efi_freemem_callback_t callback, void *arg);
-extern void efi_gettimeofday (struct timespec64 *ts);
 #ifdef CONFIG_EFI
 extern void efi_enter_virtual_mode (void);	/* switch EFI to virtual mode, if possible */
 #else
Signature · 1 line
2.17.1
#1 lore raw

Hi Ard!

Quoted 2 lines · Ard Biesheuvel

Move some EFI related declarations that are only referenced on IA64 to a new asm/efi.h arch header.

I will test these changes later this week. I guess they will make it easier to drop ia64 support from the kernel if that gets decided in the foreseeable future.

Adrian

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
author maintainer
#2 lore raw
Quoted 11 lines · John Paul Adrian Glaubitz

Hi Ard!

Quoted 2 lines · Ard Biesheuvel

Move some EFI related declarations that are only referenced on IA64 to a new asm/efi.h arch header.

I will test these changes later this week. I guess they will make it easier to drop ia64 support from the kernel if that gets decided in the foreseeable future.

Hi John,

That is one aspect of it. Another aspect is that the lack of a asm/efi.h header created some problems in the past, given that all other EFI architectures do have it.

But the most important reason is really that arch-specific definitions for an obsolete architecture should not be visible in other builds.

Signature · 1 line
Ard.
#3 lore raw

Hi Ard!

Quoted 6 lines · Ard Biesheuvel

That is one aspect of it. Another aspect is that the lack of a asm/efi.h header created some problems in the past, given that all other EFI architectures do have it.

But the most important reason is really that arch-specific definitions for an obsolete architecture should not be visible in other builds.

I fully agree. I try to test your patches over the weekend. Since Tony is not active anymore, we need to get the patches pulled in through someone else's tree. Probably Arnd or Mike (both CC'ed).

Adrian

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
author maintainer
#4 lore raw
Quoted 8 lines · John Paul Adrian Glaubitz

Hi Ard!

Quoted 4 lines · Ard Biesheuvel

That is one aspect of it. Another aspect is that the lack of a asm/efi.h header created some problems in the past, given that all other EFI architectures do have it.

Quoted 7 lines
Quoted 2 lines

But the most important reason is really that arch-specific definitions for an obsolete architecture should not be visible in other builds.

I fully agree. I try to test your patches over the weekend. Since Tony is not active anymore, we need to get the patches pulled in through someone else's tree. Probably Arnd or Mike (both CC'ed).

Actually, I have already sent this patch via the EFI tree, and it is already in -next.

#5 lore raw
Quoted 2 lines · Ard Biesheuvel

Actually, I have already sent this patch via the EFI tree, and it is already in -next.

OK, I'll test it nonetheless and report back.

Adrian

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
author maintainer
#6 lore raw
Quoted 7 lines · John Paul Adrian Glaubitz
Quoted 2 lines · Ard Biesheuvel

Actually, I have already sent this patch via the EFI tree, and it is already in -next.

OK, I'll test it nonetheless and report back.

Thanks John.

Would you mind if I cc you in the future on EFI patches that may affect IA-64?

#7 lore raw
Quoted 3 lines · Ard Biesheuvel

Thanks John.

Would you mind if I cc you in the future on EFI patches that may affect IA-64?

Not at all, please go ahead. I'm happy to test as much as I can.

Adrian

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913