diff options
| author | Bharat Bhushan <r65777@freescale.com> | 2013-04-07 20:32:12 -0400 |
|---|---|---|
| committer | Alexander Graf <agraf@suse.de> | 2013-04-26 14:27:02 -0400 |
| commit | 092d62ee93039bfccbb3a36c69d0c3ee0966a97a (patch) | |
| tree | 700128dd56aa9cddbbae33017a24a3c5cf564e3d | |
| parent | adccf65ca431b41733483f476e8de9e3cf171c44 (diff) | |
KVM: PPC: debug stub interface parameter defined
This patch defines the interface parameter for KVM_SET_GUEST_DEBUG
ioctl support. Follow up patches will use this for setting up
hardware breakpoints, watchpoints and software breakpoints.
Also kvm_arch_vcpu_ioctl_set_guest_debug() is brought one level below.
This is because I am not sure what is required for book3s. So this ioctl
behaviour will not change for book3s.
Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
| -rw-r--r-- | arch/powerpc/include/uapi/asm/kvm.h | 23 | ||||
| -rw-r--r-- | arch/powerpc/kvm/book3s.c | 6 | ||||
| -rw-r--r-- | arch/powerpc/kvm/booke.c | 6 | ||||
| -rw-r--r-- | arch/powerpc/kvm/powerpc.c | 6 |
4 files changed, 35 insertions, 6 deletions
diff --git a/arch/powerpc/include/uapi/asm/kvm.h b/arch/powerpc/include/uapi/asm/kvm.h index c2ff99c01562..c0c38ed9c97d 100644 --- a/arch/powerpc/include/uapi/asm/kvm.h +++ b/arch/powerpc/include/uapi/asm/kvm.h | |||
| @@ -272,8 +272,31 @@ struct kvm_debug_exit_arch { | |||
| 272 | 272 | ||
| 273 | /* for KVM_SET_GUEST_DEBUG */ | 273 | /* for KVM_SET_GUEST_DEBUG */ |
| 274 | struct kvm_guest_debug_arch { | 274 | struct kvm_guest_debug_arch { |
| 275 | struct { | ||
| 276 | /* H/W breakpoint/watchpoint address */ | ||
| 277 | __u64 addr; | ||
| 278 | /* | ||
| 279 | * Type denotes h/w breakpoint, read watchpoint, write | ||
| 280 | * watchpoint or watchpoint (both read and write). | ||
| 281 | */ | ||
| 282 | #define KVMPPC_DEBUG_NONE 0x0 | ||
| 283 | #define KVMPPC_DEBUG_BREAKPOINT (1UL << 1) | ||
| 284 | #define KVMPPC_DEBUG_WATCH_WRITE (1UL << 2) | ||
| 285 | #define KVMPPC_DEBUG_WATCH_READ (1UL << 3) | ||
| 286 | __u32 type; | ||
| 287 | __u32 reserved; | ||
| 288 | } bp[16]; | ||
| 275 | }; | 289 | }; |
| 276 | 290 | ||
| 291 | /* Debug related defines */ | ||
| 292 | /* | ||
| 293 | * kvm_guest_debug->control is a 32 bit field. The lower 16 bits are generic | ||
| 294 | * and upper 16 bits are architecture specific. Architecture specific defines | ||
| 295 | * that ioctl is for setting hardware breakpoint or software breakpoint. | ||
| 296 | */ | ||
| 297 | #define KVM_GUESTDBG_USE_SW_BP 0x00010000 | ||
| 298 | #define KVM_GUESTDBG_USE_HW_BP 0x00020000 | ||
| 299 | |||
| 277 | /* definition of registers in kvm_run */ | 300 | /* definition of registers in kvm_run */ |
| 278 | struct kvm_sync_regs { | 301 | struct kvm_sync_regs { |
| 279 | }; | 302 | }; |
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c index 2d32ae4bc439..128ed3a856b9 100644 --- a/arch/powerpc/kvm/book3s.c +++ b/arch/powerpc/kvm/book3s.c | |||
| @@ -612,6 +612,12 @@ int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu, | |||
| 612 | return 0; | 612 | return 0; |
| 613 | } | 613 | } |
| 614 | 614 | ||
| 615 | int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu, | ||
| 616 | struct kvm_guest_debug *dbg) | ||
| 617 | { | ||
| 618 | return -EINVAL; | ||
| 619 | } | ||
| 620 | |||
| 615 | void kvmppc_decrementer_func(unsigned long data) | 621 | void kvmppc_decrementer_func(unsigned long data) |
| 616 | { | 622 | { |
| 617 | struct kvm_vcpu *vcpu = (struct kvm_vcpu *)data; | 623 | struct kvm_vcpu *vcpu = (struct kvm_vcpu *)data; |
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index a49a68a25c39..a3e2db0cf2f9 100644 --- a/arch/powerpc/kvm/booke.c +++ b/arch/powerpc/kvm/booke.c | |||
| @@ -1526,6 +1526,12 @@ int kvm_vcpu_ioctl_set_one_reg(struct kvm_vcpu *vcpu, struct kvm_one_reg *reg) | |||
| 1526 | return r; | 1526 | return r; |
| 1527 | } | 1527 | } |
| 1528 | 1528 | ||
| 1529 | int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu, | ||
| 1530 | struct kvm_guest_debug *dbg) | ||
| 1531 | { | ||
| 1532 | return -EINVAL; | ||
| 1533 | } | ||
| 1534 | |||
| 1529 | int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu) | 1535 | int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu) |
| 1530 | { | 1536 | { |
| 1531 | return -ENOTSUPP; | 1537 | return -ENOTSUPP; |
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index a822659db50a..6b8108624851 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c | |||
| @@ -531,12 +531,6 @@ void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) | |||
| 531 | #endif | 531 | #endif |
| 532 | } | 532 | } |
| 533 | 533 | ||
| 534 | int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu, | ||
| 535 | struct kvm_guest_debug *dbg) | ||
| 536 | { | ||
| 537 | return -EINVAL; | ||
| 538 | } | ||
| 539 | |||
| 540 | static void kvmppc_complete_dcr_load(struct kvm_vcpu *vcpu, | 534 | static void kvmppc_complete_dcr_load(struct kvm_vcpu *vcpu, |
| 541 | struct kvm_run *run) | 535 | struct kvm_run *run) |
| 542 | { | 536 | { |
