From: Gabriel Krisman Bertazi <krisman@collabora.com>
To: luto@kernel.org, tglx@linutronix.de
Cc: keescook@chromium.org, x86@kernel.org,
linux-kernel@vger.kernel.org,
Gabriel Krisman Bertazi <krisman@collabora.com>,
kernel@collabora.com
Subject: [PATCH 4/6] arch: x86: Expose psABI on thread_info
Date: Tue, 28 Jul 2020 16:22:27 -0400 [thread overview]
Message-ID: <20200728202229.1195682-5-krisman@collabora.com> (raw)
In-Reply-To: <20200728202229.1195682-1-krisman@collabora.com>
Expose psABI in thread_info, in preparation for the TIF_IA32 and
TIF_X32 flags removal.
Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
---
arch/x86/include/asm/thread_info.h | 2 ++
arch/x86/kernel/process_64.c | 3 +++
2 files changed, 5 insertions(+)
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index 6d55a9c0dda2..698feefd5f5f 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -62,11 +62,13 @@ enum {
struct thread_info {
unsigned long flags; /* low level flags */
u32 status; /* thread synchronous flags */
+ short int psabi;
};
#define INIT_THREAD_INFO(tsk) \
{ \
.flags = 0, \
+ .psabi = 0, \
}
#else /* !__ASSEMBLY__ */
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index f20a365017b8..aea2c03e8a5d 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -532,6 +532,7 @@ void set_personality_64bit(void)
/* inherit personality from parent */
/* Make sure to be in 64bit mode */
+ current_thread_info()->psabi = PSABI_IA64;
clear_thread_flag(TIF_IA32);
clear_thread_flag(TIF_ADDR32);
clear_thread_flag(TIF_X32);
@@ -553,6 +554,7 @@ void set_personality_64bit(void)
static void __set_personality_x32(void)
{
#ifdef CONFIG_X86_X32
+ current_thread_info()->psabi = PSABI_X32;
clear_thread_flag(TIF_IA32);
set_thread_flag(TIF_X32);
if (current->mm)
@@ -574,6 +576,7 @@ static void __set_personality_x32(void)
static void __set_personality_ia32(void)
{
#ifdef CONFIG_IA32_EMULATION
+ current_thread_info()->psabi = PSABI_IA32;
set_thread_flag(TIF_IA32);
clear_thread_flag(TIF_X32);
if (current->mm)
--
2.27.0
next prev parent reply other threads:[~2020-07-28 20:23 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-28 20:22 [PATCH 0/6] Reclaim x86 psABI TIF flags Gabriel Krisman Bertazi
2020-07-28 20:22 ` [PATCH 1/6] arch: x86: Don't use TIF flags for mm context Gabriel Krisman Bertazi
2020-07-29 9:03 ` peterz
2020-07-28 20:22 ` [PATCH 2/6] arch: x86: Wrap TIF_IA32 checks Gabriel Krisman Bertazi
2020-07-29 3:43 ` Andy Lutomirski
2020-07-29 4:46 ` Gabriel Krisman Bertazi
2020-07-29 5:09 ` Andy Lutomirski
2020-07-29 18:11 ` Gabriel Krisman Bertazi
2020-07-29 6:59 ` Christoph Hellwig
2020-07-29 9:11 ` peterz
2020-07-28 20:22 ` [PATCH 3/6] arch: x86: Wrap TIF_X32 checks Gabriel Krisman Bertazi
2020-07-29 4:54 ` Andy Lutomirski
2020-07-28 20:22 ` Gabriel Krisman Bertazi [this message]
2020-07-29 3:44 ` [PATCH 4/6] arch: x86: Expose psABI on thread_info Andy Lutomirski
2020-07-28 20:22 ` [PATCH 5/6] arch: x86: Reclaim TIF_IA32 flag Gabriel Krisman Bertazi
2020-07-28 20:22 ` [PATCH 6/6] arch: x86: Reclaim TIF_X32 flag Gabriel Krisman Bertazi
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=20200728202229.1195682-5-krisman@collabora.com \
--to=krisman@collabora.com \
--cc=keescook@chromium.org \
--cc=kernel@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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