]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
powerpc/kasan: Fix boot failure with RELOCATABLE && FSL_BOOKE
authorChristophe Leroy <christophe.leroy@c-s.fr>
Fri, 29 Nov 2019 14:26:41 +0000 (14:26 +0000)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 6 Mar 2020 07:25:26 +0000 (02:25 -0500)
BugLink: https://bugs.launchpad.net/bugs/1864060
commit 71eb40fc53371bc247c8066ae76ad9e22ae1e18d upstream.

When enabling CONFIG_RELOCATABLE and CONFIG_KASAN on FSL_BOOKE,
the kernel doesn't boot.

relocate_init() requires KASAN early shadow area to be set up because
it needs access to the device tree through generic functions.

Call kasan_early_init() before calling relocate_init()

Reported-by: Lexi Shao <shaolexi@huawei.com>
Fixes: 2edb16efc899 ("powerpc/32: Add KASAN support")
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/b58426f1664a4b344ff696d18cacf3b3e8962111.1575036985.git.christophe.leroy@c-s.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
arch/powerpc/kernel/head_fsl_booke.S

index adf0505dbe022243dc40336262bb5af0a50f4d7e..519d49547e2f306f39af91f6b91af6585aae00fb 100644 (file)
@@ -238,6 +238,9 @@ set_ivor:
 
        bl      early_init
 
+#ifdef CONFIG_KASAN
+       bl      kasan_early_init
+#endif
 #ifdef CONFIG_RELOCATABLE
        mr      r3,r30
        mr      r4,r31
@@ -264,9 +267,6 @@ set_ivor:
 /*
  * Decide what sort of machine this is and initialize the MMU.
  */
-#ifdef CONFIG_KASAN
-       bl      kasan_early_init
-#endif
        mr      r3,r30
        mr      r4,r31
        bl      machine_init