From: Junho Choi Date: Thu, 18 Jan 2018 05:06:10 +0000 (+0900) Subject: [COMMON] soc: samsung: el3_mon: change the way to get VA of _text and _etext X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ed5d62daaea67928a82727f5830d97000414d4f5;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] soc: samsung: el3_mon: change the way to get VA of _text and _etext 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 --- diff --git a/drivers/soc/samsung/exynos-el3_mon.c b/drivers/soc/samsung/exynos-el3_mon.c index 3e6fe1925b5a..1a0174e53dc0 100644 --- a/drivers/soc/samsung/exynos-el3_mon.c +++ b/drivers/soc/samsung/exynos-el3_mon.c @@ -12,7 +12,6 @@ #include #include -#include #include #include @@ -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__);