From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754035AbeAQRHc (ORCPT ); Wed, 17 Jan 2018 12:07:32 -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 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 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