Received: by 10.223.148.5 with SMTP id 5csp6085565wrq; Wed, 17 Jan 2018 09:09:51 -0800 (PST) X-Google-Smtp-Source: ACJfBotK5OB3R8yQTW2A+k771Ya5JecVney+TLVaOxX0o1i1XcO+P/ttmFkIhq7hXou1F9s2UCq6 X-Received: by 10.99.112.81 with SMTP id a17mr28210749pgn.293.1516208991209; Wed, 17 Jan 2018 09:09:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516208991; cv=none; d=google.com; s=arc-20160816; b=o5+il3DSjgPIrr5typdbvwsJ2mReQncEvRZzOK4GfrfdrRNvfQI4outjhfyEW1KYkv PYrVm/qcwkRncofaTkoHO2yA8FbrLNlXHKKYQmmea/7GaXf3IHKbq07OaDa8hdJtrSXB GeajjNXHNMbKbP13TNHh7/4utUX/4qOhN6RIoeKZg7dM2uyIFNjyAXyAEG1pb0X7A23V V2W8i8OG22MgK9XAXZ4m5XAqlpSjWMDuBI1TuhNoE2CTx3hcwXz1aiKEQgN62iTvYXVG 1cU0s7+bZuQIKrE9G+bRiHVMaxIlq1u+xAlB6Q2mD1/kTYsyvioalKS9dfTSKD0mrAgm TXDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:subject:cc:to:from:date :arc-authentication-results; bh=sMH40bEgIdoqG+YBjhPPeZtdH83sZ45wO482Ac3iLVA=; b=L6Pas5yv69HbthNjICmRInJ3XlP29v0CcY2qeRdSl5g1eceTHY2fhzsUFwiILdCpUR PAnxMuuorbQ5mKgSR1f4D3OWTLZTdXmdIgIYES6i3IyJpkCtkURUg8KqDSkyux1MejzA plJhUtVXPZmV/N6yZuN2QYe0mF1Gu34BLkA9NEXBn16RbgAcYPHO6Lxb8sWaZYyCYvOZ Ytp8+3EaZbXTyIsIGt1De9TqFcpiPJuMwVZipt7L+AnYLzD8se59wXetbjXIrRmaKDQs +6//bA8MgM1Z8nuYuTv+R9D6DaGh5up/mqIHiK7zvfSyBVa8/7fLbAJdC8Y5wNNUGPwR dFWQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e22si4535826pff.210.2018.01.17.09.09.36; Wed, 17 Jan 2018 09:09:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754011AbeAQRHb (ORCPT + 99 others); Wed, 17 Jan 2018 12:07:31 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:39754 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752306AbeAQRHa (ORCPT ); Wed, 17 Jan 2018 12:07:30 -0500 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0HGxj8J072684 for ; Wed, 17 Jan 2018 12:07:29 -0500 Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149]) by mx0b-001b2d01.pphosted.com with ESMTP id 2fj7632xpn-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 17 Jan 2018 12:07:29 -0500 Received: from localhost by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 17 Jan 2018 10:07:28 -0700 Received: from b03cxnp08027.gho.boulder.ibm.com (9.17.130.19) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 17 Jan 2018 10:07:26 -0700 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0HH7QAF12911026; Wed, 17 Jan 2018 10:07:26 -0700 Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 10EC0C6047; Wed, 17 Jan 2018 10:07:26 -0700 (MST) Received: from suka-w540.localdomain (unknown [9.70.94.25]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP id DF5D0C6037; Wed, 17 Jan 2018 10:07:25 -0700 (MST) Received: by suka-w540.localdomain (Postfix, from userid 1000) id 66AF22280BF; Wed, 17 Jan 2018 09:07:24 -0800 (PST) Date: Wed, 17 Jan 2018 09:07:24 -0800 From: Sukadev Bhattiprolu To: Frederic Barrat Cc: Michael Ellerman , linuxppc-dev@ozlabs.org, Christophe Lombard , linux-kernel@vger.kernel.org, Philippe Bergheaud Subject: Re: [PATCH 1/2] powerpc: export thread-tidr interfaces References: <1516153832-9282-1-git-send-email-sukadev@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux 2.0.32 on an i486 User-Agent: Mutt/1.7.1 (2016-10-04) X-TM-AS-GCONF: 00 x-cbid: 18011717-8235-0000-0000-00000CE220E9 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008395; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000247; SDB=6.00976405; UDB=6.00494965; IPR=6.00756332; BA=6.00005782; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00019096; XFM=3.00000015; UTC=2018-01-17 17:07:27 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18011717-8236-0000-0000-00003F49D6F1 Message-Id: <20180117170724.GA5314@us.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-17_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801170239 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Frederic Barrat [fbarrat@linux.vnet.ibm.com] wrote: > Hi, > > > > diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c > > index 2010e4c..f20c1ad 100644 > > --- a/arch/powerpc/kernel/process.c > > +++ b/arch/powerpc/kernel/process.c > > @@ -1560,6 +1560,7 @@ void clear_thread_tidr(struct task_struct *t) > > free_thread_tidr(t->thread.tidr); > > t->thread.tidr = 0; > > } > > +EXPORT_SYMBOL_GPL(clear_thread_tidr); > > Isn't it dangerous to export clear_thread_tidr()? Other modules may also > have assigned the TIDR by calling set_thread_tidr(), so clearing it could > potentially break those other modules. My understanding is that once the > TIDR is assigned, there's no safe way to reclaim it other than the thread > exiting. Or we would need some kind of reference counter. Yes the FTW driver avoids calling clear_thread_tidr() for the same reasons. I don't have a strong case for exporting clear_thread_tidr(). Here is the updated patch, exporting just the set_thread_tidr(). Thanks, Sukadev --- From 204ee3c918f8dad46c1e40d2d3730b07c10a87a3 Mon Sep 17 00:00:00 2001 From: Sukadev Bhattiprolu Date: Mon, 15 Jan 2018 13:43:18 -0600 Subject: [PATCH 1/2] powerpc: export set_thread_tidr() Export set_thread_tidr() so it can be used by external modules. Signed-off-by: Sukadev Bhattiprolu --- Changelog [Frederic Barrat] Don't export clear_thread_tidr() --- arch/powerpc/kernel/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 2010e4c..20df2cb2 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c @@ -1592,6 +1592,7 @@ int set_thread_tidr(struct task_struct *t) return 0; } +EXPORT_SYMBOL_GPL(set_thread_tidr); #endif /* CONFIG_PPC64 */ -- 1.8.3.1