From patchwork Mon Jun 22 10:41:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhichao Huang X-Patchwork-Id: 50145 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5C22021575 for ; Mon, 22 Jun 2015 10:44:46 +0000 (UTC) Received: by lbcak1 with SMTP id ak1sf43173512lbc.2 for ; Mon, 22 Jun 2015 03:44:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=APl8LZLRimAyqCAMTYG2Qun4W+JOoYtljSVKBmcbnyA=; b=EiXOL7/SVsv7gSSrUDAlK2XE3ZHrc9gcbyTDDAqo7A/+xgEOkvWTGjp+Iaa/I6Fd5e rEZkLJgbxm2q6juWXsf/3FQ7HPeerxzMhXQhspK0YjnIDF/iDO15AOh6+ZukDVU13ty+ PGaL5s0x3Flqx9JJu22tJjJgqPvib9hlBUZK9lcv2mxZLeWmPbsKLTwAeQD/vqMDSj4o +KggADSe0+4jrDpTqmhW7sGG8enqPvRmJ1IJyMc2qyJZ0daVqP2Ldz4oYeuOwTh6n2JI swfq+Y10kRY+uOVzGMtvLEfnfnt1rBoryeufIkv60rvE/1L+2e1DzRD0VVO6lRfp3YEK VzsQ== X-Gm-Message-State: ALoCoQmO75NKkW8W4vZ11psebITc5dpUCHB9pClXpsSYLcrENwQ/MWlSDRUO6IBOnfTQOmM3QJFK X-Received: by 10.180.105.226 with SMTP id gp2mr15523248wib.1.1434969885185; Mon, 22 Jun 2015 03:44:45 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.198 with SMTP id ba6ls903433lab.40.gmail; Mon, 22 Jun 2015 03:44:44 -0700 (PDT) X-Received: by 10.112.146.97 with SMTP id tb1mr30300630lbb.12.1434969884956; Mon, 22 Jun 2015 03:44:44 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id ay4si4762097lab.9.2015.06.22.03.44.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jun 2015 03:44:44 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lbbpo10 with SMTP id po10so6388085lbb.3 for ; Mon, 22 Jun 2015 03:44:44 -0700 (PDT) X-Received: by 10.112.204.6 with SMTP id ku6mr29377424lbc.73.1434969884335; Mon, 22 Jun 2015 03:44:44 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp2288767lbb; Mon, 22 Jun 2015 03:44:43 -0700 (PDT) X-Received: by 10.70.134.231 with SMTP id pn7mr58233463pdb.97.1434969881702; Mon, 22 Jun 2015 03:44:41 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id wk5si5563983pab.37.2015.06.22.03.44.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jun 2015 03:44:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z6zBk-00063e-2A; Mon, 22 Jun 2015 10:42:52 +0000 Received: from mail-pd0-f179.google.com ([209.85.192.179]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z6zBE-0005rP-0P for linux-arm-kernel@lists.infradead.org; Mon, 22 Jun 2015 10:42:21 +0000 Received: by pdcu2 with SMTP id u2so9983976pdc.3 for ; Mon, 22 Jun 2015 03:41:59 -0700 (PDT) X-Received: by 10.70.90.42 with SMTP id bt10mr36613990pdb.106.1434969719016; Mon, 22 Jun 2015 03:41:59 -0700 (PDT) Received: from localhost ([104.207.83.42]) by mx.google.com with ESMTPSA id nw8sm19465721pdb.30.2015.06.22.03.41.56 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 22 Jun 2015 03:41:57 -0700 (PDT) From: Zhichao Huang To: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org, marc.zyngier@arm.com, alex.bennee@linaro.org, will.deacon@arm.com Subject: [PATCH v3 03/11] KVM: arm: enable to use the ARM_DSCR_MDBGEN macro from KVM assembly code Date: Mon, 22 Jun 2015 18:41:26 +0800 Message-Id: <1434969694-7432-4-git-send-email-zhichao.huang@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1434969694-7432-1-git-send-email-zhichao.huang@linaro.org> References: <1434969694-7432-1-git-send-email-zhichao.huang@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150622_034220_111206_3D9C6818 X-CRM114-Status: UNSURE ( 9.36 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.192.179 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.192.179 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record Cc: huangzhichao@huawei.com, Zhichao Huang X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: zhichao.huang@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Add #ifndef __ASSEMBLY__ in hw_breakpoint.h, in order to use the ARM_DSCR_MDBGEN macro from KVM assembly code. Signed-off-by: Zhichao Huang Reviewed-by: Alex Bennee Acked-by: Christoffer Dall --- arch/arm/include/asm/hw_breakpoint.h | 54 +++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/arch/arm/include/asm/hw_breakpoint.h b/arch/arm/include/asm/hw_breakpoint.h index 8e427c7..f2f4c61 100644 --- a/arch/arm/include/asm/hw_breakpoint.h +++ b/arch/arm/include/asm/hw_breakpoint.h @@ -3,6 +3,8 @@ #ifdef __KERNEL__ +#ifndef __ASSEMBLY__ + struct task_struct; #ifdef CONFIG_HAVE_HW_BREAKPOINT @@ -44,6 +46,33 @@ static inline void decode_ctrl_reg(u32 reg, ctrl->mismatch = reg & 0x1; } +struct notifier_block; +struct perf_event; +struct pmu; + +extern struct pmu perf_ops_bp; +extern int arch_bp_generic_fields(struct arch_hw_breakpoint_ctrl ctrl, + int *gen_len, int *gen_type); +extern int arch_check_bp_in_kernelspace(struct perf_event *bp); +extern int arch_validate_hwbkpt_settings(struct perf_event *bp); +extern int hw_breakpoint_exceptions_notify(struct notifier_block *unused, + unsigned long val, void *data); + +extern u8 arch_get_debug_arch(void); +extern u8 arch_get_max_wp_len(void); +extern void clear_ptrace_hw_breakpoint(struct task_struct *tsk); + +int arch_install_hw_breakpoint(struct perf_event *bp); +void arch_uninstall_hw_breakpoint(struct perf_event *bp); +void hw_breakpoint_pmu_read(struct perf_event *bp); +int hw_breakpoint_slots(int type); + +#else +static inline void clear_ptrace_hw_breakpoint(struct task_struct *tsk) {} + +#endif /* CONFIG_HAVE_HW_BREAKPOINT */ +#endif /* __ASSEMBLY */ + /* Debug architecture numbers. */ #define ARM_DEBUG_ARCH_RESERVED 0 /* In case of ptrace ABI updates. */ #define ARM_DEBUG_ARCH_V6 1 @@ -110,30 +139,5 @@ static inline void decode_ctrl_reg(u32 reg, asm volatile("mcr p14, 0, %0, " #N "," #M ", " #OP2 : : "r" (VAL));\ } while (0) -struct notifier_block; -struct perf_event; -struct pmu; - -extern struct pmu perf_ops_bp; -extern int arch_bp_generic_fields(struct arch_hw_breakpoint_ctrl ctrl, - int *gen_len, int *gen_type); -extern int arch_check_bp_in_kernelspace(struct perf_event *bp); -extern int arch_validate_hwbkpt_settings(struct perf_event *bp); -extern int hw_breakpoint_exceptions_notify(struct notifier_block *unused, - unsigned long val, void *data); - -extern u8 arch_get_debug_arch(void); -extern u8 arch_get_max_wp_len(void); -extern void clear_ptrace_hw_breakpoint(struct task_struct *tsk); - -int arch_install_hw_breakpoint(struct perf_event *bp); -void arch_uninstall_hw_breakpoint(struct perf_event *bp); -void hw_breakpoint_pmu_read(struct perf_event *bp); -int hw_breakpoint_slots(int type); - -#else -static inline void clear_ptrace_hw_breakpoint(struct task_struct *tsk) {} - -#endif /* CONFIG_HAVE_HW_BREAKPOINT */ #endif /* __KERNEL__ */ #endif /* _ARM_HW_BREAKPOINT_H */