From: tip-bot for Mark Rutland <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
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
Subject: [tip:x86/asm] thread_info: Use unsigned long for flags
Date: Sat, 24 Sep 2016 09:28:58 -0700 [thread overview]
Message-ID: <tip-907241dccb4ce5d9413cf3c030b32b0cfc184914@git.kernel.org> (raw)
In-Reply-To: <1474651447-30447-1-git-send-email-mark.rutland@arm.com>
Commit-ID: 907241dccb4ce5d9413cf3c030b32b0cfc184914
Gitweb: http://git.kernel.org/tip/907241dccb4ce5d9413cf3c030b32b0cfc184914
Author: Mark Rutland <mark.rutland@arm.com>
AuthorDate: Fri, 23 Sep 2016 18:24:07 +0100
Committer: Ingo Molnar <mingo@kernel.org>
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 <linux/thread_info.h> 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 <mark.rutland@arm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1474651447-30447-1-git-send-email-mark.rutland@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
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) \
prev parent reply other threads:[~2016-09-24 16:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-23 17:24 [PATCH] thread_info: use unsigned long for flags Mark Rutland
2016-09-23 18:08 ` Andy Lutomirski
2016-09-23 23:48 ` Mark Rutland
2016-09-24 16:28 ` tip-bot for Mark Rutland [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-907241dccb4ce5d9413cf3c030b32b0cfc184914@git.kernel.org \
--to=tipbot@zytor.com \
--cc=akpm@linux-foundation.org \
--cc=bp@alien8.de \
--cc=brgerst@gmail.com \
--cc=dvlasenk@redhat.com \
--cc=hpa@zytor.com \
--cc=jpoimboe@redhat.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox