Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752281AbeAQGpu (ORCPT + 1 other); Wed, 17 Jan 2018 01:45:50 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:50790 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750847AbeAQGpg (ORCPT ); Wed, 17 Jan 2018 01:45:36 -0500 Subject: Re: [PATCH 1/2] powerpc: export thread-tidr interfaces To: Sukadev Bhattiprolu , Michael Ellerman Cc: linuxppc-dev@ozlabs.org, Christophe Lombard , linux-kernel@vger.kernel.org, Philippe Bergheaud References: <1516153832-9282-1-git-send-email-sukadev@linux.vnet.ibm.com> From: Frederic Barrat Date: Wed, 17 Jan 2018 07:45:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <1516153832-9282-1-git-send-email-sukadev@linux.vnet.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 18011706-0008-0000-0000-000004C2A892 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18011706-0009-0000-0000-00001E56157B Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-17_02:,, 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=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801170097 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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. > void arch_release_task_struct(struct task_struct *t) > { > @@ -1592,6 +1593,7 @@ int set_thread_tidr(struct task_struct *t) > > return 0; > } > +EXPORT_SYMBOL_GPL(set_thread_tidr); FYI, there's a capi patch we hope to merge soon which is also doing this: http://patchwork.ozlabs.org/patch/858935/ Fred