Am 03.02.2010 um 08:53 schrieb Liu Yu <yu.liu@xxxxxxxxxxxxx>:
Signed-off-by: Liu Yu <yu.liu@xxxxxxxxxxxxx>
---
arch/powerpc/include/asm/kvm.h | 20 ++++++++++++++++++++
arch/powerpc/include/asm/kvm_host.h | 16 ++++++++++++++++
2 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/include/asm/kvm.h b/arch/powerpc/include/
asm/kvm.h
index 81f3b0b..b7f7861 100644
--- a/arch/powerpc/include/asm/kvm.h
+++ b/arch/powerpc/include/asm/kvm.h
@@ -22,6 +22,9 @@
#include <linux/types.h>
+/* Select powerpc specific features in <linux/kvm.h> */
+#define __KVM_HAVE_GUEST_DEBUG
+
struct kvm_regs {
__u64 pc;
__u64 cr;
@@ -71,10 +74,27 @@ struct kvm_fpu {
};
struct kvm_debug_exit_arch {
+ __u32 exception;
+ __u32 pc;
+ __u32 status;
};
+#define KVM_INST_GUESTGDB 0x44000022
What instruction is this again? :) Is it something reserved for
purposes like this?
Alex
+
+#define KVM_GUESTDBG_USE_SW_BP 0x00010000
+#define KVM_GUESTDBG_USE_HW_BP 0x00020000
+
+#define KVMPPC_DEBUG_NOTYPE 0x0
+#define KVMPPC_DEBUG_BREAKPOINT (1UL << 1)
+#define KVMPPC_DEBUG_WATCH_WRITE (1UL << 2)
+#define KVMPPC_DEBUG_WATCH_READ (1UL << 3)
+
/* for KVM_SET_GUEST_DEBUG */
struct kvm_guest_debug_arch {
+ struct {
+ __u32 addr;
+ __u32 type;
+ } bp[6];
I can't look up the sources right now. Is this a struct that 1:1 maps
to an ioctl struct? If so, we should add padding for a possible future
extension of debug registers.
I'd also prefer to see addr be u64. On 32 bit targets we can just use
the lower 32 bits only.
Alex
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html