qemu/target/i386/kvm
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
..
hyperv-proto.h i386: Hyper-V Direct TLB flush hypercall 2022-05-25 21:26:35 +02:00
hyperv-stub.c hyperv: Add support to process syndbg commands 2022-04-06 14:31:56 +02:00
hyperv.c hyperv: fix SynIC SINT assertion failure on guest reset 2022-10-18 13:58:04 +02:00
hyperv.h i386: move kvm accel files into kvm/ 2020-12-16 14:06:52 -05:00
kvm_i386.h hyperv: fix SynIC SINT assertion failure on guest reset 2022-10-18 13:58:04 +02:00
kvm-cpu.c target/i386: Fix sanity check on max APIC ID / X2APIC enablement 2022-05-16 04:38:39 -04:00
kvm-cpu.h i386: split cpu accelerators from cpu.c, using AccelCPUClass 2021-05-10 15:41:49 -04:00
kvm-stub.c i386: expand Hyper-V features during CPU feature expansion time 2021-07-13 09:13:29 -04:00
kvm.c hyperv: fix SynIC SINT assertion failure on guest reset 2022-10-18 13:58:04 +02:00
meson.build target/i386/kvm: Restrict SEV stubs to x86 architecture 2021-10-13 10:47:49 +02:00
sev-stub.c Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
trace-events docs: fix references to docs/devel/tracing.rst 2021-06-02 06:51:09 +02:00
trace.h i386: move kvm accel files into kvm/ 2020-12-16 14:06:52 -05:00