[COMMON] soc: samsung: el3_mon: change the way to get VA of _text and _etext
authorJunho Choi <junhosj.choi@samsung.com>
Thu, 18 Jan 2018 05:06:10 +0000 (14:06 +0900)
committerJunho Choi <junhosj.choi@samsung.com>
Wed, 23 May 2018 23:53:41 +0000 (08:53 +0900)
The start and end address of kernel text section were got
from kallsyms_lockup_name which returns the address correspond
to symbol name exported by EXPORT_SYMBOL. So, the address can't
be got if the symbol is not exported.

This patch changes the way to get the start and end addresses of
kernel text section to reading them directly. It is possible
because they have been defined in linker script. The driver
can always get them even if the symbol is not exported.

Change-Id: Ibe3ef81ff5010db55af2db11f07cd1b82e1e6685
Signed-off-by: Junho Choi <junhosj.choi@samsung.com>
drivers/soc/samsung/exynos-el3_mon.c

index 3e6fe1925b5a3a763a8c5b46adc5d6d03cb8604d..1a0174e53dc0a65fa452d5e4bfac9e55c3bf626f 100644 (file)
@@ -12,7 +12,6 @@
 
 #include <linux/slab.h>
 #include <linux/smc.h>
-#include <linux/kallsyms.h>
 #include <asm/cacheflush.h>
 
 #include <soc/samsung/exynos-el3_mon.h>
@@ -29,14 +28,14 @@ static int __init exynos_protect_kernel_text(void)
        unsigned long ktext_end_pa = 0;
 
        /* Get virtual addresses of kernel text */
-       ktext_start_va = kallsyms_lookup_name("_text");
+       ktext_start_va = (unsigned long)_text;
        if (!ktext_start_va) {
                pr_err("%s: [ERROR] Kernel text start address is invalid\n",
                                                                __func__);
                return -1;
        }
 
-       ktext_end_va = kallsyms_lookup_name("_etext");
+       ktext_end_va = (unsigned long)_etext;
        if (!ktext_end_va) {
                pr_err("%s: [ERROR] Kernel text end address is invalid\n",
                                                                __func__);