linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: fix undefined reference to 'printk'
@ 2018-03-13 11:41 Arnd Bergmann
  2018-03-13 12:48 ` Ard Biesheuvel
  0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2018-03-13 11:41 UTC (permalink / raw)
  To: linux-arm-kernel

The printk symbol was intended as a generic address that is always
exported, however that turned out to be false with CONFIG_PRINTK=n:

ERROR: "printk" [arch/arm64/kernel/arm64-reloc-test.ko] undefined!

This changes the references to memstart_addr, which should be there
regardless of configuration.

Fixes: a257e02579e4 ("arm64/kernel: don't ban ADRP to work around Cortex-A53 erratum #843419")
Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm64/kernel/reloc_test_core.c | 2 +-
 arch/arm64/kernel/reloc_test_syms.S | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/kernel/reloc_test_core.c b/arch/arm64/kernel/reloc_test_core.c
index a70489c584c7..5915ce5759cc 100644
--- a/arch/arm64/kernel/reloc_test_core.c
+++ b/arch/arm64/kernel/reloc_test_core.c
@@ -45,7 +45,7 @@ static struct {
 	{ "R_AARCH64_MOVW_SABS_Gn",	signed_movw, UL(SYM64_ABS_VAL) },
 	{ "R_AARCH64_MOVW_UABS_Gn",	unsigned_movw, UL(SYM64_ABS_VAL) },
 	{ "R_AARCH64_ADR_PREL_PG_HI21",	relative_adrp, (u64)&sym64_rel },
-	{ "R_AARCH64_ADR_PREL_PG_HI21",	relative_adrp_far, (u64)&printk },
+	{ "R_AARCH64_ADR_PREL_PG_HI21",	relative_adrp_far, (u64)&memstart_addr },
 	{ "R_AARCH64_ADR_PREL_LO21",	relative_adr, (u64)&sym64_rel },
 	{ "R_AARCH64_PREL64",		relative_data64, (u64)&sym64_rel },
 	{ "R_AARCH64_PREL32",		relative_data32, (u64)&sym64_rel },
diff --git a/arch/arm64/kernel/reloc_test_syms.S b/arch/arm64/kernel/reloc_test_syms.S
index f333b4b7880d..2b8d9cb8b078 100644
--- a/arch/arm64/kernel/reloc_test_syms.S
+++ b/arch/arm64/kernel/reloc_test_syms.S
@@ -54,8 +54,8 @@ ENDPROC(relative_adrp)
 	.align	12
 	.space	0xffc
 ENTRY(relative_adrp_far)
-	adrp	x0, printk
-	add	x0, x0, #:lo12:printk
+	adrp	x0, memstart_addr
+	add	x0, x0, #:lo12:memstart_addr
 	ret
 ENDPROC(relative_adrp_far)
 
-- 
2.9.0

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

* [PATCH] arm64: fix undefined reference to 'printk'
  2018-03-13 11:41 [PATCH] arm64: fix undefined reference to 'printk' Arnd Bergmann
@ 2018-03-13 12:48 ` Ard Biesheuvel
  2018-03-13 12:52   ` [PATCH v2] " Arnd Bergmann
  0 siblings, 1 reply; 4+ messages in thread
From: Ard Biesheuvel @ 2018-03-13 12:48 UTC (permalink / raw)
  To: linux-arm-kernel

On 13 March 2018 at 11:41, Arnd Bergmann <arnd@arndb.de> wrote:
> The printk symbol was intended as a generic address that is always
> exported, however that turned out to be false with CONFIG_PRINTK=n:
>
> ERROR: "printk" [arch/arm64/kernel/arm64-reloc-test.ko] undefined!
>
> This changes the references to memstart_addr, which should be there
> regardless of configuration.
>
> Fixes: a257e02579e4 ("arm64/kernel: don't ban ADRP to work around Cortex-A53 erratum #843419")
> Ard Biesheuvel <ard.biesheuvel@linaro.org>

Acked-by: ^^^

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/arm64/kernel/reloc_test_core.c | 2 +-
>  arch/arm64/kernel/reloc_test_syms.S | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm64/kernel/reloc_test_core.c b/arch/arm64/kernel/reloc_test_core.c
> index a70489c584c7..5915ce5759cc 100644
> --- a/arch/arm64/kernel/reloc_test_core.c
> +++ b/arch/arm64/kernel/reloc_test_core.c
> @@ -45,7 +45,7 @@ static struct {
>         { "R_AARCH64_MOVW_SABS_Gn",     signed_movw, UL(SYM64_ABS_VAL) },
>         { "R_AARCH64_MOVW_UABS_Gn",     unsigned_movw, UL(SYM64_ABS_VAL) },
>         { "R_AARCH64_ADR_PREL_PG_HI21", relative_adrp, (u64)&sym64_rel },
> -       { "R_AARCH64_ADR_PREL_PG_HI21", relative_adrp_far, (u64)&printk },
> +       { "R_AARCH64_ADR_PREL_PG_HI21", relative_adrp_far, (u64)&memstart_addr },
>         { "R_AARCH64_ADR_PREL_LO21",    relative_adr, (u64)&sym64_rel },
>         { "R_AARCH64_PREL64",           relative_data64, (u64)&sym64_rel },
>         { "R_AARCH64_PREL32",           relative_data32, (u64)&sym64_rel },
> diff --git a/arch/arm64/kernel/reloc_test_syms.S b/arch/arm64/kernel/reloc_test_syms.S
> index f333b4b7880d..2b8d9cb8b078 100644
> --- a/arch/arm64/kernel/reloc_test_syms.S
> +++ b/arch/arm64/kernel/reloc_test_syms.S
> @@ -54,8 +54,8 @@ ENDPROC(relative_adrp)
>         .align  12
>         .space  0xffc
>  ENTRY(relative_adrp_far)
> -       adrp    x0, printk
> -       add     x0, x0, #:lo12:printk
> +       adrp    x0, memstart_addr
> +       add     x0, x0, #:lo12:memstart_addr
>         ret
>  ENDPROC(relative_adrp_far)
>
> --
> 2.9.0
>

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

* [PATCH v2] arm64: fix undefined reference to 'printk'
  2018-03-13 12:48 ` Ard Biesheuvel
@ 2018-03-13 12:52   ` Arnd Bergmann
  2018-03-19 11:23     ` Will Deacon
  0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2018-03-13 12:52 UTC (permalink / raw)
  To: linux-arm-kernel

The printk symbol was intended as a generic address that is always
exported, however that turned out to be false with CONFIG_PRINTK=n:

ERROR: "printk" [arch/arm64/kernel/arm64-reloc-test.ko] undefined!

This changes the references to memstart_addr, which should be there
regardless of configuration.

Fixes: a257e02579e4 ("arm64/kernel: don't ban ADRP to work around Cortex-A53 erratum #843419")
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
v2: fix changelog as pointed out by Ard

 arch/arm64/kernel/reloc_test_core.c | 2 +-
 arch/arm64/kernel/reloc_test_syms.S | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/kernel/reloc_test_core.c b/arch/arm64/kernel/reloc_test_core.c
index a70489c584c7..5915ce5759cc 100644
--- a/arch/arm64/kernel/reloc_test_core.c
+++ b/arch/arm64/kernel/reloc_test_core.c
@@ -45,7 +45,7 @@ static struct {
 	{ "R_AARCH64_MOVW_SABS_Gn",	signed_movw, UL(SYM64_ABS_VAL) },
 	{ "R_AARCH64_MOVW_UABS_Gn",	unsigned_movw, UL(SYM64_ABS_VAL) },
 	{ "R_AARCH64_ADR_PREL_PG_HI21",	relative_adrp, (u64)&sym64_rel },
-	{ "R_AARCH64_ADR_PREL_PG_HI21",	relative_adrp_far, (u64)&printk },
+	{ "R_AARCH64_ADR_PREL_PG_HI21",	relative_adrp_far, (u64)&memstart_addr },
 	{ "R_AARCH64_ADR_PREL_LO21",	relative_adr, (u64)&sym64_rel },
 	{ "R_AARCH64_PREL64",		relative_data64, (u64)&sym64_rel },
 	{ "R_AARCH64_PREL32",		relative_data32, (u64)&sym64_rel },
diff --git a/arch/arm64/kernel/reloc_test_syms.S b/arch/arm64/kernel/reloc_test_syms.S
index f333b4b7880d..2b8d9cb8b078 100644
--- a/arch/arm64/kernel/reloc_test_syms.S
+++ b/arch/arm64/kernel/reloc_test_syms.S
@@ -54,8 +54,8 @@ ENDPROC(relative_adrp)
 	.align	12
 	.space	0xffc
 ENTRY(relative_adrp_far)
-	adrp	x0, printk
-	add	x0, x0, #:lo12:printk
+	adrp	x0, memstart_addr
+	add	x0, x0, #:lo12:memstart_addr
 	ret
 ENDPROC(relative_adrp_far)
 
-- 
2.9.0

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

* [PATCH v2] arm64: fix undefined reference to 'printk'
  2018-03-13 12:52   ` [PATCH v2] " Arnd Bergmann
@ 2018-03-19 11:23     ` Will Deacon
  0 siblings, 0 replies; 4+ messages in thread
From: Will Deacon @ 2018-03-19 11:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 13, 2018 at 01:52:36PM +0100, Arnd Bergmann wrote:
> The printk symbol was intended as a generic address that is always
> exported, however that turned out to be false with CONFIG_PRINTK=n:
> 
> ERROR: "printk" [arch/arm64/kernel/arm64-reloc-test.ko] undefined!
> 
> This changes the references to memstart_addr, which should be there
> regardless of configuration.
> 
> Fixes: a257e02579e4 ("arm64/kernel: don't ban ADRP to work around Cortex-A53 erratum #843419")
> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> v2: fix changelog as pointed out by Ard
> 
>  arch/arm64/kernel/reloc_test_core.c | 2 +-
>  arch/arm64/kernel/reloc_test_syms.S | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)

Cheers, I've picked this up now. Sorry for the delay.

Will

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

end of thread, other threads:[~2018-03-19 11:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-13 11:41 [PATCH] arm64: fix undefined reference to 'printk' Arnd Bergmann
2018-03-13 12:48 ` Ard Biesheuvel
2018-03-13 12:52   ` [PATCH v2] " Arnd Bergmann
2018-03-19 11:23     ` Will Deacon

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).