diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2010-03-12 15:20:49 +0100 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2010-04-26 11:28:35 -0300 |
commit | ff44f1a3737bfda3cac294b8e92d8ec5ddf3abf5 (patch) | |
tree | 0ed0db251b75b3f0902cb3a2421544fc49297b73 /kvm-all.c | |
parent | a303f9e37b87ced34e966dc2c0b7f86bc5e74035 (diff) | |
download | hqemu-ff44f1a3737bfda3cac294b8e92d8ec5ddf3abf5.zip hqemu-ff44f1a3737bfda3cac294b8e92d8ec5ddf3abf5.tar.gz |
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.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -64,6 +64,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 @@ -664,6 +665,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; @@ -939,6 +945,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()) { |