summaryrefslogtreecommitdiff
path: root/kvm-all.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@web.de>2009-11-25 00:33:03 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-03 15:25:57 -0600
commit2e40570728182bbcb3cb0e97b41280fd3bfd1d87 (patch)
tree03746f1dd29d82b6bf599a0afde1645454ed8593 /kvm-all.c
parentb4f7767d1e239918086542d48acd294e6e5bf369 (diff)
downloadqemu-2e40570728182bbcb3cb0e97b41280fd3bfd1d87.tar.gz
qemu-2e40570728182bbcb3cb0e97b41280fd3bfd1d87.tar.bz2
qemu-2e40570728182bbcb3cb0e97b41280fd3bfd1d87.zip
kvm: x86: Add support for VCPU event states
This patch extends the qemu-kvm state sync logic with support for KVM_GET/SET_VCPU_EVENTS, giving access to yet missing exception, interrupt and NMI states. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'kvm-all.c')
-rw-r--r--kvm-all.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/kvm-all.c b/kvm-all.c
index b8ffe546c5..15ec38e631 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -61,6 +61,7 @@ struct KVMState
int coalesced_mmio;
int broken_set_mem_region;
int migration_log;
+ int vcpu_events;
#ifdef KVM_CAP_SET_GUEST_DEBUG
struct kvm_sw_breakpoint_head kvm_sw_breakpoints;
#endif
@@ -479,6 +480,11 @@ int kvm_init(int smp_cpus)
}
#endif
+ s->vcpu_events = 0;
+#ifdef KVM_CAP_VCPU_EVENTS
+ s->vcpu_events = kvm_check_extension(s, KVM_CAP_VCPU_EVENTS);
+#endif
+
ret = kvm_arch_init(s, smp_cpus);
if (ret < 0)
goto err;
@@ -868,6 +874,11 @@ int kvm_has_sync_mmu(void)
#endif
}
+int kvm_has_vcpu_events(void)
+{
+ return kvm_state->vcpu_events;
+}
+
void kvm_setup_guest_memory(void *start, size_t size)
{
if (!kvm_has_sync_mmu()) {