From 737c7d1988dd5266303b3c2b990f0721ed963ddf Mon Sep 17 00:00:00 2001 From: Xiongfeng Wang Date: Sat, 15 Jun 2019 09:51:58 +0800 Subject: [PATCH] nmi_watchdog: add asm/nmi.h for ARM64 hulk inclusion category: bugfix bugzilla: 16572 CVE: NA ------------------------------------------------- When I compile the kernel with CONFIG_SDEI_WATCHDOG chosen and without CONFIG_HARDLOCKUP_DETECTOR, I got the following error. ./include/linux/nmi.h: In function 'touch_nmi_watchdog': ./include/linux/nmi.h:141:2: error: implicit declaration of function 'arch_touch_nmi_watchdog' [-Werror=implicit-function-declaration] arch_touch_nmi_watchdog(); ^~~~~~~~~~~~~~~~~~~~~~~ It is because CONFIG_SDEI_WATCHDOG selects HAVE_NMI_WATCHDOG, but we didn't provide arch_touch_nmi_watchdog for ARM64 in 'asm/nmi.h'. This patch implements arch_touch_nmi_watchdog() for ARM64 when CONFIG_HARDLOCKUP_DETECTOR is not chosen. Signed-off-by: Xiongfeng Wang Reviewed-by: Yang Yingliang Signed-off-by: Yang Yingliang --- arch/arm64/include/asm/nmi.h | 5 +++++ include/linux/nmi.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 arch/arm64/include/asm/nmi.h diff --git a/arch/arm64/include/asm/nmi.h b/arch/arm64/include/asm/nmi.h new file mode 100644 index 000000000000..b9258085ac13 --- /dev/null +++ b/arch/arm64/include/asm/nmi.h @@ -0,0 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#if !defined(CONFIG_HARDLOCKUP_DETECTOR) +static inline void arch_touch_nmi_watchdog(void) { } +#endif diff --git a/include/linux/nmi.h b/include/linux/nmi.h index 5e1facadc0aa..84f324d65068 100644 --- a/include/linux/nmi.h +++ b/include/linux/nmi.h @@ -7,7 +7,7 @@ #include #include -#if defined(CONFIG_HAVE_NMI_WATCHDOG) && !defined(CONFIG_SDEI_WATCHDOG) +#if defined(CONFIG_HAVE_NMI_WATCHDOG) #include #endif @@ -87,6 +87,7 @@ extern void watchdog_hardlockup_check(struct pt_regs *regs); extern unsigned int hardlockup_panic; #else static inline void hardlockup_detector_disable(void) {} +static inline void watchdog_hardlockup_check(struct pt_regs *regs) {} #endif #if defined(CONFIG_HAVE_NMI_WATCHDOG) || defined(CONFIG_HARDLOCKUP_DETECTOR) -- GitLab