[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201130174833.41315-2-rongwei.wang@linux.alibaba.com>
Date: Tue, 1 Dec 2020 01:48:31 +0800
From: Rongwei Wang <rongwei.wang@...ux.alibaba.com>
To: catalin.marinas@....com, will@...nel.org,
bjorn.andersson@...aro.org, shawnguo@...nel.org
Cc: vkoul@...nel.org, geert+renesas@...der.be, Anson.Huang@....com,
michael@...le.cc, krzk@...nel.org, olof@...om.net,
vincenzo.frascino@....com, ardb@...nel.org, masahiroy@...nel.org,
gshan@...hat.com, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/3] arm64:insn: Export symbols for MSR ARM driver
In order to use the MSR-ARM driver in module and built-in ways, we need export
following symbols.
The MSR-ARM driver depends on function aarch64_insn_patch_text to modify the
text at runtime, and function aarch64_insn_read to read one instruction in the
specified address.
In addition, we need register_undef_hook and unregister_undef_hook to handle
the low probability undefined exception which triggered only by MSR-ARM driver.
Signed-off-by: Rongwei Wang <rongwei.wang@...ux.alibaba.com>
---
arch/arm64/kernel/insn.c | 2 ++
arch/arm64/kernel/traps.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/arch/arm64/kernel/insn.c b/arch/arm64/kernel/insn.c
index 6c0de2f..67a1f78 100644
--- a/arch/arm64/kernel/insn.c
+++ b/arch/arm64/kernel/insn.c
@@ -135,6 +135,7 @@ int __kprobes aarch64_insn_read(void *addr, u32 *insnp)
return ret;
}
+EXPORT_SYMBOL(aarch64_insn_read);
static int __kprobes __aarch64_insn_write(void *addr, __le32 insn)
{
@@ -247,6 +248,7 @@ int __kprobes aarch64_insn_patch_text(void *addrs[], u32 insns[], int cnt)
return stop_machine_cpuslocked(aarch64_insn_patch_text_cb, &patch,
cpu_online_mask);
}
+EXPORT_SYMBOL(aarch64_insn_patch_text);
static int __kprobes aarch64_get_imm_shift_mask(enum aarch64_insn_imm_type type,
u32 *maskp, int *shiftp)
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index 8af4e0e..c76efa5 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -292,6 +292,7 @@ void register_undef_hook(struct undef_hook *hook)
list_add(&hook->node, &undef_hook);
raw_spin_unlock_irqrestore(&undef_lock, flags);
}
+EXPORT_SYMBOL(register_undef_hook);
void unregister_undef_hook(struct undef_hook *hook)
{
@@ -301,6 +302,7 @@ void unregister_undef_hook(struct undef_hook *hook)
list_del(&hook->node);
raw_spin_unlock_irqrestore(&undef_lock, flags);
}
+EXPORT_SYMBOL(unregister_undef_hook);
static int call_undef_hook(struct pt_regs *regs)
{
--
1.8.3.1
Powered by blists - more mailing lists