From patchwork Thu Jul 26 05:22:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharat Bhushan X-Patchwork-Id: 173339 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id EC2642C0089 for ; Thu, 26 Jul 2012 15:21:25 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751279Ab2GZFVZ (ORCPT ); Thu, 26 Jul 2012 01:21:25 -0400 Received: from am1ehsobe002.messaging.microsoft.com ([213.199.154.205]:9009 "EHLO am1outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751238Ab2GZFVY (ORCPT ); Thu, 26 Jul 2012 01:21:24 -0400 Received: from mail11-am1-R.bigfish.com (10.3.201.247) by AM1EHSOBE008.bigfish.com (10.3.204.28) with Microsoft SMTP Server id 14.1.225.23; Thu, 26 Jul 2012 05:21:22 +0000 Received: from mail11-am1 (localhost [127.0.0.1]) by mail11-am1-R.bigfish.com (Postfix) with ESMTP id D0E0634035D; Thu, 26 Jul 2012 05:21:22 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 3 X-BigFish: VS3(zzzz1202h1082kzz8275bhz2dh2a8h668h839he5bhf0ah) Received: from mail11-am1 (localhost.localdomain [127.0.0.1]) by mail11-am1 (MessageSwitch) id 1343280081272894_2239; Thu, 26 Jul 2012 05:21:21 +0000 (UTC) Received: from AM1EHSMHS004.bigfish.com (unknown [10.3.201.240]) by mail11-am1.bigfish.com (Postfix) with ESMTP id 363E4E0052; Thu, 26 Jul 2012 05:21:21 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by AM1EHSMHS004.bigfish.com (10.3.207.104) with Microsoft SMTP Server (TLS) id 14.1.225.23; Thu, 26 Jul 2012 05:21:21 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server (TLS) id 14.2.298.5; Thu, 26 Jul 2012 00:21:19 -0500 Received: from freescale.com ([10.232.15.72]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with SMTP id q6Q5LEET019386; Wed, 25 Jul 2012 22:21:16 -0700 Received: by freescale.com (sSMTP sendmail emulation); Thu, 26 Jul 2012 10:52:38 +0530 From: Bharat Bhushan To: , , CC: Bharat Bhushan , Bharat Bhushan Subject: [PATCH 1/2] Header update for guest debug suuport Date: Thu, 26 Jul 2012 10:52:36 +0530 Message-ID: <1343280157-3077-1-git-send-email-Bharat.Bhushan@freescale.com> X-Mailer: git-send-email 1.7.0.4 MIME-Version: 1.0 X-OriginatorOrg: freescale.com Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org Signed-off-by: Bharat Bhushan --- linux-headers/asm-powerpc/kvm.h | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-) diff --git a/linux-headers/asm-powerpc/kvm.h b/linux-headers/asm-powerpc/kvm.h index 1bea4d8..da71c84 100644 --- a/linux-headers/asm-powerpc/kvm.h +++ b/linux-headers/asm-powerpc/kvm.h @@ -25,6 +25,7 @@ /* Select powerpc specific features in */ #define __KVM_HAVE_SPAPR_TCE #define __KVM_HAVE_PPC_SMT +#define __KVM_HAVE_GUEST_DEBUG struct kvm_regs { __u64 pc; @@ -221,6 +222,12 @@ struct kvm_sregs { __u32 dbsr; /* KVM_SREGS_E_UPDATE_DBSR */ __u32 dbcr[3]; + /* + * iac/dac registers are 64bit wide, while this API + * interface provides only lower 32 bits on 64 bit + * processors. ONE_REG interface is added for 64bit + * iac/dac registers. + */ __u32 iac[4]; __u32 dac[2]; __u32 dvc[2]; @@ -259,10 +266,19 @@ struct kvm_fpu { }; struct kvm_debug_exit_arch { + __u32 exception; + __u32 pc; + __u32 status; }; /* for KVM_SET_GUEST_DEBUG */ struct kvm_guest_debug_arch { + struct { + __u64 addr; + __u32 type; + __u32 pad1; + __u64 pad2; + } bp[16]; }; /* definition of registers in kvm_run */ @@ -279,6 +295,17 @@ struct kvm_sync_regs { #define KVM_CPU_3S_64 4 #define KVM_CPU_E500MC 5 +/* Debug related defines */ +#define KVM_INST_GUESTGDB 0x7C00021C /* ehpriv OC=0 */ + +#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_CAP_SPAPR_TCE */ struct kvm_create_spapr_tce { __u64 liobn; @@ -326,5 +353,11 @@ struct kvm_book3e_206_tlb_params { }; #define KVM_REG_PPC_HIOR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x1) +#define KVM_REG_PPC_IAC1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x2) +#define KVM_REG_PPC_IAC2 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x3) +#define KVM_REG_PPC_IAC3 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x4) +#define KVM_REG_PPC_IAC4 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x5) +#define KVM_REG_PPC_DAC1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x6) +#define KVM_REG_PPC_DAC2 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x7) #endif /* __LINUX_KVM_POWERPC_H */