mirror of
https://github.com/qemu/qemu.git
synced 2026-04-05 22:00:58 +00:00
hw/hyperv: Fix SynIC not initialized except on first vCPU
hyperv_is_synic_enabled() is a global flag that returns true after the
first CPU initializes SynIC. With -smp N, all subsequent CPUs skip
hyperv_x86_synic_add(), leaving them without a synic object. This causes
get_synic() to return NULL, making hyperv_sint_route_new() fail and
triggering an assertion crash in hyperv_testdev.
Fix by introducing hyperv_is_synic_present() which checks per-CPU
whether a synic object is already attached instead of using the global
flag.
Fixes: c4cf32fc63 ("kvm/hyperv: add synic feature to CPU only if its not enabled")
Reported-by: Xudong Hao <xudong.hao@intel.com>
Co-authored-by: Ani Sinha <anisinha@redhat.com>
Signed-off-by: Sourav Poddar <souravpoddar93042@gmail.com>
Tested-by: Xudong Hao <xudong.hao@intel.com>
Message-ID: <20260320154752.204725-1-anisinha@redhat.com>
[PMD: Reworded subject]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
committed by
Philippe Mathieu-Daudé
parent
04249f0f94
commit
4f7a06ec25
@@ -27,7 +27,7 @@ int hyperv_x86_synic_add(X86CPU *cpu)
|
||||
int hyperv_enable_synic(X86CPU *cpu)
|
||||
{
|
||||
int ret = 0;
|
||||
if (!hyperv_is_synic_enabled()) {
|
||||
if (!hyperv_is_synic_present(CPU(cpu))) {
|
||||
ret = hyperv_x86_synic_add(cpu);
|
||||
}
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user