From patchwork Tue Oct 15 21:04:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Long X-Patchwork-Id: 3048541 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 BDC899F2B7 for ; Tue, 15 Oct 2013 21:07:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E011320425 for ; Tue, 15 Oct 2013 21:07:31 +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 A268220421 for ; Tue, 15 Oct 2013 21:07:30 +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 1VWBom-00039S-BM; Tue, 15 Oct 2013 21:06:16 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VWBoS-0005zp-0E; Tue, 15 Oct 2013 21:05:56 +0000 Received: from mail-qc0-f178.google.com ([209.85.216.178]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VWBnW-0005rT-3e for linux-arm-kernel@lists.infradead.org; Tue, 15 Oct 2013 21:04:59 +0000 Received: by mail-qc0-f178.google.com with SMTP id x19so1153062qcw.23 for ; Tue, 15 Oct 2013 14:04:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=34BfVmOmuala3q9xqUoBd8Mn8fmkVSSAl6WZGMtq0TU=; b=PbyR1WTN+1RGAme9Q9OHKyVTUbE+bm6UTPQEL0lg7wM4KAVbnomxJ+L8Ri+XeNHNrT Sa4eJzxg56Xx8giA07vBwrsTZ8Sg+0P/wmMe8DBBC0bSZuGHGoVqYvrZYq3dg7cJXpCC kyWqYw04N6vcmZtiOVzAE+t+8ywVY2wffif+ZjBEuBD/Ft1Gxdv+X1giyHwHVz2E7/2r PbyOqn/BkVzRb8jM14E8S3L/guGHsXwel73lo7bDSuA057KwzulhdYGg7+NAHjamlASO DmokljYvdwPzUpI7XS3LMYdL3Vxk1l3DjzExm1UvB3vrzZi7IBChrynEVkTPuMwke5xV pmOw== X-Gm-Message-State: ALoCoQnLDOqjmD7dx6HigXdeHcDXDQvGTmSx43r8L1p+X0R7oJEkAWTUb92MT6+oX9E1AFEumN7e X-Received: by 10.224.1.194 with SMTP id 2mr33027742qag.70.1381871076854; Tue, 15 Oct 2013 14:04:36 -0700 (PDT) Received: from localhost.localdomain (pool-72-71-243-183.cncdnh.fast00.myfairpoint.net. [72.71.243.183]) by mx.google.com with ESMTPSA id i4sm159645128qan.0.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Oct 2013 14:04:36 -0700 (PDT) From: David Long To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 04/13] uprobes: allow arch-specific initialization Date: Tue, 15 Oct 2013 17:04:19 -0400 Message-Id: <1381871068-27660-5-git-send-email-dave.long@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1381871068-27660-1-git-send-email-dave.long@linaro.org> References: <1381871068-27660-1-git-send-email-dave.long@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131015_170458_248886_F29532EF X-CRM114-Status: GOOD ( 13.45 ) X-Spam-Score: -2.6 (--) Cc: "Jon Medhurst \(Tixy\)" , Srikar Dronamraju , Oleg Nesterov , linux-kernel@vger.kernel.org, Rabin Vincent , Ingo Molnar 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=-4.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 2556ab6..a28dcbe 100644 --- a/include/linux/uprobes.h +++ b/include/linux/uprobes.h @@ -135,6 +135,7 @@ extern void arch_uprobe_abort_xol(struct arch_uprobe *aup, struct pt_regs *regs) extern unsigned long arch_uretprobe_hijack_return_addr(unsigned long trampoline_vaddr, 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 22d0121..9734a5f 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c @@ -1860,8 +1860,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++) @@ -1870,6 +1876,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);