summaryrefslogtreecommitdiff
path: root/kvm-all.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2010-03-12 15:20:49 +0100
committerMarcelo Tosatti <mtosatti@redhat.com>2010-03-15 15:18:30 -0300
commitea3c8e4f0f0dfe2932e96c555a5179ed3ba3d0d3 (patch)
tree5b982a4b105800261f761c418cdc467bf6f0ae8b /kvm-all.c
parent8f3071c9719f9701d689980cad77daaebe01e65e (diff)
KVM: x86: Add debug register saving and restoring
Make use of the new KVM_GET/SET_DEBUGREGS to save/restore the x86 debug registers. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.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 8ca480def..c469b6ab8 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -67,6 +67,7 @@ struct KVMState
int migration_log;
int vcpu_events;
int robust_singlestep;
+ int debugregs;
#ifdef KVM_CAP_SET_GUEST_DEBUG
struct kvm_sw_breakpoint_head kvm_sw_breakpoints;
#endif
@@ -676,6 +677,11 @@ int kvm_init(int smp_cpus)
kvm_check_extension(s, KVM_CAP_X86_ROBUST_SINGLESTEP);
#endif
+ s->debugregs = 0;
+#ifdef KVM_CAP_DEBUGREGS
+ s->debugregs = kvm_check_extension(s, KVM_CAP_DEBUGREGS);
+#endif
+
ret = kvm_arch_init(s, smp_cpus);
if (ret < 0)
goto err;
@@ -955,6 +961,11 @@ int kvm_has_robust_singlestep(void)
return kvm_state->robust_singlestep;
}
+int kvm_has_debugregs(void)
+{
+ return kvm_state->debugregs;
+}
+
void kvm_setup_guest_memory(void *start, size_t size)
{
if (!kvm_has_sync_mmu()) {