When CONFIG_MODULES is disabled, we cannot dereference a module pointer:
arch/arm64/kernel/ftrace.c: In function 'ftrace_make_call':
arch/arm64/kernel/ftrace.c:107:36: error: dereferencing pointer to incomplete type 'struct module'
trampoline = (unsigned long *)mod->arch.ftrace_trampoline;
Also, the within_module() function is not defined:
arch/arm64/kernel/ftrace.c: In function 'ftrace_make_nop':
arch/arm64/kernel/ftrace.c:171:8: error: implicit declaration of function 'within_module'; did you mean 'init_module'? [-Werror=implicit-function-declaration]
This addresses both by adding the appropriate stubs.
Fixes: e71a4e1bebaf ("arm64: ftrace: add support for far branches to dynamic ftrace")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm64/include/asm/module.h | 6 ++++++
arch/arm64/kernel/ftrace.c | 2 +-
include/linux/module.h | 5 +++++
3 files changed, 12 insertions(+), 1 deletion(-)
@@ -104,7 +104,7 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)*isaddedinthefuture,butfornow,thepr_err()below*dealswithatheoreticalissueonly.*/-trampoline=(unsignedlong*)mod->arch.ftrace_trampoline;+trampoline=module_ftrace_trampoline(mod);if(trampoline[0]!=addr){if(trampoline[0]!=0){pr_err("ftrace: far branches to multiple entry points unsupported inside a single module\n");
@@ -671,6 +671,11 @@ static inline bool is_module_text_address(unsigned long addr)returnfalse;}+staticinlineboolwithin_module(unsignedlongaddr,conststructmodule*mod)+{+returnfalse;+}+/* Get/put a kernel symbol (calls should be symmetric) */#define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); })#define symbol_put(x) do { } while (0)
From: Will Deacon <hidden> Date: 2017-06-09 11:38:44
Hi Arnd,
On Fri, Jun 09, 2017 at 12:27:06PM +0200, Arnd Bergmann wrote:
When CONFIG_MODULES is disabled, we cannot dereference a module pointer:
arch/arm64/kernel/ftrace.c: In function 'ftrace_make_call':
arch/arm64/kernel/ftrace.c:107:36: error: dereferencing pointer to incomplete type 'struct module'
trampoline = (unsigned long *)mod->arch.ftrace_trampoline;
Also, the within_module() function is not defined:
arch/arm64/kernel/ftrace.c: In function 'ftrace_make_nop':
arch/arm64/kernel/ftrace.c:171:8: error: implicit declaration of function 'within_module'; did you mean 'init_module'? [-Werror=implicit-function-declaration]
This addresses both by adding the appropriate stubs.
Fixes: e71a4e1bebaf ("arm64: ftrace: add support for far branches to dynamic ftrace")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm64/include/asm/module.h | 6 ++++++
arch/arm64/kernel/ftrace.c | 2 +-
include/linux/module.h | 5 +++++
3 files changed, 12 insertions(+), 1 deletion(-)
I can't seem to reproduce this simply by disabling MODULES in defconfig.
Could you share your .config, please?
Will
On Fri, Jun 9, 2017 at 1:38 PM, Will Deacon [off-list ref] wrote:
Hi Arnd,
On Fri, Jun 09, 2017 at 12:27:06PM +0200, Arnd Bergmann wrote:
quoted
When CONFIG_MODULES is disabled, we cannot dereference a module pointer:
arch/arm64/kernel/ftrace.c: In function 'ftrace_make_call':
arch/arm64/kernel/ftrace.c:107:36: error: dereferencing pointer to incomplete type 'struct module'
trampoline = (unsigned long *)mod->arch.ftrace_trampoline;
Also, the within_module() function is not defined:
arch/arm64/kernel/ftrace.c: In function 'ftrace_make_nop':
arch/arm64/kernel/ftrace.c:171:8: error: implicit declaration of function 'within_module'; did you mean 'init_module'? [-Werror=implicit-function-declaration]
This addresses both by adding the appropriate stubs.
Fixes: e71a4e1bebaf ("arm64: ftrace: add support for far branches to dynamic ftrace")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm64/include/asm/module.h | 6 ++++++
arch/arm64/kernel/ftrace.c | 2 +-
include/linux/module.h | 5 +++++
3 files changed, 12 insertions(+), 1 deletion(-)
I can't seem to reproduce this simply by disabling MODULES in defconfig.
Could you share your .config, please?
From: Will Deacon <hidden> Date: 2017-06-12 12:48:03
On Fri, Jun 09, 2017 at 08:57:31PM +0200, Arnd Bergmann wrote:
On Fri, Jun 9, 2017 at 1:38 PM, Will Deacon [off-list ref] wrote:
quoted
On Fri, Jun 09, 2017 at 12:27:06PM +0200, Arnd Bergmann wrote:
quoted
When CONFIG_MODULES is disabled, we cannot dereference a module pointer:
arch/arm64/kernel/ftrace.c: In function 'ftrace_make_call':
arch/arm64/kernel/ftrace.c:107:36: error: dereferencing pointer to incomplete type 'struct module'
trampoline = (unsigned long *)mod->arch.ftrace_trampoline;
Also, the within_module() function is not defined:
arch/arm64/kernel/ftrace.c: In function 'ftrace_make_nop':
arch/arm64/kernel/ftrace.c:171:8: error: implicit declaration of function 'within_module'; did you mean 'init_module'? [-Werror=implicit-function-declaration]
This addresses both by adding the appropriate stubs.
Fixes: e71a4e1bebaf ("arm64: ftrace: add support for far branches to dynamic ftrace")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm64/include/asm/module.h | 6 ++++++
arch/arm64/kernel/ftrace.c | 2 +-
include/linux/module.h | 5 +++++
3 files changed, 12 insertions(+), 1 deletion(-)
I can't seem to reproduce this simply by disabling MODULES in defconfig.
Could you share your .config, please?
Thanks, I was forgetting to enable ftrace. I think a simpler patch (and one
that I can just apply via arm64) is switching the IS_ENABLEDs out for
#ifdefs. See below.
Will
--->8
On 12 June 2017 at 14:48, Will Deacon [off-list ref] wrote:
On Fri, Jun 09, 2017 at 08:57:31PM +0200, Arnd Bergmann wrote:
quoted
On Fri, Jun 9, 2017 at 1:38 PM, Will Deacon [off-list ref] wrote:
quoted
On Fri, Jun 09, 2017 at 12:27:06PM +0200, Arnd Bergmann wrote:
quoted
When CONFIG_MODULES is disabled, we cannot dereference a module pointer:
arch/arm64/kernel/ftrace.c: In function 'ftrace_make_call':
arch/arm64/kernel/ftrace.c:107:36: error: dereferencing pointer to incomplete type 'struct module'
trampoline = (unsigned long *)mod->arch.ftrace_trampoline;
Also, the within_module() function is not defined:
arch/arm64/kernel/ftrace.c: In function 'ftrace_make_nop':
arch/arm64/kernel/ftrace.c:171:8: error: implicit declaration of function 'within_module'; did you mean 'init_module'? [-Werror=implicit-function-declaration]
This addresses both by adding the appropriate stubs.
Fixes: e71a4e1bebaf ("arm64: ftrace: add support for far branches to dynamic ftrace")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm64/include/asm/module.h | 6 ++++++
arch/arm64/kernel/ftrace.c | 2 +-
include/linux/module.h | 5 +++++
3 files changed, 12 insertions(+), 1 deletion(-)
I can't seem to reproduce this simply by disabling MODULES in defconfig.
Could you share your .config, please?
Thanks, I was forgetting to enable ftrace. I think a simpler patch (and one
that I can just apply via arm64) is switching the IS_ENABLEDs out for
#ifdefs.
I agree that this makes more sense in this particular case.
Acked-by: Ard Biesheuvel <redacted>
Interestingly, ARM64_MODULE_PLTS does not depend on CONFIG_MODULES,
but I can't remember whether that was deliberate or an oversight.
Thanks, I was forgetting to enable ftrace. I think a simpler patch (and one
that I can just apply via arm64) is switching the IS_ENABLEDs out for
#ifdefs. See below.