From: Eric Auger <eauger@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>, qemu-devel@nongnu.org
Cc: mst@redhat.com, peter.maydell@linaro.org,
shannon.zhaosl@gmail.com, rad@semihalf.com,
leif.lindholm@oss.qualcomm.com, qemu-arm@nongnu.org
Subject: Re: [PATCH v3 16/17] sbsa-gwdt: reschedule timer on direct WCV load
Date: Mon, 29 Jun 2026 16:08:28 +0200 [thread overview]
Message-ID: <dc356f8a-0ec3-40c2-90ce-a411210b73d3@redhat.com> (raw)
In-Reply-To: <20260624102830.1355552-17-imammedo@redhat.com>
On 6/24/26 12:28 PM, Igor Mammedov wrote:
> According to spec[1]:
>
> "The compare value can either be loaded directly or indirectly on an
> explicit refresh or timeout refresh"
>
> QEMU accepts writes to WCV but doesn't reschedule the timer,
> which it should per the spec pseudo code:
>
> "TimeoutRefresh = ( SystemCounter [63:0] > CompareValue [63:0])"
>
> Fix it by updating the timer on WCV write.
>
> Fixes Windows in GTDT mode, which never issues a WRR refresh.
> Instead, it programs WOR to ~4 sec, enables WCS, and immediately
> writes a large absolute value into WCV to push the timeout far
> into the future. Without this fix, QEMU ignores the WCV write,
> the short WOR expires, and the guest reboots unexpectedly.
>
> 1) Arm® Server Base System Architecture 6.0
> Platform Design Document
> DEN0029D 6.0
> "A.2 Watchdog Operation"
>
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---
> hw/watchdog/sbsa_gwdt.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/hw/watchdog/sbsa_gwdt.c b/hw/watchdog/sbsa_gwdt.c
> index 5ee0e06af5..fb67db9672 100644
> --- a/hw/watchdog/sbsa_gwdt.c
> +++ b/hw/watchdog/sbsa_gwdt.c
> @@ -44,6 +44,7 @@ static const VMStateDescription vmstate_sbsa_gwdt = {
> typedef enum WdtRefreshType {
> EXPLICIT_REFRESH = 0,
> TIMEOUT_REFRESH = 1,
> + WCV_LOAD = 2,
> } WdtRefreshType;
>
> static uint64_t sbsa_gwdt_rread(void *opaque, hwaddr addr, unsigned int size)
> @@ -167,10 +168,16 @@ static void sbsa_gwdt_write(void *opaque, hwaddr offset, uint64_t data,
>
> case SBSA_GWDT_WCV:
> s->wcvl = data;
> + if (s->wcs & SBSA_GWDT_WCS_EN) {
> + sbsa_gwdt_update_timer(s, WCV_LOAD);
regarding my comment on previous patch, you could add a WCV_LOAD check
in sbsa_gwdt_update_timer now.
In the previous patch it is not obvious that the code is identical to
the original code in default path (hence my previous comment)
Eric
> + }
> break;
>
> case SBSA_GWDT_WCVU:
> s->wcvu = data;
> + if (s->wcs & SBSA_GWDT_WCS_EN) {
> + sbsa_gwdt_update_timer(s, WCV_LOAD);
> + }
> break;
>
> default:
next prev parent reply other threads:[~2026-06-29 14:09 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-24 10:28 [PATCH v3 00/17] Add watchdog support to arm/virt board Igor Mammedov
2026-06-24 10:28 ` [PATCH v3 01/17] arm: sbsa_gwdt: fixup default "clock-frequency" Igor Mammedov
2026-06-24 10:28 ` [PATCH v3 02/17] arm: add tracing events to sbsa_gwdt Igor Mammedov
2026-06-24 10:28 ` [PATCH v3 03/17] arm: sbsa_gwdt: rename device type to sbsa-gwdt Igor Mammedov
2026-06-29 8:12 ` Eric Auger
2026-06-24 10:28 ` [PATCH v3 04/17] arm: virt: create sbsa-gwdt watchdog Igor Mammedov
2026-06-29 8:37 ` Eric Auger
2026-06-29 13:36 ` Igor Mammedov
2026-07-01 11:57 ` Eric Auger
2026-07-01 13:24 ` Igor Mammedov
2026-06-24 10:28 ` [PATCH v3 05/17] arm: sbsa-gwdt: add 'wdat' option Igor Mammedov
2026-06-24 10:28 ` [PATCH v3 06/17] acpi: introduce WDAT table for GWDT Igor Mammedov
2026-06-29 12:07 ` Eric Auger
2026-06-24 10:28 ` [PATCH v3 07/17] arm: virt: add support for WDAT based watchdog Igor Mammedov
2026-06-29 12:15 ` Eric Auger
2026-06-24 10:28 ` [PATCH v3 08/17] tests: acpi: arm/virt: whitelist new WDAT table Igor Mammedov
2026-06-24 10:28 ` [PATCH v3 09/17] tests: acpi: arm/virt: add WDAT table test case Igor Mammedov
2026-06-24 10:28 ` [PATCH v3 10/17] tests: acpi: arm/virt: update expected WDAT blob Igor Mammedov
2026-06-29 12:16 ` Eric Auger
2026-06-24 10:28 ` [PATCH v3 11/17] tests: acpi: arm/virt: whitelist GTDT table Igor Mammedov
2026-06-24 10:28 ` [PATCH v3 12/17] tests: acpi: arm/virt: add GTDT watchdog table test case Igor Mammedov
2026-06-24 10:28 ` [PATCH v3 13/17] tests: acpi: arm/virt: update expected GTDT blob Igor Mammedov
2026-06-24 10:28 ` [PATCH v3 14/17] sbsa-gwdt: reduce code ident Igor Mammedov
2026-06-24 10:28 ` [PATCH v3 15/17] sbsa-gwdt: move all foo_REFRESH logic under REFRESH condition Igor Mammedov
2026-06-29 14:03 ` Eric Auger
2026-06-29 14:51 ` Peter Maydell
2026-06-24 10:28 ` [PATCH v3 16/17] sbsa-gwdt: reschedule timer on direct WCV load Igor Mammedov
2026-06-29 14:08 ` Eric Auger [this message]
2026-06-24 10:28 ` [PATCH v3 17/17] sbsa-gwdt: limit compare_value to INT64_MAX Igor Mammedov
2026-06-29 14:10 ` Eric Auger
2026-06-29 14:48 ` Peter Maydell
2026-06-30 12:14 ` Igor Mammedov
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=dc356f8a-0ec3-40c2-90ce-a411210b73d3@redhat.com \
--to=eauger@redhat.com \
--cc=imammedo@redhat.com \
--cc=leif.lindholm@oss.qualcomm.com \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=rad@semihalf.com \
--cc=shannon.zhaosl@gmail.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.