diff options
author | Alex Bennée <alex.bennee@linaro.org> | 2014-09-09 12:27:18 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-09-10 05:33:12 -0400 |
commit | 4bd9d3441edadff4c8df9de4b5d5386c36667ca6 (patch) | |
tree | 82d1d887f23b9136d96688b1eb2a40f19424ce0f /Documentation/virtual | |
parent | f2a25160887e00434ce1361007009120e1fecbda (diff) |
KVM: document KVM_SET_GUEST_DEBUG api
In preparation for working on the ARM implementation I noticed the debug
interface was missing from the API document. I've pieced together the
expected behaviour from the code and commit messages written it up as
best I can.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'Documentation/virtual')
-rw-r--r-- | Documentation/virtual/kvm/api.txt | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index 6485750ae08a..539c010eade0 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt | |||
@@ -2565,6 +2565,50 @@ associated with the service will be forgotten, and subsequent RTAS | |||
2565 | calls by the guest for that service will be passed to userspace to be | 2565 | calls by the guest for that service will be passed to userspace to be |
2566 | handled. | 2566 | handled. |
2567 | 2567 | ||
2568 | 4.87 KVM_SET_GUEST_DEBUG | ||
2569 | |||
2570 | Capability: KVM_CAP_SET_GUEST_DEBUG | ||
2571 | Architectures: x86, s390, ppc | ||
2572 | Type: vcpu ioctl | ||
2573 | Parameters: struct kvm_guest_debug (in) | ||
2574 | Returns: 0 on success; -1 on error | ||
2575 | |||
2576 | struct kvm_guest_debug { | ||
2577 | __u32 control; | ||
2578 | __u32 pad; | ||
2579 | struct kvm_guest_debug_arch arch; | ||
2580 | }; | ||
2581 | |||
2582 | Set up the processor specific debug registers and configure vcpu for | ||
2583 | handling guest debug events. There are two parts to the structure, the | ||
2584 | first a control bitfield indicates the type of debug events to handle | ||
2585 | when running. Common control bits are: | ||
2586 | |||
2587 | - KVM_GUESTDBG_ENABLE: guest debugging is enabled | ||
2588 | - KVM_GUESTDBG_SINGLESTEP: the next run should single-step | ||
2589 | |||
2590 | The top 16 bits of the control field are architecture specific control | ||
2591 | flags which can include the following: | ||
2592 | |||
2593 | - KVM_GUESTDBG_USE_SW_BP: using software breakpoints [x86] | ||
2594 | - KVM_GUESTDBG_USE_HW_BP: using hardware breakpoints [x86, s390] | ||
2595 | - KVM_GUESTDBG_INJECT_DB: inject DB type exception [x86] | ||
2596 | - KVM_GUESTDBG_INJECT_BP: inject BP type exception [x86] | ||
2597 | - KVM_GUESTDBG_EXIT_PENDING: trigger an immediate guest exit [s390] | ||
2598 | |||
2599 | For example KVM_GUESTDBG_USE_SW_BP indicates that software breakpoints | ||
2600 | are enabled in memory so we need to ensure breakpoint exceptions are | ||
2601 | correctly trapped and the KVM run loop exits at the breakpoint and not | ||
2602 | running off into the normal guest vector. For KVM_GUESTDBG_USE_HW_BP | ||
2603 | we need to ensure the guest vCPUs architecture specific registers are | ||
2604 | updated to the correct (supplied) values. | ||
2605 | |||
2606 | The second part of the structure is architecture specific and | ||
2607 | typically contains a set of debug registers. | ||
2608 | |||
2609 | When debug events exit the main run loop with the reason | ||
2610 | KVM_EXIT_DEBUG with the kvm_debug_exit_arch part of the kvm_run | ||
2611 | structure containing architecture specific debug information. | ||
2568 | 2612 | ||
2569 | 5. The kvm_run structure | 2613 | 5. The kvm_run structure |
2570 | ------------------------ | 2614 | ------------------------ |