qemu-e2k/hw/i386
Maciej S. Szmigiero ec19444a53 hyperv: fix SynIC SINT assertion failure on guest reset
Resetting a guest that has Hyper-V VMBus support enabled triggers a QEMU
assertion failure:
hw/hyperv/hyperv.c:131: synic_reset: Assertion `QLIST_EMPTY(&synic->sint_routes)' failed.

This happens both on normal guest reboot or when using "system_reset" HMP
command.

The failing assertion was introduced by commit 64ddecc88b ("hyperv: SControl is optional to enable SynIc")
to catch dangling SINT routes on SynIC reset.

The root cause of this problem is that the SynIC itself is reset before
devices using SINT routes have chance to clean up these routes.

Since there seems to be no existing mechanism to force reset callbacks (or
methods) to be executed in specific order let's use a similar method that
is already used to reset another interrupt controller (APIC) after devices
have been reset - by invoking the SynIC reset from the machine reset
handler via a new x86_cpu_after_reset() function co-located with
the existing x86_cpu_reset() in target/i386/cpu.c.
Opportunistically move the APIC reset handler there, too.

Fixes: 64ddecc88b ("hyperv: SControl is optional to enable SynIc") # exposed the bug
Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Message-Id: <cb57cee2e29b20d06f81dce054cbcea8b5d497e8.1664552976.git.maciej.szmigiero@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-10-18 13:58:04 +02:00
..
kvm
xen hw/i386/xen/xen-hvm: Inline xen_piix_pci_write_config_client() and remove it 2022-06-29 00:24:59 +02:00
acpi-build.c x86: pci: acpi: consolidate PCI slots creation 2022-10-09 16:38:46 -04:00
acpi-build.h
acpi-common.c
acpi-common.h
acpi-microvm.c
acpi-microvm.h
amd_iommu.c
amd_iommu.h
e820_memory_layout.c
e820_memory_layout.h
fw_cfg.c
fw_cfg.h
generic_event_device_x86.c
intel_iommu_internal.h
intel_iommu.c Revert "intel_iommu: Fix irqchip / X2APIC configuration checks" 2022-10-09 16:38:45 -04:00
Kconfig
kvmvapic.c
meson.build
microvm-dt.c hw/rtc/mc146818rtc: QOM'ify io_base offset 2022-06-11 11:44:50 +02:00
microvm-dt.h
microvm.c hyperv: fix SynIC SINT assertion failure on guest reset 2022-10-18 13:58:04 +02:00
multiboot.c hw/i386/multiboot: Avoid dynamic stack allocation 2022-09-22 16:38:28 +01:00
multiboot.h
pc_piix.c x86: re-enable rng seeding via SetupData 2022-09-27 11:30:59 +02:00
pc_q35.c x86: re-enable rng seeding via SetupData 2022-09-27 11:30:59 +02:00
pc_sysfw_ovmf-stubs.c
pc_sysfw_ovmf.c
pc_sysfw.c
pc.c hyperv: fix SynIC SINT assertion failure on guest reset 2022-10-18 13:58:04 +02:00
port92.c
sgx-epc.c
sgx-stub.c
sgx.c hw/i386: add 4g boundary start to X86MachineState 2022-07-26 10:40:58 -04:00
trace-events
trace.h
vmmouse.c
vmport.c
x86-iommu-stub.c
x86-iommu.c
x86.c x86: re-initialize RNG seed when selecting kernel 2022-10-01 21:16:36 +02:00