Skip to contentSkip to conversation

x86: adjust initial setting of watchdog kind

PATCH New Jan Beulich 1 participant 1 message Apr 4, 2024

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 x86: adjust initial setting of watchdog kind

"watchdog_timeout=0" is documented to disable the watchdog, which wasn't really the case; the watchdog was rather ran with an, in practice, infinite timeout. Fold that command line option with "watchdog", resetting to defaults whenever encountering a new instance.

While touching opt_watchdog_timeout, also move it into .data.ro_after_init.

---
Really I think the comment in watchdog_setup() is wrong, and the function would hence better go away. The CPU notifier registration can surely be done in a pre-SMP initcall, which would have the benefit of boot-time AP bringup then working the same as runtime CPU-onlining. (In particular the set_timer() out of CPU_UP_PREPARE is a little suspicious, as the timer can't possibly be run right away when a CPU isn't online yet.) Which would leave __start_xen() to call watchdog_enable() in the place it's calling watchdog_setup() now.
---
v2: Re-do largely from scratch.

CHANGELOG.md +2 -0
@@ -13,6 +13,8 @@ The format is based on [Keep a Changelog
  - On x86:
    - HVM PIRQs are disabled by default.
    - Reduce IOMMU setup time for hardware domain.
+   - The "watchdog_timeout=" command line option is subsumed by the "watchdog="
+     one.
 
 ### Added
  - On x86:
docs/misc/xen-command-line.pandoc +7 -10
@@ -2790,22 +2790,19 @@ suboptimal scheduling decisions, but onl
 oversubscribed (i.e., in total there are more vCPUs than pCPUs).
 
 ### watchdog (x86)
-> `= force | <boolean>`
+> `= <boolean> | List of [ force | <integer>s ]`
 
 > Default: `false`
 
 Run an NMI watchdog on each processor.  If a processor is stuck for
-longer than the **watchdog_timeout**, a panic occurs.  When `force` is
-specified, in addition to running an NMI watchdog on each processor,
-unknown NMIs will still be processed.
+longer than the specified or default timeout, a panic occurs.
 
-### watchdog_timeout (x86)
-> `= <integer>`
+*   When `force` is specified, in addition to running an NMI watchdog on each
+    processor, unknown NMIs will still be processed.
 
-> Default: `5`
-
-Set the NMI watchdog timeout in seconds.  Specifying `0` will turn off
-the watchdog.
+*   The <integer>s value allows to set the NMI watchdog timeout in seconds
+    (default: `5s`).  Specifying `0` will turn off the watchdog.  Specifying
+    a non-zero value enables the watchdog.
 
 ### x2apic (x86)
 > `= <boolean>`
xen/arch/x86/nmi.c +45 -19

81 lines not on this page · raw message