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

-- 
2.47.3


Reply via email to