On Fri, 27 Feb 2026 10:18:25 +0000
Daniel P. Berrangé <[email protected]> wrote:

> On Fri, Feb 27, 2026 at 11:01:25AM +0100, Igor Mammedov wrote:
> > On Fri, 27 Feb 2026 09:01:25 +0000
> > Daniel P. Berrangé <[email protected]> wrote:
> >   
> > > On Fri, Feb 27, 2026 at 08:24:42AM +0100, Markus Armbruster wrote:  
> > > > Igor Mammedov <[email protected]> writes:
> > > >     
> > > > > On Wed, 25 Feb 2026 15:19:56 +0000
> > > > > Daniel P. Berrangé <[email protected]> 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' />  
> > 
> > not specifying above libvirt doesn't make itco go away on qemu side,
> > it's still there regardless of above.  
> 
> That is fine. Libvirt will synthesize a <watchdog> device to
> represent & track the built-in default hardware, if the mgmt
> app did not specify it explicitly.
> 
> 
> 
> > > 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'/>  
> > for gwdt it's more than just adding extra ACPI table,
> > with wdat knob, watchdog entry in GTDT table should be disabled
> > and gwdt itself should be wired to use different freq
> > (in the end it's different hw that happens to use the same registers/
> > protocol).  
> 
> That doesn't really sound that different to me.  If enabling WADT
> implies disabling GTDT that's ok, likewise if Peter wants DT to be
> available in parallel that's ok too. We can cope with modelling
> either approach in libvirt

with wdat enabled not only GTDT part but also a corresponding DT node should
be hidden from guest as they assume gwdt running at different frequency.

As for exposing both GTDT along with DT node when wdat is disabled,
quick test shows that it works for linux and Windows (if one considers
unusable Windows driver as works).
Both pickup GTDT definition just fine and
with ACPI disabled, linux guest fallbacks to DT and uses DT node
to create watchdog device node.

> 
> > if we make it built-in, we would need in addition to virt.wadt alias
> > also have virt.watchdog=[on|off] to manage creation.   
> 
> 
> 
> With regards,
> Daniel


Reply via email to