From patchwork Sun Feb 15 08:27:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 5829611 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 11D2DBF440 for ; Sun, 15 Feb 2015 08:38:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 734AF2020E for ; Sun, 15 Feb 2015 08:38:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D254E2014A for ; Sun, 15 Feb 2015 08:38:44 +0000 (UTC) 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 1YMufv-00049S-Uo; Sun, 15 Feb 2015 08:35:35 +0000 Received: from szxga01-in.huawei.com ([119.145.14.64]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YMufo-0002zc-BL for linux-arm-kernel@lists.infradead.org; Sun, 15 Feb 2015 08:35:29 +0000 Received: from 172.24.2.119 (EHLO lggeml424-hub.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CJO05236; Sun, 15 Feb 2015 16:34:01 +0800 (CST) Received: from kernel-host.huawei (10.107.197.247) by lggeml424-hub.china.huawei.com (10.72.61.34) with Microsoft SMTP Server id 14.3.158.1; Sun, 15 Feb 2015 16:33:49 +0800 From: Wang Nan To: Subject: [RFC PATCH 1/3] early kprobes: ARM: add definition for vmlinux.lds use. Date: Sun, 15 Feb 2015 16:27:05 +0800 Message-ID: <1423988825-7211-1-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1423988798-7104-1-git-send-email-wangnan0@huawei.com> References: <1423988798-7104-1-git-send-email-wangnan0@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.107.197.247] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150215_003528_552209_B76B5224 X-CRM114-Status: UNSURE ( 6.10 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: x86@kernel.org, lizefan@huawei.com, linux-arm-kernel@lists.infradead.org, rostedt@goodmis.org, linux-kernel@vger.kernel.org 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch defines MAX_OPTINSN_SIZE, MAX_INSN_SIZE and KPROBE_OPCODE_SIZE for ARM for vmlinux.lds.S use. These macros are originally defined in kprobes.h, which are unable to be used in vmlinux.lds. Signed-off-by: Wang Nan --- arch/arm/kernel/vmlinux.lds.S | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index b31aa73..38ba4fd 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S @@ -45,6 +45,16 @@ #define ARM_EXIT_DISCARD(x) x #endif +#ifdef CONFIG_EARLY_KPROBES +# ifdef CONFIG_THUMB2_KERNEL +# error "Thumb2 kernel does not support early kprobes now" +# else +# define MAX_OPTINSN_SIZE (optprobe_template_end - optprobe_template_entry) +# define MAX_INSN_SIZE 2 +# define KPROBE_OPCODE_SIZE 4 +# endif +#endif + OUTPUT_ARCH(arm) ENTRY(stext)