From nobody Fri Nov 14 16:55:23 2025 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=1761828015; cv=none; d=zohomail.com; s=zohoarc; b=FL4CADAbJ+otE1vPXf1K385jTfCjJJ/4jvgmc4kgQ0TwVnGc1jEP0jsRvjp+3l5nht5kmcVquQgi5DLP7J5Q4vZTimJc69kDztlhg2A9Ul9I6zqrZsQEHssqiVpE1TMnHV0OIhmwphAnQMPJ6cRNZp5VARJv16+aOqt15ODAeD8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761828015; 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=vo2QpaQ8nvXy8DWiIEvHHrIUdQrToRlPa1cWo0N8OS4=; b=WbMQKp3Q2rOPiGii6/ZS9fwzWGdIVIwNC2PE1x7g7SndDWXSBXSDvOkKL4RKS1yB4H/Y7fzHS90WUhYFolM2VQ9VnZw4ysfg9Tzozj0fVTXNj57u+RMRQb1i5ZiiSxgOshxgezoy2rtpnsOFzjl/go5ahd3stzUFSCi9dvmEjDM= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761828015446243.3742801608522; Thu, 30 Oct 2025 05:40:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vERv2-0000bH-IR; Thu, 30 Oct 2025 08:38:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vERuy-0000Zt-1x for qemu-devel@nongnu.org; Thu, 30 Oct 2025 08:38:16 -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 1vERup-00075B-Vq for qemu-devel@nongnu.org; Thu, 30 Oct 2025 08:38:15 -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-572-sBZcrUzVPj2guVReBYpZrA-1; Thu, 30 Oct 2025 08:37:57 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 D61381805C2C for ; Thu, 30 Oct 2025 12:37: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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 523A3180035A; Thu, 30 Oct 2025 12:37:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761827879; 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=vo2QpaQ8nvXy8DWiIEvHHrIUdQrToRlPa1cWo0N8OS4=; b=RknW0PM9+Jg20ZjDgFtHWCnVeVvlwnq30JfwNU+zt4I10DPbqaQwZWm8gv+pItDDEdGcCh mswwHnW4MrQm6qaMQavvmXy3Prdv10VqpG4kBK07FyYcB91JD/U0xl9aw+NN6+A1IGUBNx d9vzH8z8ZFeibJ1W75mkPR5Lv1r79nQ= X-MC-Unique: sBZcrUzVPj2guVReBYpZrA-1 X-Mimecast-MFC-AGG-ID: sBZcrUzVPj2guVReBYpZrA_1761827877 From: Igor Mammedov To: qemu-devel@nongnu.org Cc: mst@redhat.com, anisinha@redhat.com, berrange@redhat.com, rjones@redhat.com Subject: [PATCH 1/5] x86: q35: ich9: add 'wdat' property Date: Thu, 30 Oct 2025 13:37:46 +0100 Message-ID: <20251030123750.136175-2-imammedo@redhat.com> In-Reply-To: <20251030123750.136175-1-imammedo@redhat.com> References: <20251030123750.136175-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.93 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=lists.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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: 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: 1761828032534158500 it will be used to make QEMU generate WDAT ACPI table, that describes TCO watchdog in platfom independed way and allows guest to use generic 'wdat' driver. To enable it use '-global ICH9-LPC.wdat=3Don' option. PS: On linux wdat driver takes ove TCO watchdog if WDAT table is present, hence 'wdat=3Doff' by default to avoid guest visible change on existing VMs. Signed-off-by: Igor Mammedov --- include/hw/acpi/ich9.h | 1 + hw/acpi/ich9.c | 5 +++++ hw/isa/lpc_ich9.c | 1 + 3 files changed, 7 insertions(+) diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h index 245fe08dc2..c84e17f9f6 100644 --- a/include/hw/acpi/ich9.h +++ b/include/hw/acpi/ich9.h @@ -69,6 +69,7 @@ typedef struct ICH9LPCPMRegs { bool smm_compat; bool enable_tco; TCOIORegs tco_regs; + bool enable_wdat; =20 bool swsmi_timer_enabled; bool periodic_timer_enabled; diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 2b3b493c01..08a01aa1aa 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -321,6 +321,11 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *p= m, qemu_irq sci_irq) acpi_pm_tco_init(&pm->tco_regs, &pm->io); } =20 + if (pm->enable_wdat && !pm->enable_tco) { + error_setg(&error_fatal, + "'wdat' can not be enabled without 'enable_tco=3Don'"); + } + if (pm->acpi_pci_hotplug.use_acpi_hotplug_bridge) { object_property_set_link(OBJECT(lpc_pci), "bus", OBJECT(pci_get_bus(lpc_pci)), &error_abor= t); diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index c9cb8f7779..ce9cf87363 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -832,6 +832,7 @@ static const VMStateDescription vmstate_ich9_lpc =3D { =20 static const Property ich9_lpc_properties[] =3D { DEFINE_PROP_BOOL("noreboot", ICH9LPCState, pin_strap.spkr_hi, false), + DEFINE_PROP_BOOL("wdat", ICH9LPCState, pm.enable_wdat, false), DEFINE_PROP_BOOL("smm-compat", ICH9LPCState, pm.smm_compat, false), DEFINE_PROP_BOOL("smm-enabled", ICH9LPCState, pm.smm_enabled, false), DEFINE_PROP_BIT64("x-smi-broadcast", ICH9LPCState, smi_host_features, --=20 2.47.3 From nobody Fri Nov 14 16:55:23 2025 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=1761827976; cv=none; d=zohomail.com; s=zohoarc; b=UPqL2DxqadHoCk8sjiAYr/dFQXdSE8WCn4MmNjlgtBhFvV3cNf+JtHpR+NyYKgEcLEl5TJZ2EbVYwMFtyCQUwK3S8Ey+Bdmols8nec1KNul9bfJ1H8gj38YHwhjPT1k9fclLy01XrzcFUh0SYYs/mvfyTU2OPD+rGyCBTrjY/PE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761827976; 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=26kU2vb3MKqPLNvZn2/t1QdblvBnJmiF/5ygnfIvDKI=; b=Peh5cHncTofk3ouuGLaO+b87vKX2fh8WwlUGk2okHsCDmXnTMptnjsN4rsqSp7JTfGvKvveL3gqH3M0sDRqRwug1zObTNWE0xwLOEnLQHDhejIrSKMFmXqw8C+tZn9RRhq5TnxMYByvYD0lrU4qptMTLHRhOIq7dbj2uPxP/ILg= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761827976387655.2479975336314; Thu, 30 Oct 2025 05:39:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vERv3-0000be-7U; Thu, 30 Oct 2025 08:38:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vERuz-0000aO-Di for qemu-devel@nongnu.org; Thu, 30 Oct 2025 08:38:17 -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 1vERup-00075I-W3 for qemu-devel@nongnu.org; Thu, 30 Oct 2025 08:38: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-81-Apu05M7sOQOrotGuNC8vQQ-1; Thu, 30 Oct 2025 08:38:00 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 D06B3180AE12 for ; Thu, 30 Oct 2025 12:37: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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 485B718004D8; Thu, 30 Oct 2025 12:37:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761827882; 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=26kU2vb3MKqPLNvZn2/t1QdblvBnJmiF/5ygnfIvDKI=; b=DR+o5Rzknpp3ZWILhXmHYHb8Q/Mjv1MDbBHGL3IzHWNOUWOjBEl9XE1XOMeLA2HUy7ImIK DClDHbfrok/OGRQOQLTAohU+qHELiQxmD7yfMfbAOMHOHZ2gDL/uDmfO16778U6FWrTvd6 XmuoeNzE5y4M9RpaasTrK+fsBjqQ0Uo= X-MC-Unique: Apu05M7sOQOrotGuNC8vQQ-1 X-Mimecast-MFC-AGG-ID: Apu05M7sOQOrotGuNC8vQQ_1761827880 From: Igor Mammedov To: qemu-devel@nongnu.org Cc: mst@redhat.com, anisinha@redhat.com, berrange@redhat.com, rjones@redhat.com Subject: [PATCH 2/5] acpi: add API to build WDAT instructions Date: Thu, 30 Oct 2025 13:37:47 +0100 Message-ID: <20251030123750.136175-3-imammedo@redhat.com> In-Reply-To: <20251030123750.136175-1-imammedo@redhat.com> References: <20251030123750.136175-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.93 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=lists.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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: 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: 1761827988036158500 Add definitions for WDAT[1] actions/instructions and build_append_wdat_ins() API to build table entries. 1) "Hardware Watchdog Timers Design=C2=A0Specification" https://uefi.org/acpi 'Watchdog Action Table (WDAT)' Signed-off-by: Igor Mammedov --- include/hw/acpi/wdat.h | 118 +++++++++++++++++++++++++++++++++++++++++ hw/acpi/aml-build.c | 14 +++++ 2 files changed, 132 insertions(+) create mode 100644 include/hw/acpi/wdat.h diff --git a/include/hw/acpi/wdat.h b/include/hw/acpi/wdat.h new file mode 100644 index 0000000000..c539e97e9b --- /dev/null +++ b/include/hw/acpi/wdat.h @@ -0,0 +1,118 @@ +/* + * Watchdog Action Table (WDAT) definitions + * + * Copyright Red Hat, Inc. 2025 + * Author(s): Igor Mammedov + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#ifndef QEMU_HW_ACPI_WDAT_H +#define QEMU_HW_ACPI_WDAT_H + +#include "hw/acpi/acpi-defs.h" + +/* + * Watchdog actions as described in + * "Hardware Watchdog Timers Design=C2=A0Specification" + * for link to spec see https://uefi.org/acpi + * 'Watchdog Action Table (WDAT)' + */ +typedef enum { + /* + * Restarts the watchdog timer's countdown. This action is + * required. + */ + WDAT_ACTION_RESET =3D 0x1, + /* + * Returns the current countdown value of the watchdog hardware + * (in count intervals). + */ + WDAT_ACTION_QUERY_CURRENT_COUNTDOWN_PERIOD =3D 0x4, + /* + * Returns the countdown value the watchdog hardware is + * configured to use when reset (in count intervals). + */ + WDAT_ACTION_QUERY_COUNTDOWN_PERIOD =3D 0x5, + /* + * Sets the countdown value (in count intervals) to be used when + * the watchdog timer is reset. This action is required if + * WDAT_ACTION_RESET does not explicitly write a new + * countdown value to a register during a reset. Otherwise, this + * action is optional. + */ + WDAT_ACTION_SET_COUNTDOWN_PERIOD =3D 0x6, + /* + * Determines if the watchdog hardware is currently in enabled/ + * running state. The same result must occur when performed from + * both from enabled/stopped state and enabled/running state. If + * the watchdog hardware is disabled, results are indeterminate. + * This action is required. + */ + WDAT_ACTION_QUERY_RUNNING_STATE =3D 0x8, + /* + * Starts the watchdog, if not already in running state. If the + * watchdog hardware is disabled, results are indeterminate. + * This action is required. + */ + WDAT_ACTION_SET_RUNNING_STATE =3D 0x9, + /* + * Determines if the watchdog hardware is currently in enabled/ + * stopped state. The same result must occur when performed from + * both the enabled/stopped state and enabled/running state. If + * the watchdog hardware is disabled, results are indeterminate. + * This action is required. + */ + WDAT_ACTION_QUERY_STOPPED_STATE =3D 0xA, + /* + * Stops the watchdog, if not already in stopped state. If the + * watchdog hardware is disabled, results are indeterminate. + * This action is required. + */ + WDAT_ACTION_SET_STOPPED_STATE =3D 0xB, + /* + * Determines if the watchdog hardware is configured to perform a + * reboot when the watchdog is fired. + */ + WDAT_ACTION_QUERY_REBOOT =3D 0x10, + /* + * Configures the watchdog hardware to perform a reboot when it + * is fired. + */ + WDAT_ACTION_SET_REBOOT =3D 0x11, + /* + * Determines if the watchdog hardware is configured to perform a + * system shutdown when fired. + */ + WDAT_ACTION_QUERY_SHUTDOWN =3D 0x12, + /* + * Configures the watchdog hardware to perform a system shutdown + * when fired. + */ + WDAT_ACTION_SET_SHUTDOWN =3D 0x13, + /* + * Determines if the current boot was caused by the watchdog + * firing. The boot status is required to be set if the watchdog + * fired and caused a reboot. It is recommended that the + * Watchdog Status be set if the watchdog fired and caused a + * shutdown. This action is required. + */ + WDAT_ACTION_QUERY_WATCHDOG_STATUS =3D 0x20, + /* + * Sets the watchdog's boot status to the default value. This + * action is required. + */ + WDAT_ACTION_SET_WATCHDOG_STATUS =3D 0x21, +} WDATAction; + +#define WDAT_INS_READ_VALUE 0x0 +#define WDAT_INS_READ_COUNTDOWN 0x1 +#define WDAT_INS_WRITE_VALUE 0x2 +#define WDAT_INS_WRITE_COUNTDOWN 0x3 +#define WDAT_INS_PRESERVE_REGISTER 0x80 + +void build_append_wdat_ins(GArray *table_data, + WDATAction action, uint8_t flags, + struct AcpiGenericAddress as, + uint32_t val, uint32_t mask); + +#endif /* QEMU_HW_ACPI_WDAT_H */ diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 2d5826a8f1..acc655df6f 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -31,6 +31,7 @@ #include "hw/pci/pci_bus.h" #include "hw/pci/pci_bridge.h" #include "qemu/cutils.h" +#include "hw/acpi/wdat.h" =20 static GArray *build_alloc_array(void) { @@ -2639,3 +2640,16 @@ Aml *aml_error_device(void) =20 return dev; } + +void build_append_wdat_ins(GArray *table_data, + WDATAction action, uint8_t flags, + struct AcpiGenericAddress as, + uint32_t val, uint32_t mask) +{ + build_append_int_noprefix(table_data, action, 1); /* Watchdog Actio= n */ + build_append_int_noprefix(table_data, flags, 1); /* Instruction Fl= ags */ + build_append_int_noprefix(table_data, 0, 2); /* Reserved */ + build_append_gas_from_struct(table_data, &as); /* Register Regio= n */ + build_append_int_noprefix(table_data, val, 4); /* Value */ + build_append_int_noprefix(table_data, mask, 4); /* Mask */ +} --=20 2.47.3 From nobody Fri Nov 14 16:55:23 2025 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=1761827970; cv=none; d=zohomail.com; s=zohoarc; b=jJWeAMFSnKXJ4jd8D0SLwXit8+JSjlAPfSYNRxOLjI/2TAZ7LROKgNGvu36x+2cqUUWfEsRngUlbijZhXFwa2RuiYjIVjLSxsebYEOBkqmmaWFokAc0j4PXaK9PBMC6JFayfhZpRcgadHDB0lUQwWdzw9ez/k9uJUE4ULY8T5u8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761827970; 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=VAHVVTSyx5Xxrd9+qsV63pT0QmdiWt4y9ARsLPf+/nY=; b=iTczW0AE6c6Vn/FpONzfGSTzNwY4IWK4wLMqMwEOxas9+0rvlw0UyReML/GQHjdTi0wTRXFRW9M6zJSJSIoHd8xmnTwsass8YHbTwLdbdktw0LdzPCy/YnMhO7H+BVyFnRPobVfLnouahIu/xS7+qRxmWvxeJspcU5s6UelUWgs= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761827970692738.0420136531051; Thu, 30 Oct 2025 05:39:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vERv5-0000c9-T9; Thu, 30 Oct 2025 08:38:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vERv0-0000aZ-Ax for qemu-devel@nongnu.org; Thu, 30 Oct 2025 08:38:18 -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 1vERup-00075Q-MB for qemu-devel@nongnu.org; Thu, 30 Oct 2025 08:38: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-527-32n98en7Op-FuE5mE2AxzQ-1; Thu, 30 Oct 2025 08:38:03 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 F3E741954B0D for ; Thu, 30 Oct 2025 12:38: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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 415491800581; Thu, 30 Oct 2025 12:38:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761827885; 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=VAHVVTSyx5Xxrd9+qsV63pT0QmdiWt4y9ARsLPf+/nY=; b=Pn5ykeAhuFNg1ohad/61SH0wvkmGkY3Ul5ZBXgtDigw7d/4BzkLKHLP58bQYgS4iAoyF4o BI93gDoDlaa87TISrW/YMq5E73JFbKlPEAKHzZYIv+PBr+I3v95ufx0lEjhYSLt2rrOwIc Yw53kLInmu+Mk7kPB1ny7WiCtn/aWhY= X-MC-Unique: 32n98en7Op-FuE5mE2AxzQ-1 X-Mimecast-MFC-AGG-ID: 32n98en7Op-FuE5mE2AxzQ_1761827882 From: Igor Mammedov To: qemu-devel@nongnu.org Cc: mst@redhat.com, anisinha@redhat.com, berrange@redhat.com, rjones@redhat.com Subject: [PATCH 3/5] x86: q35: generate WDAT ACPI table Date: Thu, 30 Oct 2025 13:37:48 +0100 Message-ID: <20251030123750.136175-4-imammedo@redhat.com> In-Reply-To: <20251030123750.136175-1-imammedo@redhat.com> References: <20251030123750.136175-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.93 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=lists.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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: 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: 1761827994145158500 It will generate WDAT table [1] customized for TCO watchdog. This allows Windows guests (Windows Server 2008/Vista) to use TCO watchdog using built-in generic driver, which aleviates need to install vendor specific drivers. Given that enabling it might change guest behaviour (both Windows/Linux) the feature is disabled by default. Users that need it can enable the feature with following CLI option. -global 'ICH9-LPC.wdat=3Don' 1) "Hardware Watchdog Timers Design=C2=A0Specification" https://uefi.org/acpi 'Watchdog Action Table (WDAT)' Signed-off-by: Igor Mammedov --- include/hw/acpi/wdat.h | 3 ++ hw/acpi/meson.build | 3 +- hw/acpi/wdat-ich9.c | 85 ++++++++++++++++++++++++++++++++++++++++++ hw/acpi/wdat-stub.c | 16 ++++++++ hw/i386/acpi-build.c | 13 +++++++ 5 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 hw/acpi/wdat-ich9.c create mode 100644 hw/acpi/wdat-stub.c diff --git a/include/hw/acpi/wdat.h b/include/hw/acpi/wdat.h index c539e97e9b..67b9136d8c 100644 --- a/include/hw/acpi/wdat.h +++ b/include/hw/acpi/wdat.h @@ -115,4 +115,7 @@ void build_append_wdat_ins(GArray *table_data, struct AcpiGenericAddress as, uint32_t val, uint32_t mask); =20 +void build_wdat(GArray *table_data, BIOSLinker *linker, const char *oem_id, + const char *oem_table_id, uint64_t tco_base); + #endif /* QEMU_HW_ACPI_WDAT_H */ diff --git a/hw/acpi/meson.build b/hw/acpi/meson.build index 56b5d1ec96..fb4304f21c 100644 --- a/hw/acpi/meson.build +++ b/hw/acpi/meson.build @@ -24,7 +24,7 @@ acpi_ss.add(when: 'CONFIG_ACPI_PCI_BRIDGE', if_true: file= s('pci-bridge.c')) acpi_ss.add(when: 'CONFIG_ACPI_PCIHP', if_true: files('pcihp.c')) acpi_ss.add(when: 'CONFIG_ACPI_PCIHP', if_false: files('acpi-pci-hotplug-s= tub.c')) acpi_ss.add(when: 'CONFIG_ACPI_VIOT', if_true: files('viot.c')) -acpi_ss.add(when: 'CONFIG_ACPI_ICH9', if_true: files('ich9.c', 'ich9_tco.c= ', 'ich9_timer.c')) +acpi_ss.add(when: 'CONFIG_ACPI_ICH9', if_true: files('ich9.c', 'ich9_tco.c= ', 'ich9_timer.c', 'wdat-ich9.c')) acpi_ss.add(when: 'CONFIG_ACPI_ERST', if_true: files('erst.c')) acpi_ss.add(when: 'CONFIG_IPMI', if_true: files('ipmi.c'), if_false: files= ('ipmi-stub.c')) acpi_ss.add(when: 'CONFIG_PC', if_false: files('acpi-x86-stub.c')) @@ -33,6 +33,7 @@ if have_tpm endif system_ss.add(when: 'CONFIG_ACPI', if_false: files('acpi-stub.c', 'aml-bui= ld-stub.c', 'ghes-stub.c', 'acpi_interface.c')) system_ss.add(when: 'CONFIG_ACPI_PCI_BRIDGE', if_false: files('pci-bridge-= stub.c')) +system_ss.add(when: 'CONFIG_ACPI_ICH9', if_false: files('wdat-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')) system_ss.add(when: 'CONFIG_GHES_CPER', if_false: files('ghes_cper_stub.c'= )) diff --git a/hw/acpi/wdat-ich9.c b/hw/acpi/wdat-ich9.c new file mode 100644 index 0000000000..c32ecf922c --- /dev/null +++ b/hw/acpi/wdat-ich9.c @@ -0,0 +1,85 @@ +/* + * TCO Watchdog Action Table (WDAT) + * + * Copyright Red Hat, Inc. 2025 + * 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.h" +#include "hw/southbridge/ich9.h" + +#define TCO_REG(base, reg_offset, reg_width) { .space_id =3D AML_AS_SYSTEM= _IO, \ + .address =3D base + reg_offset, .bit_width =3D reg_width, \ + .access_width =3D AML_WORD_ACC, }; + +/* + * "Hardware Watchdog Timers Design=C2=A0Specification" + * https://uefi.org/acpi 'Watchdog Action Table (WDAT)' + */ +void build_wdat(GArray *table_data, BIOSLinker *linker, const char *oem_id, + const char *oem_table_id, uint64_t tco_base) +{ + AcpiTable table =3D { .sig =3D "WDAT", .rev =3D 1, .oem_id =3D oem_id, + .oem_table_id =3D oem_table_id }; + struct AcpiGenericAddress tco_rld =3D TCO_REG(tco_base, 0x0, 16); + struct AcpiGenericAddress tco2_sts =3D TCO_REG(tco_base, 0x6, 16); + struct AcpiGenericAddress tco1_cnt =3D TCO_REG(tco_base, 0x8, 16); + struct AcpiGenericAddress tco_tmr =3D TCO_REG(tco_base, 0x12, 16); + + acpi_table_begin(&table, table_data); + build_append_int_noprefix(table_data, 0x20, 4); /* Watchdog Header Len= gth */ + 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 */ + build_append_int_noprefix(table_data, 0x258, 4);/* Timer Period, ms */ + build_append_int_noprefix(table_data, 0x3ff, 4);/* Maximum Count */ + build_append_int_noprefix(table_data, 0x4, 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, 10, 4); + /* Action table */ + build_append_wdat_ins(table_data, WDAT_ACTION_RESET, + WDAT_INS_WRITE_VALUE, + tco_rld, 0x1, 0x1ff); + build_append_wdat_ins(table_data, WDAT_ACTION_QUERY_RUNNING_STATE, + WDAT_INS_READ_VALUE, + tco1_cnt, 0x0, 0x800); + build_append_wdat_ins(table_data, WDAT_ACTION_SET_RUNNING_STATE, + WDAT_INS_WRITE_VALUE | WDAT_INS_PRESERVE_REGISTER, + tco1_cnt, 0, 0x800); + build_append_wdat_ins(table_data, WDAT_ACTION_QUERY_STOPPED_STATE, + WDAT_INS_READ_VALUE, + tco1_cnt, 0x800, 0x800); + build_append_wdat_ins(table_data, WDAT_ACTION_SET_STOPPED_STATE, + WDAT_INS_WRITE_VALUE | WDAT_INS_PRESERVE_REGISTER, + tco1_cnt, 0x800, 0x800); + build_append_wdat_ins(table_data, WDAT_ACTION_SET_COUNTDOWN_PERIOD, + WDAT_INS_WRITE_COUNTDOWN, + tco_tmr, 0x0, 0x3FF); + build_append_wdat_ins(table_data, WDAT_ACTION_QUERY_COUNTDOWN_PERIOD, + WDAT_INS_READ_COUNTDOWN, + tco_tmr, 0x0, 0x3FF); + build_append_wdat_ins(table_data, WDAT_ACTION_QUERY_WATCHDOG_STATUS, + WDAT_INS_READ_VALUE, + tco2_sts, 0x2, 0x2); + build_append_wdat_ins(table_data, WDAT_ACTION_SET_WATCHDOG_STATUS, + WDAT_INS_WRITE_VALUE | WDAT_INS_PRESERVE_REGISTER, + tco2_sts, 0x2, 0x2); + build_append_wdat_ins(table_data, WDAT_ACTION_SET_WATCHDOG_STATUS, + WDAT_INS_WRITE_VALUE | WDAT_INS_PRESERVE_REGISTER, + tco2_sts, 0x4, 0x4); + + acpi_table_end(linker, &table); +} diff --git a/hw/acpi/wdat-stub.c b/hw/acpi/wdat-stub.c new file mode 100644 index 0000000000..a9b57a047b --- /dev/null +++ b/hw/acpi/wdat-stub.c @@ -0,0 +1,16 @@ +/* + * Copyright Red Hat, Inc. 2025 + * 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.h" + +void build_wdat(GArray *table_data, BIOSLinker *linker, const char *oem_id, + const char *oem_table_id, uint64_t tco_base) +{ + g_assert_not_reached(); +} diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 9446a9f862..ac420eab81 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -77,6 +77,7 @@ =20 #include "hw/acpi/hmat.h" #include "hw/acpi/viot.h" +#include "hw/acpi/wdat.h" =20 #include CONFIG_DEVICES =20 @@ -104,11 +105,13 @@ typedef struct AcpiPmInfo { bool smi_on_cpuhp; bool smi_on_cpu_unplug; bool pcihp_root_en; + bool wdat_enabled; uint8_t s4_val; AcpiFadtData fadt; uint16_t cpu_hp_io_base; uint16_t pcihp_io_base; uint16_t pcihp_io_len; + uint64_t tco_io_base; } AcpiPmInfo; =20 typedef struct AcpiMiscInfo { @@ -203,6 +206,7 @@ static void acpi_get_pm_info(MachineState *machine, Acp= iPmInfo *pm) pm->pcihp_io_len =3D 0; pm->smi_on_cpuhp =3D false; pm->smi_on_cpu_unplug =3D false; + pm->wdat_enabled =3D false; =20 assert(obj); init_common_fadt_data(machine, obj, &pm->fadt); @@ -224,6 +228,9 @@ static void acpi_get_pm_info(MachineState *machine, Acp= iPmInfo *pm) !!(smi_features & BIT_ULL(ICH9_LPC_SMI_F_CPU_HOTPLUG_BIT)); pm->smi_on_cpu_unplug =3D !!(smi_features & BIT_ULL(ICH9_LPC_SMI_F_CPU_HOT_UNPLUG_BIT)); + pm->wdat_enabled =3D object_property_get_bool(obj, "wdat", NULL); + pm->tco_io_base =3D object_property_get_uint(obj, ACPI_PM_PROP_PM_= IO_BASE, + NULL) + ICH9_PMIO_TCO_RLD; } pm->pcihp_io_base =3D object_property_get_uint(obj, ACPI_PCIHP_IO_BASE_PROP, NULL); @@ -2079,6 +2086,12 @@ void acpi_build(AcpiBuildTables *tables, MachineStat= e *machine) acpi_add_table(table_offsets, tables_blob); build_waet(tables_blob, tables->linker, x86ms->oem_id, x86ms->oem_tabl= e_id); =20 + if (pm.wdat_enabled =3D=3D true) { + acpi_add_table(table_offsets, tables_blob); + build_wdat(tables_blob, tables->linker, x86ms->oem_id, + x86ms->oem_table_id, pm.tco_io_base); + } + /* Add tables supplied by user (if any) */ for (u =3D acpi_table_first(); u; u =3D acpi_table_next(u)) { unsigned len =3D acpi_table_len(u); --=20 2.47.3 From nobody Fri Nov 14 16:55:23 2025 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=1761827976; cv=none; d=zohomail.com; s=zohoarc; b=KK894a1FJ+c2192FKFmexJElZIMpEmHjmd7gCdyu/Htn3qKqBKnda3yfnz9IrOIm5aCiBxpEnmU1wijhIFoWKBY2rsmmH4I+mrTrtELAlsjJ2bZmsbtP9IpbgAHlAAnIDlwCeJFUTDxhRGPs7V5nY6jXU61vxMoWkKVW5STFJD8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761827976; 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=MLiGcTbSHKA43eTPCAHyp0JChYQd+RA4tqTH0tfSlD8=; b=m/H7ZUTfoorxmr1h7xbiJOgVIE6A7l2LSvW80tIQYi8Li6ZomyCHWsirj4j5Z33uuk7uYHwu7fxEfjGVtVMAB00tmHKVa1m/RO3Q/3GO2SzqbCZalwaPBMctl40Pe3TFrT16q8rFMUMELTn0FBT+iR3sjEavVDVDxOlfHK3Ei2Y= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761827976083222.25511844567393; Thu, 30 Oct 2025 05:39:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vERv7-0000cW-C6; Thu, 30 Oct 2025 08:38:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vERv4-0000cA-Vg for qemu-devel@nongnu.org; Thu, 30 Oct 2025 08:38:23 -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 1vERuy-00075b-Cb for qemu-devel@nongnu.org; Thu, 30 Oct 2025 08:38:22 -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-154-28mS63YAMD6OMqX5XS8TEw-1; Thu, 30 Oct 2025 08:38:05 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 480EC1805C34 for ; Thu, 30 Oct 2025 12:38:04 +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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9275D1800581; Thu, 30 Oct 2025 12:38:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761827888; 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=MLiGcTbSHKA43eTPCAHyp0JChYQd+RA4tqTH0tfSlD8=; b=QYGUbzLW5VNpI2OI80+yIKgT0DCCuRVkaHfPP0wetEZwMIrB66bMwHzKmRoziVy4oe/hki ORLlJ5bSkM44oc90wBSGliSKOoBj/8RmhMcTH1Pan9FMVWWLbhDMebv9hNPDLq5+VPuv3G iFoAgkIQkWJd9tXPou1nDOVNthx0Mjw= X-MC-Unique: 28mS63YAMD6OMqX5XS8TEw-1 X-Mimecast-MFC-AGG-ID: 28mS63YAMD6OMqX5XS8TEw_1761827884 From: Igor Mammedov To: qemu-devel@nongnu.org Cc: mst@redhat.com, anisinha@redhat.com, berrange@redhat.com, rjones@redhat.com Subject: [PATCH 4/5] tests: x86: q35: acpi: add WDAT table test case Date: Thu, 30 Oct 2025 13:37:49 +0100 Message-ID: <20251030123750.136175-5-imammedo@redhat.com> In-Reply-To: <20251030123750.136175-1-imammedo@redhat.com> References: <20251030123750.136175-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.93 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=lists.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_VALIDITY_SAFE_BLOCKED=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: 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: 1761827978464154100 Signed-off-by: Igor Mammedov --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + tests/qtest/bios-tables-test.c | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index dfb8523c8b..14b680debe 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/x86/q35/WDAT.wdat", diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 6b892ef23e..34d50ab36c 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -2510,6 +2510,18 @@ static void test_acpi_isapc_smbios_legacy(void) free_test_data(&data); } =20 +static void test_acpi_q35_wdat(void) +{ + test_data data =3D { + .machine =3D MACHINE_Q35, + .arch =3D "x86", + .variant =3D ".wdat", + }; + + test_acpi_one("-global ICH9-LPC.wdat=3Don", &data); + free_test_data(&data); +} + static void test_oem_fields(test_data *data) { int i; @@ -2804,6 +2816,7 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/q35/cxl", test_acpi_q35_cxl); #endif qtest_add_func("acpi/q35/slic", test_acpi_q35_slic); + qtest_add_func("acpi/q35/wdat", test_acpi_q35_wdat); } if (qtest_has_machine("microvm")) { qtest_add_func("acpi/microvm", test_acpi_microvm_tcg); --=20 2.47.3 From nobody Fri Nov 14 16:55:23 2025 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=1761827980; cv=none; d=zohomail.com; s=zohoarc; b=dOSu/rMiJDJ+g1XU6U7QkxIwynaEnN6JrKkui00ihwn6FVsiSkRHZWS0O0QXhxNTMYUSN7DqHet7u6MRmJlWiPKffqbzbwRVpB8kqEq2DQf0JPGwTDuzKZVH9aWIJ49mVjkUUjEFnWKeT8yKvFFfrV/faihHZA+yBa4YtXWtsB8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761827980; 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=8Su57o+lAn2Wjjm4dysXDHFWqL9w8329LPRsr/DbXGI=; b=N6IPGqg3AWa/LP4+i92KzsJwNBvzVjMZUOihSYPudGvKE1FBbCbqTVQskg8byYVs5eZADg/sU/wJ9lcRoR7hyy5pAtBxwwSiDLJvE+X+Wy1gbc2vLOae2xP8/v84EGtL7PQ7J61J7HGWXNvXbATeNunCLOjWi3MuusnIf1K+wPU= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761827980239138.83883164387942; Thu, 30 Oct 2025 05:39:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vERvA-0000dm-6N; Thu, 30 Oct 2025 08:38:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vERv7-0000cu-6W for qemu-devel@nongnu.org; Thu, 30 Oct 2025 08:38:25 -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 1vERuw-00075a-Ck for qemu-devel@nongnu.org; Thu, 30 Oct 2025 08:38:24 -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-578-L8SF7-cQPdmc8TmS9Cq_gQ-1; Thu, 30 Oct 2025 08:38:07 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 72D761955EA6 for ; Thu, 30 Oct 2025 12:38: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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AE95618004D8; Thu, 30 Oct 2025 12:38:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761827888; 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=8Su57o+lAn2Wjjm4dysXDHFWqL9w8329LPRsr/DbXGI=; b=MLcR7naokW3rJVwL34LZMyuYur9ddZLhQ3emPke/l5gfDw43F6jSQ7N6FeYJHm/qgKbcIl rgwZ1HDCsirHcr0+kf12nMRC0rhwTJPtYD3U69gHe6b9RW+l70k04T38aOmwGRIztcNp8u eUJLLdAqBAl3QuuJvAXaotcXgiQcXx0= X-MC-Unique: L8SF7-cQPdmc8TmS9Cq_gQ-1 X-Mimecast-MFC-AGG-ID: L8SF7-cQPdmc8TmS9Cq_gQ_1761827886 From: Igor Mammedov To: qemu-devel@nongnu.org Cc: mst@redhat.com, anisinha@redhat.com, berrange@redhat.com, rjones@redhat.com Subject: [PATCH 5/5] tests: acpi: update expected WDAT blob Date: Thu, 30 Oct 2025 13:37:50 +0100 Message-ID: <20251030123750.136175-6-imammedo@redhat.com> In-Reply-To: <20251030123750.136175-1-imammedo@redhat.com> References: <20251030123750.136175-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.93 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=lists.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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: 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: 1761827982647154100 replace blank table with a new one: +[000h 0000 4] Signature : "WDAT" [Watchdog Action = Table] +[004h 0004 4] Table Length : 00000134 +[008h 0008 1] Revision : 01 +[009h 0009 1] Checksum : 31 +[00Ah 0010 6] Oem ID : "BOCHS " +[010h 0016 8] Oem Table ID : "BXPC " +[018h 0024 4] Oem Revision : 00000001 +[01Ch 0028 4] Asl Compiler ID : "BXPC" +[020h 0032 4] Asl Compiler Revision : 00000001 + +[024h 0036 4] Header Length : 00000020 +[028h 0040 2] PCI Segment : 00FF +[02Ah 0042 1] PCI Bus : FF +[02Bh 0043 1] PCI Device : FF +[02Ch 0044 1] PCI Function : FF +[02Dh 0045 3] Reserved : 000000 +[030h 0048 4] Timer Period : 00000258 +[034h 0052 4] Max Count : 000003FF +[038h 0056 4] Min Count : 00000004 +[03Ch 0060 1] Flags (decoded below) : 81 + Enabled : 1 + Stopped When Asleep : 1 +[03Dh 0061 3] Reserved : 000000 +[040h 0064 4] Watchdog Entry Count : 0000000A + +[044h 0068 1] Watchdog Action : 01 +[045h 0069 1] Instruction : 02 +[046h 0070 2] Reserved : 0000 + +[048h 0072 12] Register Region : [Generic Address Structure] +[048h 0072 1] Space ID : 01 [SystemIO] +[049h 0073 1] Bit Width : 10 +[04Ah 0074 1] Bit Offset : 00 +[04Bh 0075 1] Encoded Access Width : 02 [Word Access:16] +[04Ch 0076 8] Address : 0000000000000660 + +[054h 0084 4] Value : 00000001 +[058h 0088 4] Register Mask : 000001FF + +[05Ch 0092 1] Watchdog Action : 08 +[05Dh 0093 1] Instruction : 00 +[05Eh 0094 2] Reserved : 0000 + +[060h 0096 12] Register Region : [Generic Address Structure] +[060h 0096 1] Space ID : 01 [SystemIO] +[061h 0097 1] Bit Width : 10 +[062h 0098 1] Bit Offset : 00 +[063h 0099 1] Encoded Access Width : 02 [Word Access:16] +[064h 0100 8] Address : 0000000000000668 + +[06Ch 0108 4] Value : 00000000 +[070h 0112 4] Register Mask : 00000800 + +[074h 0116 1] Watchdog Action : 09 +[075h 0117 1] Instruction : 82 +[076h 0118 2] Reserved : 0000 + +[078h 0120 12] Register Region : [Generic Address Structure] +[078h 0120 1] Space ID : 01 [SystemIO] +[079h 0121 1] Bit Width : 10 +[07Ah 0122 1] Bit Offset : 00 +[07Bh 0123 1] Encoded Access Width : 02 [Word Access:16] +[07Ch 0124 8] Address : 0000000000000668 + +[084h 0132 4] Value : 00000000 +[088h 0136 4] Register Mask : 00000800 + +[08Ch 0140 1] Watchdog Action : 0A +[08Dh 0141 1] Instruction : 00 +[08Eh 0142 2] Reserved : 0000 + +[090h 0144 12] Register Region : [Generic Address Structure] +[090h 0144 1] Space ID : 01 [SystemIO] +[091h 0145 1] Bit Width : 10 +[092h 0146 1] Bit Offset : 00 +[093h 0147 1] Encoded Access Width : 02 [Word Access:16] +[094h 0148 8] Address : 0000000000000668 + +[09Ch 0156 4] Value : 00000800 +[0A0h 0160 4] Register Mask : 00000800 + +[0A4h 0164 1] Watchdog Action : 0B +[0A5h 0165 1] Instruction : 82 +[0A6h 0166 2] Reserved : 0000 + +[0A8h 0168 12] Register Region : [Generic Address Structure] +[0A8h 0168 1] Space ID : 01 [SystemIO] +[0A9h 0169 1] Bit Width : 10 +[0AAh 0170 1] Bit Offset : 00 +[0ABh 0171 1] Encoded Access Width : 02 [Word Access:16] +[0ACh 0172 8] Address : 0000000000000668 + +[0B4h 0180 4] Value : 00000800 +[0B8h 0184 4] Register Mask : 00000800 + +[0BCh 0188 1] Watchdog Action : 06 +[0BDh 0189 1] Instruction : 03 +[0BEh 0190 2] Reserved : 0000 + +[0C0h 0192 12] Register Region : [Generic Address Structure] +[0C0h 0192 1] Space ID : 01 [SystemIO] +[0C1h 0193 1] Bit Width : 10 +[0C2h 0194 1] Bit Offset : 00 +[0C3h 0195 1] Encoded Access Width : 02 [Word Access:16] +[0C4h 0196 8] Address : 0000000000000672 + +[0CCh 0204 4] Value : 00000000 +[0D0h 0208 4] Register Mask : 000003FF + +[0D4h 0212 1] Watchdog Action : 05 +[0D5h 0213 1] Instruction : 01 +[0D6h 0214 2] Reserved : 0000 + +[0D8h 0216 12] Register Region : [Generic Address Structure] +[0D8h 0216 1] Space ID : 01 [SystemIO] +[0D9h 0217 1] Bit Width : 10 +[0DAh 0218 1] Bit Offset : 00 +[0DBh 0219 1] Encoded Access Width : 02 [Word Access:16] +[0DCh 0220 8] Address : 0000000000000672 + +[0E4h 0228 4] Value : 00000000 +[0E8h 0232 4] Register Mask : 000003FF + +[0ECh 0236 1] Watchdog Action : 20 +[0EDh 0237 1] Instruction : 00 +[0EEh 0238 2] Reserved : 0000 + +[0F0h 0240 12] Register Region : [Generic Address Structure] +[0F0h 0240 1] Space ID : 01 [SystemIO] +[0F1h 0241 1] Bit Width : 10 +[0F2h 0242 1] Bit Offset : 00 +[0F3h 0243 1] Encoded Access Width : 02 [Word Access:16] +[0F4h 0244 8] Address : 0000000000000666 + +[0FCh 0252 4] Value : 00000002 +[100h 0256 4] Register Mask : 00000002 + +[104h 0260 1] Watchdog Action : 21 +[105h 0261 1] Instruction : 82 +[106h 0262 2] Reserved : 0000 + +[108h 0264 12] Register Region : [Generic Address Structure] +[108h 0264 1] Space ID : 01 [SystemIO] +[109h 0265 1] Bit Width : 10 +[10Ah 0266 1] Bit Offset : 00 +[10Bh 0267 1] Encoded Access Width : 02 [Word Access:16] +[10Ch 0268 8] Address : 0000000000000666 + +[114h 0276 4] Value : 00000002 +[118h 0280 4] Register Mask : 00000002 + +[11Ch 0284 1] Watchdog Action : 21 +[11Dh 0285 1] Instruction : 82 +[11Eh 0286 2] Reserved : 0000 + +[120h 0288 12] Register Region : [Generic Address Structure] +[120h 0288 1] Space ID : 01 [SystemIO] +[121h 0289 1] Bit Width : 10 +[122h 0290 1] Bit Offset : 00 +[123h 0291 1] Encoded Access Width : 02 [Word Access:16] +[124h 0292 8] Address : 0000000000000666 + +[12Ch 0300 4] Value : 00000004 +[130h 0304 4] Register Mask : 00000004 Signed-off-by: Igor Mammedov --- tests/qtest/bios-tables-test-allowed-diff.h | 1 - tests/data/acpi/x86/q35/WDAT.wdat | Bin 0 -> 308 bytes 2 files changed, 1 deletion(-) create mode 100644 tests/data/acpi/x86/q35/WDAT.wdat diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index 14b680debe..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/x86/q35/WDAT.wdat", diff --git a/tests/data/acpi/x86/q35/WDAT.wdat b/tests/data/acpi/x86/q35/WD= AT.wdat new file mode 100644 index 0000000000000000000000000000000000000000..e1e056b390e51c49f11f7b0d35e= 4e7c55d8067b1 GIT binary patch literal 308 zcmWG{aSSnGWME)4bnu~w7?=3D{+fE*AXi2nl#4iFnCo&gmH$$