* [PATCH] powerpc/booke: use IS_ENABLED(CONFIG_BOOKE_WDT) for WatchdogException
@ 2026-12-04 2:35 Pengpeng Hou
2026-12-04 2:44 ` sashiko-bot
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Pengpeng Hou @ 2026-12-04 2:35 UTC (permalink / raw)
To: Madhavan Srinivasan
Cc: Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
Ritesh Harjani (IBM), Shrikanth Hegde, linuxppc-dev, kvm,
Pengpeng Hou, Wim Van Sebroeck, Guenter Roeck, linux-watchdog
A modular Book E watchdog driver can enable watchdog interrupts, but the
exception vectors and kernel handler currently depend on the built-in
spelling of the driver option.
Include the matching exception handling for module configurations too.
Keep the vector, C handler and KVM dispatch guards consistent.
The issue was found by our static-analysis tool and manually reviewed.
Fixes: 609af38f8fc0 ("powerpc/booke64: Critical and machine check exception support")
Fixes: 6328e593c3df ("booke/bookehv: Add host crit-watchdog exception support")
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
---
The patch was prepared with Gemini and revised with Codex assistance
(Assisted-by: gpt 5).
Built the PowerPC watchdog exception paths with Clang 18.1.3 and
BOOKE_WDT=m. On 44x, traps.o and head_44x.o gained WatchdogException; on
85xx the change was visible in traps.o, kvm/booke.o and the preprocessed
head_85xx.s; on 64e it was visible in traps.o and exceptions-64e.o. It
was absent in those checks before the patch. No watchdog interrupt was
triggered.
arch/powerpc/kernel/exceptions-64e.S | 2 +-
arch/powerpc/kernel/head_44x.S | 2 +-
arch/powerpc/kernel/head_85xx.S | 2 +-
arch/powerpc/kernel/traps.c | 2 +-
arch/powerpc/kvm/booke.c | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S
index 63f6b9f513a43c6c07078918af141bd9b55f19b8..4a47ad68e825a35a4f2cd1d1e5eecfcd6cb5358f 100644
--- a/arch/powerpc/kernel/exceptions-64e.S
+++ b/arch/powerpc/kernel/exceptions-64e.S
@@ -648,7 +648,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
bl special_reg_save
CHECK_NAPPING();
addi r3,r1,STACK_INT_FRAME_REGS
-#ifdef CONFIG_BOOKE_WDT
+#if IS_ENABLED(CONFIG_BOOKE_WDT)
bl WatchdogException
#else
bl unknown_nmi_exception
diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
index 25642e802ed3da4397ce18537e828d0149bc0d69..3b3c4837bb74140fc010dbd5882a462252adab33 100644
--- a/arch/powerpc/kernel/head_44x.S
+++ b/arch/powerpc/kernel/head_44x.S
@@ -294,7 +294,7 @@ interrupt_base:
/* Watchdog Timer Interrupt */
/* TODO: Add watchdog support */
-#ifdef CONFIG_BOOKE_WDT
+#if IS_ENABLED(CONFIG_BOOKE_WDT)
CRITICAL_EXCEPTION(0x1020, WATCHDOG, WatchdogTimer, WatchdogException)
#else
CRITICAL_EXCEPTION(0x1020, WATCHDOG, WatchdogTimer, unknown_exception)
diff --git a/arch/powerpc/kernel/head_85xx.S b/arch/powerpc/kernel/head_85xx.S
index 8867596d35adc8197f07bb04971c16aa8f6485a2..8e17c8642b2f549e58a0c0121b855e49b6ce44f7 100644
--- a/arch/powerpc/kernel/head_85xx.S
+++ b/arch/powerpc/kernel/head_85xx.S
@@ -404,7 +404,7 @@ interrupt_base:
EXCEPTION(0x3100, FIT, FixedIntervalTimer, unknown_exception)
/* Watchdog Timer Interrupt */
-#ifdef CONFIG_BOOKE_WDT
+#if IS_ENABLED(CONFIG_BOOKE_WDT)
CRITICAL_EXCEPTION(0x3200, WATCHDOG, WatchdogTimer, WatchdogException)
#else
CRITICAL_EXCEPTION(0x3200, WATCHDOG, WatchdogTimer, unknown_exception)
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 3a8f5416e3f6e1edbb654a763dc82060682549ae..bc780c7c198d8541a9fffc4158b142082dc3a71e 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -2240,7 +2240,7 @@ void __noreturn unrecoverable_exception(struct pt_regs *regs)
;
}
-#ifdef CONFIG_BOOKE_WDT
+#if IS_ENABLED(CONFIG_BOOKE_WDT)
DEFINE_INTERRUPT_HANDLER_NMI(WatchdogException)
{
printk (KERN_EMERG "PowerPC Book-E Watchdog Exception\n");
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index bda86a076f7217e785c566d3f625fa41f86c650c..46cedbfe5268e5e62f91c1c6e2d923e29510061b 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -960,7 +960,7 @@ static void kvmppc_restart_interrupt(struct kvm_vcpu *vcpu,
break;
case BOOKE_INTERRUPT_WATCHDOG:
kvmppc_fill_pt_regs(®s);
-#ifdef CONFIG_BOOKE_WDT
+#if IS_ENABLED(CONFIG_BOOKE_WDT)
WatchdogException(®s);
#else
unknown_exception(®s);
base-commit: d06ce6f1eb5eeffd4ebcfde345dc34a98131d106
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/booke: use IS_ENABLED(CONFIG_BOOKE_WDT) for WatchdogException
2026-12-04 2:35 [PATCH] powerpc/booke: use IS_ENABLED(CONFIG_BOOKE_WDT) for WatchdogException Pengpeng Hou
@ 2026-12-04 2:44 ` sashiko-bot
2026-12-04 19:49 ` Guenter Roeck
2026-12-05 18:48 ` Guenter Roeck
2 siblings, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-12-04 2:44 UTC (permalink / raw)
To: Pengpeng Hou; +Cc: kvm, linux-watchdog
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] powerpc/booke: missing Fixes trailer for commit fbdd7144cead
--
commit bffb052a3bf1c6416e89decccc24b8695ac2bc65
Author: Pengpeng Hou <hppiscas@163.com>
> powerpc/booke: use IS_ENABLED(CONFIG_BOOKE_WDT) for WatchdogException
>
> A modular Book E watchdog driver can enable watchdog interrupts, but the
> exception vectors and kernel handler currently depend on the built-in
> spelling of the driver option.
>
> Include the matching exception handling for module configurations too.
> Keep the vector, C handler and KVM dispatch guards consistent.
>
> The issue was found by our static-analysis tool and manually reviewed.
>
> Fixes: 609af38f8fc0 ("powerpc/booke64: Critical and machine check exception support")
> Fixes: 6328e593c3df ("booke/bookehv: Add host crit-watchdog exception support")
> Signed-off-by: Pengpeng Hou <hppiscas@163.com>
[Severity: Low]
The existing Fixes tags cover exceptions-64e.S and kvm/booke.c, but the
guards in head_44x.S, head_85xx.S, and traps.c predate both commits and
broke for modular builds when BOOKE_WDT was changed from bool to tristate.
Should this also include:
Fixes: fbdd7144cead ("powerpc/watchdog: Allow the Book-E driver to be compiled as a module")
--
Sashiko AI review · https://sashiko.dev/#/patchset/179635170533.74470.14039483594135636314@163.com?part=1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/booke: use IS_ENABLED(CONFIG_BOOKE_WDT) for WatchdogException
2026-12-04 2:35 [PATCH] powerpc/booke: use IS_ENABLED(CONFIG_BOOKE_WDT) for WatchdogException Pengpeng Hou
2026-12-04 2:44 ` sashiko-bot
@ 2026-12-04 19:49 ` Guenter Roeck
2026-12-05 18:48 ` Guenter Roeck
2 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2026-12-04 19:49 UTC (permalink / raw)
To: Pengpeng Hou
Cc: Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy (CS GROUP), Ritesh Harjani (IBM),
Shrikanth Hegde, linuxppc-dev, kvm, Wim Van Sebroeck,
linux-watchdog
On Fri, Dec 04, 2026 at 10:35:05AM +0800, Pengpeng Hou wrote:
> A modular Book E watchdog driver can enable watchdog interrupts, but the
> exception vectors and kernel handler currently depend on the built-in
> spelling of the driver option.
>
> Include the matching exception handling for module configurations too.
> Keep the vector, C handler and KVM dispatch guards consistent.
>
> The issue was found by our static-analysis tool and manually reviewed.
>
> Fixes: 609af38f8fc0 ("powerpc/booke64: Critical and machine check exception support")
> Fixes: 6328e593c3df ("booke/bookehv: Add host crit-watchdog exception support")
> Signed-off-by: Pengpeng Hou <hppiscas@163.com>
Applied.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/booke: use IS_ENABLED(CONFIG_BOOKE_WDT) for WatchdogException
2026-12-04 2:35 [PATCH] powerpc/booke: use IS_ENABLED(CONFIG_BOOKE_WDT) for WatchdogException Pengpeng Hou
2026-12-04 2:44 ` sashiko-bot
2026-12-04 19:49 ` Guenter Roeck
@ 2026-12-05 18:48 ` Guenter Roeck
2 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2026-12-05 18:48 UTC (permalink / raw)
To: Pengpeng Hou
Cc: Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy (CS GROUP), Ritesh Harjani (IBM),
Shrikanth Hegde, linuxppc-dev, kvm, Wim Van Sebroeck,
linux-watchdog
On Fri, Dec 04, 2026 at 10:35:05AM +0800, Pengpeng Hou wrote:
> A modular Book E watchdog driver can enable watchdog interrupts, but the
> exception vectors and kernel handler currently depend on the built-in
> spelling of the driver option.
>
> Include the matching exception handling for module configurations too.
> Keep the vector, C handler and KVM dispatch guards consistent.
>
> The issue was found by our static-analysis tool and manually reviewed.
>
> Fixes: 609af38f8fc0 ("powerpc/booke64: Critical and machine check exception support")
> Fixes: 6328e593c3df ("booke/bookehv: Add host crit-watchdog exception support")
> Signed-off-by: Pengpeng Hou <hppiscas@163.com>
I previously had applied this patch to the watchdog tree,
for some reason not realizing that it idesn't even touch watchdog code.
So I dropped it; it will have to be applied through a Powerpc tree.
Sorry for the confusion.
For the record:
Acked-by: Guenter Roeck <linux@roeck-us.net>
Thanks,
Guenter
> ---
> The patch was prepared with Gemini and revised with Codex assistance
> (Assisted-by: gpt 5).
>
> Built the PowerPC watchdog exception paths with Clang 18.1.3 and
> BOOKE_WDT=m. On 44x, traps.o and head_44x.o gained WatchdogException; on
> 85xx the change was visible in traps.o, kvm/booke.o and the preprocessed
> head_85xx.s; on 64e it was visible in traps.o and exceptions-64e.o. It
> was absent in those checks before the patch. No watchdog interrupt was
> triggered.
>
> arch/powerpc/kernel/exceptions-64e.S | 2 +-
> arch/powerpc/kernel/head_44x.S | 2 +-
> arch/powerpc/kernel/head_85xx.S | 2 +-
> arch/powerpc/kernel/traps.c | 2 +-
> arch/powerpc/kvm/booke.c | 2 +-
> 5 files changed, 5 insertions(+), 5 deletions(-)
>
>
> base-commit: d06ce6f1eb5eeffd4ebcfde345dc34a98131d106
>
> diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S
> index 63f6b9f513a43c6c07078918af141bd9b55f19b8..4a47ad68e825a35a4f2cd1d1e5eecfcd6cb5358f 100644
> --- a/arch/powerpc/kernel/exceptions-64e.S
> +++ b/arch/powerpc/kernel/exceptions-64e.S
> @@ -648,7 +648,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
> bl special_reg_save
> CHECK_NAPPING();
> addi r3,r1,STACK_INT_FRAME_REGS
> -#ifdef CONFIG_BOOKE_WDT
> +#if IS_ENABLED(CONFIG_BOOKE_WDT)
> bl WatchdogException
> #else
> bl unknown_nmi_exception
> diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
> index 25642e802ed3da4397ce18537e828d0149bc0d69..3b3c4837bb74140fc010dbd5882a462252adab33 100644
> --- a/arch/powerpc/kernel/head_44x.S
> +++ b/arch/powerpc/kernel/head_44x.S
> @@ -294,7 +294,7 @@ interrupt_base:
>
> /* Watchdog Timer Interrupt */
> /* TODO: Add watchdog support */
> -#ifdef CONFIG_BOOKE_WDT
> +#if IS_ENABLED(CONFIG_BOOKE_WDT)
> CRITICAL_EXCEPTION(0x1020, WATCHDOG, WatchdogTimer, WatchdogException)
> #else
> CRITICAL_EXCEPTION(0x1020, WATCHDOG, WatchdogTimer, unknown_exception)
> diff --git a/arch/powerpc/kernel/head_85xx.S b/arch/powerpc/kernel/head_85xx.S
> index 8867596d35adc8197f07bb04971c16aa8f6485a2..8e17c8642b2f549e58a0c0121b855e49b6ce44f7 100644
> --- a/arch/powerpc/kernel/head_85xx.S
> +++ b/arch/powerpc/kernel/head_85xx.S
> @@ -404,7 +404,7 @@ interrupt_base:
> EXCEPTION(0x3100, FIT, FixedIntervalTimer, unknown_exception)
>
> /* Watchdog Timer Interrupt */
> -#ifdef CONFIG_BOOKE_WDT
> +#if IS_ENABLED(CONFIG_BOOKE_WDT)
> CRITICAL_EXCEPTION(0x3200, WATCHDOG, WatchdogTimer, WatchdogException)
> #else
> CRITICAL_EXCEPTION(0x3200, WATCHDOG, WatchdogTimer, unknown_exception)
> diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
> index 3a8f5416e3f6e1edbb654a763dc82060682549ae..bc780c7c198d8541a9fffc4158b142082dc3a71e 100644
> --- a/arch/powerpc/kernel/traps.c
> +++ b/arch/powerpc/kernel/traps.c
> @@ -2240,7 +2240,7 @@ void __noreturn unrecoverable_exception(struct pt_regs *regs)
> ;
> }
>
> -#ifdef CONFIG_BOOKE_WDT
> +#if IS_ENABLED(CONFIG_BOOKE_WDT)
> DEFINE_INTERRUPT_HANDLER_NMI(WatchdogException)
> {
> printk (KERN_EMERG "PowerPC Book-E Watchdog Exception\n");
> diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
> index bda86a076f7217e785c566d3f625fa41f86c650c..46cedbfe5268e5e62f91c1c6e2d923e29510061b 100644
> --- a/arch/powerpc/kvm/booke.c
> +++ b/arch/powerpc/kvm/booke.c
> @@ -960,7 +960,7 @@ static void kvmppc_restart_interrupt(struct kvm_vcpu *vcpu,
> break;
> case BOOKE_INTERRUPT_WATCHDOG:
> kvmppc_fill_pt_regs(®s);
> -#ifdef CONFIG_BOOKE_WDT
> +#if IS_ENABLED(CONFIG_BOOKE_WDT)
> WatchdogException(®s);
> #else
> unknown_exception(®s);
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-12-05 18:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 2:35 [PATCH] powerpc/booke: use IS_ENABLED(CONFIG_BOOKE_WDT) for WatchdogException Pengpeng Hou
2026-12-04 2:44 ` sashiko-bot
2026-12-04 19:49 ` Guenter Roeck
2026-12-05 18:48 ` Guenter Roeck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.