From: Xiongfeng Wang <wangxiongfeng2(a)huawei.com>
commit 6c19c0e5140a24f4b41811f30ca0dfb118607248 openEuler-1.0.
Functions called in sdei_handler are not allowed to be kprobed, so
marked them as NOKPROBE_SYMBOL. There are so many functions in
'watchdog_check_timestamp()'. Luckily, we don't need
'CONFIG_HARDLOCKUP_CHECK_TIMESTAMP' now. So just make
CONFIG_SDEI_WATCHDOG depends on !CONFIG_HARDLOCKUP_CHECK_TIMESTAMP
in case someone add 'CONFIG_HARDLOCKUP_CHECK_TIMESTAMP' in the future.
Signed-off-by: Xiongfeng Wang <wangxiongfeng2(a)huawei.com>
Reviewed-by: Yang Yingliang <yangyingliang(a)huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang(a)huawei.com>
Signed-off-by: Xin Hao <haoxing990(a)gmail.com>
---
arch/arm64/kernel/watchdog_sdei.c | 2 ++
kernel/watchdog.c | 2 ++
kernel/watchdog_hld.c | 1 +
lib/Kconfig.debug | 2 +-
4 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kernel/watchdog_sdei.c b/arch/arm64/kernel/watchdog_sdei.c
index c342f86560d5..6352b589e02a 100644
--- a/arch/arm64/kernel/watchdog_sdei.c
+++ b/arch/arm64/kernel/watchdog_sdei.c
@@ -14,6 +14,7 @@
#include <asm/sdei.h>
#include <asm/virt.h>
#include <linux/arm_sdei.h>
+#include <linux/kprobes.h>
#include <linux/nmi.h>
/* We use the secure physical timer as SDEI NMI watchdog timer */
@@ -66,6 +67,7 @@ static int sdei_watchdog_callback(u32 event,
return 0;
}
+NOKPROBE_SYMBOL(sdei_watchdog_callback);
static void sdei_nmi_watchdog_bind(void *data)
{
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index bbc4940f21af..1857d98ebe07 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -16,6 +16,7 @@
#include <linux/cpu.h>
#include <linux/nmi.h>
#include <linux/init.h>
+#include <linux/kprobes.h>
#include <linux/module.h>
#include <linux/sysctl.h>
#include <linux/tick.h>
@@ -324,6 +325,7 @@ bool is_hardlockup(void)
__this_cpu_write(hrtimer_interrupts_saved, hrint);
return false;
}
+NOKPROBE_SYMBOL(is_hardlockup);
static void watchdog_interrupt_count(void)
{
diff --git a/kernel/watchdog_hld.c b/kernel/watchdog_hld.c
index 7154451653ad..564790f64415 100644
--- a/kernel/watchdog_hld.c
+++ b/kernel/watchdog_hld.c
@@ -14,6 +14,7 @@
#include <linux/nmi.h>
#include <linux/atomic.h>
+#include <linux/kprobes.h>
#include <linux/module.h>
#include <linux/sched/debug.h>
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index c4f0235ca9d5..5b3967683a1b 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -838,7 +838,7 @@ config HARDLOCKUP_DETECTOR_PERF
config SDEI_WATCHDOG
bool "SDEI NMI Watchdog support"
- depends on ARM_SDE_INTERFACE
+ depends on ARM_SDE_INTERFACE && !HARDLOCKUP_CHECK_TIMESTAMP
select HAVE_HARDLOCKUP_DETECTOR_ARCH
#
--
2.31.0