On Tue, 8 Sep 2026 16:08:35 +0100
Peter Maydell <peter.maydell@linaro.org> wrote:
> On Wed, 2 Sept 2026 at 13:26, Igor Mammedov <imammedo@redhat.com> wrote:
> >
> >
> > Series picks up dropped gwdt fixes from
> >
> > [PATCH v3 00/17] Add watchdog support to arm/virt board
> > https://patchew.org/QEMU/20260624102830.1355552-1-imammedo@redhat.com/
> >
> > patches were basically rewritten to make changes simpler/easier to reson about.
> >
> > patch 6/6 is partial fix with open question:
> >
> > sbsa-gwdt currently mantains WVC in since VM start ticks, which works fine under
> > TCG. However under KVM those system counter domains diverge and CNTPCT in guest
> > starts to return host's value. As result WCV reads/writes got mixed up with
> > QEMU still assuming VM timeframe while guest using host's one.
> > Question is how should we fix it?
>
> Presumably we should be dealing in deltas from the
> QEMU_CLOCK_VIRTUAL value?
deltas could works as workaround at cost of polluting sbsa-gwdt
device model with KVM quirk. but then real fun begins when we
bring in picture migration (even not counting CNTPCT jump),
WCV would either diverge or jump as well => more KVM quirks
in whatchdog code to deal with.
I'd think that we would want to track QEMU_CLOCK_VIRTUAL in WCV,
basically make CNTPCT = CNTVCT and treat as such everywhere.
What is lost on me is history/reasoning why CNTPCT tracks host value?
Why can't we make it track virtual clock instead (there is KVM_ARM_SET_COUNTER_OFFSET
that supposedly should do the job)?
> Anyway, for this series, since the only thing I wanted to change
> was expanding a comment, I'll apply this to target-arm.next and
> make that tweak there.
Thanks!
>
> -- PMM
>