From patchwork Thu Aug 1 23:45:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Long X-Patchwork-Id: 2837412 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 245FA9F485 for ; Thu, 1 Aug 2013 23:47:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E6B6B203ED for ; Thu, 1 Aug 2013 23:47:47 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BBD93203E3 for ; Thu, 1 Aug 2013 23:47:46 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V52aH-0003Gr-4F; Thu, 01 Aug 2013 23:47:05 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V52a4-0000WA-1K; Thu, 01 Aug 2013 23:46:52 +0000 Received: from mail-yh0-f42.google.com ([209.85.213.42]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V52ZZ-0000Ql-Aj for linux-arm-kernel@lists.infradead.org; Thu, 01 Aug 2013 23:46:22 +0000 Received: by mail-yh0-f42.google.com with SMTP id l109so738yhq.29 for ; Thu, 01 Aug 2013 16:46:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=b0s0L/KRC7eZiefmt/Fc6W/ul9+Tta2eioyUVgXYUOM=; b=KuRUPmuYV6G9boR0h7f/dFB7xmSOxCwxzOsPEk7rRHNGy/yypy2FjLWq5bbi09cYM2 b6B1OFd/Lwy8hU/fjGe342VmLXA/TX6aMX3bfx8ZqyOffOHwzOyUU8BJi1dERAaIZYw2 wTbyNzrM4UXu/wVx5hAcbWQ/+jQK4Fw0iQlimY8zEw4aG66ogRvfHOTQoCQOK4IHeyum bIezP/sESXOq8kHQ2tpJf/UlB1Pu4VhKCW8HD/zQFkiOWVGns0zIbW3PFB9V4e7xtf95 F15QRgAK9PgNaJHONujeLGthjXXs1GOWFZTjxS9681LCvwo0y6iKdI0JguEAEY8lUjXZ pGcw== X-Received: by 10.236.112.143 with SMTP id y15mr2534247yhg.70.1375400760292; Thu, 01 Aug 2013 16:46:00 -0700 (PDT) Received: from localhost.localdomain (pool-71-181-37-252.cncdnh.fast.myfairpoint.net. [71.181.37.252]) by mx.google.com with ESMTPSA id b48sm7874263yhc.8.2013.08.01.16.45.59 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 01 Aug 2013 16:45:59 -0700 (PDT) From: David Long To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 4/9] uprobes: allow arch-specific initialization Date: Thu, 1 Aug 2013 19:45:48 -0400 Message-Id: <1375400753-3454-5-git-send-email-dave.long@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1375400753-3454-1-git-send-email-dave.long@linaro.org> References: <1375400753-3454-1-git-send-email-dave.long@linaro.org> X-Gm-Message-State: ALoCoQkRjfto7+mWYVxFo6UazcA65/fTck/Ko3nzUPJ0hQqlrTIuHTDVhDrIJhPWHhwIaql6yjGU X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130801_194621_465656_D9606134 X-CRM114-Status: GOOD ( 12.66 ) X-Spam-Score: -2.6 (--) Cc: Rabin Vincent , "Jon Medhurst \(Tixy\)" , linux-kernel@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 From: Rabin Vincent 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 Signed-off-by: David A. Long --- 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 f6287f0..6feae5d 100644 --- a/include/linux/uprobes.h +++ b/include/linux/uprobes.h @@ -135,6 +135,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 64471bd..5004f6f 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c @@ -1862,8 +1862,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++) @@ -1872,6 +1878,10 @@ static int __init init_uprobes(void) if (percpu_init_rwsem(&dup_mmap_sem)) return -ENOMEM; + ret = arch_uprobes_init(); + if (ret) + return ret; + return register_die_notifier(&uprobe_exception_nb); } module_init(init_uprobes);