All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/10] arm64: assembly export cleanup
@ 2018-11-05 13:06 Mark Rutland
  2018-11-05 13:06 ` [PATCH 01/10] arm64: remove bitop exports Mark Rutland
                   ` (9 more replies)
  0 siblings, 10 replies; 12+ messages in thread
From: Mark Rutland @ 2018-11-05 13:06 UTC (permalink / raw)
  To: linux-arm-kernel

When exporting a C function, we place the EXPORT_SYMBOL() immediately after the
function definition. Historically we couldn't do this with assembly functions,
and hence we collected all of these exports in arm64ksyms.c. Over time, this
has retained redundant includes and exports for items defined in C code.

For a while now it has been possible to export functions directly from assembly
files, which is beneficial for ongoing maintenance.

These patches move the exports from arm64ksyms.c into their relevant assembly
files, and remove the newly redundant arm64ksyms.c. I've pushed the series to
my arm64/export-cleanup branch [1] on kernel.org.

Thanks,
Mark.

[1] git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git arm64/export-cleanup

Mark Rutland (10):
  arm64: remove bitop exports
  arm64: move memstart_addr export inline
  arm64: add <asm/export.h>
  arm64: tishift: use asm EXPORT_SYMBOL()
  arm64: smccc: use asm EXPORT_SYMBOL()
  arm64: page: use asm EXPORT_SYMBOL()
  arm64: uaccess: use asm EXPORT_SYMBOL()
  arm64: string: use asm EXPORT_SYMBOL()
  arm64: frace: use asm EXPORT_SYMBOL()
  arm64: remove arm64ksyms.c

 arch/arm64/include/asm/export.h  | 13 ++++++
 arch/arm64/kernel/Makefile       |  2 +-
 arch/arm64/kernel/arm64ksyms.c   | 88 ----------------------------------------
 arch/arm64/kernel/entry-ftrace.S |  6 +++
 arch/arm64/kernel/smccc-call.S   |  4 ++
 arch/arm64/lib/clear_page.S      |  5 ++-
 arch/arm64/lib/clear_user.S      |  2 +
 arch/arm64/lib/copy_from_user.S  |  4 +-
 arch/arm64/lib/copy_in_user.S    |  4 +-
 arch/arm64/lib/copy_page.S       |  9 ++--
 arch/arm64/lib/copy_to_user.S    |  4 +-
 arch/arm64/lib/memchr.S          |  3 ++
 arch/arm64/lib/memcmp.S          |  3 ++
 arch/arm64/lib/memcpy.S          |  4 ++
 arch/arm64/lib/memmove.S         |  4 ++
 arch/arm64/lib/memset.S          |  4 ++
 arch/arm64/lib/strchr.S          |  3 ++
 arch/arm64/lib/strcmp.S          |  3 ++
 arch/arm64/lib/strlen.S          |  3 ++
 arch/arm64/lib/strncmp.S         |  3 ++
 arch/arm64/lib/strnlen.S         |  3 ++
 arch/arm64/lib/strrchr.S         |  3 ++
 arch/arm64/lib/tishift.S         |  5 +++
 arch/arm64/mm/init.c             |  2 +
 24 files changed, 88 insertions(+), 96 deletions(-)
 create mode 100644 arch/arm64/include/asm/export.h
 delete mode 100644 arch/arm64/kernel/arm64ksyms.c

-- 
2.11.0

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 01/10] arm64: remove bitop exports
  2018-11-05 13:06 [PATCH 00/10] arm64: assembly export cleanup Mark Rutland
@ 2018-11-05 13:06 ` Mark Rutland
  2018-11-05 13:06 ` [PATCH 02/10] arm64: move memstart_addr export inline Mark Rutland
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Mark Rutland @ 2018-11-05 13:06 UTC (permalink / raw)
  To: linux-arm-kernel

Now that the arm64 bitops are inlines built atop of the regular atomics,
we don't need to export anything.

Remove the redundant exports.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
---
 arch/arm64/kernel/arm64ksyms.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/arch/arm64/kernel/arm64ksyms.c b/arch/arm64/kernel/arm64ksyms.c
index 72f63a59b008..c4003c18a18b 100644
--- a/arch/arm64/kernel/arm64ksyms.c
+++ b/arch/arm64/kernel/arm64ksyms.c
@@ -62,14 +62,6 @@ EXPORT_SYMBOL(__memset);
 EXPORT_SYMBOL(__memcpy);
 EXPORT_SYMBOL(__memmove);
 
-	/* atomic bitops */
-EXPORT_SYMBOL(set_bit);
-EXPORT_SYMBOL(test_and_set_bit);
-EXPORT_SYMBOL(clear_bit);
-EXPORT_SYMBOL(test_and_clear_bit);
-EXPORT_SYMBOL(change_bit);
-EXPORT_SYMBOL(test_and_change_bit);
-
 #ifdef CONFIG_FUNCTION_TRACER
 EXPORT_SYMBOL(_mcount);
 NOKPROBE_SYMBOL(_mcount);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 02/10] arm64: move memstart_addr export inline
  2018-11-05 13:06 [PATCH 00/10] arm64: assembly export cleanup Mark Rutland
  2018-11-05 13:06 ` [PATCH 01/10] arm64: remove bitop exports Mark Rutland
@ 2018-11-05 13:06 ` Mark Rutland
  2018-11-05 13:06 ` [PATCH 03/10] arm64: add <asm/export.h> Mark Rutland
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Mark Rutland @ 2018-11-05 13:06 UTC (permalink / raw)
  To: linux-arm-kernel

Since we define memstart_addr in a C file, we can have the export
immediately after the definition of the symbol, as we do elsewhere.

As a step towards removing arm64ksyms.c, move the export of
memstart_addr to init.c, where the symbol is defined.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
---
 arch/arm64/kernel/arm64ksyms.c | 3 ---
 arch/arm64/mm/init.c           | 2 ++
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/kernel/arm64ksyms.c b/arch/arm64/kernel/arm64ksyms.c
index c4003c18a18b..73237dc8a994 100644
--- a/arch/arm64/kernel/arm64ksyms.c
+++ b/arch/arm64/kernel/arm64ksyms.c
@@ -40,9 +40,6 @@ EXPORT_SYMBOL(__arch_copy_to_user);
 EXPORT_SYMBOL(__arch_clear_user);
 EXPORT_SYMBOL(__arch_copy_in_user);
 
-	/* physical memory */
-EXPORT_SYMBOL(memstart_addr);
-
 	/* string / mem functions */
 #ifndef CONFIG_KASAN
 EXPORT_SYMBOL(strchr);
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index 9d9582cac6c4..65288aa9b3b4 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -59,6 +59,8 @@
  * that cannot be mistaken for a real physical address.
  */
 s64 memstart_addr __ro_after_init = -1;
+EXPORT_SYMBOL(memstart_addr);
+
 phys_addr_t arm64_dma_phys_limit __ro_after_init;
 
 #ifdef CONFIG_BLK_DEV_INITRD
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 03/10] arm64: add <asm/export.h>
  2018-11-05 13:06 [PATCH 00/10] arm64: assembly export cleanup Mark Rutland
  2018-11-05 13:06 ` [PATCH 01/10] arm64: remove bitop exports Mark Rutland
  2018-11-05 13:06 ` [PATCH 02/10] arm64: move memstart_addr export inline Mark Rutland
@ 2018-11-05 13:06 ` Mark Rutland
  2018-11-26 14:21   ` Will Deacon
  2018-11-05 13:06 ` [PATCH 04/10] arm64: tishift: use asm EXPORT_SYMBOL() Mark Rutland
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 12+ messages in thread
From: Mark Rutland @ 2018-11-05 13:06 UTC (permalink / raw)
  To: linux-arm-kernel

So that we can export symbols directly from assembly files, let's make
use of the generic <asm/export.h>. We have a few symbols that we'll want
to conditionally export for !KASAN kernel builds, so we add a helepr for
that.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
---
 arch/arm64/include/asm/export.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 arch/arm64/include/asm/export.h

diff --git a/arch/arm64/include/asm/export.h b/arch/arm64/include/asm/export.h
new file mode 100644
index 000000000000..d7a82246816e
--- /dev/null
+++ b/arch/arm64/include/asm/export.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef __ASM_EXPORT_H
+#define __ASM_EXPORT_H
+#include <asm-generic/export.h>
+
+#ifdef CONFIG_KASAN
+#define EXPORT_SYMBOL_NOKASAN(name)
+#else
+#define EXPORT_SYMBOL_NOKASAN(name)	EXPORT_SYMBOL(name)
+#endif
+
+#endif /* __ASM_EXPORT_H */
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 04/10] arm64: tishift: use asm EXPORT_SYMBOL()
  2018-11-05 13:06 [PATCH 00/10] arm64: assembly export cleanup Mark Rutland
                   ` (2 preceding siblings ...)
  2018-11-05 13:06 ` [PATCH 03/10] arm64: add <asm/export.h> Mark Rutland
@ 2018-11-05 13:06 ` Mark Rutland
  2018-11-05 13:06 ` [PATCH 05/10] arm64: smccc: " Mark Rutland
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Mark Rutland @ 2018-11-05 13:06 UTC (permalink / raw)
  To: linux-arm-kernel

For a while now it's been possible to use EXPORT_SYMBOL() in assembly
files, which allows us to place exports immediately after assembly
functions, as we do for C functions.

As a step towards removing arm64ksyms.c, let's move the tishift exports
to the assembly file the functions are defined in.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
---
 arch/arm64/kernel/arm64ksyms.c | 7 -------
 arch/arm64/lib/tishift.S       | 5 +++++
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/arch/arm64/kernel/arm64ksyms.c b/arch/arm64/kernel/arm64ksyms.c
index 73237dc8a994..d80e9cfc3062 100644
--- a/arch/arm64/kernel/arm64ksyms.c
+++ b/arch/arm64/kernel/arm64ksyms.c
@@ -68,10 +68,3 @@ NOKPROBE_SYMBOL(_mcount);
 EXPORT_SYMBOL(__arm_smccc_smc);
 EXPORT_SYMBOL(__arm_smccc_hvc);
 
-	/* tishift.S */
-extern long long __ashlti3(long long a, int b);
-EXPORT_SYMBOL(__ashlti3);
-extern long long __ashrti3(long long a, int b);
-EXPORT_SYMBOL(__ashrti3);
-extern long long __lshrti3(long long a, int b);
-EXPORT_SYMBOL(__lshrti3);
diff --git a/arch/arm64/lib/tishift.S b/arch/arm64/lib/tishift.S
index 0fdff97794de..981ff4496b7a 100644
--- a/arch/arm64/lib/tishift.S
+++ b/arch/arm64/lib/tishift.S
@@ -5,6 +5,8 @@
 
 #include <linux/linkage.h>
 
+#include <asm/export.h>
+
 ENTRY(__ashlti3)
 	cbz	x2, 1f
 	mov	x3, #64
@@ -25,6 +27,7 @@ ENTRY(__ashlti3)
 	mov	x0, x2
 	ret
 ENDPROC(__ashlti3)
+EXPORT_SYMBOL(__ashlti3)
 
 ENTRY(__ashrti3)
 	cbz	x2, 1f
@@ -46,6 +49,7 @@ ENTRY(__ashrti3)
 	mov	x1, x2
 	ret
 ENDPROC(__ashrti3)
+EXPORT_SYMBOL(__ashrti3)
 
 ENTRY(__lshrti3)
 	cbz	x2, 1f
@@ -67,3 +71,4 @@ ENTRY(__lshrti3)
 	mov	x1, x2
 	ret
 ENDPROC(__lshrti3)
+EXPORT_SYMBOL(__lshrti3)
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 05/10] arm64: smccc: use asm EXPORT_SYMBOL()
  2018-11-05 13:06 [PATCH 00/10] arm64: assembly export cleanup Mark Rutland
                   ` (3 preceding siblings ...)
  2018-11-05 13:06 ` [PATCH 04/10] arm64: tishift: use asm EXPORT_SYMBOL() Mark Rutland
@ 2018-11-05 13:06 ` Mark Rutland
  2018-11-05 13:06 ` [PATCH 06/10] arm64: page: " Mark Rutland
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Mark Rutland @ 2018-11-05 13:06 UTC (permalink / raw)
  To: linux-arm-kernel

For a while now it's been possible to use EXPORT_SYMBOL() in assembly
files, which allows us to place exports immediately after assembly
functions, as we do for C functions.

As a step towards removing arm64ksyms.c, let's move the SMCCC exports to
the assembly file the functions are defined in.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
---
 arch/arm64/kernel/arm64ksyms.c | 5 -----
 arch/arm64/kernel/smccc-call.S | 4 ++++
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/arm64/kernel/arm64ksyms.c b/arch/arm64/kernel/arm64ksyms.c
index d80e9cfc3062..74e29e69190b 100644
--- a/arch/arm64/kernel/arm64ksyms.c
+++ b/arch/arm64/kernel/arm64ksyms.c
@@ -26,7 +26,6 @@
 #include <linux/syscalls.h>
 #include <linux/uaccess.h>
 #include <linux/io.h>
-#include <linux/arm-smccc.h>
 #include <linux/kprobes.h>
 
 #include <asm/checksum.h>
@@ -64,7 +63,3 @@ EXPORT_SYMBOL(_mcount);
 NOKPROBE_SYMBOL(_mcount);
 #endif
 
-	/* arm-smccc */
-EXPORT_SYMBOL(__arm_smccc_smc);
-EXPORT_SYMBOL(__arm_smccc_hvc);
-
diff --git a/arch/arm64/kernel/smccc-call.S b/arch/arm64/kernel/smccc-call.S
index 62522342e1e4..67218e9e8d5e 100644
--- a/arch/arm64/kernel/smccc-call.S
+++ b/arch/arm64/kernel/smccc-call.S
@@ -13,7 +13,9 @@
  */
 #include <linux/linkage.h>
 #include <linux/arm-smccc.h>
+
 #include <asm/asm-offsets.h>
+#include <asm/export.h>
 
 	.macro SMCCC instr
 	.cfi_startproc
@@ -40,6 +42,7 @@
 ENTRY(__arm_smccc_smc)
 	SMCCC	smc
 ENDPROC(__arm_smccc_smc)
+EXPORT_SYMBOL(__arm_smccc_smc)
 
 /*
  * void arm_smccc_hvc(unsigned long a0, unsigned long a1, unsigned long a2,
@@ -50,3 +53,4 @@ ENDPROC(__arm_smccc_smc)
 ENTRY(__arm_smccc_hvc)
 	SMCCC	hvc
 ENDPROC(__arm_smccc_hvc)
+EXPORT_SYMBOL(__arm_smccc_hvc)
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 06/10] arm64: page: use asm EXPORT_SYMBOL()
  2018-11-05 13:06 [PATCH 00/10] arm64: assembly export cleanup Mark Rutland
                   ` (4 preceding siblings ...)
  2018-11-05 13:06 ` [PATCH 05/10] arm64: smccc: " Mark Rutland
@ 2018-11-05 13:06 ` Mark Rutland
  2018-11-05 13:06 ` [PATCH 07/10] arm64: uaccess: " Mark Rutland
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Mark Rutland @ 2018-11-05 13:06 UTC (permalink / raw)
  To: linux-arm-kernel

For a while now it's been possible to use EXPORT_SYMBOL() in assembly
files, which allows us to place exports immediately after assembly
functions, as we do for C functions.

As a step towards removing arm64ksyms.c, let's move the copy_page and
clear_page exports to the assembly files the functions are defined in.
As we have to include <asm/export.h>, the existing includes are fixed to
follow the usual ordering conventions.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
---
 arch/arm64/kernel/arm64ksyms.c | 3 ---
 arch/arm64/lib/clear_page.S    | 5 ++++-
 arch/arm64/lib/copy_page.S     | 9 ++++++---
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/arch/arm64/kernel/arm64ksyms.c b/arch/arm64/kernel/arm64ksyms.c
index 74e29e69190b..784b257d9643 100644
--- a/arch/arm64/kernel/arm64ksyms.c
+++ b/arch/arm64/kernel/arm64ksyms.c
@@ -30,9 +30,6 @@
 
 #include <asm/checksum.h>
 
-EXPORT_SYMBOL(copy_page);
-EXPORT_SYMBOL(clear_page);
-
 	/* user mem (segment) */
 EXPORT_SYMBOL(__arch_copy_from_user);
 EXPORT_SYMBOL(__arch_copy_to_user);
diff --git a/arch/arm64/lib/clear_page.S b/arch/arm64/lib/clear_page.S
index ef08e905e35b..543313c31384 100644
--- a/arch/arm64/lib/clear_page.S
+++ b/arch/arm64/lib/clear_page.S
@@ -14,9 +14,11 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <linux/linkage.h>
 #include <linux/const.h>
+#include <linux/linkage.h>
+
 #include <asm/assembler.h>
+#include <asm/export.h>
 #include <asm/page.h>
 
 /*
@@ -37,3 +39,4 @@ ENTRY(clear_page)
 	b.ne	1b
 	ret
 ENDPROC(clear_page)
+EXPORT_SYMBOL(clear_page)
diff --git a/arch/arm64/lib/copy_page.S b/arch/arm64/lib/copy_page.S
index 076c43715e64..7248e7157138 100644
--- a/arch/arm64/lib/copy_page.S
+++ b/arch/arm64/lib/copy_page.S
@@ -14,12 +14,14 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <linux/linkage.h>
 #include <linux/const.h>
+#include <linux/linkage.h>
+
+#include <asm/alternative.h>
 #include <asm/assembler.h>
-#include <asm/page.h>
+#include <asm/export.h>
 #include <asm/cpufeature.h>
-#include <asm/alternative.h>
+#include <asm/page.h>
 
 /*
  * Copy a page from src to dest (both are page aligned)
@@ -87,3 +89,4 @@ alternative_else_nop_endif
 
 	ret
 ENDPROC(copy_page)
+EXPORT_SYMBOL(copy_page)
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 07/10] arm64: uaccess: use asm EXPORT_SYMBOL()
  2018-11-05 13:06 [PATCH 00/10] arm64: assembly export cleanup Mark Rutland
                   ` (5 preceding siblings ...)
  2018-11-05 13:06 ` [PATCH 06/10] arm64: page: " Mark Rutland
@ 2018-11-05 13:06 ` Mark Rutland
  2018-11-05 13:06 ` [PATCH 08/10] arm64: string: " Mark Rutland
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Mark Rutland @ 2018-11-05 13:06 UTC (permalink / raw)
  To: linux-arm-kernel

For a while now it's been possible to use EXPORT_SYMBOL() in assembly
files, which allows us to place exports immediately after assembly
functions, as we do for C functions.

As a step towards removing arm64ksyms.c, let's move the uaccess exports
to the assembly files the functions are defined in.  As we have to
include <asm/export.h>, the existing includes are fixed to follow the
usual ordering conventions.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
---
 arch/arm64/kernel/arm64ksyms.c  | 7 -------
 arch/arm64/lib/clear_user.S     | 2 ++
 arch/arm64/lib/copy_from_user.S | 4 +++-
 arch/arm64/lib/copy_in_user.S   | 4 +++-
 arch/arm64/lib/copy_to_user.S   | 4 +++-
 5 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/arch/arm64/kernel/arm64ksyms.c b/arch/arm64/kernel/arm64ksyms.c
index 784b257d9643..02019667e319 100644
--- a/arch/arm64/kernel/arm64ksyms.c
+++ b/arch/arm64/kernel/arm64ksyms.c
@@ -24,18 +24,11 @@
 #include <linux/delay.h>
 #include <linux/in6.h>
 #include <linux/syscalls.h>
-#include <linux/uaccess.h>
 #include <linux/io.h>
 #include <linux/kprobes.h>
 
 #include <asm/checksum.h>
 
-	/* user mem (segment) */
-EXPORT_SYMBOL(__arch_copy_from_user);
-EXPORT_SYMBOL(__arch_copy_to_user);
-EXPORT_SYMBOL(__arch_clear_user);
-EXPORT_SYMBOL(__arch_copy_in_user);
-
 	/* string / mem functions */
 #ifndef CONFIG_KASAN
 EXPORT_SYMBOL(strchr);
diff --git a/arch/arm64/lib/clear_user.S b/arch/arm64/lib/clear_user.S
index 21ba0b29621b..81a572dec379 100644
--- a/arch/arm64/lib/clear_user.S
+++ b/arch/arm64/lib/clear_user.S
@@ -18,6 +18,7 @@
 #include <linux/linkage.h>
 
 #include <asm/asm-uaccess.h>
+#include <asm/export.h>
 
 	.text
 
@@ -53,6 +54,7 @@ uao_user_alternative 9f, strb, sttrb, wzr, x0, 0
 	uaccess_disable_not_uao x2, x3
 	ret
 ENDPROC(__arch_clear_user)
+EXPORT_SYMBOL(__arch_clear_user)
 
 	.section .fixup,"ax"
 	.align	2
diff --git a/arch/arm64/lib/copy_from_user.S b/arch/arm64/lib/copy_from_user.S
index 20305d485046..d7a0a1deef5d 100644
--- a/arch/arm64/lib/copy_from_user.S
+++ b/arch/arm64/lib/copy_from_user.S
@@ -16,8 +16,9 @@
 
 #include <linux/linkage.h>
 
-#include <asm/cache.h>
 #include <asm/asm-uaccess.h>
+#include <asm/cache.h>
+#include <asm/export.h>
 
 /*
  * Copy from user space to a kernel buffer (alignment handled by the hardware)
@@ -71,6 +72,7 @@ ENTRY(__arch_copy_from_user)
 	mov	x0, #0				// Nothing to copy
 	ret
 ENDPROC(__arch_copy_from_user)
+EXPORT_SYMBOL(__arch_copy_from_user)
 
 	.section .fixup,"ax"
 	.align	2
diff --git a/arch/arm64/lib/copy_in_user.S b/arch/arm64/lib/copy_in_user.S
index 54b75deb1d16..804a65470d13 100644
--- a/arch/arm64/lib/copy_in_user.S
+++ b/arch/arm64/lib/copy_in_user.S
@@ -18,8 +18,9 @@
 
 #include <linux/linkage.h>
 
-#include <asm/cache.h>
 #include <asm/asm-uaccess.h>
+#include <asm/cache.h>
+#include <asm/export.h>
 
 /*
  * Copy from user space to user space (alignment handled by the hardware)
@@ -73,6 +74,7 @@ ENTRY(__arch_copy_in_user)
 	mov	x0, #0
 	ret
 ENDPROC(__arch_copy_in_user)
+EXPORT_SYMBOL(__arch_copy_in_user)
 
 	.section .fixup,"ax"
 	.align	2
diff --git a/arch/arm64/lib/copy_to_user.S b/arch/arm64/lib/copy_to_user.S
index fda6172d6b88..2f42acba6d68 100644
--- a/arch/arm64/lib/copy_to_user.S
+++ b/arch/arm64/lib/copy_to_user.S
@@ -16,8 +16,9 @@
 
 #include <linux/linkage.h>
 
-#include <asm/cache.h>
 #include <asm/asm-uaccess.h>
+#include <asm/export.h>
+#include <asm/cache.h>
 
 /*
  * Copy to user space from a kernel buffer (alignment handled by the hardware)
@@ -70,6 +71,7 @@ ENTRY(__arch_copy_to_user)
 	mov	x0, #0
 	ret
 ENDPROC(__arch_copy_to_user)
+EXPORT_SYMBOL(__arch_copy_to_user)
 
 	.section .fixup,"ax"
 	.align	2
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 08/10] arm64: string: use asm EXPORT_SYMBOL()
  2018-11-05 13:06 [PATCH 00/10] arm64: assembly export cleanup Mark Rutland
                   ` (6 preceding siblings ...)
  2018-11-05 13:06 ` [PATCH 07/10] arm64: uaccess: " Mark Rutland
@ 2018-11-05 13:06 ` Mark Rutland
  2018-11-05 13:06 ` [PATCH 09/10] arm64: frace: " Mark Rutland
  2018-11-05 13:06 ` [PATCH 10/10] arm64: remove arm64ksyms.c Mark Rutland
  9 siblings, 0 replies; 12+ messages in thread
From: Mark Rutland @ 2018-11-05 13:06 UTC (permalink / raw)
  To: linux-arm-kernel

For a while now it's been possible to use EXPORT_SYMBOL() in assembly
files, which allows us to place exports immediately after assembly
functions, as we do for C functions.

As a step towards removing arm64ksyms.c, let's move the string routine
exports to the assembly files the functions are defined in. Routines
which should only be exported for !KASNA builds are exported using the
EXPORT_SYMBOL_NOKASAN() helper. As we have to include <asm/export.h>,
the existing includes are fixed to follow the usual ordering
conventions.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
---
 arch/arm64/kernel/arm64ksyms.c | 20 --------------------
 arch/arm64/lib/memchr.S        |  3 +++
 arch/arm64/lib/memcmp.S        |  3 +++
 arch/arm64/lib/memcpy.S        |  4 ++++
 arch/arm64/lib/memmove.S       |  4 ++++
 arch/arm64/lib/memset.S        |  4 ++++
 arch/arm64/lib/strchr.S        |  3 +++
 arch/arm64/lib/strcmp.S        |  3 +++
 arch/arm64/lib/strlen.S        |  3 +++
 arch/arm64/lib/strncmp.S       |  3 +++
 arch/arm64/lib/strnlen.S       |  3 +++
 arch/arm64/lib/strrchr.S       |  3 +++
 12 files changed, 36 insertions(+), 20 deletions(-)

diff --git a/arch/arm64/kernel/arm64ksyms.c b/arch/arm64/kernel/arm64ksyms.c
index 02019667e319..c142103bc0fe 100644
--- a/arch/arm64/kernel/arm64ksyms.c
+++ b/arch/arm64/kernel/arm64ksyms.c
@@ -19,7 +19,6 @@
 
 #include <linux/export.h>
 #include <linux/sched.h>
-#include <linux/string.h>
 #include <linux/cryptohash.h>
 #include <linux/delay.h>
 #include <linux/in6.h>
@@ -29,25 +28,6 @@
 
 #include <asm/checksum.h>
 
-	/* string / mem functions */
-#ifndef CONFIG_KASAN
-EXPORT_SYMBOL(strchr);
-EXPORT_SYMBOL(strrchr);
-EXPORT_SYMBOL(strcmp);
-EXPORT_SYMBOL(strncmp);
-EXPORT_SYMBOL(strlen);
-EXPORT_SYMBOL(strnlen);
-EXPORT_SYMBOL(memcmp);
-EXPORT_SYMBOL(memchr);
-#endif
-
-EXPORT_SYMBOL(memset);
-EXPORT_SYMBOL(memcpy);
-EXPORT_SYMBOL(memmove);
-EXPORT_SYMBOL(__memset);
-EXPORT_SYMBOL(__memcpy);
-EXPORT_SYMBOL(__memmove);
-
 #ifdef CONFIG_FUNCTION_TRACER
 EXPORT_SYMBOL(_mcount);
 NOKPROBE_SYMBOL(_mcount);
diff --git a/arch/arm64/lib/memchr.S b/arch/arm64/lib/memchr.S
index 0f164a4baf52..2b0e7648a7dd 100644
--- a/arch/arm64/lib/memchr.S
+++ b/arch/arm64/lib/memchr.S
@@ -18,7 +18,9 @@
  */
 
 #include <linux/linkage.h>
+
 #include <asm/assembler.h>
+#include <asm/export.h>
 
 /*
  * Find a character in an area of memory.
@@ -42,3 +44,4 @@ WEAK(memchr)
 2:	mov	x0, #0
 	ret
 ENDPIPROC(memchr)
+EXPORT_SYMBOL_NOKASAN(memchr)
diff --git a/arch/arm64/lib/memcmp.S b/arch/arm64/lib/memcmp.S
index fb295f52e9f8..10d39668ef03 100644
--- a/arch/arm64/lib/memcmp.S
+++ b/arch/arm64/lib/memcmp.S
@@ -23,7 +23,9 @@
  */
 
 #include <linux/linkage.h>
+
 #include <asm/assembler.h>
+#include <asm/export.h>
 
 /*
 * compare memory areas(when two memory areas' offset are different,
@@ -256,3 +258,4 @@ CPU_LE( rev	data2, data2 )
 	mov	result, #0
 	ret
 ENDPIPROC(memcmp)
+EXPORT_SYMBOL_NOKASAN(memcmp)
diff --git a/arch/arm64/lib/memcpy.S b/arch/arm64/lib/memcpy.S
index 67613937711f..7bfb34566d79 100644
--- a/arch/arm64/lib/memcpy.S
+++ b/arch/arm64/lib/memcpy.S
@@ -23,8 +23,10 @@
  */
 
 #include <linux/linkage.h>
+
 #include <asm/assembler.h>
 #include <asm/cache.h>
+#include <asm/export.h>
 
 /*
  * Copy a buffer from src to dest (alignment handled by the hardware)
@@ -74,4 +76,6 @@ ENTRY(memcpy)
 #include "copy_template.S"
 	ret
 ENDPIPROC(memcpy)
+EXPORT_SYMBOL(memcpy)
 ENDPROC(__memcpy)
+EXPORT_SYMBOL(__memcpy)
diff --git a/arch/arm64/lib/memmove.S b/arch/arm64/lib/memmove.S
index a5a4459013b1..bf9bedb78594 100644
--- a/arch/arm64/lib/memmove.S
+++ b/arch/arm64/lib/memmove.S
@@ -23,8 +23,10 @@
  */
 
 #include <linux/linkage.h>
+
 #include <asm/assembler.h>
 #include <asm/cache.h>
+#include <asm/export.h>
 
 /*
  * Move a buffer from src to test (alignment handled by the hardware).
@@ -197,4 +199,6 @@ ENTRY(memmove)
 	b.ne	.Ltail63
 	ret
 ENDPIPROC(memmove)
+EXPORT_SYMBOL(memmove)
 ENDPROC(__memmove)
+EXPORT_SYMBOL(__memmove)
diff --git a/arch/arm64/lib/memset.S b/arch/arm64/lib/memset.S
index f2670a9f218c..9542cfda590a 100644
--- a/arch/arm64/lib/memset.S
+++ b/arch/arm64/lib/memset.S
@@ -23,8 +23,10 @@
  */
 
 #include <linux/linkage.h>
+
 #include <asm/assembler.h>
 #include <asm/cache.h>
+#include <asm/export.h>
 
 /*
  * Fill in the buffer with character c (alignment handled by the hardware)
@@ -216,4 +218,6 @@ ENTRY(memset)
 	b.ne	.Ltail_maybe_long
 	ret
 ENDPIPROC(memset)
+EXPORT_SYMBOL(memset)
 ENDPROC(__memset)
+EXPORT_SYMBOL(__memset)
diff --git a/arch/arm64/lib/strchr.S b/arch/arm64/lib/strchr.S
index 7c83091d1bcd..02364e5363c4 100644
--- a/arch/arm64/lib/strchr.S
+++ b/arch/arm64/lib/strchr.S
@@ -18,7 +18,9 @@
  */
 
 #include <linux/linkage.h>
+
 #include <asm/assembler.h>
+#include <asm/export.h>
 
 /*
  * Find the first occurrence of a character in a string.
@@ -40,3 +42,4 @@ WEAK(strchr)
 	csel	x0, x0, xzr, eq
 	ret
 ENDPROC(strchr)
+EXPORT_SYMBOL_NOKASAN(strchr)
diff --git a/arch/arm64/lib/strcmp.S b/arch/arm64/lib/strcmp.S
index 7d5d15398bfb..75954df67c35 100644
--- a/arch/arm64/lib/strcmp.S
+++ b/arch/arm64/lib/strcmp.S
@@ -23,7 +23,9 @@
  */
 
 #include <linux/linkage.h>
+
 #include <asm/assembler.h>
+#include <asm/export.h>
 
 /*
  * compare two strings
@@ -232,3 +234,4 @@ CPU_BE(	orr	syndrome, diff, has_nul )
 	sub	result, data1, data2, lsr #56
 	ret
 ENDPIPROC(strcmp)
+EXPORT_SYMBOL_NOKASAN(strcmp)
diff --git a/arch/arm64/lib/strlen.S b/arch/arm64/lib/strlen.S
index 8e0b14205dcb..4330a231da43 100644
--- a/arch/arm64/lib/strlen.S
+++ b/arch/arm64/lib/strlen.S
@@ -23,7 +23,9 @@
  */
 
 #include <linux/linkage.h>
+
 #include <asm/assembler.h>
+#include <asm/export.h>
 
 /*
  * calculate the length of a string
@@ -124,3 +126,4 @@ CPU_LE( lsr	tmp2, tmp2, tmp1 )	/* Shift (tmp1 & 63).  */
 	csel	data2, data2, data2a, le
 	b	.Lrealigned
 ENDPIPROC(strlen)
+EXPORT_SYMBOL_NOKASAN(strlen)
diff --git a/arch/arm64/lib/strncmp.S b/arch/arm64/lib/strncmp.S
index 66bd145935d9..47bc24ae5ebc 100644
--- a/arch/arm64/lib/strncmp.S
+++ b/arch/arm64/lib/strncmp.S
@@ -23,7 +23,9 @@
  */
 
 #include <linux/linkage.h>
+
 #include <asm/assembler.h>
+#include <asm/export.h>
 
 /*
  * compare two strings
@@ -308,3 +310,4 @@ CPU_BE( orr	syndrome, diff, has_nul )
 	mov	result, #0
 	ret
 ENDPIPROC(strncmp)
+EXPORT_SYMBOL_NOKASAN(strncmp)
diff --git a/arch/arm64/lib/strnlen.S b/arch/arm64/lib/strnlen.S
index 355be04441fe..e68b30f71ee9 100644
--- a/arch/arm64/lib/strnlen.S
+++ b/arch/arm64/lib/strnlen.S
@@ -23,7 +23,9 @@
  */
 
 #include <linux/linkage.h>
+
 #include <asm/assembler.h>
+#include <asm/export.h>
 
 /*
  * determine the length of a fixed-size string
@@ -169,3 +171,4 @@ CPU_LE( lsr	tmp2, tmp2, tmp4 )	/* Shift (tmp1 & 63).  */
 	mov	len, limit
 	ret
 ENDPIPROC(strnlen)
+EXPORT_SYMBOL_NOKASAN(strnlen)
diff --git a/arch/arm64/lib/strrchr.S b/arch/arm64/lib/strrchr.S
index ea84924d5990..668934e99172 100644
--- a/arch/arm64/lib/strrchr.S
+++ b/arch/arm64/lib/strrchr.S
@@ -18,7 +18,9 @@
  */
 
 #include <linux/linkage.h>
+
 #include <asm/assembler.h>
+#include <asm/export.h>
 
 /*
  * Find the last occurrence of a character in a string.
@@ -41,3 +43,4 @@ WEAK(strrchr)
 2:	mov	x0, x3
 	ret
 ENDPIPROC(strrchr)
+EXPORT_SYMBOL_NOKASAN(strrchr)
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 09/10] arm64: frace: use asm EXPORT_SYMBOL()
  2018-11-05 13:06 [PATCH 00/10] arm64: assembly export cleanup Mark Rutland
                   ` (7 preceding siblings ...)
  2018-11-05 13:06 ` [PATCH 08/10] arm64: string: " Mark Rutland
@ 2018-11-05 13:06 ` Mark Rutland
  2018-11-05 13:06 ` [PATCH 10/10] arm64: remove arm64ksyms.c Mark Rutland
  9 siblings, 0 replies; 12+ messages in thread
From: Mark Rutland @ 2018-11-05 13:06 UTC (permalink / raw)
  To: linux-arm-kernel

For a while now it's been possible to use EXPORT_SYMBOL() in assembly
files, which allows us to place exports immediately after assembly
functions, as we do for C functions.

As a step towards removing arm64ksyms.c, let's move the ftrace exports
to the assembly files the functions are defined in.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
---
 arch/arm64/kernel/arm64ksyms.c   | 5 -----
 arch/arm64/kernel/entry-ftrace.S | 6 ++++++
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/arch/arm64/kernel/arm64ksyms.c b/arch/arm64/kernel/arm64ksyms.c
index c142103bc0fe..4ca8d2b245d2 100644
--- a/arch/arm64/kernel/arm64ksyms.c
+++ b/arch/arm64/kernel/arm64ksyms.c
@@ -28,8 +28,3 @@
 
 #include <asm/checksum.h>
 
-#ifdef CONFIG_FUNCTION_TRACER
-EXPORT_SYMBOL(_mcount);
-NOKPROBE_SYMBOL(_mcount);
-#endif
-
diff --git a/arch/arm64/kernel/entry-ftrace.S b/arch/arm64/kernel/entry-ftrace.S
index 1175f5827ae1..98f029c7d4f4 100644
--- a/arch/arm64/kernel/entry-ftrace.S
+++ b/arch/arm64/kernel/entry-ftrace.S
@@ -10,7 +10,9 @@
  */
 
 #include <linux/linkage.h>
+
 #include <asm/assembler.h>
+#include <asm/export.h>
 #include <asm/ftrace.h>
 #include <asm/insn.h>
 
@@ -121,6 +123,8 @@ skip_ftrace_call:			// }
 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */
 	mcount_exit
 ENDPROC(_mcount)
+EXPORT_SYMBOL(_mcount)
+NOKPROBE(_mcount)
 
 #else /* CONFIG_DYNAMIC_FTRACE */
 /*
@@ -132,6 +136,8 @@ ENDPROC(_mcount)
 ENTRY(_mcount)
 	ret
 ENDPROC(_mcount)
+EXPORT_SYMBOL(_mcount)
+NOKPROBE(_mcount)
 
 /*
  * void ftrace_caller(unsigned long return_address)
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 10/10] arm64: remove arm64ksyms.c
  2018-11-05 13:06 [PATCH 00/10] arm64: assembly export cleanup Mark Rutland
                   ` (8 preceding siblings ...)
  2018-11-05 13:06 ` [PATCH 09/10] arm64: frace: " Mark Rutland
@ 2018-11-05 13:06 ` Mark Rutland
  9 siblings, 0 replies; 12+ messages in thread
From: Mark Rutland @ 2018-11-05 13:06 UTC (permalink / raw)
  To: linux-arm-kernel

Now that arm64ksyms.c has been reduced to a stub, let's remove it
entirely. New exports should be associated with their function
definition.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
---
 arch/arm64/kernel/Makefile     |  2 +-
 arch/arm64/kernel/arm64ksyms.c | 30 ------------------------------
 2 files changed, 1 insertion(+), 31 deletions(-)
 delete mode 100644 arch/arm64/kernel/arm64ksyms.c

diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile
index 4c8b13bede80..e069f957ec28 100644
--- a/arch/arm64/kernel/Makefile
+++ b/arch/arm64/kernel/Makefile
@@ -30,7 +30,7 @@ $(obj)/%.stub.o: $(obj)/%.o FORCE
 arm64-obj-$(CONFIG_COMPAT)		+= sys32.o kuser32.o signal32.o 	\
 					   sys_compat.o
 arm64-obj-$(CONFIG_FUNCTION_TRACER)	+= ftrace.o entry-ftrace.o
-arm64-obj-$(CONFIG_MODULES)		+= arm64ksyms.o module.o
+arm64-obj-$(CONFIG_MODULES)		+= module.o
 arm64-obj-$(CONFIG_ARM64_MODULE_PLTS)	+= module-plts.o
 arm64-obj-$(CONFIG_PERF_EVENTS)		+= perf_regs.o perf_callchain.o
 arm64-obj-$(CONFIG_HW_PERF_EVENTS)	+= perf_event.o
diff --git a/arch/arm64/kernel/arm64ksyms.c b/arch/arm64/kernel/arm64ksyms.c
deleted file mode 100644
index 4ca8d2b245d2..000000000000
--- a/arch/arm64/kernel/arm64ksyms.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Based on arch/arm/kernel/armksyms.c
- *
- * Copyright (C) 2000 Russell King
- * Copyright (C) 2012 ARM Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <linux/export.h>
-#include <linux/sched.h>
-#include <linux/cryptohash.h>
-#include <linux/delay.h>
-#include <linux/in6.h>
-#include <linux/syscalls.h>
-#include <linux/io.h>
-#include <linux/kprobes.h>
-
-#include <asm/checksum.h>
-
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 03/10] arm64: add <asm/export.h>
  2018-11-05 13:06 ` [PATCH 03/10] arm64: add <asm/export.h> Mark Rutland
@ 2018-11-26 14:21   ` Will Deacon
  0 siblings, 0 replies; 12+ messages in thread
From: Will Deacon @ 2018-11-26 14:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 05, 2018 at 01:06:42PM +0000, Mark Rutland wrote:
> So that we can export symbols directly from assembly files, let's make
> use of the generic <asm/export.h>. We have a few symbols that we'll want
> to conditionally export for !KASAN kernel builds, so we add a helepr for
> that.
> 
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> ---
>  arch/arm64/include/asm/export.h | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>  create mode 100644 arch/arm64/include/asm/export.h
> 
> diff --git a/arch/arm64/include/asm/export.h b/arch/arm64/include/asm/export.h
> new file mode 100644
> index 000000000000..d7a82246816e
> --- /dev/null
> +++ b/arch/arm64/include/asm/export.h
> @@ -0,0 +1,13 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +
> +#ifndef __ASM_EXPORT_H
> +#define __ASM_EXPORT_H
> +#include <asm-generic/export.h>
> +
> +#ifdef CONFIG_KASAN
> +#define EXPORT_SYMBOL_NOKASAN(name)
> +#else
> +#define EXPORT_SYMBOL_NOKASAN(name)	EXPORT_SYMBOL(name)
> +#endif
> +
> +#endif /* __ASM_EXPORT_H */

It feels a bit OTT to create a new arch header for this. Could we either
put it in the core code, or move it into asm/assembler.h instead?

Will

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-11-26 14:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-05 13:06 [PATCH 00/10] arm64: assembly export cleanup Mark Rutland
2018-11-05 13:06 ` [PATCH 01/10] arm64: remove bitop exports Mark Rutland
2018-11-05 13:06 ` [PATCH 02/10] arm64: move memstart_addr export inline Mark Rutland
2018-11-05 13:06 ` [PATCH 03/10] arm64: add <asm/export.h> Mark Rutland
2018-11-26 14:21   ` Will Deacon
2018-11-05 13:06 ` [PATCH 04/10] arm64: tishift: use asm EXPORT_SYMBOL() Mark Rutland
2018-11-05 13:06 ` [PATCH 05/10] arm64: smccc: " Mark Rutland
2018-11-05 13:06 ` [PATCH 06/10] arm64: page: " Mark Rutland
2018-11-05 13:06 ` [PATCH 07/10] arm64: uaccess: " Mark Rutland
2018-11-05 13:06 ` [PATCH 08/10] arm64: string: " Mark Rutland
2018-11-05 13:06 ` [PATCH 09/10] arm64: frace: " Mark Rutland
2018-11-05 13:06 ` [PATCH 10/10] arm64: remove arm64ksyms.c Mark Rutland

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.