qemu/hw
Daniel P. Berrangé a6b6414f0c hw/isa: enable TCO watchdog reboot pin strap by default
The TCO watchdog implementation default behaviour from POV of the
guest OS relies on the initial values for two I/O ports:

  * TCO1_CNT == 0x0

    Since bit 11 (TCO Timer Halt) is clear, the watchdog state
    is considered to be initially running

  * GCS == 0x20

    Since bit 5 (No Reboot) is set, the watchdog will not trigger
    when the timer expires

This is a safe default, because the No Reboot bit will prevent the
watchdog from triggering if the guest OS is unaware of its existance,
or is slow in configuring it. When a Linux guest initializes the TCO
watchdog, it will attempt to clear the "No Reboot" flag, and read the
value back. If the clear was honoured, the driver will treat this as
an indicator that the watchdog is functional and create the guest
watchdog device.

QEMU implements a second "no reboot" flag, however, via pin straps
which overrides the behaviour of the guest controlled "no reboot"
flag:

  commit 5add35bec1
  Author: Paulo Alcantara <pcacjr@gmail.com>
  Date:   Sun Jun 28 14:58:58 2015 -0300

    ich9: implement strap SPKR pin logic

This second 'noreboot' pin was defaulted to high, which also inhibits
triggering of the requested watchdog actions, unless QEMU is launched
with the magic flag "-global ICH9-LPC.noreboot=false".

This is a bad default as we are exposing a watchdog to every guest OS
using the q35 machine type, but preventing it from actually doing what
it is designed to do. What is worse is that the guest OS and its apps
have no way to know that the watchdog is never going to fire, due to
this second 'noreboot' pin.

If a guest OS had no watchdog device at all, then apps whose operation
and/or data integrity relies on a watchdog can refuse to launch, and
alert the administrator of the problematic deployment. With Q35 machines
unconditionally exposing a watchdog though, apps will think their
deployment is correct but in fact have no protection at all.

This patch flips the default of the second 'no reboot' flag, so that
configured watchdog actions will be honoured out of the box for the
7.2 Q35 machine type onwards, if the guest enables use of the watchdog.

See also related bug reports

  https://bugzilla.redhat.com/show_bug.cgi?id=2080207
  https://bugzilla.redhat.com/show_bug.cgi?id=2136889
  https://bugzilla.redhat.com/show_bug.cgi?id=2137346

Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20221216125749.596075-5-berrange@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2022-12-21 06:35:28 -05:00
..
9pfs cleanup: Tweak and re-run return_directly.cocci 2022-12-14 16:19:35 +01:00
acpi hw/acpi: add trace events for TCO watchdog register access 2022-12-21 06:35:28 -05:00
adc hw/adc: Make adci[*] R/W in NPCM7XX ADC 2022-07-18 13:20:14 +01:00
alpha hw: Remove unused MAX_IDE_BUS define 2022-10-31 11:32:07 +01:00
arm hw: Add compat machines for 8.0 2022-12-21 06:35:28 -05:00
audio hw/audio/intel-hda: Drop unnecessary prototype 2022-11-23 12:30:45 +01:00
avr
block hw/virtio: generalise CHR_EVENT_CLOSED handling 2022-12-01 02:30:13 -05:00
char cleanup: Tweak and re-run return_directly.cocci 2022-12-14 16:19:35 +01:00
core hw: Add compat machines for 8.0 2022-12-21 06:35:28 -05:00
cpu
cris
cxl hw/cxl/cdat: CXL CDAT Data Object Exchange implementation 2022-11-07 13:12:19 -05:00
display hw/display/virtio-vga: Convert TYPE_VIRTIO_VGA_BASE to 3-phase reset 2022-12-16 15:59:07 +00:00
dma treewide: Remove the unnecessary space before semicolon 2022-10-24 13:41:10 +02:00
gpio hw/gpio/meson: Introduce dedicated config switch for hw/gpio/mpc8xxx 2022-10-17 16:15:09 -03:00
hppa hw: Remove unused MAX_IDE_BUS define 2022-10-31 11:32:07 +01:00
hyperv hw/hyperv/vmbus: Use device_cold_reset() and bus_cold_reset() 2022-12-16 15:55:32 +00:00
i2c hw/i2c/aspeed: Fix old reg slave receive 2022-10-24 11:20:15 +02:00
i386 hw/isa: enable TCO watchdog reboot pin strap by default 2022-12-21 06:35:28 -05:00
ide hw/ppc/mac.h: Rename to include/hw/nvram/mac_nvram.h 2022-10-31 18:48:23 +00:00
input hw/input/ps2.c: Convert TYPE_PS2_{KBD, MOUSE}_DEVICE to 3-phase reset 2022-12-16 15:56:24 +00:00
intc hw/intc/xics: Convert TYPE_ICS to 3-phase reset 2022-12-16 15:59:07 +00:00
ipack
ipmi ipmi:smbus: Add a check around a memcpy 2022-08-01 06:40:50 -05:00
isa hw/isa: enable TCO watchdog reboot pin strap by default 2022-12-21 06:35:28 -05:00
loongarch hw/loongarch/virt: Add cfi01 pflash device 2022-12-15 15:46:12 +08:00
m68k hw: Add compat machines for 8.0 2022-12-21 06:35:28 -05:00
mem qapi machine: Elide redundant has_FOO in generated C 2022-12-14 20:04:47 +01:00
microblaze hw/microblaze: pass random seed to fdt 2022-09-21 19:59:56 +02:00
mips hw/mips/malta: Use bootloader helper to set BAR registers 2022-10-31 11:32:56 +01:00
misc hw/misc: Convert TYPE_MOS6522 subclasses to 3-phase reset 2022-12-16 15:56:55 +00:00
net hw: Include the VMWare devices only in the x86 targets 2022-12-15 15:19:24 +01:00
nios2 hw/nios2: set machine->fdt in nios2_load_dtb() 2022-10-17 16:15:10 -03:00
nubus
nvme Drop more useless casts from void * to pointer 2022-12-14 16:19:35 +01:00
nvram qapi machine: Elide redundant has_FOO in generated C 2022-12-14 20:04:47 +01:00
openrisc openrisc: re-randomize rng-seed on reboot 2022-10-27 11:34:31 +01:00
pci pci: Use device_cold_reset() and bus_cold_reset() 2022-12-16 15:55:32 +00:00
pci-bridge pci: Convert child classes of TYPE_PCIE_ROOT_PORT to 3-phase reset 2022-12-16 15:59:07 +00:00
pci-host hw/pci-host/pnv_phb3_msi: Convert TYPE_PHB3_MSI to 3-phase reset 2022-12-16 15:59:07 +00:00
pcmcia
ppc hw: Add compat machines for 8.0 2022-12-21 06:35:28 -05:00
rdma cleanup: Tweak and re-run return_directly.cocci 2022-12-14 16:19:35 +01:00
remote Replace use of qdev_reset_all() with device_cold_reset() 2022-12-16 15:55:32 +00:00
riscv riscv: re-randomize rng-seed on reboot 2022-10-27 11:34:31 +01:00
rtc goldfish_rtc: Add big-endian property 2022-09-04 07:02:56 +01:00
rx rx: re-randomize rng-seed on reboot 2022-10-27 11:34:31 +01:00
s390x hw: Add compat machines for 8.0 2022-12-21 06:35:28 -05:00
scsi vhost: enable vrings in vhost_dev_start() for vhost-user devices 2022-12-01 02:30:04 -05:00
sd hw/sd: Fix sun4i allwinner-sdhost for U-Boot 2022-11-21 11:45:12 +00:00
sensor hw/sensor: Add Renesas ISL69259 device model 2022-07-14 16:24:38 +02:00
sh4
smbios hw/smbios: add core_count2 to smbios table type 4 2022-11-07 14:08:17 -05:00
sparc
sparc64 hw: Remove unused MAX_IDE_BUS define 2022-10-31 11:32:07 +01:00
ssi aspeed/smc: Cache AspeedSMCClass 2022-10-24 11:20:15 +02:00
timer target/imx: reload cmp timer outside of the reload ptimer transaction 2022-10-27 10:27:23 +01:00
tpm tpm_crb: Avoid backend startup just before shutdown under Xen 2022-09-09 17:55:59 -04:00
tricore
usb Replace use of qdev_reset_all() with device_cold_reset() 2022-12-16 15:55:32 +00:00
vfio pci,pc,virtio: features, tests, fixes, cleanups 2022-11-07 18:43:56 -05:00
virtio hw/virtio: Convert TYPE_VIRTIO_PCI to 3-phase reset 2022-12-16 15:59:07 +00:00
watchdog hw/watchdog: add trace events for watchdog action handling 2022-12-21 06:35:28 -05:00
xen xen/pt: fix syntax error that causes FTBFS in some configurations 2022-11-05 20:35:45 +01:00
xenpv
xtensa
Kconfig hw/loongarch: Add support loongson3 virt machine type. 2022-06-06 18:09:03 +00:00
meson.build hw/loongarch: Add support loongson3 virt machine type. 2022-06-06 18:09:03 +00:00