From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759248AbcIXQaM (ORCPT ); Sat, 24 Sep 2016 12:30:12 -0400 Received: from terminus.zytor.com ([198.137.202.10]:56972 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759011AbcIXQaF (ORCPT ); Sat, 24 Sep 2016 12:30:05 -0400 Date: Sat, 24 Sep 2016 09:28:58 -0700 From: tip-bot for Mark Rutland Message-ID: Cc: akpm@linux-foundation.org, tglx@linutronix.de, mark.rutland@arm.com, brgerst@gmail.com, linux-kernel@vger.kernel.org, peterz@infradead.org, hpa@zytor.com, torvalds@linux-foundation.org, bp@alien8.de, mingo@kernel.org, keescook@chromium.org, jpoimboe@redhat.com, luto@kernel.org, dvlasenk@redhat.com Reply-To: akpm@linux-foundation.org, mark.rutland@arm.com, tglx@linutronix.de, brgerst@gmail.com, linux-kernel@vger.kernel.org, hpa@zytor.com, peterz@infradead.org, torvalds@linux-foundation.org, bp@alien8.de, mingo@kernel.org, keescook@chromium.org, jpoimboe@redhat.com, luto@kernel.org, dvlasenk@redhat.com In-Reply-To: <1474651447-30447-1-git-send-email-mark.rutland@arm.com> References: <1474651447-30447-1-git-send-email-mark.rutland@arm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/asm] thread_info: Use unsigned long for flags Git-Commit-ID: 907241dccb4ce5d9413cf3c030b32b0cfc184914 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 907241dccb4ce5d9413cf3c030b32b0cfc184914 Gitweb: http://git.kernel.org/tip/907241dccb4ce5d9413cf3c030b32b0cfc184914 Author: Mark Rutland AuthorDate: Fri, 23 Sep 2016 18:24:07 +0100 Committer: Ingo Molnar CommitDate: Sat, 24 Sep 2016 09:35:06 +0200 thread_info: Use unsigned long for flags The generic THREAD_INFO_IN_TASK definition of thread_info::flags is a u32, matching x86 prior to the introduction of THREAD_INFO_IN_TASK. However, common helpers like test_ti_thread_flag() implicitly assume that thread_info::flags has at least the size and alignment of unsigned long, and relying on padding and alignment provided by other elements of task_struct is somewhat fragile. Additionally, some architectures use more that 32 bits for thread_info::flags, and others may need to in future. With THREAD_INFO_IN_TASK, task struct follows thread_info with a long field, and thus we no longer save any space as we did back in commit: affa219b60a11b32 ("x86: change thread_info's flag field back to 32 bits") Given all this, it makes more sense for the generic thread_info::flags to be an unsigned long. In fact given contains/uses the helpers mentioned above, BE arches *must* use unsigned long (or something of the same size) today, or they wouldn't work. Make it so. Signed-off-by: Mark Rutland Cc: Andrew Morton Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Josh Poimboeuf Cc: Kees Cook Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1474651447-30447-1-git-send-email-mark.rutland@arm.com Signed-off-by: Ingo Molnar --- include/linux/thread_info.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h index e2d0fd8..45f004e 100644 --- a/include/linux/thread_info.h +++ b/include/linux/thread_info.h @@ -15,7 +15,7 @@ struct compat_timespec; #ifdef CONFIG_THREAD_INFO_IN_TASK struct thread_info { - u32 flags; /* low level flags */ + unsigned long flags; /* low level flags */ }; #define INIT_THREAD_INFO(tsk) \