From patchwork Tue Sep 21 14:34:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiongwei Song X-Patchwork-Id: 12507987 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=-8.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 50F64C433F5 for ; Tue, 21 Sep 2021 14:34:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D7CF0611BD for ; Tue, 21 Sep 2021 14:34:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D7CF0611BD 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 6EEDC940009; Tue, 21 Sep 2021 10:34:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 67826940008; Tue, 21 Sep 2021 10:34:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4CA5D940009; Tue, 21 Sep 2021 10:34:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0132.hostedemail.com [216.40.44.132]) by kanga.kvack.org (Postfix) with ESMTP id 3A070940008 for ; Tue, 21 Sep 2021 10:34:56 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 032352BA9C for ; Tue, 21 Sep 2021 14:34:56 +0000 (UTC) X-FDA: 78611827392.06.892B331 Received: from pv50p00im-ztdg10021801.me.com (pv50p00im-ztdg10021801.me.com [17.58.6.56]) by imf24.hostedemail.com (Postfix) with ESMTP id 8F4BFB00009D for ; Tue, 21 Sep 2021 14:34:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1632234894; bh=mt5z+MTvIXfkfJHGwkXCnjTCaO1yXPjuyx+vnuzqbpY=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=dZtu7zQjb8UDJQ6/fAx52qpNf0Eo/pPzoKYPxNYvhwF7NuySopjA2HmpyGd/dvAyB XgkhwVQGM4mFHBHtscAG8NvC1vG1SrVB8467IVQqdvuvqaaF/B6cbtOxknKoxXAP/h VpJ7uNCE8RRSgHWRSib02SqXuc0xw7gkEgOcmdFTJtrpvePq6dgBlvJLZvluYZLMCk X1NgGiXW6D9Y+K3K2MEhLzFAYjVb0sV9dpjEg1nZMFeDh+BaHMhf4fzc6pdS7Yu00I AswAK9LVmadh8zxDkIdMhwgoOVlZK80xh2R66uKUBoMQLoNIzecQcaNNLWicuOVII6 W6i6GKFEPF/pw== Received: from xiongwei.. (unknown [120.245.3.37]) by pv50p00im-ztdg10021801.me.com (Postfix) with ESMTPSA id 3D93C360390; Tue, 21 Sep 2021 14:34:36 +0000 (UTC) From: sxwjean@me.com To: x86@kernel.org, linux-mm@kvack.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, luto@kernel.org, krisman@collabora.com, chang.seok.bae@intel.com, viro@zeniv.linux.org.uk, nivedita@alum.mit.edu, adobriyan@gmail.com, oleg@redhat.com, sblbir@amazon.com, axboe@kernel.dk, laijs@linux.alibaba.com, dave.hansen@linux.intel.com, peterz@infradead.org, akpm@linux-foundation.org, arnd@arndb.de, davem@davemloft.net, keescook@chromium.org, kim.phillips@amd.com, yazen.ghannam@amd.com, dave@stgolabs.net, metze@samba.org, elver@google.com, ebiederm@xmission.com, christophe.leroy@csgroup.eu, linux-kernel@vger.kernel.org, Xiongwei Song Subject: [PATCH RESEND 0/2] Use generic code for randomization of virtual address of x86 Date: Tue, 21 Sep 2021 22:34:12 +0800 Message-Id: <20210921143414.70723-1-sxwjean@me.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-09-21_04: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=233 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2009150000 definitions=main-2109210090 X-Stat-Signature: xz39ug4phbmg3e1o34mfuuygddjsuhmk Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=me.com header.s=1a1hai header.b=dZtu7zQj; dmarc=pass (policy=quarantine) header.from=me.com; spf=pass (imf24.hostedemail.com: domain of sxwjean@me.com designates 17.58.6.56 as permitted sender) smtp.mailfrom=sxwjean@me.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 8F4BFB00009D X-HE-Tag: 1632234895-58879 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 Hello, The two patches are to use generic code for randomization of virtual address of x86. Since the basic code logic of x86 is same as generic code, so no need to implement these functions on x86, please see the details in comments of patch 2. Please review it. Why resend? Because I missed email addresses for patch 1 and 2, so resend the patches. Sorry for the inconvenience. Xiongwei Song (2): x86: Rename TIF_ADDR32 to TIF_32BIT x86/mm: Randomize va with generic arch_pick_mmap_layout() arch/x86/Kconfig | 2 +- arch/x86/include/asm/compat.h | 7 +- arch/x86/include/asm/elf.h | 2 +- arch/x86/include/asm/page_64_types.h | 6 +- arch/x86/include/asm/processor.h | 4 +- arch/x86/include/asm/thread_info.h | 4 +- arch/x86/kernel/process.c | 5 -- arch/x86/kernel/process_64.c | 4 +- arch/x86/mm/mmap.c | 112 --------------------------- include/linux/compat.h | 4 + mm/util.c | 18 ++++- 11 files changed, 37 insertions(+), 131 deletions(-)