Skip to content

x86: q35: add support for WDAT watchdog

Igor Mammedov qemu-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5x86: q35: ich9: add 'wdat' propertyhw/acpi/ich9.c hw/isa/lpc_ich9.c include/hw/acpi/ich9.h+7 -00 replies
2/5acpi: add API to build WDAT instructionshw/acpi/aml-build.c include/hw/acpi/wdat.h+132 -00 replies
3/5x86: q35: generate WDAT ACPI tablehw/acpi/meson.build hw/acpi/wdat-ich9.c hw/acpi/wdat-stub.c +2 more+119 -10 replies
4/5tests: x86: q35: acpi: add WDAT table test casetests/qtest/bios-tables-test-allowed-diff.h tests/qtest/bios-tables-test.c+14 -00 replies
5/5tests: acpi: update expected WDAT blobtests/data/acpi/x86/q35/WDAT.wdat tests/qtest/bios-tables-test-allowed-diff.h+0 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] x86: q35: add support for WDAT watchdog

Windows doesn't ship built-in TCO watchdog driver, and users are forced to install vendor specific driver(s) if such exists. However OS provides a generic watchdog driver that uses ACPI WDAT table [1] to abstract actual hardware behind it.

This series adds an optional WDAT table tailored for TCO watchdog that Q35 already has as part of ICH9 chipset and a knob to enable it. Guest OS support is present since Windows Vista and Linux since 2016[2].

One can test it launching VM with following options:
-watchdog-action reset -global ICH9-LPC.wdat=on
to trace access to TCO registers one can also add to CLI:

    -trace "tco_*"

To verify that guest uses WDAT (both Windows and Linux would use it if present),
* on linux make sure that watchdog service is configured/running and then trigger kernel panic with command:
echo c > /proc/sysrq-trigger
* on Windows kill svchost process, running shell in admin mode:
taskkill /f /im svchost.exe

Tested with WS2025 & RHEL9.6

git tree at: https://gitlab.com/imammedo/qemu/-/commits/wadt_q35_v1

1) http://msdn.microsoft.com/en-us/windows/hardware/gg463320.aspx
2) https://lwn.net/Articles/700524/

PS:
ARM version of this is still work in progress, and probably should be ready by the next merge window. So I'm sending only x86 part of WDAT enablement.

Igor Mammedov (5):
x86: q35: ich9: add 'wdat' property
acpi: add API to build WDAT instructions
x86: q35: generate WDAT ACPI table
tests: x86: q35: acpi: add WDAT table test case
tests: acpi: update expected WDAT blob

 include/hw/acpi/ich9.h            |   1 +
 include/hw/acpi/wdat.h            | 121 ++++++++++++++++++++++++++++++
 hw/acpi/aml-build.c               |  14 ++++
 hw/acpi/ich9.c                    |   5 ++
 hw/acpi/meson.build               |   3 +-
 hw/acpi/wdat-ich9.c               |  85 +++++++++++++++++++++
 hw/acpi/wdat-stub.c               |  16 ++++
 hw/i386/acpi-build.c              |  13 ++++
 hw/isa/lpc_ich9.c                 |   1 +
 tests/data/acpi/x86/q35/WDAT.wdat | Bin 0 -> 308 bytes
 tests/qtest/bios-tables-test.c    |  13 ++++
 11 files changed, 271 insertions(+), 1 deletion(-)
 create mode 100644 include/hw/acpi/wdat.h
 create mode 100644 hw/acpi/wdat-ich9.c
 create mode 100644 hw/acpi/wdat-stub.c
 create mode 100644 tests/data/acpi/x86/q35/WDAT.wdat
Signature · 1 line
2.47.3