From patchwork Mon Aug 10 13:25:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhichao Huang X-Patchwork-Id: 52250 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by patches.linaro.org (Postfix) with ESMTPS id 7737D22919 for ; Mon, 10 Aug 2015 13:31:54 +0000 (UTC) Received: by lbcli1 with SMTP id li1sf5482474lbc.2 for ; Mon, 10 Aug 2015 06:31:53 -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:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:cc:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=vcq5EYngWqWePkmG4XPXopgIZRq1vGQ4aOWjwtOhjd4=; b=MjD94RJw7HvZxnOvkZin12aHDtwTJ6nDE1oLtP0Mf7WajUvV84o1HED4Eq9euvI2Cg kYLHk6SnOLsSCEoaqSTgtZbjnUv3d7TFhX54KNTW85eS8FQSQOgoAb2N0MKlxweuo5++ j/0l9DP35IGcYmR8BujCU2LHZ4xRj+049tjsOVFR4HMy76r0eW8x2K+QFBmfTWwVj/5g qsT1begX7Ct70BQfj6/M6BvTCxrjJ9S31havVPibNei/LWoPFlQYwe21A/xPqzq+ZshY JUPoYNgFkRmsvw2TucWBl+7gkHeAYhTbta6a8e6Gy+dlMaj2RE+MX3jkCJYDl0TU/3iM fmHA== X-Gm-Message-State: ALoCoQmIInV4NAwOagZyyMJYvnsMGDRoUaZtbEGx1z8nL2zzWjry9MeMZzO7UyvO/m8tA0URNWFL X-Received: by 10.152.115.196 with SMTP id jq4mr6352457lab.1.1439213513434; Mon, 10 Aug 2015 06:31:53 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.179.171 with SMTP id dh11ls613288lac.47.gmail; Mon, 10 Aug 2015 06:31:53 -0700 (PDT) X-Received: by 10.112.105.104 with SMTP id gl8mr19963024lbb.81.1439213513291; Mon, 10 Aug 2015 06:31:53 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id lo16si7854147lbb.83.2015.08.10.06.31.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 06:31:53 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lbcbn3 with SMTP id bn3so583477lbc.2 for ; Mon, 10 Aug 2015 06:31:53 -0700 (PDT) X-Received: by 10.112.126.101 with SMTP id mx5mr20307835lbb.35.1439213513146; Mon, 10 Aug 2015 06:31:53 -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.7.198 with SMTP id l6csp1936882lba; Mon, 10 Aug 2015 06:31:51 -0700 (PDT) X-Received: by 10.66.197.234 with SMTP id ix10mr43857207pac.152.1439213510748; Mon, 10 Aug 2015 06:31:50 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id kg9si33197617pab.100.2015.08.10.06.31.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 06:31:50 -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 1ZOn9s-0001lY-PR; Mon, 10 Aug 2015 13:30:32 +0000 Received: from mail-pa0-f51.google.com ([209.85.220.51]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZOn6T-0005ro-5W for linux-arm-kernel@lists.infradead.org; Mon, 10 Aug 2015 13:27:22 +0000 Received: by pacgr6 with SMTP id gr6so27271716pac.2 for ; Mon, 10 Aug 2015 06:26:40 -0700 (PDT) X-Received: by 10.67.1.72 with SMTP id be8mr45001761pad.47.1439213200287; Mon, 10 Aug 2015 06:26:40 -0700 (PDT) Received: from localhost ([199.168.112.128]) by smtp.gmail.com with ESMTPSA id fe8sm9950216pab.40.2015.08.10.06.26.36 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 10 Aug 2015 06:26:38 -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 v4 03/15] KVM: arm: enable to use the ARM_DSCR_MDBGEN macro from KVM assembly code Date: Mon, 10 Aug 2015 21:25:55 +0800 Message-Id: <1439213167-8988-4-git-send-email-zhichao.huang@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1439213167-8988-1-git-send-email-zhichao.huang@linaro.org> References: <1439213167-8988-1-git-send-email-zhichao.huang@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150810_062701_657260_F8289D12 X-CRM114-Status: UNSURE ( 9.66 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.220.51 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.220.51 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Cc: huangzhichao@huawei.com, Zhichao Huang 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.175 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 */