From nobody Sun Jul 26 12:31:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1782297046; cv=none; d=zohomail.com; s=zohoarc; b=UsQGvPCwXEbxp1ctNNJcBmHz6+tPZNfi4a/88FaOfTKpkfQ88ftCeG19kgP6VWTx/xRP52WHgpO3t8kU0JwWacmm7su/aD4P7LfI/c69qy9I6oYULDqmy0ATKrcHirsWOPz1Ibw9CgR7kUxwvVHEfPwNA42pXXhMEH0W1kv04+s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782297046; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=YcreBT6yOPwaacOWLfu2u1EniV6qHpkGam79kBzQUp0=; b=JFad624vsGIM6JGcp/YCpS7+C5iIOMRgx0c2jSDRw38t1tuhibllAaFzjI1CcpWLa9lyAsvDwpUeTGuN+7n/xPd1Ga2dgMvw9MJk5LTSMMfXOSrOvW+WItYlUp2TEAsiZGpCAeGRZSwuOQfrNzn9q2/x1XDBxRAvWe4KU6DdOSQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782297046743936.3875920179573; Wed, 24 Jun 2026 03:30:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wcKqc-0006jz-Hd; Wed, 24 Jun 2026 06:28:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKqa-0006jP-FX for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:28:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKqY-00078K-Lv for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:28:44 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-390-qoZDtgWwN-OeiwqYvGylBg-1; Wed, 24 Jun 2026 06:28:40 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id ADB841801BE0; Wed, 24 Jun 2026 10:28:38 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2B8BD30001A7; Wed, 24 Jun 2026 10:28:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1782296921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YcreBT6yOPwaacOWLfu2u1EniV6qHpkGam79kBzQUp0=; b=V0SQzL+RvnnMjP5atzqtS6ZAyddWpD78UX1+aH40r4q4XRCkto7hbwyfYZ5vN4RxWHFb97 OEsuapdm2muFuWpF9LHNXxVHEOXgri7ZeDQT41n1RJZNMMI7C29U44FyxroBUVsEy3xaFT fL79AHlZGnAZBxUMNmLk2CsijIigKVc= X-MC-Unique: qoZDtgWwN-OeiwqYvGylBg-1 X-Mimecast-MFC-AGG-ID: qoZDtgWwN-OeiwqYvGylBg_1782296918 From: Igor Mammedov To: qemu-devel@nongnu.org Cc: mst@redhat.com, eauger@redhat.com, peter.maydell@linaro.org, shannon.zhaosl@gmail.com, rad@semihalf.com, leif.lindholm@oss.qualcomm.com, qemu-arm@nongnu.org, Eric Auger Subject: [PATCH v3 01/17] arm: sbsa_gwdt: fixup default "clock-frequency" Date: Wed, 24 Jun 2026 12:28:14 +0200 Message-ID: <20260624102830.1355552-2-imammedo@redhat.com> In-Reply-To: <20260624102830.1355552-1-imammedo@redhat.com> References: <20260624102830.1355552-1-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1782297047699158500 Comment about keeping legacy freq, is wrong to begin with (should be 62.5MHz), but that value also doesn't make sense anymore as the watchdog is used only by un-versioned SBSA board and the later has hard-coded it to 1GHz. Other potential user (arm/virt) also has system clock at 1GHz. Drop misleading comment about legacy and set default to 1GHz to match both boards. (not that it does matter, since users are setting frequency to match CPU's one explicitly) Signed-off-by: Igor Mammedov Reviewed-by: Eric Auger --- hw/watchdog/sbsa_gwdt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/watchdog/sbsa_gwdt.c b/hw/watchdog/sbsa_gwdt.c index 7ade5c6f18..b739a3ce3c 100644 --- a/hw/watchdog/sbsa_gwdt.c +++ b/hw/watchdog/sbsa_gwdt.c @@ -264,11 +264,10 @@ static void wdt_sbsa_gwdt_realize(DeviceState *dev, E= rror **errp) static const Property wdt_sbsa_gwdt_props[] =3D { /* * Timer frequency in Hz. This must match the frequency used by - * the CPU's generic timer. Default 62.5Hz matches QEMU's legacy - * CPU timer frequency default. + * the CPU's generic timer. */ DEFINE_PROP_UINT64("clock-frequency", struct SBSA_GWDTState, freq, - 62500000), + 1000000000), }; =20 static void wdt_sbsa_gwdt_class_init(ObjectClass *klass, const void *data) --=20 2.47.3 From nobody Sun Jul 26 12:31:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1782297193; cv=none; d=zohomail.com; s=zohoarc; b=eucYR8fATwnHEkVG+CEE8daQ43mJjREANdp/cr2q3TDr7BVnK/NBfjvpaXhwtWK5rSOOfutrzRE02UWEEuKPpXa+egawBEs3EqjjFirOQwT+bZJedTjjIva/4b1rysfyexZMUWVxY+Ki/Os2owxxPkrTB8mJKmwlz6k4Is364cI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782297193; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wBQRWE3oHz4dQwe/0gi4IuXipiKYKp8N64q0brpREPc=; b=m1L8kx9vkvA+K6S/5bgUSM10F1yBxfMNB+WlFjnRm9XmagTaHKxNq5nLP6fep35tYRO0eVWeLBwC9LVJzPzgnudazIr+/CiVCSu8WHXdmUio67cJ2SEeT7WdKuranbuAdDNwaeHbHdDrXjCFETtbtJHmK2GzHGjgX+XIxn+yTVg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782297193795324.0407349826761; Wed, 24 Jun 2026 03:33:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wcKqm-0006ne-UG; Wed, 24 Jun 2026 06:28:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKql-0006mq-Be for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:28:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKqj-0007BH-TE for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:28:55 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-172-t-Li1XW8OV6icPko2dbp_Q-1; Wed, 24 Jun 2026 06:28:44 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9A27519560AF; Wed, 24 Jun 2026 10:28:41 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 10EBC30001A7; Wed, 24 Jun 2026 10:28:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1782296933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wBQRWE3oHz4dQwe/0gi4IuXipiKYKp8N64q0brpREPc=; b=MkZrVx1ygQo4axYXFGDtOswbxJnKMVux4afKG2/5UgadcU15TF9h8hns3P8vt3UtwLPASc Bs20Cl4Y8nt7ghoWGSjXfIYhvIYK6EJXpLOpE7iqC9pk3tbDVAvuO2uITEkrmMnUD+sUG7 QNNFpITgvr73u8aQTqtmXmwhsOHq4aU= X-MC-Unique: t-Li1XW8OV6icPko2dbp_Q-1 X-Mimecast-MFC-AGG-ID: t-Li1XW8OV6icPko2dbp_Q_1782296921 From: Igor Mammedov To: qemu-devel@nongnu.org Cc: mst@redhat.com, eauger@redhat.com, peter.maydell@linaro.org, shannon.zhaosl@gmail.com, rad@semihalf.com, leif.lindholm@oss.qualcomm.com, qemu-arm@nongnu.org, Ani Sinha , Eric Auger Subject: [PATCH v3 02/17] arm: add tracing events to sbsa_gwdt Date: Wed, 24 Jun 2026 12:28:15 +0200 Message-ID: <20260624102830.1355552-3-imammedo@redhat.com> In-Reply-To: <20260624102830.1355552-1-imammedo@redhat.com> References: <20260624102830.1355552-1-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1782297194429158500 Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Reviewed-by: Eric Auger --- hw/watchdog/sbsa_gwdt.c | 8 ++++++++ hw/watchdog/trace-events | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/hw/watchdog/sbsa_gwdt.c b/hw/watchdog/sbsa_gwdt.c index b739a3ce3c..acb970e8b3 100644 --- a/hw/watchdog/sbsa_gwdt.c +++ b/hw/watchdog/sbsa_gwdt.c @@ -24,6 +24,7 @@ #include "migration/vmstate.h" #include "qemu/log.h" #include "qemu/module.h" +#include "trace.h" =20 static const VMStateDescription vmstate_sbsa_gwdt =3D { .name =3D "sbsa-gwdt", @@ -62,6 +63,7 @@ static uint64_t sbsa_gwdt_rread(void *opaque, hwaddr addr= , unsigned int size) qemu_log_mask(LOG_GUEST_ERROR, "bad address in refresh frame read = :" " 0x%x\n", (int)addr); } + trace_sbsa_gwdt_refresh_read(addr, ret); return ret; } =20 @@ -93,6 +95,7 @@ static uint64_t sbsa_gwdt_read(void *opaque, hwaddr addr,= unsigned int size) qemu_log_mask(LOG_GUEST_ERROR, "bad address in control frame read = :" " 0x%x\n", (int)addr); } + trace_sbsa_gwdt_control_read(addr, ret); return ret; } =20 @@ -127,6 +130,7 @@ static void sbsa_gwdt_rwrite(void *opaque, hwaddr offse= t, uint64_t data, unsigned size) { SBSA_GWDTState *s =3D SBSA_GWDT(opaque); =20 + trace_sbsa_gwdt_refresh_write(offset, data); if (offset =3D=3D SBSA_GWDT_WRR) { s->wcs &=3D ~(SBSA_GWDT_WCS_WS0 | SBSA_GWDT_WCS_WS1); =20 @@ -141,6 +145,7 @@ static void sbsa_gwdt_write(void *opaque, hwaddr offset= , uint64_t data, unsigned size) { SBSA_GWDTState *s =3D SBSA_GWDT(opaque); =20 + trace_sbsa_gwdt_control_write(offset, data); switch (offset) { case SBSA_GWDT_WCS: s->wcs =3D data & SBSA_GWDT_WCS_EN; @@ -180,6 +185,7 @@ static void wdt_sbsa_gwdt_reset(DeviceState *dev) { SBSA_GWDTState *s =3D SBSA_GWDT(dev); =20 + trace_sbsa_gwdt_reset(); timer_del(s->timer); =20 s->wcs =3D 0; @@ -196,10 +202,12 @@ static void sbsa_gwdt_timer_sysinterrupt(void *opaque) =20 if (!(s->wcs & SBSA_GWDT_WCS_WS0)) { s->wcs |=3D SBSA_GWDT_WCS_WS0; + trace_sbsa_gwdt_ws0_asserted(); sbsa_gwdt_update_timer(s, TIMEOUT_REFRESH); qemu_set_irq(s->irq, 1); } else { s->wcs |=3D SBSA_GWDT_WCS_WS1; + trace_sbsa_gwdt_ws1_asserted(); qemu_log_mask(CPU_LOG_RESET, "Watchdog timer expired.\n"); /* * Reset the watchdog only if the guest gets notified about diff --git a/hw/watchdog/trace-events b/hw/watchdog/trace-events index d85b3ca769..b388f7b250 100644 --- a/hw/watchdog/trace-events +++ b/hw/watchdog/trace-events @@ -42,3 +42,12 @@ k230_wdt_interrupt(void) "K230 WDT interrupt" k230_wdt_reset(void) "K230 WDT system reset" k230_wdt_restart(void) "K230 WDT restart" k230_wdt_reset_device(void) "K230 WDT device reset" + +#sbsa_gwdt.c +sbsa_gwdt_refresh_read(uint64_t addr, uint32_t value) "[0x%" PRIx64 "] -> = 0x%" PRIx32 +sbsa_gwdt_refresh_write(uint64_t addr, uint64_t value) "[0x%" PRIx64 "] <-= 0x%" PRIx64 +sbsa_gwdt_control_read(uint64_t addr, uint32_t value) "[0x%" PRIx64 "] -> = 0x%" PRIx32 +sbsa_gwdt_control_write(uint64_t addr, uint64_t value) "[0x%" PRIx64 "] <-= 0x%" PRIx64 +sbsa_gwdt_ws0_asserted(void) "WS0 signal is asserted" +sbsa_gwdt_ws1_asserted(void) "WS1 signal is asserted" +sbsa_gwdt_reset(void) "reset watchdog to default state" --=20 2.47.3 From nobody Sun Jul 26 12:31:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1782297172; cv=none; d=zohomail.com; s=zohoarc; b=cH3uSEQMmN1EaQQ8ompbmv86jsDnMRJIvK0vrExhV9yHZfIULB7wBfETHIxhyNLzCuV0CIrG0LnaoudREgOHWzWEzDmawKz6651qjoRbEazcIi/NI6ZV8QRb75TuFzgdCRprxSDHCbd5WeosI6HsCTFnw7NsReNI253jP6ZvLWI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782297172; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=6bqd+48YFH3p5jZTGj4/Jgg9aZXLgidEu4QGg0yoGco=; b=cyIzyYY52Nx47S9hboQDxQ5zmfqLKYnHiV0cd+NkNp21+d+KkepQr4uXfbniIlQ+xkdt0Mu5N2A5DIYu3FEujXmjmLGOAlLopskx4ghH2/yhGBNJ0MnNbZ2hxtkozli7onfs17m/0DKXJmVpItBeakd4r+nfLgKK5syBF4k2wo4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782297172516370.05900567445667; Wed, 24 Jun 2026 03:32:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wcKqj-0006ly-6L; Wed, 24 Jun 2026 06:28:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKqh-0006lS-9z for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:28:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKqg-0007Ae-1Z for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:28:51 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-455-p7JFMpWANme5mEW06kJQ7w-1; Wed, 24 Jun 2026 06:28:45 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EB8BD195604C; Wed, 24 Jun 2026 10:28:43 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id F0E0B3000B54; Wed, 24 Jun 2026 10:28:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1782296929; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6bqd+48YFH3p5jZTGj4/Jgg9aZXLgidEu4QGg0yoGco=; b=SJS65JFW/sC3HMLLWk5ULA5k2g9a+HnHSgtFk5SOezNcsMmQMWrXMhxT9rmRNvWbMyleFv cIjGwcU22cQbqImCPImDSiRPI5ZnBlaQ7LZhEVCEc4XIL8tp1sqjutRnMTSyKGBdEDuBus cmCzOuZdc3Dsixfa2YeUc7dlEu23/F0= X-MC-Unique: p7JFMpWANme5mEW06kJQ7w-1 X-Mimecast-MFC-AGG-ID: p7JFMpWANme5mEW06kJQ7w_1782296924 From: Igor Mammedov To: qemu-devel@nongnu.org Cc: mst@redhat.com, eauger@redhat.com, peter.maydell@linaro.org, shannon.zhaosl@gmail.com, rad@semihalf.com, leif.lindholm@oss.qualcomm.com, qemu-arm@nongnu.org Subject: [PATCH v3 03/17] arm: sbsa_gwdt: rename device type to sbsa-gwdt Date: Wed, 24 Jun 2026 12:28:16 +0200 Message-ID: <20260624102830.1355552-4-imammedo@redhat.com> In-Reply-To: <20260624102830.1355552-1-imammedo@redhat.com> References: <20260624102830.1355552-1-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1782297174342158500 Use hyphenated name to follow QEMU device naming convention. Migration compatibility is preserved since the vmstate name is already "sbsa-gwdt". Signed-off-by: Igor Mammedov Reviewed-by: Eric Auger --- include/hw/watchdog/sbsa_gwdt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/watchdog/sbsa_gwdt.h b/include/hw/watchdog/sbsa_gwd= t.h index 307a4f291a..8941dcff9e 100644 --- a/include/hw/watchdog/sbsa_gwdt.h +++ b/include/hw/watchdog/sbsa_gwdt.h @@ -16,7 +16,7 @@ #include "hw/core/sysbus.h" #include "hw/core/irq.h" =20 -#define TYPE_WDT_SBSA "sbsa_gwdt" +#define TYPE_WDT_SBSA "sbsa-gwdt" #define SBSA_GWDT(obj) \ OBJECT_CHECK(SBSA_GWDTState, (obj), TYPE_WDT_SBSA) #define SBSA_GWDT_CLASS(klass) \ --=20 2.47.3 From nobody Sun Jul 26 12:31:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1782296981; cv=none; d=zohomail.com; s=zohoarc; b=WtAiiklm5P+HZrZyp4kSncl04PG1A3U9MT2tVKKiCf1yP5/tHJ02nbf9y+gUr2b3VFGL1MmA/XMO7XMfrQbofYcgymCqJ1cZZS4KeQ4PiyIfUX2z7uJ9b0B24vNtIRX+Dkw24T4HPxtRHB31n4s9cgPzkkRWsyoTedtFTvHWfBE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782296981; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dAUdgD4/ItHFDoK/4MgWc6Zxs6DyQymODNzJ6MhQdUg=; b=DHESFgfBb9dfq02UYUngCK6otwZ4nRmY4rivCLfxwClZEU5z97AjJxt2kwhDQOeObsryb7SQeWerosI9MX2VBufmZbEZFGVkrL8IVmp6xYhe6oToDp1TF/NX3ViH3KHeQ1Zl3oyaLg22nf8TcCVXpuzv60/pMGkat70WK3Yd8A0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782296980997649.4413748185347; Wed, 24 Jun 2026 03:29:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wcKqk-0006mV-II; Wed, 24 Jun 2026 06:28:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKqj-0006lz-Hr for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:28:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKqh-0007Ar-MR for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:28:53 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-80-ZVOaTUhzMQqneSp4ndXFWA-1; Wed, 24 Jun 2026 06:28:48 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8FB841955F03; Wed, 24 Jun 2026 10:28:46 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4D5C230001A7; Wed, 24 Jun 2026 10:28:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1782296931; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dAUdgD4/ItHFDoK/4MgWc6Zxs6DyQymODNzJ6MhQdUg=; b=JvvRBQ1HJKq+oq12LtQOtG2EFj6B3owQyLORa892A57fVWE9e7Gs60IW/5sHvdeZcF45Hy 2PaQb5W+4RqUMuBLJvLuGT23HQczxPs3C158Oaqw01b3EC6HZvoYKWeBjSsEiIeQ2HwRbu OwIvxk7Uxr5wXuxJF0lCf06ioWa3s9c= X-MC-Unique: ZVOaTUhzMQqneSp4ndXFWA-1 X-Mimecast-MFC-AGG-ID: ZVOaTUhzMQqneSp4ndXFWA_1782296926 From: Igor Mammedov To: qemu-devel@nongnu.org Cc: mst@redhat.com, eauger@redhat.com, peter.maydell@linaro.org, shannon.zhaosl@gmail.com, rad@semihalf.com, leif.lindholm@oss.qualcomm.com, qemu-arm@nongnu.org Subject: [PATCH v3 04/17] arm: virt: create sbsa-gwdt watchdog Date: Wed, 24 Jun 2026 12:28:17 +0200 Message-ID: <20260624102830.1355552-5-imammedo@redhat.com> In-Reply-To: <20260624102830.1355552-1-imammedo@redhat.com> References: <20260624102830.1355552-1-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1782296983226158500 Allow to use SBSA generic watchdog with virt machine type. (includes conditional generation of corresponding FDT and ACPI GTDT descriptors) Use '-device sbsa-gwdt' to command line to enable it. Instead of using dynamic sysbus infra to wire up MMIO/IRQ/FDT, statically assign resources in machine's mem/irq maps and wire them up at device (pre_)plug handlers. It's similar to dynamic sysbus wiring, modulo resources are nailed down statically, and wiring is limited to virt machine only. (Benefit is that tests don't break anymore on rebase due to address being stable) Tested with Fedora 43: FDT: -M virt,acpi=3Doff -device sbsa-gwdt ACPI: -M virt -device sbsa-gwdt Note: Windows sees GTDT, initializes watchdog but instead pinging WRR it sets/advances WOR to way too large value, so it's never going to trigger watchdog reboot (it's Windows driver issue though). Signed-off-by: Igor Mammedov --- v3: - (Eric) assign MMIO/IRQ statically and abandon most of dynamic sysbus machinery. - (Peter) set watchdog freq to system clock explicitly, machine version compat won't work in case host is not runing 1GHz clock. (Tested on Jetson machine) --- include/hw/arm/virt.h | 3 +++ hw/arm/Kconfig | 1 + hw/arm/virt-acpi-build.c | 29 +++++++++++++++++++++++++++-- hw/arm/virt.c | 37 +++++++++++++++++++++++++++++++++++++ hw/core/sysbus-fdt.c | 2 ++ hw/watchdog/sbsa_gwdt.c | 1 + 6 files changed, 71 insertions(+), 2 deletions(-) diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index 171d44c644..22e66d1a11 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -97,6 +97,9 @@ enum { VIRT_NVDIMM_ACPI, VIRT_PVTIME, VIRT_ACPI_PCIHP, + VIRT_GWDT_WS0, + VIRT_GWDT_REFRESH, + VIRT_GWDT_CONTROL, VIRT_LOWMEMMAP_LAST, }; =20 diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index 500bfdfe2a..962a39247c 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -36,6 +36,7 @@ config ARM_VIRT select VIRTIO_MEM_SUPPORTED select ACPI_CXL select ACPI_HMAT + select WDT_SBSA =20 config CUBIEBOARD bool diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 99490aa7b1..f5b3b4ce48 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -64,6 +64,7 @@ #include "hw/virtio/virtio-acpi.h" #include "target/arm/cpu.h" #include "target/arm/multiprocessing.h" +#include "hw/watchdog/sbsa_gwdt.h" =20 #include "smmuv3-accel.h" #include "tegra241-cmdqv.h" @@ -868,6 +869,8 @@ build_gtdt(GArray *table_data, BIOSLinker *linker, Virt= MachineState *vms) const uint32_t irqflags =3D 0; /* Interrupt is Level triggered */ AcpiTable table =3D { .sig =3D "GTDT", .rev =3D 3, .oem_id =3D vms->oe= m_id, .oem_table_id =3D vms->oem_table_id }; + uint32_t gtdt_start =3D table_data->len; + Object *wdt =3D object_resolve_type_unambiguous(TYPE_WDT_SBSA, NULL); =20 acpi_table_begin(&table, table_data); =20 @@ -898,10 +901,15 @@ build_gtdt(GArray *table_data, BIOSLinker *linker, Vi= rtMachineState *vms) build_append_int_noprefix(table_data, irqflags, 4); /* CntReadBase Physical address */ build_append_int_noprefix(table_data, 0xFFFFFFFFFFFFFFFF, 8); + /* Platform Timer Count */ - build_append_int_noprefix(table_data, 0, 4); + build_append_int_noprefix(table_data, wdt ? 1 : 0, 4); /* Platform Timer Offset */ - build_append_int_noprefix(table_data, 0, 4); + build_append_int_noprefix(table_data, + wdt ? (table_data->len - gtdt_start) + + 4 + 4 + 4 /* len of this & following 2 fields to skip */ + : 0, 4); + if (vms->ns_el2_virt_timer_irq) { /* Virtual EL2 Timer GSIV */ build_append_int_noprefix(table_data, ARCH_TIMER_NS_EL2_VIRT_IRQ, = 4); @@ -911,6 +919,23 @@ build_gtdt(GArray *table_data, BIOSLinker *linker, Vir= tMachineState *vms) build_append_int_noprefix(table_data, 0, 4); build_append_int_noprefix(table_data, 0, 4); } + + /* ACPI 6.5 spec: 5.2.25.2 ARM Generic Watchdog Structure (Table 5-124= ) */ + if (wdt) { + hwaddr rbase =3D vms->memmap[VIRT_GWDT_REFRESH].base; + hwaddr cbase =3D vms->memmap[VIRT_GWDT_CONTROL].base; + int irq =3D ARM_SPI_BASE + vms->irqmap[VIRT_GWDT_WS0]; + + build_append_int_noprefix(table_data, 1 /* Type: Watchdog GT */, 1= ); + build_append_int_noprefix(table_data, 28 /* Length */, 2); + build_append_int_noprefix(table_data, 0, 1); /* Reserved */ + /* RefreshFrame Physical Address */ + build_append_int_noprefix(table_data, rbase, 8); + /* WatchdogControlFrame Physical Address */ + build_append_int_noprefix(table_data, cbase, 8); + build_append_int_noprefix(table_data, irq, 4); /* Watchdog Timer G= SIV */ + build_append_int_noprefix(table_data, 0, 4); /* Watchdog Timer Fla= gs */ + } acpi_table_end(linker, &table); } =20 diff --git a/hw/arm/virt.c b/hw/arm/virt.c index d8d27f2ef6..aacf9b7251 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -95,6 +95,7 @@ #include "hw/cxl/cxl.h" #include "hw/cxl/cxl_host.h" #include "qemu/guest-random.h" +#include "hw/watchdog/sbsa_gwdt.h" =20 static GlobalProperty arm_virt_compat_defaults[] =3D { { TYPE_VIRTIO_IOMMU_PCI, "aw-bits", "48" }, @@ -214,6 +215,8 @@ static const MemMapEntry base_memmap[] =3D { /* ...repeating for a total of NUM_VIRTIO_TRANSPORTS, each of that siz= e */ [VIRT_PLATFORM_BUS] =3D { 0x0c000000, 0x02000000 }, [VIRT_SECURE_MEM] =3D { 0x0e000000, 0x01000000 }, + [VIRT_GWDT_REFRESH] =3D { 0x0f000000, 0x00001000 }, + [VIRT_GWDT_CONTROL] =3D { 0x0f001000, 0x00001000 }, [VIRT_PCIE_MMIO] =3D { 0x10000000, 0x2eff0000 }, [VIRT_PCIE_PIO] =3D { 0x3eff0000, 0x00010000 }, [VIRT_PCIE_ECAM] =3D { 0x3f000000, 0x01000000 }, @@ -267,6 +270,7 @@ static const int a15irqmap[] =3D { [VIRT_MMIO] =3D 16, /* ...to 16 + NUM_VIRTIO_TRANSPORTS - 1 */ [VIRT_GIC_V2M] =3D 48, /* ...to 48 + NUM_GICV2M_SPIS - 1 */ [VIRT_SMMU] =3D 74, /* ...to 74 + NUM_SMMU_IRQS - 1 */ + [VIRT_GWDT_WS0] =3D 10, [VIRT_PLATFORM_BUS] =3D 112, /* ...to 112 + PLATFORM_BUS_NUM_IRQS -1 */ }; =20 @@ -3820,6 +3824,10 @@ static void virt_machine_device_pre_plug_cb(HotplugH= andler *hotplug_dev, qlist_append_str(reserved_regions, resv_prop_str); qdev_prop_set_array(dev, "reserved-regions", reserved_regions); g_free(resv_prop_str); + } else if (object_dynamic_cast(OBJECT(dev), TYPE_WDT_SBSA)) { + uint64_t cntfrq =3D object_property_get_int(OBJECT(qemu_get_cpu(0)= ), + "cntfrq", &error_abort); + qdev_prop_set_uint64(dev, "clock-frequency", cntfrq); } else if (object_dynamic_cast(OBJECT(dev), TYPE_ARM_SMMUV3)) { if (vms->legacy_smmuv3_present || vms->iommu =3D=3D VIRT_IOMMU_VIR= TIO) { error_setg(errp, "virt machine already has %s set. " @@ -3871,6 +3879,34 @@ static void virt_machine_device_plug_cb(HotplugHandl= er *hotplug_dev, { VirtMachineState *vms =3D VIRT_MACHINE(hotplug_dev); =20 + if (object_dynamic_cast(OBJECT(dev), TYPE_WDT_SBSA)) { + SysBusDevice *s =3D SYS_BUS_DEVICE(dev); + MachineState *ms =3D MACHINE(vms); + hwaddr rbase =3D vms->memmap[VIRT_GWDT_REFRESH].base; + hwaddr cbase =3D vms->memmap[VIRT_GWDT_CONTROL].base; + int irq =3D vms->irqmap[VIRT_GWDT_WS0]; + + sysbus_mmio_map(s, 0, rbase); + sysbus_mmio_map(s, 1, cbase); + sysbus_connect_irq(s, 0, qdev_get_gpio_in(vms->gic, irq)); + + { + char *nodename =3D g_strdup_printf("/watchdog@%" PRIx64, cbase= ); + + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop_string(ms->fdt, nodename, + "compatible", "arm,sbsa-gwdt"); + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", + 2, cbase, 2, SBSA_GWDT_CMMIO_SIZE, + 2, rbase, 2, SBSA_GWDT_RMMIO_SIZE= ); + qemu_fdt_setprop_cells(ms->fdt, nodename, "interrupts", + GIC_FDT_IRQ_TYPE_SPI, irq, + GIC_FDT_IRQ_FLAGS_LEVEL_HI); + qemu_fdt_setprop_cell(ms->fdt, nodename, "timeout-sec", 30); + g_free(nodename); + } + } + if (vms->platform_bus_dev) { MachineClass *mc =3D MACHINE_GET_CLASS(vms); =20 @@ -4123,6 +4159,7 @@ static void virt_machine_class_init(ObjectClass *oc, = const void *data) machine_class_allow_dynamic_sysbus_dev(mc, TYPE_RAMFB_DEVICE); machine_class_allow_dynamic_sysbus_dev(mc, TYPE_UEFI_VARS_SYSBUS); machine_class_allow_dynamic_sysbus_dev(mc, TYPE_ARM_SMMUV3); + machine_class_allow_dynamic_sysbus_dev(mc, TYPE_WDT_SBSA); #ifdef CONFIG_TPM machine_class_allow_dynamic_sysbus_dev(mc, TYPE_TPM_TIS_SYSBUS); #endif diff --git a/hw/core/sysbus-fdt.c b/hw/core/sysbus-fdt.c index 89d0c46445..12238570b5 100644 --- a/hw/core/sysbus-fdt.c +++ b/hw/core/sysbus-fdt.c @@ -36,6 +36,7 @@ #include "hw/display/ramfb.h" #include "hw/uefi/var-service-api.h" #include "hw/arm/fdt.h" +#include "hw/watchdog/sbsa_gwdt.h" =20 /* * internal struct that contains the information to create dynamic @@ -140,6 +141,7 @@ static const BindingEntry bindings[] =3D { TYPE_BINDING(TYPE_ARM_SMMUV3, no_fdt_node), TYPE_BINDING(TYPE_RAMFB_DEVICE, no_fdt_node), TYPE_BINDING(TYPE_UEFI_VARS_SYSBUS, add_uefi_vars_node), + TYPE_BINDING(TYPE_WDT_SBSA, no_fdt_node), TYPE_BINDING("", NULL), /* last element */ }; =20 diff --git a/hw/watchdog/sbsa_gwdt.c b/hw/watchdog/sbsa_gwdt.c index acb970e8b3..c4dd8005b7 100644 --- a/hw/watchdog/sbsa_gwdt.c +++ b/hw/watchdog/sbsa_gwdt.c @@ -285,6 +285,7 @@ static void wdt_sbsa_gwdt_class_init(ObjectClass *klass= , const void *data) dc->realize =3D wdt_sbsa_gwdt_realize; device_class_set_legacy_reset(dc, wdt_sbsa_gwdt_reset); dc->hotpluggable =3D false; + dc->user_creatable =3D true; set_bit(DEVICE_CATEGORY_WATCHDOG, dc->categories); dc->vmsd =3D &vmstate_sbsa_gwdt; dc->desc =3D "SBSA-compliant generic watchdog device"; --=20 2.47.3 From nobody Sun Jul 26 12:31:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1782297037; cv=none; d=zohomail.com; s=zohoarc; b=GFPz6jmZZXgFhGxdKozm1Siy7rvZUNYCvxirQIsSC+DXL0U+V3+buKUp7564pDEQ/1QAd/rDSnssuFjkT/eFePnsObhQ83VdeqdAtaJFMhMJXH9PJPMrpghuiVrySgQwD7WOnVAlkExuo6Vr+hjUt1UhFBX38lFRi6vZcTGqEF0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782297037; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=WjFTpdwQIaE79YV3syPDPnn+JV1JhF7PJ2yrcTZS4iY=; b=CE/c9qGIWdGWWidllOg3XDyLO/ygHLeq76q7sNy8clJvdI65dgEwxyKt/ZHQ7tFMPnHD6p6XCTq+uSc9FPP1DrUm9d+B7//JEip2OF/nFmKEMRKsurHOT5CWiSrRJARp0meJv6VcCUZtV/byEONJxdxFioINkfWR26negZahvbg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782297037536621.3663961612248; Wed, 24 Jun 2026 03:30:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wcKql-0006n6-RW; Wed, 24 Jun 2026 06:28:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKqk-0006mB-09 for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:28:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKqi-0007B7-LL for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:28:53 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-168-nrokYGKBOpKlVxVCdo0b3Q-1; Wed, 24 Jun 2026 06:28:50 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 22F4219560B4; Wed, 24 Jun 2026 10:28:49 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E5B3330001A7; Wed, 24 Jun 2026 10:28:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1782296932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WjFTpdwQIaE79YV3syPDPnn+JV1JhF7PJ2yrcTZS4iY=; b=THVJ+eWqjydYt3Otr3KfJClcuIOID+Sbin1aQk/GHIsJ/l3DXBL7i/9lMmqIn34o2k2TqN qPrMLuiTxtrrdxiPob5Gn4tAjhnVdtctT4XX9Sudha4Uun8oQxZDkhDA1jOm+HovzAEtAW Cy231Jd/7axn5zjuOc21da1eFGF72N8= X-MC-Unique: nrokYGKBOpKlVxVCdo0b3Q-1 X-Mimecast-MFC-AGG-ID: nrokYGKBOpKlVxVCdo0b3Q_1782296929 From: Igor Mammedov To: qemu-devel@nongnu.org Cc: mst@redhat.com, eauger@redhat.com, peter.maydell@linaro.org, shannon.zhaosl@gmail.com, rad@semihalf.com, leif.lindholm@oss.qualcomm.com, qemu-arm@nongnu.org, Eric Auger Subject: [PATCH v3 05/17] arm: sbsa-gwdt: add 'wdat' option Date: Wed, 24 Jun 2026 12:28:18 +0200 Message-ID: <20260624102830.1355552-6-imammedo@redhat.com> In-Reply-To: <20260624102830.1355552-1-imammedo@redhat.com> References: <20260624102830.1355552-1-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1782297039655158500 it will be used by arm/virt board, to pick WDAT compatible watchdog impl. and act as switch over to WDAT ACPI table vesus default GTDT ACPI table. Signed-off-by: Igor Mammedov Reviewed-by: Eric Auger --- include/hw/watchdog/sbsa_gwdt.h | 1 + hw/watchdog/sbsa_gwdt.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/include/hw/watchdog/sbsa_gwdt.h b/include/hw/watchdog/sbsa_gwd= t.h index 8941dcff9e..5ad7c7a798 100644 --- a/include/hw/watchdog/sbsa_gwdt.h +++ b/include/hw/watchdog/sbsa_gwdt.h @@ -73,6 +73,7 @@ typedef struct SBSA_GWDTState { uint32_t woru; uint32_t wcvl; uint32_t wcvu; + bool wdat; } SBSA_GWDTState; =20 #endif /* WDT_SBSA_GWDT_H */ diff --git a/hw/watchdog/sbsa_gwdt.c b/hw/watchdog/sbsa_gwdt.c index c4dd8005b7..1678ab85db 100644 --- a/hw/watchdog/sbsa_gwdt.c +++ b/hw/watchdog/sbsa_gwdt.c @@ -265,6 +265,14 @@ static void wdt_sbsa_gwdt_realize(DeviceState *dev, Er= ror **errp) =20 sysbus_init_irq(sbd, &s->irq); =20 + /* + * WDAT spec: "The clock interval that the WDT uses must be + * greater than or equal to 1 millisecond." + */ + if (s->wdat) { + s->freq =3D 1000; + } + s->timer =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, sbsa_gwdt_timer_sysinter= rupt, dev); } @@ -276,6 +284,7 @@ static const Property wdt_sbsa_gwdt_props[] =3D { */ DEFINE_PROP_UINT64("clock-frequency", struct SBSA_GWDTState, freq, 1000000000), + DEFINE_PROP_BOOL("wdat", struct SBSA_GWDTState, wdat, false), }; =20 static void wdt_sbsa_gwdt_class_init(ObjectClass *klass, const void *data) --=20 2.47.3 From nobody Sun Jul 26 12:31:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1782296977; cv=none; d=zohomail.com; s=zohoarc; b=Q05zpgAZqKaMjDevS8f+S9JPEosfJPd/Nh5iYsukhHjBmn5JkRxsZZcta4iGG6gOwNmHCba+nbB+lDtBxwfMf2Qw5rGy+5U+cONbOawv3HZkb31Bt0GGWskbefjdtLAlloL9bPKzDo+dhovBTOjGdGrTtR8jJhIWsHo+j4v5G88= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782296977; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=eMbcEBa5NOl5Dg8dRc0zIT/e0EYx+nZ1G0Qrji2bcXk=; b=THkMDiIgGNiWDQkY0wjeGhGfab2xEuGhaQJbh58BOwDRgvp2/S2ba8eM1+AhKPBO4XYJOxN8Q2GKHx1CDabB7ijQdQ356TE6ZBivumWiStmEGXfx9S/JX5tk9ufG58v970Rd93YZE9jq2zwqC6zSbfqe8YyJ77PpMP2fDrwd6p4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782296977886732.6088561076951; Wed, 24 Jun 2026 03:29:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wcKqs-0006s9-OW; Wed, 24 Jun 2026 06:29:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKqr-0006qj-4h for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:29:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKqp-0007CN-49 for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:29:00 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-473-SGPjti55MtWGG-sXjc7BqQ-1; Wed, 24 Jun 2026 06:28:53 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 79A681800D8F; Wed, 24 Jun 2026 10:28:51 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6362130001A7; Wed, 24 Jun 2026 10:28:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1782296938; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eMbcEBa5NOl5Dg8dRc0zIT/e0EYx+nZ1G0Qrji2bcXk=; b=O1Wi/0B+S+8Ow9UM98bDd4nTa+T7ewh0R9/b6QBjoVwowJOs4jiqFYE0eNxlM3dyKh5QFM oWROoYb7zHpN3i/T4SCRiFMueC8hKqP78gLrkMVhGZy57v+ghxyl+HEfBOD3Ce41UVCJo5 bf0K8Vr3loFuKoiLDpfrpwfGT2J5LJA= X-MC-Unique: SGPjti55MtWGG-sXjc7BqQ-1 X-Mimecast-MFC-AGG-ID: SGPjti55MtWGG-sXjc7BqQ_1782296932 From: Igor Mammedov To: qemu-devel@nongnu.org Cc: mst@redhat.com, eauger@redhat.com, peter.maydell@linaro.org, shannon.zhaosl@gmail.com, rad@semihalf.com, leif.lindholm@oss.qualcomm.com, qemu-arm@nongnu.org Subject: [PATCH v3 06/17] acpi: introduce WDAT table for GWDT Date: Wed, 24 Jun 2026 12:28:19 +0200 Message-ID: <20260624102830.1355552-7-imammedo@redhat.com> In-Reply-To: <20260624102830.1355552-1-imammedo@redhat.com> References: <20260624102830.1355552-1-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1782296979569158500 Add build_gwdt_wdat() to generate a Watchdog Action Table tailored for the SBSA Generic Watchdog Timer. Signed-off-by: Igor Mammedov Reviewed-by: Eric Auger --- v3: (Eric) - split '[PATCH v2 11/21] arm: virt: add support for WDAT based watchdo= g' on smaller chunks. - add/improve comments where requested - actualy use 'freq' argument passed down by caller - simplify magic val on WRR write and add comment - group table records by used register --- include/hw/acpi/wdat-gwdt.h | 19 +++++++ hw/acpi/meson.build | 2 + hw/acpi/wdat-gwdt-stub.c | 16 ++++++ hw/acpi/wdat-gwdt.c | 99 +++++++++++++++++++++++++++++++++++++ 4 files changed, 136 insertions(+) create mode 100644 include/hw/acpi/wdat-gwdt.h create mode 100644 hw/acpi/wdat-gwdt-stub.c create mode 100644 hw/acpi/wdat-gwdt.c diff --git a/include/hw/acpi/wdat-gwdt.h b/include/hw/acpi/wdat-gwdt.h new file mode 100644 index 0000000000..42339e031e --- /dev/null +++ b/include/hw/acpi/wdat-gwdt.h @@ -0,0 +1,19 @@ +/* + * GWDT Watchdog Action Table (WDAT) definition + * + * Copyright Red Hat, Inc. 2026 + * Author(s): Igor Mammedov + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#ifndef QEMU_HW_ACPI_WDAT_GWDT_H +#define QEMU_HW_ACPI_WDAT_GWDT_H + +#include "hw/acpi/aml-build.h" +#include "hw/watchdog/sbsa_gwdt.h" + +void build_gwdt_wdat(GArray *table_data, BIOSLinker *linker, const char *o= em_id, + const char *oem_table_id, uint64_t rbase, uint64_t cb= ase, + uint64_t freq); + +#endif /* QEMU_HW_ACPI_WDAT_GWDT_H */ diff --git a/hw/acpi/meson.build b/hw/acpi/meson.build index 0c7bfb278a..09ad488a04 100644 --- a/hw/acpi/meson.build +++ b/hw/acpi/meson.build @@ -31,11 +31,13 @@ acpi_ss.add(when: 'CONFIG_ACPI_ERST', if_true: files('e= rst.c')) acpi_ss.add(when: 'CONFIG_IPMI', if_true: files('ipmi.c')) stub_ss.add(files('ipmi-stub.c')) stub_ss.add(files('acpi-x86-stub.c')) +acpi_ss.add(when: 'CONFIG_WDT_SBSA', if_true: files('wdat-gwdt.c')) if have_tpm acpi_ss.add(files('tpm.c')) endif stub_ss.add(files('acpi-stub.c', 'aml-build-stub.c', 'ghes-stub.c')) stub_ss.add(files('pci-bridge-stub.c')) +stub_ss.add(files('wdat-gwdt-stub.c')) system_ss.add_all(when: 'CONFIG_ACPI', if_true: acpi_ss) system_ss.add(when: 'CONFIG_GHES_CPER', if_true: files('ghes_cper.c')) stub_ss.add(files('ghes_cper_stub.c')) diff --git a/hw/acpi/wdat-gwdt-stub.c b/hw/acpi/wdat-gwdt-stub.c new file mode 100644 index 0000000000..4d43783f70 --- /dev/null +++ b/hw/acpi/wdat-gwdt-stub.c @@ -0,0 +1,16 @@ +/* + * Copyright Red Hat, Inc. 2026 + * Author(s): Igor Mammedov + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "hw/acpi/wdat-gwdt.h" + +void build_gwdt_wdat(GArray *table_data, BIOSLinker *linker, const char *o= em_id, + const char *oem_table_id, uint64_t rbase, uint64_t cb= ase, + uint64_t freq) +{ + g_assert_not_reached(); +} diff --git a/hw/acpi/wdat-gwdt.c b/hw/acpi/wdat-gwdt.c new file mode 100644 index 0000000000..b30566ef6a --- /dev/null +++ b/hw/acpi/wdat-gwdt.c @@ -0,0 +1,99 @@ +/* + * SBSA GWDT Watchdog Action Table (WDAT) + * + * Copyright Red Hat, Inc. 2026 + * Author(s): Igor Mammedov + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "hw/acpi/aml-build.h" +#include "hw/acpi/wdat-gwdt.h" +#include "hw/acpi/wdat.h" +#include "hw/watchdog/sbsa_gwdt.h" + +#define GWDT_REG(base, reg_offset, reg_width) { \ + .space_id =3D AML_AS_SYSTEM_MEMORY, \ + .address =3D base + reg_offset, .bit_width =3D reg_width,= \ + .access_width =3D AML_DWORD_ACC }; + +/* + * "Hardware Watchdog Timers Design=C2=A0Specification" + * https://uefi.org/acpi 'Watchdog Action Table (WDAT)' + */ +void build_gwdt_wdat(GArray *table_data, BIOSLinker *linker, const char *o= em_id, + const char *oem_table_id, uint64_t rbase, uint64_t cb= ase, + uint64_t freq) +{ + AcpiTable table =3D { .sig =3D "WDAT", .rev =3D 1, .oem_id =3D oem_id, + .oem_table_id =3D oem_table_id }; + + struct AcpiGenericAddress wrr =3D GWDT_REG(rbase, 0x0, 32); + struct AcpiGenericAddress wor_l =3D GWDT_REG(cbase, SBSA_GWDT_WOR, 32= ); + struct AcpiGenericAddress wcs =3D GWDT_REG(cbase, SBSA_GWDT_WCS, 32); + + acpi_table_begin(&table, table_data); + build_append_int_noprefix(table_data, 0x20, 4); /* Watchdog Header Len= gth */ + /* + * PCI location fields are set to 0xff to indicate + * that the watchdog is not a PCI device. + */ + build_append_int_noprefix(table_data, 0xff, 2); /* PCI Segment */ + build_append_int_noprefix(table_data, 0xff, 1); /* PCI Bus Number */ + build_append_int_noprefix(table_data, 0xff, 1); /* PCI Device Number */ + build_append_int_noprefix(table_data, 0xff, 1); /* PCI Function Number= */ + build_append_int_noprefix(table_data, 0, 3); /* Reserved */ + /* + * WDAT spec: "The clock interval that the WDT uses must be + * greater than or equal to 1 millisecond." + */ + g_assert(freq <=3D 1000); + /* Timer Period, ms */ + build_append_int_noprefix(table_data, 1000 / freq, 4); + /* + * WDAT spec: "The time-out period before the WDT fires is recommended + * to be at least 5 minutes." + * Set max count to 10min and min count to 5sec. + */ + build_append_int_noprefix(table_data, 600 * freq, 4); /* Maximum Count= */ + build_append_int_noprefix(table_data, 5 * freq, 4); /* Minimum Count= */ + /* + * WATCHDOG_ENABLED | WATCHDOG_STOPPED_IN_SLEEP_STATE + */ + build_append_int_noprefix(table_data, 0x81, 1); /* Watchdog Flags */ + build_append_int_noprefix(table_data, 0, 3); /* Reserved */ + /* + * watchdog instruction entries + */ + build_append_int_noprefix(table_data, 8, 4); + /* Action table: WCS (control/status) register actions */ + build_append_wdat_ins(table_data, WDAT_ACTION_QUERY_RUNNING_STATE, + WDAT_INS_READ_VALUE, + wcs, 0x1, 0x1); + build_append_wdat_ins(table_data, WDAT_ACTION_SET_RUNNING_STATE, + WDAT_INS_WRITE_VALUE | WDAT_INS_PRESERVE_REGISTER, + wcs, 1, 0x00000001); + build_append_wdat_ins(table_data, WDAT_ACTION_QUERY_STOPPED_STATE, + WDAT_INS_READ_VALUE, + wcs, 0x0, 0x00000001); + build_append_wdat_ins(table_data, WDAT_ACTION_SET_STOPPED_STATE, + WDAT_INS_WRITE_VALUE | WDAT_INS_PRESERVE_REGISTER, + wcs, 0x0, 0x00000001); + build_append_wdat_ins(table_data, WDAT_ACTION_QUERY_WATCHDOG_STATUS, + WDAT_INS_READ_VALUE, + wcs, 0x4, 0x00000004); + /* WOR (offset) and WRR (refresh) register actions */ + build_append_wdat_ins(table_data, WDAT_ACTION_SET_COUNTDOWN_PERIOD, + WDAT_INS_WRITE_COUNTDOWN, + wor_l, 0, 0xffffffff); + /* WRR: any write refreshes the watchdog, value is ignored */ + build_append_wdat_ins(table_data, WDAT_ACTION_RESET, + WDAT_INS_WRITE_VALUE, + wrr, 0x1, 0x1); + build_append_wdat_ins(table_data, WDAT_ACTION_SET_WATCHDOG_STATUS, + WDAT_INS_WRITE_VALUE | WDAT_INS_PRESERVE_REGISTER, + wrr, 0x4, 0x4); + + acpi_table_end(linker, &table); +} --=20 2.47.3 From nobody Sun Jul 26 12:31:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1782297146; cv=none; d=zohomail.com; s=zohoarc; b=P3EsaXlo53b1NmZCqnW0n4pIxecXr1DFHL1hd7ARAiDJs/0a/54lWqEvuodonnazu7UGUf2R/v+TGbRXbhK8bxaarpbv3mIai+yD4kpyn6zPSqlECtlHSq/yJnKLrR3Ej1WGLTQbCJrKtZqb4HdwwuX+zOfHZxywK2k5fulbXjI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782297146; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Mm48+Ix2espphnUYjw02/IvBMQ0pd4071xogvguQjgc=; b=G3jKW98+23QLMObqZ1GLCACniP26Lix8ehEyO5B+FoyI5Nl1MxT9WLJaewmPh+vMNyd/CP6N14NcpWPf0ileIF99DUL4Tjhw/0RFaGbSucCRR1fE2nQ/UQ9oIYhyL50zAnKNsnPjZ79LupHbbCungwdF9IfXiWKguF2LaGaR11g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782297146544737.4204785456207; Wed, 24 Jun 2026 03:32:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wcKqu-0006uR-5w; Wed, 24 Jun 2026 06:29:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKqt-0006sd-2u for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:29:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKqr-0007Ch-As for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:29:02 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-85-L0ZJKFhxNEKg6H44Y_W9qA-1; Wed, 24 Jun 2026 06:28:55 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DCC2318052DD; Wed, 24 Jun 2026 10:28:53 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D11393000B55; Wed, 24 Jun 2026 10:28:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1782296940; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Mm48+Ix2espphnUYjw02/IvBMQ0pd4071xogvguQjgc=; b=YYsK9gJs8GTmcinUctecuyyjOm1Dz1/hZV1JY+dIzHRFAgoZpx1hQLnNPTHU3d3MhNgUPD lmugpAbGW50yp6lYU+AZxZ0BrceAJFgRkFBePvTr1+f+1Iv2GUgiL+2Oe/yFXKvhTxq0yo qxnFfxzRCnLnoAJB6dAl+82I4iFA4FM= X-MC-Unique: L0ZJKFhxNEKg6H44Y_W9qA-1 X-Mimecast-MFC-AGG-ID: L0ZJKFhxNEKg6H44Y_W9qA_1782296934 From: Igor Mammedov To: qemu-devel@nongnu.org Cc: mst@redhat.com, eauger@redhat.com, peter.maydell@linaro.org, shannon.zhaosl@gmail.com, rad@semihalf.com, leif.lindholm@oss.qualcomm.com, qemu-arm@nongnu.org Subject: [PATCH v3 07/17] arm: virt: add support for WDAT based watchdog Date: Wed, 24 Jun 2026 12:28:20 +0200 Message-ID: <20260624102830.1355552-8-imammedo@redhat.com> In-Reply-To: <20260624102830.1355552-1-imammedo@redhat.com> References: <20260624102830.1355552-1-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1782297148326158500 Add WDAT handling for sbsa-gwdt on arm/virt machine. WDAT mode is enabled by 'wdat' option: ex: "-device sbsa-gwdt,wdat=3Don" When WDAT is enabled: - Build the WDAT ACPI table instead of the GTDT watchdog entry, since they are mutually exclusive due to different timer resolution (WDAT uses 1 kHz vs GTDT's system counter frequency). - Skip FDT watchdog node creation, as the DT-based Linux driver would use the system counter frequency which doesn't match the WDAT-mode 1 kHz clock. Signed-off-by: Igor Mammedov Reviewed-by: Eric Auger --- v3: - Skip FDT watchdog node creation in wdat mode (Eric) - wiring part of larger '[PATCH v2 11/21] arm: virt: add support for W= DAT based watchdog' --- hw/arm/virt-acpi-build.c | 34 ++++++++++++++++++++++++++-------- hw/arm/virt.c | 10 ++++++---- 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index f5b3b4ce48..71706b98e6 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -65,6 +65,7 @@ #include "target/arm/cpu.h" #include "target/arm/multiprocessing.h" #include "hw/watchdog/sbsa_gwdt.h" +#include "hw/acpi/wdat-gwdt.h" =20 #include "smmuv3-accel.h" #include "tegra241-cmdqv.h" @@ -859,7 +860,8 @@ build_srat(GArray *table_data, BIOSLinker *linker, Virt= MachineState *vms) * 5.2.25 Generic Timer Description Table (GTDT) */ static void -build_gtdt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) +build_gtdt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms, + Object *wdt, bool add_watchdog) { /* * Table 5-117 Flag Definitions @@ -870,7 +872,6 @@ build_gtdt(GArray *table_data, BIOSLinker *linker, Virt= MachineState *vms) AcpiTable table =3D { .sig =3D "GTDT", .rev =3D 3, .oem_id =3D vms->oe= m_id, .oem_table_id =3D vms->oem_table_id }; uint32_t gtdt_start =3D table_data->len; - Object *wdt =3D object_resolve_type_unambiguous(TYPE_WDT_SBSA, NULL); =20 acpi_table_begin(&table, table_data); =20 @@ -903,12 +904,12 @@ build_gtdt(GArray *table_data, BIOSLinker *linker, Vi= rtMachineState *vms) build_append_int_noprefix(table_data, 0xFFFFFFFFFFFFFFFF, 8); =20 /* Platform Timer Count */ - build_append_int_noprefix(table_data, wdt ? 1 : 0, 4); + build_append_int_noprefix(table_data, add_watchdog ? 1 : 0, 4); /* Platform Timer Offset */ build_append_int_noprefix(table_data, - wdt ? (table_data->len - gtdt_start) + - 4 + 4 + 4 /* len of this & following 2 fields to skip */ - : 0, 4); + add_watchdog ? (table_data->len - gtdt_start) + + 4 + 4 + 4 /* len of this & following 2 fields to sk= ip */ + : 0, 4); =20 if (vms->ns_el2_virt_timer_irq) { /* Virtual EL2 Timer GSIV */ @@ -921,7 +922,7 @@ build_gtdt(GArray *table_data, BIOSLinker *linker, Virt= MachineState *vms) } =20 /* ACPI 6.5 spec: 5.2.25.2 ARM Generic Watchdog Structure (Table 5-124= ) */ - if (wdt) { + if (add_watchdog) { hwaddr rbase =3D vms->memmap[VIRT_GWDT_REFRESH].base; hwaddr cbase =3D vms->memmap[VIRT_GWDT_CONTROL].base; int irq =3D ARM_SPI_BASE + vms->irqmap[VIRT_GWDT_WS0]; @@ -1332,13 +1333,19 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBui= ldTables *tables) VirtMachineClass *vmc =3D VIRT_MACHINE_GET_CLASS(vms); GArray *table_offsets; unsigned dsdt, xsdt; + bool has_wdat =3D false; GArray *tables_blob =3D tables->table_data; MachineState *ms =3D MACHINE(vms); CPUCoreCaches caches[CPU_MAX_CACHES]; unsigned int num_caches; + Object *wdt =3D object_resolve_type_unambiguous(TYPE_WDT_SBSA, NULL); =20 num_caches =3D virt_get_caches(vms, caches); =20 + if (wdt) { + has_wdat =3D object_property_get_bool(wdt, "wdat", &error_abort); + } + table_offsets =3D g_array_new(false, true /* clear */, sizeof(uint32_t)); =20 @@ -1357,6 +1364,17 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuil= dTables *tables) acpi_add_table(table_offsets, tables_blob); build_madt(tables_blob, tables->linker, vms); =20 + acpi_add_table(table_offsets, tables_blob); + if (wdt && has_wdat) { + uint64_t freq =3D object_property_get_uint(wdt, "clock-frequency", + &error_abort); + build_gwdt_wdat(tables_blob, tables->linker, + vms->oem_id, vms->oem_table_id, + vms->memmap[VIRT_GWDT_REFRESH].base, + vms->memmap[VIRT_GWDT_CONTROL].base, + freq); + } + if (!vmc->no_cpu_topology) { acpi_add_table(table_offsets, tables_blob); build_pptt(tables_blob, tables->linker, ms, vms->oem_id, @@ -1364,7 +1382,7 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuild= Tables *tables) } =20 acpi_add_table(table_offsets, tables_blob); - build_gtdt(tables_blob, tables->linker, vms); + build_gtdt(tables_blob, tables->linker, vms, wdt, wdt && !has_wdat); =20 acpi_add_table(table_offsets, tables_blob); { diff --git a/hw/arm/virt.c b/hw/arm/virt.c index aacf9b7251..35ded6d1d4 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -3825,9 +3825,11 @@ static void virt_machine_device_pre_plug_cb(HotplugH= andler *hotplug_dev, qdev_prop_set_array(dev, "reserved-regions", reserved_regions); g_free(resv_prop_str); } else if (object_dynamic_cast(OBJECT(dev), TYPE_WDT_SBSA)) { - uint64_t cntfrq =3D object_property_get_int(OBJECT(qemu_get_cpu(0)= ), - "cntfrq", &error_abort); - qdev_prop_set_uint64(dev, "clock-frequency", cntfrq); + if (!object_property_get_bool(OBJECT(dev), "wdat", &error_abort)) { + uint64_t cntfrq =3D object_property_get_int(OBJECT(qemu_get_cp= u(0)), + "cntfrq", &error_abo= rt); + qdev_prop_set_uint64(dev, "clock-frequency", cntfrq); + } } else if (object_dynamic_cast(OBJECT(dev), TYPE_ARM_SMMUV3)) { if (vms->legacy_smmuv3_present || vms->iommu =3D=3D VIRT_IOMMU_VIR= TIO) { error_setg(errp, "virt machine already has %s set. " @@ -3890,7 +3892,7 @@ static void virt_machine_device_plug_cb(HotplugHandle= r *hotplug_dev, sysbus_mmio_map(s, 1, cbase); sysbus_connect_irq(s, 0, qdev_get_gpio_in(vms->gic, irq)); =20 - { + if (!object_property_get_bool(OBJECT(dev), "wdat", &error_abort)) { char *nodename =3D g_strdup_printf("/watchdog@%" PRIx64, cbase= ); =20 qemu_fdt_add_subnode(ms->fdt, nodename); --=20 2.47.3 From nobody Sun Jul 26 12:31:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1782297175; cv=none; d=zohomail.com; s=zohoarc; b=YfvUy9mIzca1Hzudyomp4Z96hZR9r90/gMBGmuVytP5OZyOLTv9QvjRJVkBpfI4rZImTkLKw9j/RlrPGnAWDewDUjKI5vTBoHDt43E9u72lzt7TPVvZ5ALhhxd1dI0zXEG+Wq7aebVMZiW4PH6MvMBjtIkKQrHnCFtDHvYKlj3Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782297175; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wujx3idx78Myx2EqeDpbTah++59X09/APupYTbYNwh8=; b=l/jSA16BXiwrq6Cg5eprftf+gWAxUTMPlpCE0/0Gb0D0vWxX8epqHkEiUoQh268etZSInZQaNqETrG9DLQ9d4+519iMt2yVTS4FM0fJ3Az+dt2Q7oCTOtnkU0nu/hWba5Yyb9/S0Oi3QIImKu2Y3/M3CQYQqouGtEIRIf2RwKQU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782297175334624.4942353113034; Wed, 24 Jun 2026 03:32:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wcKqu-0006uX-Hc; Wed, 24 Jun 2026 06:29:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKqt-0006tc-Nd for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:29:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKqr-0007Cw-Od for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:29:03 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-187-8AMjT5awMnyA42ZiBx8-ig-1; Wed, 24 Jun 2026 06:28:57 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9133218052D6; Wed, 24 Jun 2026 10:28:56 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3FC5C30001A7; Wed, 24 Jun 2026 10:28:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1782296941; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wujx3idx78Myx2EqeDpbTah++59X09/APupYTbYNwh8=; b=D+Fxj+KL/04gsY8waLdTMVnty0raEM3Fc22pr/M9IKXu+O37nDs+ZprUg7y5pQv9glOM5Z 6fdpKo5nM58mViif+y9Ci+fLQOFFAe78WjYVT0/1n4vtaWgz+5okfZ6aMvQV912wL3b72z WXw3kTzfP/htszqMozE0y6rcr/+fTiE= X-MC-Unique: 8AMjT5awMnyA42ZiBx8-ig-1 X-Mimecast-MFC-AGG-ID: 8AMjT5awMnyA42ZiBx8-ig_1782296936 From: Igor Mammedov To: qemu-devel@nongnu.org Cc: mst@redhat.com, eauger@redhat.com, peter.maydell@linaro.org, shannon.zhaosl@gmail.com, rad@semihalf.com, leif.lindholm@oss.qualcomm.com, qemu-arm@nongnu.org, Eric Auger Subject: [PATCH v3 08/17] tests: acpi: arm/virt: whitelist new WDAT table Date: Wed, 24 Jun 2026 12:28:21 +0200 Message-ID: <20260624102830.1355552-9-imammedo@redhat.com> In-Reply-To: <20260624102830.1355552-1-imammedo@redhat.com> References: <20260624102830.1355552-1-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1782297176349158500 Signed-off-by: Igor Mammedov Reviewed-by: Eric Auger --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + tests/data/acpi/aarch64/virt/WDAT.wdat | 0 2 files changed, 1 insertion(+) create mode 100644 tests/data/acpi/aarch64/virt/WDAT.wdat diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index dfb8523c8b..135186b40b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,2 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/aarch64/virt/WDAT.wdat", diff --git a/tests/data/acpi/aarch64/virt/WDAT.wdat b/tests/data/acpi/aarch= 64/virt/WDAT.wdat new file mode 100644 index 0000000000..e69de29bb2 --=20 2.47.3 From nobody Sun Jul 26 12:31:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1782297171; cv=none; d=zohomail.com; s=zohoarc; b=dyKmVIT1QSxNXRYu22eYjdKgu3ZXBRVfUkjBcvF9dYdWfZSl0dCufZSdRSa5/LraJ96jcgBmfK3hW87sKyRA1Li6Q1m4Wc22imhV0CAwkQEurcfRVqcKjVLzNdIVFz1pm+dHLsU6y6ocdstywZnSDBGUxOTKmUY5zOiIslISXs8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782297171; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=EVfv9bqr3sAYoY83sQ3/zd3RNroDmvSwnSBFyo/6YCA=; b=ebLs6BW3jbCtL5nr0lk5Yl1Iyy9Udp+cmKARH57XaSUVd/+JXg2HBRbEsTRUtpPru310CqxY6UMxPlEkb4zL4/izsHps1xwXl1rKPPIsJ6RHNrtMDZyKIPKFbEwn/JheThVZP3BPgLCIT+kEMoFtAQGwx/sEfW6Ve/tkSjUWfzI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782297171646423.43951922603935; Wed, 24 Jun 2026 03:32:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wcKqx-0006vs-5I; Wed, 24 Jun 2026 06:29:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKqv-0006vG-Cp for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:29:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKqu-0007Du-13 for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:29:05 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-308-AGmidUWXMDOu2regTbtIPg-1; Wed, 24 Jun 2026 06:29:00 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 268861802677; Wed, 24 Jun 2026 10:28:59 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E80E230001A7; Wed, 24 Jun 2026 10:28:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1782296943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EVfv9bqr3sAYoY83sQ3/zd3RNroDmvSwnSBFyo/6YCA=; b=hymGYV0lvVNlJAc600CFb+lsz+n+0eLdfmb1OexcvB3IARrsjOK2u9rw3t/qxy1SCs0dlK IwpqUWRLZYFylXBkhuOTYcqnMtR3iZGgZBMgpOCwfSVIhoY8hC2mOG68gD6BypxQfhjjgt 9RswGHm88KWu5TN+dpk+e6y+ia1/Ldg= X-MC-Unique: AGmidUWXMDOu2regTbtIPg-1 X-Mimecast-MFC-AGG-ID: AGmidUWXMDOu2regTbtIPg_1782296939 From: Igor Mammedov To: qemu-devel@nongnu.org Cc: mst@redhat.com, eauger@redhat.com, peter.maydell@linaro.org, shannon.zhaosl@gmail.com, rad@semihalf.com, leif.lindholm@oss.qualcomm.com, qemu-arm@nongnu.org, Eric Auger Subject: [PATCH v3 09/17] tests: acpi: arm/virt: add WDAT table test case Date: Wed, 24 Jun 2026 12:28:22 +0200 Message-ID: <20260624102830.1355552-10-imammedo@redhat.com> In-Reply-To: <20260624102830.1355552-1-imammedo@redhat.com> References: <20260624102830.1355552-1-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1782297172333158500 Signed-off-by: Igor Mammedov Reviewed-by: Eric Auger --- tests/qtest/bios-tables-test.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index af6d9b5136..5440aab2f8 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -2275,6 +2275,25 @@ static void test_acpi_aarch64_virt_tcg_msi_gicv2m(vo= id) free_test_data(&data); } =20 +static void test_acpi_aarch64_virt_tcg_wdat(void) +{ + test_data data =3D { + .machine =3D "virt", + .arch =3D "aarch64", + .variant =3D ".wdat", + .tcg_only =3D true, + .uefi_fl1 =3D "pc-bios/edk2-aarch64-code.fd", + .uefi_fl2 =3D "pc-bios/edk2-arm-vars.fd", + .cd =3D "tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.= qcow2", + .ram_start =3D 0x40000000ULL, + .scan_len =3D 128ULL * MiB, + }; + + test_acpi_one("-cpu cortex-a57 " + "-device sbsa-gwdt,wdat=3Don", &data); + free_test_data(&data); +} + static void test_acpi_q35_viot(void) { test_data data =3D { @@ -2893,6 +2912,8 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/virt/smmuv3-dev", test_acpi_aarch64_virt_smmuv3_dev); } + qtest_add_func("acpi/virt/acpi-watchdog", + test_acpi_aarch64_virt_tcg_wdat); } } else if (strcmp(arch, "riscv64") =3D=3D 0) { if (has_tcg && qtest_has_device("virtio-blk-pci")) { --=20 2.47.3 From nobody Sun Jul 26 12:31:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1782296977; cv=none; d=zohomail.com; s=zohoarc; b=EOx/wnwM5fdOgnofyiUNBtHgBtIM42Jy3vzCP2Twz49205Dl1fkL8uF9iC52ZgnNAjGvyZSh50BcRImAbU3kssTelESZhKeXkl87WX1yg0i+TKC+3QwuvBCKggSEWGb7PVlGI/gleJronhum4oD1c94fgYh0XamxL4Dl7qyugg8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782296977; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=v2ZHcRnnDKpabZVFml4+n/8swazbhX4IspMtuEpM8+g=; b=BTAPaQyS9lEUBFGtUBMKZgJoao+a9PZhLABHfup38ZdecxQrqSW9riV4XndfYXrrbyOrIaYDuFyxw7NODupWs46hQ4UQctAwdlJhUnDs8k4b4bo6uSy32Rz5/s1fqeYgusKha2Wf6JgB5mpMzPXqO4SXS9SUmW2pAHJ6oHmlur4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178229697796419.582153499559922; Wed, 24 Jun 2026 03:29:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wcKr0-0006xD-Rc; Wed, 24 Jun 2026 06:29:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKqz-0006wk-Ol for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:29:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKqw-0007ET-Na for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:29:09 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-435-HS-zQFRyNBa30oIeY4scYA-1; Wed, 24 Jun 2026 06:29:02 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 51AE71955F7C; Wed, 24 Jun 2026 10:29:01 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 65D3E30001A7; Wed, 24 Jun 2026 10:28:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1782296946; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v2ZHcRnnDKpabZVFml4+n/8swazbhX4IspMtuEpM8+g=; b=JsEZCAYcfUn+y8sm8iN4sDhYONXuO1SPW49nOLYU0Aba5DlUJ92dB2k1+eipRPvSP7Rs8n dmYY6n4a2Xv6/U9TliI2nOlUGuL+Mkyl+seeEV3JqO/BUEkUs/GJC5X1uvqHmtMK+PuYbm 4uKo5oVTpVeKGG/ikAIR5K9KGse61aE= X-MC-Unique: HS-zQFRyNBa30oIeY4scYA-1 X-Mimecast-MFC-AGG-ID: HS-zQFRyNBa30oIeY4scYA_1782296941 From: Igor Mammedov To: qemu-devel@nongnu.org Cc: mst@redhat.com, eauger@redhat.com, peter.maydell@linaro.org, shannon.zhaosl@gmail.com, rad@semihalf.com, leif.lindholm@oss.qualcomm.com, qemu-arm@nongnu.org Subject: [PATCH v3 10/17] tests: acpi: arm/virt: update expected WDAT blob Date: Wed, 24 Jun 2026 12:28:23 +0200 Message-ID: <20260624102830.1355552-11-imammedo@redhat.com> In-Reply-To: <20260624102830.1355552-1-imammedo@redhat.com> References: <20260624102830.1355552-1-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1782296979605158500 replace blank table with a new one: [000h 0000 004h] Signature : "WDAT" [Watchdog Action= Table] [004h 0004 004h] Table Length : 00000104 [008h 0008 001h] Revision : 01 [009h 0009 001h] Checksum : 3B [00Ah 0010 006h] Oem ID : "BOCHS " [010h 0016 008h] Oem Table ID : "BXPC " [018h 0024 004h] Oem Revision : 00000001 [01Ch 0028 004h] Asl Compiler ID : "BXPC" [020h 0032 004h] Asl Compiler Revision : 00000001 [024h 0036 004h] Header Length : 00000020 [028h 0040 002h] PCI Segment : 00FF [02Ah 0042 001h] PCI Bus : FF [02Bh 0043 001h] PCI Device : FF [02Ch 0044 001h] PCI Function : FF [02Dh 0045 003h] Reserved : 000000 [030h 0048 004h] Timer Period : 00000001 [034h 0052 004h] Max Count : 000927C0 [038h 0056 004h] Min Count : 00001388 [03Ch 0060 001h] Flags (decoded below) : 81 Enabled : 1 Stopped When Asleep : 1 [03Dh 0061 003h] Reserved : 000000 [040h 0064 004h] Watchdog Entry Count : 00000008 [044h 0068 001h] Watchdog Action : 08 [045h 0069 001h] Instruction : 00 [046h 0070 002h] Reserved : 0000 [048h 0072 00Ch] Register Region : [Generic Address Structure] [048h 0072 001h] Space ID : 00 [SystemMemory] [049h 0073 001h] Bit Width : 20 [04Ah 0074 001h] Bit Offset : 00 [04Bh 0075 001h] Encoded Access Width : 03 [DWord Access:32] [04Ch 0076 008h] Address : 000000000C001000 [054h 0084 004h] Value : 00000001 [058h 0088 004h] Register Mask : 00000001 [05Ch 0092 001h] Watchdog Action : 01 [05Dh 0093 001h] Instruction : 02 [05Eh 0094 002h] Reserved : 0000 [060h 0096 00Ch] Register Region : [Generic Address Structure] [060h 0096 001h] Space ID : 00 [SystemMemory] [061h 0097 001h] Bit Width : 20 [062h 0098 001h] Bit Offset : 00 [063h 0099 001h] Encoded Access Width : 03 [DWord Access:32] [064h 0100 008h] Address : 000000000C000000 [06Ch 0108 004h] Value : 00000001 [070h 0112 004h] Register Mask : 00000007 [074h 0116 001h] Watchdog Action : 06 [075h 0117 001h] Instruction : 03 [076h 0118 002h] Reserved : 0000 [078h 0120 00Ch] Register Region : [Generic Address Structure] [078h 0120 001h] Space ID : 00 [SystemMemory] [079h 0121 001h] Bit Width : 20 [07Ah 0122 001h] Bit Offset : 00 [07Bh 0123 001h] Encoded Access Width : 03 [DWord Access:32] [07Ch 0124 008h] Address : 000000000C001008 [084h 0132 004h] Value : 00000000 [088h 0136 004h] Register Mask : FFFFFFFF [08Ch 0140 001h] Watchdog Action : 09 [08Dh 0141 001h] Instruction : 82 [08Eh 0142 002h] Reserved : 0000 [090h 0144 00Ch] Register Region : [Generic Address Structure] [090h 0144 001h] Space ID : 00 [SystemMemory] [091h 0145 001h] Bit Width : 20 [092h 0146 001h] Bit Offset : 00 [093h 0147 001h] Encoded Access Width : 03 [DWord Access:32] [094h 0148 008h] Address : 000000000C001000 [09Ch 0156 004h] Value : 00000001 [0A0h 0160 004h] Register Mask : 00000001 [0A4h 0164 001h] Watchdog Action : 0A [0A5h 0165 001h] Instruction : 00 [0A6h 0166 002h] Reserved : 0000 [0A8h 0168 00Ch] Register Region : [Generic Address Structure] [0A8h 0168 001h] Space ID : 00 [SystemMemory] [0A9h 0169 001h] Bit Width : 20 [0AAh 0170 001h] Bit Offset : 00 [0ABh 0171 001h] Encoded Access Width : 03 [DWord Access:32] [0ACh 0172 008h] Address : 000000000C001000 [0B4h 0180 004h] Value : 00000000 [0B8h 0184 004h] Register Mask : 00000001 [0BCh 0188 001h] Watchdog Action : 0B [0BDh 0189 001h] Instruction : 82 [0BEh 0190 002h] Reserved : 0000 [0C0h 0192 00Ch] Register Region : [Generic Address Structure] [0C0h 0192 001h] Space ID : 00 [SystemMemory] [0C1h 0193 001h] Bit Width : 20 [0C2h 0194 001h] Bit Offset : 00 [0C3h 0195 001h] Encoded Access Width : 03 [DWord Access:32] [0C4h 0196 008h] Address : 000000000C001000 [0CCh 0204 004h] Value : 00000000 [0D0h 0208 004h] Register Mask : 00000001 [0D4h 0212 001h] Watchdog Action : 20 [0D5h 0213 001h] Instruction : 00 [0D6h 0214 002h] Reserved : 0000 [0D8h 0216 00Ch] Register Region : [Generic Address Structure] [0D8h 0216 001h] Space ID : 00 [SystemMemory] [0D9h 0217 001h] Bit Width : 20 [0DAh 0218 001h] Bit Offset : 00 [0DBh 0219 001h] Encoded Access Width : 03 [DWord Access:32] [0DCh 0220 008h] Address : 000000000C001000 [0E4h 0228 004h] Value : 00000004 [0E8h 0232 004h] Register Mask : 00000004 [0ECh 0236 001h] Watchdog Action : 21 [0EDh 0237 001h] Instruction : 82 [0EEh 0238 002h] Reserved : 0000 [0F0h 0240 00Ch] Register Region : [Generic Address Structure] [0F0h 0240 001h] Space ID : 00 [SystemMemory] [0F1h 0241 001h] Bit Width : 20 [0F2h 0242 001h] Bit Offset : 00 [0F3h 0243 001h] Encoded Access Width : 03 [DWord Access:32] [0F4h 0244 008h] Address : 000000000C000000 [0FCh 0252 004h] Value : 00000004 [100h 0256 004h] Register Mask : 00000004 Raw Table Data: Length 260 (0x104) Signed-off-by: Igor Mammedov Reviewed-by: Eric Auger --- tests/qtest/bios-tables-test-allowed-diff.h | 1 - tests/data/acpi/aarch64/virt/WDAT.wdat | Bin 0 -> 260 bytes 2 files changed, 1 deletion(-) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index 135186b40b..dfb8523c8b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,2 +1 @@ /* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/aarch64/virt/WDAT.wdat", diff --git a/tests/data/acpi/aarch64/virt/WDAT.wdat b/tests/data/acpi/aarch= 64/virt/WDAT.wdat index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..d5adacf9114637d8803d08906ff= 1e29ac61f5fe0 100644 GIT binary patch literal 260 zcmZXOK@NgI3`O4vF`x@byg*$Mjv=3D^kCkZBU9awQJZ&p(1B&bcAwm0T&h&0RR91 literal 0 HcmV?d00001 --=20 2.47.3 From nobody Sun Jul 26 12:31:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1782296997; cv=none; d=zohomail.com; s=zohoarc; b=HUZ4uRxqhMOUBUg5/gvFDzPmdaPO56hFp1/IdCtfgnWu2cS8aW77RRRz39CZ/5UAkxtup+TeRFOpBMpiLQsG74LAM2p+7gJAj1Jov7QgkN8wJf1UKgY+Qwk3FkIXkj6/OSxJbtqFiAv484N/JRiv/KJkeFHR9BcYEKM1/qhnsAc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782296997; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1q90WPkRUZ7wuR6JvKufex+5QOAiX2MNCSlX3ENKcGo=; b=EPz+zwJ7q1n/Dj6IpDY4E2BNLzQD4AIWyTeV8YMkePXrr6YTL2BbL8F6BLuE3JtmRQoAOJ/0r0WZH8bSm8q5YQiVj1azqDt0wHUvveYtPNg7i0JxAcjMCiRseSIfvyRZ4TKTl5rzPPgkY8gq0YQ8Xnbn4fb/MBIkM4GuutzJaG4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782296997467583.1644626096943; Wed, 24 Jun 2026 03:29:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wcKr1-0006xP-EF; Wed, 24 Jun 2026 06:29:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKr0-0006x4-GY for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:29:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKqz-0007Ep-79 for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:29:10 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-32-Wtrgxq3mN8unh96EDdoy8A-1; Wed, 24 Jun 2026 06:29:05 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D12EC18052DD; Wed, 24 Jun 2026 10:29:03 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A84593000B56; Wed, 24 Jun 2026 10:29:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1782296948; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1q90WPkRUZ7wuR6JvKufex+5QOAiX2MNCSlX3ENKcGo=; b=M/GwLeM8NRcL/u38TGqg6HFIB6iRyqBc9L06uSF3l27dBhhtTJxrBXb8qYBufbSK+oI8mI u/QAyeKlr577gjBagTkRaaj++KB6UxGUDVHkADMlkzE1z/K3qfh+NpmMPVdJmSkByoDr7h O1RDU1TXV7BjiM+J0+b4+sZ5lX3A4eI= X-MC-Unique: Wtrgxq3mN8unh96EDdoy8A-1 X-Mimecast-MFC-AGG-ID: Wtrgxq3mN8unh96EDdoy8A_1782296944 From: Igor Mammedov To: qemu-devel@nongnu.org Cc: mst@redhat.com, eauger@redhat.com, peter.maydell@linaro.org, shannon.zhaosl@gmail.com, rad@semihalf.com, leif.lindholm@oss.qualcomm.com, qemu-arm@nongnu.org, Eric Auger Subject: [PATCH v3 11/17] tests: acpi: arm/virt: whitelist GTDT table Date: Wed, 24 Jun 2026 12:28:24 +0200 Message-ID: <20260624102830.1355552-12-imammedo@redhat.com> In-Reply-To: <20260624102830.1355552-1-imammedo@redhat.com> References: <20260624102830.1355552-1-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1782296999112158500 Signed-off-by: Igor Mammedov Reviewed-by: Eric Auger --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index dfb8523c8b..3e9be28cc4 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,2 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/aarch64/virt/GTDT", --=20 2.47.3 From nobody Sun Jul 26 12:31:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1782297101; cv=none; d=zohomail.com; s=zohoarc; b=HohxViYjpKaq8psVoSKJpsw9UGbOKtnsP/l/0YYJjTnfDvnWP4jJgIkGiUpBYcrQff/WJPROoCRkXg8UTDwdkGJbe30Bxs17Jsoq92/n4Vx+3E8Oe7f/fdEGUiXys8hwwmrGI1Mu2N9j/1Jj2aFxO2tHrJ9TLLs2FAHaS9TfBwQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782297101; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=E97naQQNgChH4yflOR0n9iaRVgXS/TPf31LHSC5FjVM=; b=Qjv6aP9qQ3OIXPyl0ntNivx5Iyta0MbNT+r2c7rm/ziT0Zav+J2V5Q9Q40rkEWMoc74CeUzFQjDwlT0r+C4EiZC37JVNpjJrZvvY8Q1b+5EYiZdVGm73+yUIr8aWYO3VUL9xi59VZNmv4pFfHfYBzI3Znku5nI4F4kZRX/T00dE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782297101276335.8088108487576; Wed, 24 Jun 2026 03:31:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wcKr1-0006xf-R3; Wed, 24 Jun 2026 06:29:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKr0-0006xB-Mh for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:29:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKqz-0007Eu-B1 for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:29:10 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-684-nUAmwFDVMXaUNfKuGTfOPQ-1; Wed, 24 Jun 2026 06:29:07 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4E4DD180064A; Wed, 24 Jun 2026 10:29:06 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 339FA3000B54; Wed, 24 Jun 2026 10:29:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1782296948; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E97naQQNgChH4yflOR0n9iaRVgXS/TPf31LHSC5FjVM=; b=FZQWZ2GDzCR+Jvl+v76d4IqXAr312H15rn3Q+7J3ESOMA99mFUvsYU3UvdRFIEzRDCTz3Q 2Abx18Ttz3qOfLWU74vHPqEqhZZayDhcw95i5VYUAARQ14NdIlnQcUHrK46YTVG80HlMSj p1K8J6XK/eSS1W5UW70BK4Dkozy0Y48= X-MC-Unique: nUAmwFDVMXaUNfKuGTfOPQ-1 X-Mimecast-MFC-AGG-ID: nUAmwFDVMXaUNfKuGTfOPQ_1782296946 From: Igor Mammedov To: qemu-devel@nongnu.org Cc: mst@redhat.com, eauger@redhat.com, peter.maydell@linaro.org, shannon.zhaosl@gmail.com, rad@semihalf.com, leif.lindholm@oss.qualcomm.com, qemu-arm@nongnu.org, Eric Auger Subject: [PATCH v3 12/17] tests: acpi: arm/virt: add GTDT watchdog table test case Date: Wed, 24 Jun 2026 12:28:25 +0200 Message-ID: <20260624102830.1355552-13-imammedo@redhat.com> In-Reply-To: <20260624102830.1355552-1-imammedo@redhat.com> References: <20260624102830.1355552-1-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1782297101858158500 Signed-off-by: Igor Mammedov Reviewed-by: Eric Auger --- tests/qtest/bios-tables-test.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 5440aab2f8..94fc95c8e1 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -2294,6 +2294,24 @@ static void test_acpi_aarch64_virt_tcg_wdat(void) free_test_data(&data); } =20 +static void test_acpi_aarch64_virt_tcg_gtdt_wd(void) +{ + test_data data =3D { + .machine =3D "virt", + .arch =3D "aarch64", + .variant =3D ".gwdt", + .tcg_only =3D true, + .uefi_fl1 =3D "pc-bios/edk2-aarch64-code.fd", + .uefi_fl2 =3D "pc-bios/edk2-arm-vars.fd", + .cd =3D "tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.= qcow2", + .ram_start =3D 0x40000000ULL, + .scan_len =3D 128ULL * MiB, + }; + + test_acpi_one("-cpu cortex-a57 " "-device sbsa-gwdt", &data); + free_test_data(&data); +} + static void test_acpi_q35_viot(void) { test_data data =3D { @@ -2914,6 +2932,8 @@ int main(int argc, char *argv[]) } qtest_add_func("acpi/virt/acpi-watchdog", test_acpi_aarch64_virt_tcg_wdat); + qtest_add_func("acpi/virt/gwdt-watchdog", + test_acpi_aarch64_virt_tcg_gtdt_wd); } } else if (strcmp(arch, "riscv64") =3D=3D 0) { if (has_tcg && qtest_has_device("virtio-blk-pci")) { --=20 2.47.3 From nobody Sun Jul 26 12:31:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1782297106; cv=none; d=zohomail.com; s=zohoarc; b=fWTgiE/qUv0ZG30D/jgTjWiLwWd/rvGZ5YNecN/6xuTuO1aRFz/HiEFcj78yF2yMjGmN+P32xEn4VldzRuW2uUvcGlfkIM+yU2++m1o5i3aB4ZlUlnqkRIfNgod5R79//qrKWVcUEkOucoEM/t7yi7MNfGKGJx0Nv/YmMJFkr6A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782297106; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=k4iQ/5rn+WmQNXMNztjv9K91ycXFphWBg9nehTmrLyM=; b=CIOotWbPvOUvlCcOHf4mTy76phGSOVKpo/H21/mPD/3uqrn6Uw0FdKC/OAa80gmv5y7TtZ0ijNN8bXch5H095q3JdeMavZeY+ju4qw6kklMmQHEMc/FmjX5boMxvl/jVpG2q486zYM76anAZm2NAkpXIvkQaId8sC12KaDmpK5Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782297106097493.75487713106486; Wed, 24 Jun 2026 03:31:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wcKrA-00073x-Rt; Wed, 24 Jun 2026 06:29:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKr7-00072d-Ce for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:29:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKr5-0007G3-VV for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:29:17 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-382-q9FruZOpNaeSVZ1QdaOp1w-1; Wed, 24 Jun 2026 06:29:10 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EAB4F1800648; Wed, 24 Jun 2026 10:29:08 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A532830001A7; Wed, 24 Jun 2026 10:29:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1782296955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k4iQ/5rn+WmQNXMNztjv9K91ycXFphWBg9nehTmrLyM=; b=aP/CTGhfDb6oa/ANdJWNC2WjzBeQKGcm+aV5KCog2TizOBbcyhm2mBJX6xTc0uqhU2WbAY YjDQOwPFjNNDhrYj2Co9bDinbTZufif6tlBPlfYMdxZG0BoFIj4/RrmSqN3LQ++qKDlpdX xo9wnDmdDwCfMhGKHe/YxGdrm6XSN2U= X-MC-Unique: q9FruZOpNaeSVZ1QdaOp1w-1 X-Mimecast-MFC-AGG-ID: q9FruZOpNaeSVZ1QdaOp1w_1782296949 From: Igor Mammedov To: qemu-devel@nongnu.org Cc: mst@redhat.com, eauger@redhat.com, peter.maydell@linaro.org, shannon.zhaosl@gmail.com, rad@semihalf.com, leif.lindholm@oss.qualcomm.com, qemu-arm@nongnu.org, Eric Auger Subject: [PATCH v3 13/17] tests: acpi: arm/virt: update expected GTDT blob Date: Wed, 24 Jun 2026 12:28:26 +0200 Message-ID: <20260624102830.1355552-14-imammedo@redhat.com> In-Reply-To: <20260624102830.1355552-1-imammedo@redhat.com> References: <20260624102830.1355552-1-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1782297108054158500 Expected diff from base GTDT is an addition of watchdog timer block: [000h 0000 004h] Signature : "GTDT" [Generic Timer = Description Table] -[004h 0004 004h] Table Length : 00000068 +[004h 0004 004h] Table Length : 00000084 [008h 0008 001h] Revision : 03 -[009h 0009 001h] Checksum : 93 +[009h 0009 001h] Checksum : 39 [00Ah 0010 006h] Oem ID : "BOCHS " [010h 0016 008h] Oem Table ID : "BXPC " [018h 0024 004h] Oem Revision : 00000001 @@ -48,17 +48,30 @@ Always On : 0 [050h 0080 008h] Counter Read Block Address : FFFFFFFFFFFFFFFF -[058h 0088 004h] Platform Timer Count : 00000000 -[05Ch 0092 004h] Platform Timer Offset : 00000000 +[058h 0088 004h] Platform Timer Count : 00000001 +[05Ch 0092 004h] Platform Timer Offset : 00000068 [060h 0096 004h] Virtual EL2 Timer GSIV : 00000000 [064h 0100 004h] Virtual EL2 Timer Flags : 00000000 -Raw Table Data: Length 104 (0x68) +[068h 0104 001h] Subtable Type : 01 [Generic Watchdog Time= r] +[069h 0105 002h] Length : 001C +[06Bh 0107 001h] Reserved : 00 +[06Ch 0108 008h] Refresh Frame Address : 000000000C000000 +[074h 0116 008h] Control Frame Address : 000000000C001000 +[07Ch 0124 004h] Timer Interrupt : 00000090 +[080h 0128 004h] Timer Flags (decoded below) : 00000000 + Trigger Mode : 0 + Polarity : 0 + Security : 0 + +Raw Table Data: Length 132 (0x84) Signed-off-by: Igor Mammedov Reviewed-by: Eric Auger --- tests/qtest/bios-tables-test-allowed-diff.h | 1 - tests/data/acpi/aarch64/virt/GTDT.gwdt | Bin 0 -> 132 bytes 2 files changed, 1 deletion(-) create mode 100644 tests/data/acpi/aarch64/virt/GTDT.gwdt diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index 3e9be28cc4..dfb8523c8b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,2 +1 @@ /* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/aarch64/virt/GTDT", diff --git a/tests/data/acpi/aarch64/virt/GTDT.gwdt b/tests/data/acpi/aarch= 64/virt/GTDT.gwdt new file mode 100644 index 0000000000000000000000000000000000000000..44e6f2b18d2848f595a8c69bdb5= 4a59e1becaffd GIT binary patch literal 132 zcmXwwyA6Oq3`5@udZ_s+HDlZ%K?f37Fam?H1k-{Nf(yUca^^hc3n=3Dcmre&9SY)M2U h0D3DQ7eKED3_uCAo*U=3DC)xXm_Rp< (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782297082115738.4362250259051; Wed, 24 Jun 2026 03:31:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wcKrA-00074C-WF; Wed, 24 Jun 2026 06:29:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKr7-00072f-Pd for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:29:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKr6-0007GC-Dl for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:29:17 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-534-50Sd4vyiPkSZP5o8SpZFng-1; Wed, 24 Jun 2026 06:29:12 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7D16E1956076; Wed, 24 Jun 2026 10:29:11 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4DC4F30001A7; Wed, 24 Jun 2026 10:29:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1782296955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fta3ujsMWU/24uQqd5ToZqhS5bH/tIQ9KiCrl4mbbow=; b=Oj6pP8H98v4JCkzTiHKN5deTdpg77Zf6iQPM9Hi5TNrSp9RGjjdVFBVZKsrQDBCH8R7stB ruJPNfwFjmStWtrmk6LNlgMqog9Pkp/lveWQWvkwgbkghNr1Df1eZoLBm7n/w220PyB85T 1nNsP6CIqwz4RVvqksXBfg8iGIQbdbo= X-MC-Unique: 50Sd4vyiPkSZP5o8SpZFng-1 X-Mimecast-MFC-AGG-ID: 50Sd4vyiPkSZP5o8SpZFng_1782296951 From: Igor Mammedov To: qemu-devel@nongnu.org Cc: mst@redhat.com, eauger@redhat.com, peter.maydell@linaro.org, shannon.zhaosl@gmail.com, rad@semihalf.com, leif.lindholm@oss.qualcomm.com, qemu-arm@nongnu.org, Eric Auger Subject: [PATCH v3 14/17] sbsa-gwdt: reduce code ident Date: Wed, 24 Jun 2026 12:28:27 +0200 Message-ID: <20260624102830.1355552-15-imammedo@redhat.com> In-Reply-To: <20260624102830.1355552-1-imammedo@redhat.com> References: <20260624102830.1355552-1-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1782297083896158500 Signed-off-by: Igor Mammedov Reviewed-by: Eric Auger --- hw/watchdog/sbsa_gwdt.c | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/hw/watchdog/sbsa_gwdt.c b/hw/watchdog/sbsa_gwdt.c index 1678ab85db..6113dcd077 100644 --- a/hw/watchdog/sbsa_gwdt.c +++ b/hw/watchdog/sbsa_gwdt.c @@ -105,25 +105,27 @@ static void sbsa_gwdt_update_timer(SBSA_GWDTState *s,= WdtRefreshType rtype) =20 timer_del(s->timer); =20 - if (s->wcs & SBSA_GWDT_WCS_EN) { - /* - * Extract the upper 16 bits from woru & 32 bits from worl - * registers to construct the 48 bit offset value - */ - timeout =3D s->woru; - timeout <<=3D 32; - timeout |=3D s->worl; - timeout =3D muldiv64(timeout, NANOSECONDS_PER_SECOND, s->freq); - timeout +=3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); - - if ((rtype =3D=3D EXPLICIT_REFRESH) || ((rtype =3D=3D TIMEOUT_REFR= ESH) && - (!(s->wcs & SBSA_GWDT_WCS_WS0)))) { - /* store the current timeout value into compare registers */ - s->wcvu =3D timeout >> 32; - s->wcvl =3D timeout; - } - timer_mod(s->timer, timeout); + if (!(s->wcs & SBSA_GWDT_WCS_EN)) { + return; + } + + /* + * Extract the upper 16 bits from woru & 32 bits from worl + * registers to construct the 48 bit offset value + */ + timeout =3D s->woru; + timeout <<=3D 32; + timeout |=3D s->worl; + timeout =3D muldiv64(timeout, NANOSECONDS_PER_SECOND, s->freq); + timeout +=3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); + + if ((rtype =3D=3D EXPLICIT_REFRESH) || ((rtype =3D=3D TIMEOUT_REFRESH)= && + (!(s->wcs & SBSA_GWDT_WCS_WS0)))) { + /* store the current timeout value into compare registers */ + s->wcvu =3D timeout >> 32; + s->wcvl =3D timeout; } + timer_mod(s->timer, timeout); } =20 static void sbsa_gwdt_rwrite(void *opaque, hwaddr offset, uint64_t data, --=20 2.47.3 From nobody Sun Jul 26 12:31:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1782296980; cv=none; d=zohomail.com; s=zohoarc; b=CD18hGDE9FuVH2YdsFdfDfLXQJbRhKqYuLwSMSQFmp8IGrfe4lPOFN277OEYc9TYIPBYmUcD5+2liUDsf66n1DR+69h39XMTpmyVfUCLdUJsGDcMg5oFRILSfYBPe8oOngubmlDjZCRYESYuq+u4zfcPVJS7MVrzjlWTrgISv14= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782296980; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=eyUXN6Cgw7aj6HH9ofzx6iCg0qLWoEd4shoxm8gF4rc=; b=YOGG8tRhkzf8QuOFp7VTyHhSMuHMJtZss3oEnJqR1oD+afotX8VCC3d7kAkQ9oqkMwVEUwHfrUH8DK0XFLVmWfwkxCwWWIY95IRH9X0LcOafrEy8CNhHxV4dJsqJrgWAbLqdvFJL9NiWq09r8nO2ttwlNnp0Vxun+CViNqBwfuA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782296980900578.5726232394561; Wed, 24 Jun 2026 03:29:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wcKrF-00076I-Lm; Wed, 24 Jun 2026 06:29:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKrD-00075A-KO for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:29:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKrA-0007Gm-QN for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:29:23 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-107-KqIcqabSMSSqRObHwTu8Qg-1; Wed, 24 Jun 2026 06:29:15 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CDF0D19560A2; Wed, 24 Jun 2026 10:29:13 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D2F8630001A7; Wed, 24 Jun 2026 10:29:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1782296960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eyUXN6Cgw7aj6HH9ofzx6iCg0qLWoEd4shoxm8gF4rc=; b=dYlkq61LMhdkEfef/uy55sfMeU4+t0TQFeqlzphbQyx4Dzvyw4R4uZDhl5cmclBk0PLWok 3aKZLIMdexnyJ4KWULjMdj9psZ/6JIXvV1vshSZxMPN2CuJZ1afFsr1WfDSFC26XfbNEfL l0VYefc2mCjSWNW1ZVthwglh+NfyUWE= X-MC-Unique: KqIcqabSMSSqRObHwTu8Qg-1 X-Mimecast-MFC-AGG-ID: KqIcqabSMSSqRObHwTu8Qg_1782296953 From: Igor Mammedov To: qemu-devel@nongnu.org Cc: mst@redhat.com, eauger@redhat.com, peter.maydell@linaro.org, shannon.zhaosl@gmail.com, rad@semihalf.com, leif.lindholm@oss.qualcomm.com, qemu-arm@nongnu.org Subject: [PATCH v3 15/17] sbsa-gwdt: move all foo_REFRESH logic under REFRESH condition Date: Wed, 24 Jun 2026 12:28:28 +0200 Message-ID: <20260624102830.1355552-16-imammedo@redhat.com> In-Reply-To: <20260624102830.1355552-1-imammedo@redhat.com> References: <20260624102830.1355552-1-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1782296983068158500 No functional change, just code reorganization to prepare for direct WCV load support in the next commit. While at it, simplify timeout calculations Signed-off-by: Igor Mammedov --- hw/watchdog/sbsa_gwdt.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/hw/watchdog/sbsa_gwdt.c b/hw/watchdog/sbsa_gwdt.c index 6113dcd077..5ee0e06af5 100644 --- a/hw/watchdog/sbsa_gwdt.c +++ b/hw/watchdog/sbsa_gwdt.c @@ -109,22 +109,18 @@ static void sbsa_gwdt_update_timer(SBSA_GWDTState *s,= WdtRefreshType rtype) return; } =20 - /* - * Extract the upper 16 bits from woru & 32 bits from worl - * registers to construct the 48 bit offset value - */ - timeout =3D s->woru; - timeout <<=3D 32; - timeout |=3D s->worl; - timeout =3D muldiv64(timeout, NANOSECONDS_PER_SECOND, s->freq); - timeout +=3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); - if ((rtype =3D=3D EXPLICIT_REFRESH) || ((rtype =3D=3D TIMEOUT_REFRESH)= && (!(s->wcs & SBSA_GWDT_WCS_WS0)))) { + uint64_t offset =3D (uint64_t)s->woru << 32 | s->worl; + timeout =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + + muldiv64(offset, NANOSECONDS_PER_SECOND, s->freq); + /* store the current timeout value into compare registers */ s->wcvu =3D timeout >> 32; s->wcvl =3D timeout; } + + timeout =3D (uint64_t)s->wcvu << 32 | s->wcvl; timer_mod(s->timer, timeout); } =20 --=20 2.47.3 From nobody Sun Jul 26 12:31:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1782297018; cv=none; d=zohomail.com; s=zohoarc; b=ZquO8uc/8sAhBklDv/8PlnNAdbZF/SrBogv+A9BPXo0Kt39sBEGDFijjDzkmk+qjAxz1bxqlj6UZes+DBnIhyKcT8VHnbU086ZhDccqZmeoXtalGCM/D8r81Timqw5BebH9CnzADc1uwuibGD+ypl41HYeVNT126YYsWHsibcYI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782297018; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=uPHPJEflTJSX9W8Tr7SbmiMKyZuqzu4vD1amQlm5twU=; b=R+uvF0mT00Y0/aN1pxQqJWCv1NtzdkVZpNfS/shES/Rc6Uudcq3IlWiFM3v4SVdrIbnYaeRLuf2m5e4XU1Qr6Xxb3ZNElu/I04VSs8BV42e6Z44Ml+dnrcyFj5BgJSjXXOxSF0DyWkofCgb73PYUEFBUJdVRYIm9c4aSJ1/M/fw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178229701816411.618555025582168; Wed, 24 Jun 2026 03:30:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wcKrG-00076x-GR; Wed, 24 Jun 2026 06:29:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKrD-00075j-SR for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:29:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKrB-0007Gt-JV for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:29:23 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-15-_IXHDuHON72hCXGL3Hvs0w-1; Wed, 24 Jun 2026 06:29:17 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1D2DF19560A5; Wed, 24 Jun 2026 10:29:16 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2FEB430001A7; Wed, 24 Jun 2026 10:29:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1782296960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uPHPJEflTJSX9W8Tr7SbmiMKyZuqzu4vD1amQlm5twU=; b=ehJmFVwHOgsvBkc2QXxgLeR0CiVxHyjBSWyxx3EkvzSP/DtgM1jTS+CfwefRhtvK0gRUN0 J9HVs6LOvNxWMEvX3l6vwZo1nnltL5zrPgeQd7NSw+P232jZpB3OsiA+TC9moKFs/K+vJf iBUx7IaA2jjF9K9rhzo9NHiStCGmCWw= X-MC-Unique: _IXHDuHON72hCXGL3Hvs0w-1 X-Mimecast-MFC-AGG-ID: _IXHDuHON72hCXGL3Hvs0w_1782296956 From: Igor Mammedov To: qemu-devel@nongnu.org Cc: mst@redhat.com, eauger@redhat.com, peter.maydell@linaro.org, shannon.zhaosl@gmail.com, rad@semihalf.com, leif.lindholm@oss.qualcomm.com, qemu-arm@nongnu.org Subject: [PATCH v3 16/17] sbsa-gwdt: reschedule timer on direct WCV load Date: Wed, 24 Jun 2026 12:28:29 +0200 Message-ID: <20260624102830.1355552-17-imammedo@redhat.com> In-Reply-To: <20260624102830.1355552-1-imammedo@redhat.com> References: <20260624102830.1355552-1-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1782297019452158500 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 =3D ( 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=C2=AE Server Base System Architecture 6.0 Platform Design Document DEN0029D 6.0 "A.2 Watchdog Operation" Signed-off-by: Igor Mammedov --- 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 =3D { typedef enum WdtRefreshType { EXPLICIT_REFRESH =3D 0, TIMEOUT_REFRESH =3D 1, + WCV_LOAD =3D 2, } WdtRefreshType; =20 static uint64_t sbsa_gwdt_rread(void *opaque, hwaddr addr, unsigned int si= ze) @@ -167,10 +168,16 @@ static void sbsa_gwdt_write(void *opaque, hwaddr offs= et, uint64_t data, =20 case SBSA_GWDT_WCV: s->wcvl =3D data; + if (s->wcs & SBSA_GWDT_WCS_EN) { + sbsa_gwdt_update_timer(s, WCV_LOAD); + } break; =20 case SBSA_GWDT_WCVU: s->wcvu =3D data; + if (s->wcs & SBSA_GWDT_WCS_EN) { + sbsa_gwdt_update_timer(s, WCV_LOAD); + } break; =20 default: --=20 2.47.3 From nobody Sun Jul 26 12:31:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1782297113; cv=none; d=zohomail.com; s=zohoarc; b=WEvUGHS6/FMiJyEBRiXqSDDyZuDECkgUdPSZRKKY9OlkNyai4yR3Ql5JQsCrKq4srv9HXFFbkpeG0DsrMwBfp9rrhbkZZcbqnQEixiKP+tYyX34/I5J1G7gAUEm8koydJXDVwjpenQkG2trM0JNUpV5ehuvvodtP+7KU948+Vro= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782297113; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=TSn0YlKNIrGhiGyyc7mHGoMTOpJjhPKEHsQv9XyR10o=; b=lUZne9+SYvYUvRkqvdeymFzh5/sglU9l40d1JV9akQCzQ1+iLGqw/jdD7vZdSvWa7KMxseYWeougkKg+8aS6eqX+n+7yRKbbL7PGLbo62gqKCNFbNbYQBGapXEcdwBe9AGj1P+b19yorJQ6uz3POfRdZvx6Jtw1wst2A96zClJs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782297112951701.4385216017321; Wed, 24 Jun 2026 03:31:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wcKrH-000777-IH; Wed, 24 Jun 2026 06:29:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKrF-000762-5A for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:29:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wcKrD-0007HU-Nq for qemu-devel@nongnu.org; Wed, 24 Jun 2026 06:29:24 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-695-YkLKGIjEPMej8ETdxIYnPQ-1; Wed, 24 Jun 2026 06:29:19 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 732491954B35; Wed, 24 Jun 2026 10:29:18 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 72F0030001A7; Wed, 24 Jun 2026 10:29:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1782296963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TSn0YlKNIrGhiGyyc7mHGoMTOpJjhPKEHsQv9XyR10o=; b=DF2juVTjFJyxg56utJbwehng5a87s1/ThKHA3E5K4c56vx9d/M910flAJ6zgFheoUH0NuY IDlhxbXL2chB8VllYlR8hdbQuqm/sw0+yE9a6AplBN8kiSBXhtUCjiC1MAyfXsi0ITJmi8 NH6LdWOZ2TkRt7qZ4/GKgXJ2sDURQ6Q= X-MC-Unique: YkLKGIjEPMej8ETdxIYnPQ-1 X-Mimecast-MFC-AGG-ID: YkLKGIjEPMej8ETdxIYnPQ_1782296958 From: Igor Mammedov To: qemu-devel@nongnu.org Cc: mst@redhat.com, eauger@redhat.com, peter.maydell@linaro.org, shannon.zhaosl@gmail.com, rad@semihalf.com, leif.lindholm@oss.qualcomm.com, qemu-arm@nongnu.org Subject: [PATCH v3 17/17] sbsa-gwdt: limit compare_value to INT64_MAX Date: Wed, 24 Jun 2026 12:28:30 +0200 Message-ID: <20260624102830.1355552-18-imammedo@redhat.com> In-Reply-To: <20260624102830.1355552-1-imammedo@redhat.com> References: <20260624102830.1355552-1-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1782297114124158500 QEMU timer subsystem uses int64_t, so WCV values with bit 63 set overflow and cause the timer to fire immediately. The SBSA spec defines WCV as an unsigned 64-bit compare value, so such values are valid per spec and represent far-future deadlines (however unpractical). Windows in GTDT mode writes WCV in two 32-bit halves while the watchdog is running: sbsa-gwdt_control_write [0x8] <- 0xffffffff # WOR (~4 sec) sbsa-gwdt_control_write [0x0] <- 0x1 # WCS enable sbsa-gwdt_control_write [0x14] <- 0xffffffff # WCVU (intermediate) sbsa-gwdt_control_write [0x10] <- 0xa906ca28 # WCVL sbsa-gwdt_control_write [0x14] <- 0xecb1 # WCVU (final) The intermediate WCVU write (0xffffffff) creates a WCV above INT64_MAX, which overflows QEMU's signed timer and fires immediately =E2=80=94 triggering WS0 =3D> WS1 =3D> reboot before the final WCVU write lands. Clamp WCV to INT64_MAX to avoid timer API overflow. Note: Windows' GTDT watchdog usage is also fragile under virtualization. It programs a short WOR (~4 sec), enables WCS, and relies on a subsequent WCV write to push the deadline far into the future =E2=80=94 never using WRR for explicit refresh. On bare metal the WCS=3D>WCV gap is negligible, but in a VM the vCPU can be preempted between MMIO accesses while the clock keeps ticking, potentially expiring the short WOR timeout before the WCV override lands. Signed-off-by: Igor Mammedov Reviewed-by: Eric Auger --- hw/watchdog/sbsa_gwdt.c | 2 ++ tests/qtest/bios-tables-test.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/watchdog/sbsa_gwdt.c b/hw/watchdog/sbsa_gwdt.c index fb67db9672..ff7adbcb0f 100644 --- a/hw/watchdog/sbsa_gwdt.c +++ b/hw/watchdog/sbsa_gwdt.c @@ -122,6 +122,8 @@ static void sbsa_gwdt_update_timer(SBSA_GWDTState *s, W= dtRefreshType rtype) } =20 timeout =3D (uint64_t)s->wcvu << 32 | s->wcvl; + /* clamp timeout to INT64_MAX to avoid timer overflow */ + timeout &=3D INT64_MAX; timer_mod(s->timer, timeout); } =20 diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 94fc95c8e1..370b0fd2e6 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -2308,7 +2308,7 @@ static void test_acpi_aarch64_virt_tcg_gtdt_wd(void) .scan_len =3D 128ULL * MiB, }; =20 - test_acpi_one("-cpu cortex-a57 " "-device sbsa-gwdt", &data); + test_acpi_one("-cpu cortex-a57 -device sbsa-gwdt", &data); free_test_data(&data); } =20 --=20 2.47.3