From patchwork Tue May 8 19:06:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kim Phillips X-Patchwork-Id: 10387443 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6DEC56037F for ; Tue, 8 May 2018 19:07:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3265928FE1 for ; Tue, 8 May 2018 19:07:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2740D29047; Tue, 8 May 2018 19:07:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8489928FE1 for ; Tue, 8 May 2018 19:07:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Mime-Version:Message-Id:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=2lsqcngAot+vdLAdAIJMb2ZFM2VctIRbgnkbbn2hyRI=; b=LO3Q/uraphTV/f IKwF4GqCwMDXseUghe6wHvBp6qhvJVsMOsazJWh6PJz4r1iVh2AMfLR2wQg7Cv7lsu/dKO8qX14Fh RkOlnp1k20GEkvLQUgMFPeRfRVUEbgCZgSy0S3zNKFrX0gxRRWT4zkiTe4WDohIJpvDPVZ++KbkFw GkUhxcNeDvosh8yf2xMcuidTv2xzaKsouyksqdS0939OdUJ+EQtXvGqN9vC3C9XX+ZSj315mWUt+V hunURMrhb8VGR03AWb2FgZeTIGR2jrSqkwbv4SmOTVkDeB6La8hfrpRszxlSJ1Imv9SuKaHx/+sQK lda9AkinZ6BgvzoszsKA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fG7xS-0004an-2N; Tue, 08 May 2018 19:07:30 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fG7wt-0003x7-8p for linux-arm-kernel@lists.infradead.org; Tue, 08 May 2018 19:06:57 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 10FAD1529; Tue, 8 May 2018 12:06:45 -0700 (PDT) Received: from dupont (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 93B613F58C; Tue, 8 May 2018 12:06:42 -0700 (PDT) Date: Tue, 8 May 2018 14:06:40 -0500 From: Kim Phillips To: Mathieu Poirier Subject: [PATCH 2/4] pid: Export find_task_by_vpid for use in external modules Message-Id: <20180508140640.0e312dba025df75cbf205cdb@arm.com> Organization: Arm X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180508_120655_375972_33557B9B X-CRM114-Status: GOOD ( 14.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kefeng Wang , Kim Phillips , Geert Uytterhoeven , Alexander Shishkin , Oleg Nesterov , David Howells , Russell King , Pavel Tatashin , Thierry Reding , Rik van Riel , Eric Auger , Alex Williamson , Kirill Tkhai , Gargi Sharma , linux-arm-kernel@lists.infradead.org, Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Mike Rapoport , Eric Biederman , Andrew Morton , Robin Murphy , Todd Kjos Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch is in the context of allowing the Coresight h/w trace driver suite to be loaded as modules. Coresight uses find_task_by_vpid when running in direct capture mode (via sysfs) when getting/setting the context ID comparator to trigger on (/sys/bus/coresight/devices/.etm/ctxid_pid). Cc: Mathieu Poirier Cc: Andrew Morton Cc: Oleg Nesterov Cc: Gargi Sharma Cc: Rik van Riel Cc: Pavel Tatashin Cc: Kefeng Wang Cc: Kirill Tkhai Cc: Mike Rapoport Cc: David Howells Cc: "Eric W. Biederman" Signed-off-by: Kim Phillips Nacked-by: "Eric W. Biederman" --- Current CoreSight callsite: https://lxr.missinglinkelectronics.com/linux/include/linux/coresight.h#L285 A quick look didn't find anything, but if Coresight needs to do something differently, please comment. kernel/pid.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/pid.c b/kernel/pid.c index 157fe4b19971..92b1b623f3e0 100644 --- a/kernel/pid.c +++ b/kernel/pid.c @@ -342,6 +342,7 @@ struct task_struct *find_task_by_vpid(pid_t vnr) { return find_task_by_pid_ns(vnr, task_active_pid_ns(current)); } +EXPORT_SYMBOL_GPL(find_task_by_vpid); struct task_struct *find_get_task_by_vpid(pid_t nr) {