diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2008-12-15 07:52:10 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-03-24 05:02:49 -0400 |
commit | d0bfb940ecabf0b44fb1fd80d8d60594e569e5ec (patch) | |
tree | b5927d44937a54ec23d2a28d59db06a0262c0412 /include/linux/kvm_host.h | |
parent | 8ab2d2e231062814bd89bba2d6d92563190aa2bb (diff) |
KVM: New guest debug interface
This rips out the support for KVM_DEBUG_GUEST and introduces a new IOCTL
instead: KVM_SET_GUEST_DEBUG. The IOCTL payload consists of a generic
part, controlling the "main switch" and the single-step feature. The
arch specific part adds an x86 interface for intercepting both types of
debug exceptions separately and re-injecting them when the host was not
interested. Moveover, the foundation for guest debugging via debug
registers is layed.
To signal breakpoint events properly back to userland, an arch-specific
data block is now returned along KVM_EXIT_DEBUG. For x86, the arch block
contains the PC, the debug exception, and relevant debug registers to
tell debug events properly apart.
The availability of this new interface is signaled by
KVM_CAP_SET_GUEST_DEBUG. Empty stubs for not yet supported archs are
provided.
Note that both SVM and VTX are supported, but only the latter was tested
yet. Based on the experience with all those VTX corner case, I would be
fairly surprised if SVM will work out of the box.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r-- | include/linux/kvm_host.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index bf6f703642fc..e92212f970db 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -73,7 +73,7 @@ struct kvm_vcpu { | |||
73 | struct kvm_run *run; | 73 | struct kvm_run *run; |
74 | int guest_mode; | 74 | int guest_mode; |
75 | unsigned long requests; | 75 | unsigned long requests; |
76 | struct kvm_guest_debug guest_debug; | 76 | unsigned long guest_debug; |
77 | int fpu_active; | 77 | int fpu_active; |
78 | int guest_fpu_loaded; | 78 | int guest_fpu_loaded; |
79 | wait_queue_head_t wq; | 79 | wait_queue_head_t wq; |
@@ -255,8 +255,8 @@ int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu, | |||
255 | struct kvm_mp_state *mp_state); | 255 | struct kvm_mp_state *mp_state); |
256 | int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu, | 256 | int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu, |
257 | struct kvm_mp_state *mp_state); | 257 | struct kvm_mp_state *mp_state); |
258 | int kvm_arch_vcpu_ioctl_debug_guest(struct kvm_vcpu *vcpu, | 258 | int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu, |
259 | struct kvm_debug_guest *dbg); | 259 | struct kvm_guest_debug *dbg); |
260 | int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run); | 260 | int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run); |
261 | 261 | ||
262 | int kvm_arch_init(void *opaque); | 262 | int kvm_arch_init(void *opaque); |