Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp581589ybg; Tue, 28 Jul 2020 13:23:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzivf1CT/KEIDsJ7DoegK4vy+7hJmbMBlPmWSoYBTcshu0LPkkRnFNIfywA0zHsrOwPvDqh X-Received: by 2002:a05:6402:74a:: with SMTP id p10mr8424128edy.348.1595967797901; Tue, 28 Jul 2020 13:23:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595967797; cv=none; d=google.com; s=arc-20160816; b=f1GWAnIDbu4GMi376ILvIOn2C6ZFuI1DuTewSb+zCffQCVKAZW74sMnSlonv3Zjszq FRRJkS5s67R0EWHQ3pRcYuIqgvf1rCEO6CRjlrl/XX13uszctKFuf/OIran9rqrgSL4r HooTLpc7R7fVIjiK0hvmT1N4l/rFs4ptgYZ4czagCLef3x9DkkLnREHaTNi3+rD/fw5C d12xRv/cHL8r+bi2Y/FLWCeQQSDtH6idropK10mxpD76b58aBOcjwAvsKEpYa4IC3lkI 6LXWe/RIk2RKeA5q5dWvueG97M/sqIgcJ3Muj1KGsMS31EMqCSANL74rUnswYHrI+tOv Y9Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=IITY1BRzvwZYVljCfdn4QVQDNArYyHsKzkcXRRxbKdE=; b=vk0Ptf9BTh8b4leaV6Yz85qBRhJoQSOdZ6/6Ot4Z925gPYmWGskj4MA/Cz+ezraQc6 wuNPbWgQ1Lbwz/s9fUNrOofaFP2WBaDw4iERfYxGxZkiaRcvjxtWjXp5ZxC04JaiLXyq 47MG82rzPNqQ3rJUHcD9S1jjrJfWMfwrU6qt2dJyAD2rHMwDo9PrWgWmqtlME2dndkZN eC0bwwyancEMujDkbBSq76ZEEPsl1w98XZr1pLmQUWFBrRLv5zsDKaKnEQLHzC+EAo0C zB2xmsk3IpjXxajmbVwYQAjD9CUJ1lwlQE9HAGYT8fDV31yf/IIM1sdOujJ/J82ivX0X wI9A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id si28si5031762ejb.157.2020.07.28.13.22.55; Tue, 28 Jul 2020 13:23:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728698AbgG1UWs (ORCPT + 99 others); Tue, 28 Jul 2020 16:22:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728234AbgG1UWs (ORCPT ); Tue, 28 Jul 2020 16:22:48 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD821C061794 for ; Tue, 28 Jul 2020 13:22:47 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 86B68297E76 From: Gabriel Krisman Bertazi To: luto@kernel.org, tglx@linutronix.de Cc: keescook@chromium.org, x86@kernel.org, linux-kernel@vger.kernel.org, Gabriel Krisman Bertazi , kernel@collabora.com Subject: [PATCH 1/6] arch: x86: Don't use TIF flags for mm context Date: Tue, 28 Jul 2020 16:22:24 -0400 Message-Id: <20200728202229.1195682-2-krisman@collabora.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200728202229.1195682-1-krisman@collabora.com> References: <20200728202229.1195682-1-krisman@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org TIF_IA32 and TIF_X32 are going away. Create a dedicated enum for the MM context. Signed-off-by: Gabriel Krisman Bertazi --- arch/x86/include/asm/mmu_context.h | 2 +- arch/x86/include/asm/thread_info.h | 6 ++++++ arch/x86/kernel/process_64.c | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/mmu_context.h b/arch/x86/include/asm/mmu_context.h index 47562147e70b..055ee5d66b41 100644 --- a/arch/x86/include/asm/mmu_context.h +++ b/arch/x86/include/asm/mmu_context.h @@ -178,7 +178,7 @@ static inline void arch_exit_mmap(struct mm_struct *mm) static inline bool is_64bit_mm(struct mm_struct *mm) { return !IS_ENABLED(CONFIG_IA32_EMULATION) || - !(mm->context.ia32_compat == TIF_IA32); + !(mm->context.ia32_compat == PSABI_IA32); } #else static inline bool is_64bit_mm(struct mm_struct *mm) diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h index 267701ae3d86..934aa15b20f2 100644 --- a/arch/x86/include/asm/thread_info.h +++ b/arch/x86/include/asm/thread_info.h @@ -53,6 +53,12 @@ struct task_struct; #include #include +enum { + PSABI_IA64 = 0, + PSABI_IA32 = 1, + PSABI_X32 = 2 +}; + struct thread_info { unsigned long flags; /* low level flags */ u32 status; /* thread synchronous flags */ diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index 9a97415b2139..4452a35402f9 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c @@ -557,7 +557,7 @@ static void __set_personality_x32(void) clear_thread_flag(TIF_IA32); set_thread_flag(TIF_X32); if (current->mm) - current->mm->context.ia32_compat = TIF_X32; + current->mm->context.ia32_compat = PSABI_X32; current->personality &= ~READ_IMPLIES_EXEC; /* * in_32bit_syscall() uses the presence of the x32 syscall bit @@ -578,7 +578,7 @@ static void __set_personality_ia32(void) set_thread_flag(TIF_IA32); clear_thread_flag(TIF_X32); if (current->mm) - current->mm->context.ia32_compat = TIF_IA32; + current->mm->context.ia32_compat = PSABI_IA32; current->personality |= force_personality32; /* Prepare the first "return" to user space */ task_pt_regs(current)->orig_ax = __NR_ia32_execve; -- 2.27.0