From patchwork Tue Sep 21 11:02:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiongwei Song X-Patchwork-Id: 12507681 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C087BC433F5 for ; Tue, 21 Sep 2021 11:04:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7613F61178 for ; Tue, 21 Sep 2021 11:04:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7613F61178 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=me.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 19CF294000A; Tue, 21 Sep 2021 07:04:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 14BCF940009; Tue, 21 Sep 2021 07:04:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 03A4294000A; Tue, 21 Sep 2021 07:04:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0183.hostedemail.com [216.40.44.183]) by kanga.kvack.org (Postfix) with ESMTP id EBA3B940009 for ; Tue, 21 Sep 2021 07:04:28 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id ADC678249980 for ; Tue, 21 Sep 2021 11:04:28 +0000 (UTC) X-FDA: 78611297016.09.F7E44F2 Received: from pv50p00im-ztdg10011301.me.com (pv50p00im-ztdg10011301.me.com [17.58.6.40]) by imf19.hostedemail.com (Postfix) with ESMTP id 53904B0000A3 for ; Tue, 21 Sep 2021 11:04:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1632222267; bh=nF4rPElvIlem61hyKWx0Vc237954X2JNlZJpztGylhA=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=1tMbtPzRetwr0OKsLbvsWA3AbH5msVcbTcKuba98Jkvb/3c8wjEVkGj2Aqv/tabUX 0jzlmXgbQnIt18bHR6KXbznjGhxjFpTN3XhRgMfi40HjdJncXA3dqEY6+Kztrj6DQp 1pyiO9egLetuYYB52lpK6kFKuNi856JfGaWZ1PTdZ3j1zizw6aL7liqdmQt0+Bog3X qwgC1FFhZGkfJfYXXOBSKJxdt2eVQVU8dWkzg51nm7bkzCok8FWENX/cNJp5RQMj0s xHsK9sGFQVC6G3Zb34JXoPzeAj0P5cDMAKrT0N9x+RqSPu5XigfWEUdP6DTOIZQ2H0 x8Uyd8/bz762Q== Received: from xiongwei.. (unknown [120.245.3.37]) by pv50p00im-ztdg10011301.me.com (Postfix) with ESMTPSA id 67AEB760288; Tue, 21 Sep 2021 11:04:23 +0000 (UTC) From: sxwjean@me.com To: x86@kernel.org, linux-mm@kvack.org Cc: sxwjean@me.com, Xiongwei Song Subject: [PATCH 1/2] x86: Rename TIF_ADDR32 to TIF_32BIT Date: Tue, 21 Sep 2021 19:02:51 +0800 Message-Id: <20210921110252.2593542-2-sxwjean@me.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210921110252.2593542-1-sxwjean@me.com> References: <20210921110252.2593542-1-sxwjean@me.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-09-21_01:2021-09-20,2021-09-21 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=706 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2009150000 definitions=main-2109210070 Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=me.com header.s=1a1hai header.b=1tMbtPzR; spf=pass (imf19.hostedemail.com: domain of sxwjean@me.com designates 17.58.6.40 as permitted sender) smtp.mailfrom=sxwjean@me.com; dmarc=pass (policy=quarantine) header.from=me.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 53904B0000A3 X-Stat-Signature: mfphs4w3awgp3n3uzze59dbgiws8us5c X-HE-Tag: 1632222268-160753 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Xiongwei Song In arm64 or powerpc or sparc, the 32 bits process in 64 bits kernel is set flag TIF_32BIT. However in x86, that flag name is TIF_ADDR32. This patch makes the flag name in x86 same as other archs. Signed-off-by: Xiongwei Song --- arch/x86/include/asm/elf.h | 2 +- arch/x86/include/asm/page_64_types.h | 6 +++--- arch/x86/include/asm/thread_info.h | 4 ++-- arch/x86/kernel/process_64.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h index 29fea180a665..aa6ae2bc20bd 100644 --- a/arch/x86/include/asm/elf.h +++ b/arch/x86/include/asm/elf.h @@ -322,7 +322,7 @@ static inline int mmap_is_ia32(void) { return IS_ENABLED(CONFIG_X86_32) || (IS_ENABLED(CONFIG_COMPAT) && - test_thread_flag(TIF_ADDR32)); + test_thread_flag(TIF_32BIT)); } extern unsigned long task_size_32bit(void); diff --git a/arch/x86/include/asm/page_64_types.h b/arch/x86/include/asm/page_64_types.h index a8d4ad856568..f4631bee9119 100644 --- a/arch/x86/include/asm/page_64_types.h +++ b/arch/x86/include/asm/page_64_types.h @@ -70,11 +70,11 @@ #define IA32_PAGE_OFFSET ((current->personality & ADDR_LIMIT_3GB) ? \ 0xc0000000 : 0xFFFFe000) -#define TASK_SIZE_LOW (test_thread_flag(TIF_ADDR32) ? \ +#define TASK_SIZE_LOW (test_thread_flag(TIF_32BIT) ? \ IA32_PAGE_OFFSET : DEFAULT_MAP_WINDOW) -#define TASK_SIZE (test_thread_flag(TIF_ADDR32) ? \ +#define TASK_SIZE (test_thread_flag(TIF_32BIT) ? \ IA32_PAGE_OFFSET : TASK_SIZE_MAX) -#define TASK_SIZE_OF(child) ((test_tsk_thread_flag(child, TIF_ADDR32)) ? \ +#define TASK_SIZE_OF(child) ((test_tsk_thread_flag(child, TIF_32BIT)) ? \ IA32_PAGE_OFFSET : TASK_SIZE_MAX) #define STACK_TOP TASK_SIZE_LOW diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h index cf132663c219..9e768e7714cc 100644 --- a/arch/x86/include/asm/thread_info.h +++ b/arch/x86/include/asm/thread_info.h @@ -97,7 +97,7 @@ struct thread_info { #define TIF_FORCED_TF 24 /* true if TF in eflags artificially */ #define TIF_BLOCKSTEP 25 /* set when we want DEBUGCTLMSR_BTF */ #define TIF_LAZY_MMU_UPDATES 27 /* task is updating the mmu lazily */ -#define TIF_ADDR32 29 /* 32-bit address space on 64 bits */ +#define TIF_32BIT 29 /* 32-bit address space on 64 bits */ #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) @@ -120,7 +120,7 @@ struct thread_info { #define _TIF_FORCED_TF (1 << TIF_FORCED_TF) #define _TIF_BLOCKSTEP (1 << TIF_BLOCKSTEP) #define _TIF_LAZY_MMU_UPDATES (1 << TIF_LAZY_MMU_UPDATES) -#define _TIF_ADDR32 (1 << TIF_ADDR32) +#define _TIF_32BIT (1 << TIF_32BIT) /* flags to check in __switch_to() */ #define _TIF_WORK_CTXSW_BASE \ diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index ec0d836a13b1..a8a94f87548f 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c @@ -666,7 +666,7 @@ void set_personality_64bit(void) /* inherit personality from parent */ /* Make sure to be in 64bit mode */ - clear_thread_flag(TIF_ADDR32); + clear_thread_flag(TIF_32BIT); /* Pretend that this comes from a 64bit execve */ task_pt_regs(current)->orig_ax = __NR_execve; current_thread_info()->status &= ~TS_COMPAT; @@ -721,7 +721,7 @@ static void __set_personality_ia32(void) void set_personality_ia32(bool x32) { /* Make sure to be in 32bit mode */ - set_thread_flag(TIF_ADDR32); + set_thread_flag(TIF_32BIT); if (x32) __set_personality_x32();