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: 21049 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f199.google.com (mail-ve0-f199.google.com [209.85.128.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id ED89C20D84 for ; Tue, 15 Oct 2013 21:04:37 +0000 (UTC) Received: by mail-ve0-f199.google.com with SMTP id c14sf3833899vea.6 for ; Tue, 15 Oct 2013 14:04:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=34BfVmOmuala3q9xqUoBd8Mn8fmkVSSAl6WZGMtq0TU=; b=AXITF1FiAXvMpdLSW5ub8pjq2SS+nEVzUB/aXecsYF0OEzYDd9RrtREhqRTTqdJ4Mx yyn3BQNBOhAh9neK/LXdi/AYqoEc+4MU+I4HS8a+Eta6usCshIj26f26QJGwHy2Ki1Wd p8YavPQVqgQmkqdR7l1Rnscqxyw35VLMrp7Uwf32xFm7SYM4bTvE41xD2X3/l3W+H4b1 5DgrpTvN6OeXD4yYypX8hsyjELmVsrdmpPunNdGKym+/oRokAYHwPsnnO5IhOOFCzzNt 0lehPD7I+PCtfRfhhrySmkNqQxpY0UpQV4o2jESttHIVGcfLP1O5e3zWPCiv8cFXFqSz cXcw== X-Received: by 10.58.46.36 with SMTP id s4mr4765328vem.18.1381871077797; Tue, 15 Oct 2013 14:04:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.2.166 with SMTP id 6ls273707qev.69.gmail; Tue, 15 Oct 2013 14:04:37 -0700 (PDT) X-Received: by 10.58.161.231 with SMTP id xv7mr13465636veb.2.1381871077694; Tue, 15 Oct 2013 14:04:37 -0700 (PDT) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id ee8si23427324vdc.119.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Oct 2013 14:04:37 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.170; Received: by mail-ve0-f170.google.com with SMTP id db12so1042279veb.29 for ; Tue, 15 Oct 2013 14:04:37 -0700 (PDT) X-Gm-Message-State: ALoCoQm6p6Rfvt7BCtBuO8UoJyvlCzc+BW7IinWZkjs280IN5L4Q/c//Eub/QuwO9NC70ErdXnwG X-Received: by 10.52.173.165 with SMTP id bl5mr35254052vdc.18.1381871077587; Tue, 15 Oct 2013 14:04:37 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp328414vcz; Tue, 15 Oct 2013 14:04:37 -0700 (PDT) X-Received: by 10.49.70.129 with SMTP id m1mr36692252qeu.69.1381871077196; Tue, 15 Oct 2013 14:04:37 -0700 (PDT) Received: from mail-qc0-f176.google.com (mail-qc0-f176.google.com [209.85.216.176]) by mx.google.com with ESMTPS id jz14si11625974qeb.43.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Oct 2013 14:04:37 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.216.176 is neither permitted nor denied by best guess record for domain of dave.long@linaro.org) client-ip=209.85.216.176; Received: by mail-qc0-f176.google.com with SMTP id t7so6386770qcv.7 for ; Tue, 15 Oct 2013 14:04:37 -0700 (PDT) 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 Cc: Rabin Vincent , "Jon Medhurst (Tixy)" , Oleg Nesterov , Srikar Dronamraju , Ingo Molnar , linux-kernel@vger.kernel.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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: dave.long@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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);