diff options
author | 2023-03-12 14:25:57 +0300 | |
---|---|---|
committer | 2023-03-16 13:08:39 -0700 | |
commit | 5ef495e55f07aa117fdd8e187c9901cefc02fe0a (patch) | |
tree | 796fe02adece943b5b149acbd00f9d327a821596 /arch/x86/entry | |
parent | x86/mm: Rework address range check in get_user() and put_user() (diff) | |
download | linux-5ef495e55f07aa117fdd8e187c9901cefc02fe0a.tar.gz linux-5ef495e55f07aa117fdd8e187c9901cefc02fe0a.tar.bz2 linux-5ef495e55f07aa117fdd8e187c9901cefc02fe0a.zip |
x86: Allow atomic MM_CONTEXT flags setting
So far there's no need in atomic setting of MM context flags in
mm_context_t::flags. The flags set early in exec and never change
after that.
LAM enabling requires atomic flag setting. The upcoming flag
MM_CONTEXT_FORCE_TAGGED_SVA can be set much later in the process
lifetime where multiple threads exist.
Convert the field to unsigned long and do MM_CONTEXT_* accesses with
__set_bit() and test_bit().
No functional changes.
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Alexander Potapenko <glider@google.com>
Link: https://lore.kernel.org/all/20230312112612.31869-3-kirill.shutemov%40linux.intel.com
Diffstat (limited to 'arch/x86/entry')
-rw-r--r-- | arch/x86/entry/vsyscall/vsyscall_64.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/entry/vsyscall/vsyscall_64.c b/arch/x86/entry/vsyscall/vsyscall_64.c index d234ca797e4a..e0ca8120aea8 100644 --- a/arch/x86/entry/vsyscall/vsyscall_64.c +++ b/arch/x86/entry/vsyscall/vsyscall_64.c @@ -317,7 +317,7 @@ static struct vm_area_struct gate_vma __ro_after_init = { struct vm_area_struct *get_gate_vma(struct mm_struct *mm) { #ifdef CONFIG_COMPAT - if (!mm || !(mm->context.flags & MM_CONTEXT_HAS_VSYSCALL)) + if (!mm || !test_bit(MM_CONTEXT_HAS_VSYSCALL, &mm->context.flags)) return NULL; #endif if (vsyscall_mode == NONE) |