From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
qemu-devel@nongnu.org, mst@redhat.com, anisinha@redhat.com,
pbonzini@redhat.com, shannon.zhaosl@gmail.com, philmd@linaro.org,
zhao1.liu@intel.com, rad@semihalf.com,
leif.lindholm@oss.qualcomm.com
Subject: Re: [PATCH 08/11] arm: virt: create GWDT watchdog paired with WDAT ACPI table
Date: Fri, 27 Feb 2026 09:01:25 +0000 [thread overview]
Message-ID: <aaFdZY5ESpQCJigY@redhat.com> (raw)
In-Reply-To: <878qced4xx.fsf@pond.sub.org>
On Fri, Feb 27, 2026 at 08:24:42AM +0100, Markus Armbruster wrote:
> Igor Mammedov <imammedo@redhat.com> writes:
>
> > On Wed, 25 Feb 2026 15:19:56 +0000
> > Daniel P. Berrangé <berrange@redhat.com> wrote:
> >>
> >> Right, if there was a case where we were already using -device to
> >> create the watchdog, then I would suggest having a simple
> >> 'wadt=on|off' property as standard for any watchdog wanting that
> >> ACPI abstraction wrapper.
> >>
> >> That could (hypothetically) be the case if we had chosen to add
> >> WADT suport backed by i6300esb, eg -device i6300esb,wadt=on|off
> >>
> >> For cases built-in to the machine type, I'd suggest <type>-wadt=on|off
> >>
> >> eg for Q35, "-machine q35,itco-wadt=on|off"
> >>
> >> for virt, '-machine virt,gwdt-wadt=on|off'
> >
> > CCin Markus since it touches QAPI stuff.
> >
> > For respin, I've went ahead with a bit more generic approach
> > (as a user, I wouldn't really care what kind of built-in watchdog board ships,
> > and having 1 property instead total instead of machine specific ones makes it
> > easier for mgmt layer to deal with).
> >
> > here is current idea:
> >
> > diff --git a/hw/core/machine.c b/hw/core/machine.c
> > index 6411e68856..a0c6719b58 100644
> > --- a/hw/core/machine.c
> > +++ b/hw/core/machine.c
> > @@ -1257,6 +1271,14 @@ static void machine_class_init(ObjectClass *oc, const void *data)
> > NULL, NULL);
> > object_class_property_set_description(oc, "memory",
> > "Memory size configuration");
> > +
> > + object_class_property_add_enum(oc, "watchdog", "WatchdogType",
> > + &WatchdogType_lookup,
> > + machine_get_watchdog, machine_set_watchdog);
> > + object_class_property_set_description(oc, "watchdog",
> > + "Use: auto (watchdog is configured according board defaults),"
> > + " off (disabled), native (built-in watchdog), wdat (ACPI based watchdog)]. "
> > + " Default: auto");
> > }
>
> Adds the property to abstract base type "machine", i.e. every machine
> has it.
>
> Fundamentally assumes there is at most one onboard watchdog of interest.
>
> I'm lacking context, please bear with me: who or what is going to set
> this property, and for what purpose?
>
> > diff --git a/qapi/machine-common.json b/qapi/machine-common.json
> > index 92e84dfb14..7f5e10340f 100644
> > --- a/qapi/machine-common.json
> > +++ b/qapi/machine-common.json
> > @@ -9,6 +9,23 @@
> > # Common machine types
> > # ********************
> > ##
> > +##
> > +# @WatchdogType:
> > +#
> > +# On board watchdog configuration.
> > +#
> > +# @auto: Watchdog is configured according to board defaults.
>
> As far as I can tell, we don't document "boards" (machine types)
> anywhere, let alone "board defaults". Not this patch's fault, of
> course. The meaning of @auto remains unclear.
>
> > +#
> > +# @off: Watchdog disabled (ARM).
> > +#
> > +# @native: Native watchdog (arm/virt: sbsa-gwdt, x86/q53: TCO)
> > +#
> > +# @wdat: ACPI WDAT watchdog.
> > +#
> > +# Since: 10.2
>
> 11.0
>
> > +##
> > +{ 'enum': 'WatchdogType',
> > + 'data': [ 'auto', 'off', 'native', 'wdat' ] }
>
> What do managament applications need to know about onboard watchdog
> configuration?
>
> Do they need to know what @auto means for the machine type at hand?
>
> Do they ever need to pick a value? Do they need to know which values
> work with the machine type then?
Libvirt generally wants to work with & express the exact hardware
and not rely on "auto" settings in QEMU.
So in terms of the built-in watchdog for Q35 we currently express
this explicitly via
<watchdog model='itco' />
Adding "WADT" is not expressing a new piece of hardware, just a
configuration choice of the iTCO hardware. So from that POV in
libvirt I anticipate expressing it as
<watchdog model='itco' wadt='yes|no'/>
IMHO, similar reasoning works at the QEMU level - WADT is not a
new type of watchdog hardware, just a config choice supported
with certain specific QEMU watchdogs. So I'd prefer something
closer to what I suggested in the mail that Igor replies to,
where we have a simple boolean flag to control use of WADT,
and other distinct properties if we need other controls on the
watchdog, instead of trying overload multiple distinct settings
into one enum.
For Arm we would similarly want to express the choice of
hardware directly as
<watchdog model='gwdt'/>
regardless of whether the GWDT ends up being something we have to
add manually with -device, or something built-in to the machine.
> >> Q35 is easier as we rely on the guest quirks to disable direct
> >> access via both paths.
> >>
> >> With GWDT we need to decide if gwdt-wadt=on should imply DTB
> >> disabled, or if we just expose both & rely on a guest quirk
> >> or worst case, need a separate property to toggle DTB too.
> >>
> >> > I've used device property for x86 Q35 TCO watchdog and
> >> > then using -global to enable it as workaround in previous version.
> >> > Ugly but doable workaround. It puts a burden on users to learn how
> >> > to configure it for each support watchdog/board combo.
> >> > It's nightmare to discover/maintain though.
>
> Our unsolved "how to configure onboard devices" problem bites again.
>
> -global can be pressed into service when there's just once instance of
> the device type. The drawbacks you describe are real. I want to see
> less of it, not more.
IIRC, the only place we use -global with watchdogs today is to
set "-global ICH9-LPC.noreboot=off" which was merely to workaround
a historical QEMU bug which exposed a guest watchdog and then
inexplicably made it not work by having it ignore the guest
trigger event. Newer machine types fixed that broken default, but
libvirt keeps setting things explicitly since that's easier than
making machine version specific choices.
I'm not sure we need -global to support the WADT features, as that
seems like it can just a -machine property instead.
With regards,
Daniel
--
|: https://berrange.com ~~ https://hachyderm.io/@berrange :|
|: https://libvirt.org ~~ https://entangle-photo.org :|
|: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
next prev parent reply other threads:[~2026-02-27 9:02 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-06 13:14 [PATCH 00/11] Introduce ACPI watchdog for Q35 and arm/virt boards Igor Mammedov
2026-02-06 13:14 ` [PATCH 01/11] acpi: add API to build WDAT instructions Igor Mammedov
2026-02-16 8:12 ` Ani Sinha
2026-02-06 13:14 ` [PATCH 02/11] machine: add "acpi-watchdog" property Igor Mammedov
2026-02-16 8:23 ` Ani Sinha
2026-02-26 17:08 ` Philippe Mathieu-Daudé
2026-02-27 8:23 ` Igor Mammedov
2026-02-06 13:14 ` [PATCH 03/11] x86: q35: generate WDAT ACPI table Igor Mammedov
2026-02-16 10:51 ` Ani Sinha
2026-02-06 13:14 ` [PATCH 04/11] tests: acpi: x86/q35: whitelist new WDAT table Igor Mammedov
2026-02-16 9:50 ` Ani Sinha
2026-02-06 13:14 ` [PATCH 05/11] tests: acpi: x86/q35: add WDAT table test case Igor Mammedov
2026-02-16 9:51 ` Ani Sinha
2026-02-06 13:14 ` [PATCH 06/11] tests: acpi: x86/q35: update expected WDAT blob Igor Mammedov
2026-02-17 5:34 ` Ani Sinha
2026-02-06 13:14 ` [PATCH 07/11] arm: add tracing events to sbsa_gwdt Igor Mammedov
2026-02-16 10:22 ` Ani Sinha
2026-02-06 13:14 ` [PATCH 08/11] arm: virt: create GWDT watchdog paired with WDAT ACPI table Igor Mammedov
2026-02-18 19:08 ` Peter Maydell
2026-02-19 12:17 ` Igor Mammedov
2026-02-19 13:00 ` Peter Maydell
2026-02-19 14:55 ` Igor Mammedov
2026-02-19 16:04 ` Peter Maydell
2026-02-23 9:28 ` Igor Mammedov
2026-02-25 15:11 ` Daniel P. Berrangé
2026-02-25 15:19 ` Daniel P. Berrangé
2026-02-26 12:56 ` Igor Mammedov
2026-02-27 7:24 ` Markus Armbruster
2026-02-27 9:01 ` Daniel P. Berrangé [this message]
2026-02-27 10:01 ` Igor Mammedov
2026-02-27 10:18 ` Daniel P. Berrangé
2026-02-27 11:41 ` Igor Mammedov
2026-02-27 9:42 ` Igor Mammedov
2026-02-27 12:10 ` Markus Armbruster
2026-02-27 13:14 ` Peter Maydell
2026-02-27 14:51 ` Markus Armbruster
2026-02-27 15:01 ` Peter Maydell
2026-03-02 5:32 ` Markus Armbruster
2026-02-06 13:14 ` [PATCH 09/11] tests: acpi: arm/virt: whitelist new WDAT table Igor Mammedov
2026-02-06 13:14 ` [PATCH 10/11] tests: acpi: arm/virt: add WDAT table test case Igor Mammedov
2026-02-06 13:14 ` [PATCH 11/11] tests: acpi: arm/virt: update expected WDAT blob Igor Mammedov
2026-02-16 7:39 ` [PATCH 00/11] Introduce ACPI watchdog for Q35 and arm/virt boards Ani Sinha
2026-02-16 8:46 ` Mohamed Mediouni
2026-02-18 9:29 ` Igor Mammedov
2026-02-18 19:10 ` Peter Maydell
2026-02-19 12:27 ` Igor Mammedov
2026-02-19 14:05 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aaFdZY5ESpQCJigY@redhat.com \
--to=berrange@redhat.com \
--cc=anisinha@redhat.com \
--cc=armbru@redhat.com \
--cc=imammedo@redhat.com \
--cc=leif.lindholm@oss.qualcomm.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rad@semihalf.com \
--cc=shannon.zhaosl@gmail.com \
--cc=zhao1.liu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.