From patchwork Sun Oct 14 19:23:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rabin Vincent X-Patchwork-Id: 1591631 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 0E22040135 for ; Sun, 14 Oct 2012 19:26:30 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TNTnk-00068B-IK; Sun, 14 Oct 2012 19:24:40 +0000 Received: from mail-lb0-f177.google.com ([209.85.217.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TNTmr-0005wO-RM for linux-arm-kernel@lists.infradead.org; Sun, 14 Oct 2012 19:23:47 +0000 Received: by mail-lb0-f177.google.com with SMTP id gi11so2942876lbb.36 for ; Sun, 14 Oct 2012 12:23:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=O3NG7LmPkwh2DAxiELe3OdBQRgztnBH9VPTh+FmicWk=; b=cibahRKccKZ8vlmXaEX/16E8KImsN0z2Ok9VAdugUNydtEBl71vrdm2M5Jjg6P9BE2 edtbNM2ptZxb5h3Iimlv5FoqqBhAeyMiYXYSCsqhQW+DFZqZ3aRQxKvTaDykbKGfbzMk JqJUijgJhlSnEmPiBCaCH7XKDal3VrledbEcCxFQUokYRTOHszIK9eF0x5qiF0yTV7Xy jNmJmWfiT7UW7s3vFMzIcjtGF/uKSBjM13ScjSnQvpjpoRkhMsyHwl3jNG6kIEPZKGz2 a17k96Xye+AJruRwW/Onp5rOY0SxgBwt1Medbw70RvWaEzqbYQ33NNQKJZBAya3VC7aq 2cZg== Received: by 10.112.39.170 with SMTP id q10mr3332010lbk.120.1350242625432; Sun, 14 Oct 2012 12:23:45 -0700 (PDT) Received: from localhost.localdomain (c83-254-195-218.bredband.comhem.se. [83.254.195.218]) by mx.google.com with ESMTPS id ef4sm556036lbb.13.2012.10.14.12.23.43 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 14 Oct 2012 12:23:44 -0700 (PDT) From: Rabin Vincent To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 5/9] uprobes: allow arch-specific initialization Date: Sun, 14 Oct 2012 21:23:09 +0200 Message-Id: <1350242593-17761-5-git-send-email-rabin@rab.in> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1350242593-17761-1-git-send-email-rabin@rab.in> References: <1350242593-17761-1-git-send-email-rabin@rab.in> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.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.217.177 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (rabin.vincent[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Peter Zijlstra , Rabin Vincent , Srikar Dronamraju , oleg@redhat.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add a weak function for any architecture-specific initialization. ARM will use this to register the handlers for the undefined instructions it uses to implement uprobes. Signed-off-by: Rabin Vincent --- include/linux/uprobes.h | 1 + kernel/events/uprobes.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h index b4380ad..c3dc5de 100644 --- a/include/linux/uprobes.h +++ b/include/linux/uprobes.h @@ -130,6 +130,7 @@ extern int arch_uprobe_exception_notify(struct notifier_block *self, unsigned l extern void arch_uprobe_abort_xol(struct arch_uprobe *aup, struct pt_regs *regs); extern bool __weak arch_uprobe_ignore(struct arch_uprobe *aup, struct pt_regs *regs); extern void __weak arch_uprobe_xol_copy(struct arch_uprobe *auprobe, void *vaddr); +extern int __weak arch_uprobes_init(void); #else /* !CONFIG_UPROBES */ struct uprobes_state { }; diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index f7ff3a4..ca000a9 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c @@ -1634,8 +1634,14 @@ static struct notifier_block uprobe_exception_nb = { .priority = INT_MAX-1, /* notified after kprobes, kgdb */ }; +int __weak __init arch_uprobes_init(void) +{ + return 0; +} + static int __init init_uprobes(void) { + int ret; int i; for (i = 0; i < UPROBES_HASH_SZ; i++) { @@ -1643,6 +1649,10 @@ static int __init init_uprobes(void) mutex_init(&uprobes_mmap_mutex[i]); } + ret = arch_uprobes_init(); + if (ret) + return ret; + return register_die_notifier(&uprobe_exception_nb); } module_init(init_uprobes);