summaryrefslogtreecommitdiffstats
path: root/target/i386/kvm.c
diff options
context:
space:
mode:
authorRoman Kagan2018-09-21 10:22:09 +0200
committerPaolo Bonzini2018-10-19 13:44:14 +0200
commit606c34bfd57a0ecda67b395bea022bb307a5384e (patch)
tree448b94dd535847b0cd358a13332e46085d563c6f /target/i386/kvm.c
parenthyperv:synic: split capability testing and setting (diff)
downloadqemu-606c34bfd57a0ecda67b395bea022bb307a5384e.tar.gz
qemu-606c34bfd57a0ecda67b395bea022bb307a5384e.tar.xz
qemu-606c34bfd57a0ecda67b395bea022bb307a5384e.zip
hyperv: qom-ify SynIC
Make Hyper-V SynIC a device which is attached as a child to a CPU. For now it only makes SynIC visibile in the qom hierarchy, and maintains its internal fields in sync with the respecitve msrs of the parent cpu (the fields will be used in followup patches). Signed-off-by: Roman Kagan <rkagan@virtuozzo.com> Message-Id: <20180921082217.29481-3-rkagan@virtuozzo.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target/i386/kvm.c')
-rw-r--r--target/i386/kvm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 2e5b9f63eb..cf6270ae39 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -790,6 +790,13 @@ static int hyperv_init_vcpu(X86CPU *cpu)
strerror(-ret));
return ret;
}
+
+ ret = hyperv_x86_synic_add(cpu);
+ if (ret < 0) {
+ error_report("failed to create HyperV SynIC: %s",
+ strerror(-ret));
+ return ret;
+ }
}
return 0;
@@ -1250,6 +1257,8 @@ void kvm_arch_reset_vcpu(X86CPU *cpu)
for (i = 0; i < ARRAY_SIZE(env->msr_hv_synic_sint); i++) {
env->msr_hv_synic_sint[i] = HV_SINT_MASKED;
}
+
+ hyperv_x86_synic_reset(cpu);
}
}