From patchwork Wed Feb 3 07:53:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Yu-B13201 X-Patchwork-Id: 76620 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o13844pZ027136 for ; Wed, 3 Feb 2010 08:04:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754996Ab0BCIEA (ORCPT ); Wed, 3 Feb 2010 03:04:00 -0500 Received: from az33egw02.freescale.net ([192.88.158.103]:40174 "EHLO az33egw02.freescale.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754899Ab0BCID6 (ORCPT ); Wed, 3 Feb 2010 03:03:58 -0500 Received: from de01smr02.am.mot.com (de01smr02.freescale.net [10.208.0.151]) by az33egw02.freescale.net (8.14.3/az33egw02) with ESMTP id o1383kYo027597; Wed, 3 Feb 2010 01:03:47 -0700 (MST) Received: from zch01exm26.fsl.freescale.net (zch01exm26.ap.freescale.net [10.192.129.221]) by de01smr02.am.mot.com (8.13.1/8.13.0) with ESMTP id o138Anh6014402; Wed, 3 Feb 2010 02:10:52 -0600 (CST) Received: from localhost ([10.193.20.106]) by zch01exm26.fsl.freescale.net with Microsoft SMTPSVC(6.0.3790.3959); Wed, 3 Feb 2010 16:03:44 +0800 From: Liu Yu To: agraf@suse.de, hollis@penguinppc.org, kvm-ppc@vger.kernel.org Cc: kvm@vger.kernel.org, Liu Yu Subject: [PATCH 1/4] kvmppc: guest debug definitions Date: Wed, 3 Feb 2010 15:53:50 +0800 Message-Id: <1265183633-2230-2-git-send-email-yu.liu@freescale.com> X-Mailer: git-send-email 1.6.4 In-Reply-To: <1265183633-2230-1-git-send-email-yu.liu@freescale.com> References: <1265183633-2230-1-git-send-email-yu.liu@freescale.com> X-OriginalArrivalTime: 03 Feb 2010 08:03:45.0060 (UTC) FILETIME=[68586E40:01CAA4A7] Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 03 Feb 2010 08:04:04 +0000 (UTC) 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 +/* Select powerpc specific features in */ +#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 + +#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]; }; #endif /* __LINUX_KVM_POWERPC_H */ diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h index 5e5bae7..a364832 100644 --- a/arch/powerpc/include/asm/kvm_host.h +++ b/arch/powerpc/include/asm/kvm_host.h @@ -157,6 +157,18 @@ struct hpte_cache { struct kvmppc_pte pte; }; +struct kvmppc_debug_reg { + u32 dbcr0; + u32 iac[0]; + u32 iac1; + u32 iac2; + u32 iac3; + u32 iac4; + u32 dac[0]; + u32 dac1; + u32 dac2; +}; + struct kvm_vcpu_arch { ulong host_stack; u32 host_pid; @@ -240,6 +252,9 @@ struct kvm_vcpu_arch { u32 dbcr1; u32 dbsr; + struct kvmppc_debug_reg shadow_dbg_reg; + struct kvmppc_debug_reg host_dbg_reg; + #ifdef CONFIG_KVM_EXIT_TIMING struct kvmppc_exit_timing timing_exit; struct kvmppc_exit_timing timing_last_enter; @@ -274,6 +289,7 @@ struct kvm_vcpu_arch { struct tasklet_struct tasklet; u64 dec_jiffies; unsigned long pending_exceptions; + struct kvm_guest_debug_arch dbg; #ifdef CONFIG_PPC64 struct hpte_cache hpte_cache[HPTEG_CACHE_NUM];