Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756906AbcJTK3h (ORCPT ); Thu, 20 Oct 2016 06:29:37 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:53532 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754041AbcJTK3f (ORCPT ); Thu, 20 Oct 2016 06:29:35 -0400 Date: Thu, 20 Oct 2016 12:29:26 +0200 From: Heiko Carstens To: Mark Rutland Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, akpm@linux-foundation.org, hpa@zytor.com, keescook@chromium.org, luto@kernel.org, mingo@redhat.com, tglx@linutronix.de Subject: Re: [PATCH 3/3] thread_info: include for THREAD_INFO_IN_TASK References: <1476901693-8492-1-git-send-email-mark.rutland@arm.com> <1476901693-8492-4-git-send-email-mark.rutland@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1476901693-8492-4-git-send-email-mark.rutland@arm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16102010-0016-0000-0000-0000024F49AB X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16102010-0017-0000-0000-000023790EE7 Message-Id: <20161020102925.GA3529@osiris> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-10-20_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1610200189 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1487 Lines: 37 On Wed, Oct 19, 2016 at 07:28:13PM +0100, Mark Rutland wrote: > When CONFIG_THREAD_INFO_IN_TASK is selected, the current_thread_info() > macro relies on current having been defined prior to its use. However, > not all users of current_thread_info() include , and thus > current is not guaranteed to be defined. > > When CONFIG_THREAD_INFO_IN_TASK is not selected, it's possible that > get_current() / current are based upon current_thread_info(), and > includes . Thus always including > would result in circular dependences on some platforms. > > To ensure both cases work, this patch includes , but only > when CONFIG_THREAD_INFO_IN_TASK is selected. > > Signed-off-by: Mark Rutland > Cc: Andrew Morton > Cc: Andy Lutomirski > Cc: Heiko Carstens > Cc: Kees Cook > --- > include/linux/thread_info.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h > index c75c6ab..ef1f4b0 100644 > --- a/include/linux/thread_info.h > +++ b/include/linux/thread_info.h > @@ -12,6 +12,7 @@ > #include > > #ifdef CONFIG_THREAD_INFO_IN_TASK > +#include > #define current_thread_info() ((struct thread_info *)current) > #endif FWIW: Acked-by: Heiko Carstens