Skip to contentSkip to conversation

RISC-V: include linux/ftrace.h in asm-prototypes.h

PATCH New James Cowgill 2 participants 3 messages Sep 6, 2018 – Sep 21, 2018 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RISC-V: include linux/ftrace.h in asm-prototypes.h

Building a riscv kernel with CONFIG_FUNCTION_TRACER and CONFIG_MODVERSIONS enabled results in these two warnings:

MODPOST vmlinux.o
WARNING: EXPORT symbol "return_to_handler" [vmlinux] version generation failed, symbol will not be versioned.
WARNING: EXPORT symbol "_mcount" [vmlinux] version generation failed, symbol will not be versioned.

When exporting symbols from an assembly file, the MODVERSIONS code requires their prototypes to be defined in asm-prototypes.h (see scripts/Makefile.build). Since both of these symbols have prototypes defined in linux/ftrace.h, include this header from RISC-V's asm-prototypes.h.

---
 arch/riscv/include/asm/asm-prototypes.h | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 arch/riscv/include/asm/asm-prototypes.h
arch/riscv/include/asm/asm-prototypes.h new file +7 -0
new file mode 100644
index 000000000000..c9fecd120d18
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_RISCV_PROTOTYPES_H
+
+#include <linux/ftrace.h>
+#include <asm-generic/asm-prototypes.h>
+
+#endif /* _ASM_RISCV_PROTOTYPES_H */
Signature · 1 line
2.19.0.rc2
#1 lore raw

PATCH 1/1 RISC-V: include linux/ftrace.h in asm-prototypes.h

Quoted 8 lines · James Cowgill

When exporting symbols from an assembly file, the MODVERSIONS code requires their prototypes to be defined in asm-prototypes.h (see scripts/Makefile.build). Since both of these symbols have prototypes defined in linux/ftrace.h, include this header from RISC-V's asm-prototypes.h.

I think this needs at very least a good comment, including for which symbols you are doing this.

Also I'm curious if it might be worth just handling this in the asm-generic version, as those symbols should be assembly exports in most architectures.

#2 lore raw

PATCH 1/1 RISC-V: include linux/ftrace.h in asm-prototypes.h

Quoted 10 lines · Christoph Hellwig
Quoted 8 lines · James Cowgill

When exporting symbols from an assembly file, the MODVERSIONS code requires their prototypes to be defined in asm-prototypes.h (see scripts/Makefile.build). Since both of these symbols have prototypes defined in linux/ftrace.h, include this header from RISC-V's asm-prototypes.h.

Quoted 6 lines

I think this needs at very least a good comment, including for which symbols you are doing this.

Also I'm curious if it might be worth just handling this in the asm-generic version, as those symbols should be assembly exports in most architectures.

Ok, looks like we don't really need the asm-generic asm-prototypes.h to start with as far as I can tell. So I think you can resubmit it with just the ftrace.h include and a comment.