Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp582298ybg; Tue, 28 Jul 2020 13:24:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyS687vZv3PzL6OzbmtUmtQWgBEUzvo9smFUoEJVHoTE5nXnRzzfVmbow5o/T7Ebyuw08GJ X-Received: by 2002:a17:906:6408:: with SMTP id d8mr11537595ejm.345.1595967875452; Tue, 28 Jul 2020 13:24:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595967875; cv=none; d=google.com; s=arc-20160816; b=Wpa7OERx2XxYdCRd0YVtk1p4F2PbWmKfFnDKwnrbcQBCC54YR6+Su4s5LogF376eMP 0pKo9UcziQBk3c9Yq6oWuJRdwh4GfN6wnmBp3jRLzzqpXYF8a1mt/F/JsrWfqfBoOQs/ kEwLSSEZMYHQFDd6AezWjustAuccrgB/aqKV5bM9qrlXL1IayZ//eNIAVMSDU4+4RrFw 3HfhXeTnmYSbVOEh7P1hFbk79jIz+A46ERJ7QtpW0V/ONcYlWWNE6gJE4ODAREjjrhZT uQf7H4+avHKs0FpppBJ1N88Mjre5rM3qHYGPL8EqDE69857yw5Lm6rxKx2XiAgZnXwCj rYrg== 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=uxeMQuffWNwcjgsgCLEmXQ8IZ4gIlIBERSoEZkCPWok=; b=YXUjkdj9zy3TCVUT7yhPhMn4y0/nDsFB7comQ4WCwVAaWljnmBVXcsPP49uKL+keyA IMlTZw5PJIX2sBMT83wpIM0cvMBUkAcBD/0gkIIhwP1gne5pdzePC+hanRSGAXwKBH/4 bOLJEsETwLFN44i9R6NtPz1/PNJvN119KSu4XSNYOGXuSeq5//wuSnqCf8PIXjVzQYXf UJkZ4WydkeEy92/5TswlvKN+ATAYUeHWV/k9Sb7ZCVrOlKcj6opM7l/HWuU5eYNrnwy+ BdTS2q/pw49Xov8Zv6KvGVNSDvt9WLVrvA68bviwLMA/qKydce0U2bQv7Cdg2D/4FPue VxsQ== 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 e10si7784803ejj.546.2020.07.28.13.24.13; Tue, 28 Jul 2020 13:24:35 -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 S1728927AbgG1UXD (ORCPT + 99 others); Tue, 28 Jul 2020 16:23:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728437AbgG1UXB (ORCPT ); Tue, 28 Jul 2020 16:23:01 -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 70245C061794 for ; Tue, 28 Jul 2020 13:23:01 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 303C628EA02 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 5/6] arch: x86: Reclaim TIF_IA32 flag Date: Tue, 28 Jul 2020 16:22:28 -0400 Message-Id: <20200728202229.1195682-6-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 Dropping this as a TIF flag is interesting given the pressure over x86 remaining x86 flags, plus considering the current common entry code, reducing arch-specific flags is a good thing. Notice that no path really relies on TIF_IA32 as part of a critical path, therefore the cost of checking another field in thread_info shouldn't be a problem. Signed-off-by: Gabriel Krisman Bertazi --- arch/x86/include/asm/thread_info.h | 4 +--- arch/x86/kernel/process_64.c | 3 --- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h index 698feefd5f5f..aa7d27054a8a 100644 --- a/arch/x86/include/asm/thread_info.h +++ b/arch/x86/include/asm/thread_info.h @@ -99,7 +99,6 @@ struct thread_info { #define TIF_NEED_FPU_LOAD 14 /* load FPU on return to userspace */ #define TIF_NOCPUID 15 /* CPUID is not accessible in userland */ #define TIF_NOTSC 16 /* TSC is not accessible in userland */ -#define TIF_IA32 17 /* IA32 compatibility process */ #define TIF_SLD 18 /* Restore split lock detection on context switch */ #define TIF_MEMDIE 20 /* is terminating due to OOM killer */ #define TIF_POLLING_NRFLAG 21 /* idle is polling for TIF_NEED_RESCHED */ @@ -129,7 +128,6 @@ struct thread_info { #define _TIF_NEED_FPU_LOAD (1 << TIF_NEED_FPU_LOAD) #define _TIF_NOCPUID (1 << TIF_NOCPUID) #define _TIF_NOTSC (1 << TIF_NOTSC) -#define _TIF_IA32 (1 << TIF_IA32) #define _TIF_SLD (1 << TIF_SLD) #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) #define _TIF_IO_BITMAP (1 << TIF_IO_BITMAP) @@ -245,7 +243,7 @@ extern void arch_setup_new_exec(void); #define arch_setup_new_exec arch_setup_new_exec #endif /* !__ASSEMBLY__ */ -#define TASK_IA32(tsk) test_tsk_thread_flag(tsk, TIF_IA32) +#define TASK_IA32(tsk) (task_thread_info(tsk)->psabi == PSABI_IA32) #define TASK_X32(tsk) test_tsk_thread_flag(tsk, TIF_X32) #endif /* _ASM_X86_THREAD_INFO_H */ diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index aea2c03e8a5d..75059c9de829 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c @@ -533,7 +533,6 @@ void set_personality_64bit(void) /* 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); /* Pretend that this comes from a 64bit execve */ @@ -555,7 +554,6 @@ 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) current->mm->context.ia32_compat = PSABI_X32; @@ -577,7 +575,6 @@ 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) current->mm->context.ia32_compat = PSABI_IA32; -- 2.27.0