Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp426506img; Fri, 22 Mar 2019 00:43:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQKPhw5/2ww5wiC4JajYcZG8yNr6XRKVS2lOpXwKUeKVlfKUyvRFhjz2am9iUUffMzNYu+ X-Received: by 2002:a63:5159:: with SMTP id r25mr7672850pgl.112.1553240604613; Fri, 22 Mar 2019 00:43:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553240604; cv=none; d=google.com; s=arc-20160816; b=Fq1YFoj/NxvBQj1IDOV7/1nZ93AtQLPwPTI+wWmzr2SKefDXRjaAdLig9mJJb4DFKd XwX0qwG2Jka286m1aJ2dim5Sx3DnHITmtHnQELuALSHMpCsnu8umsvvflAf27zNprUIs 6QCmYFx2YeiMw4xZhpb6aE4u+T6QtMmg0KCCzrFTuZjnQsa3kfOO76RMNXkraS4S9WZk zq3sbnGmVzNJWR5/Bzoz2EAIfD+LghBOcNHGkW4oNzBWKatB59T/udDBU2/Td22NteWj 943zdS/ZDxh+DQ5JuK4eiyMsP4ksWgktsH3RFzEbgcJ7OOkh7UgF8WsBbgZLq/O70+oM +Oog== 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 :message-id:date:subject:cc:to:from; bh=uuVoQSuf+9094U8dvrcpi1WtCkgz+3tOu7qt/A6L9wg=; b=sP43WGcYbo3qCKArQdSJPMLCVARFZQuYtpFTcsobNdB+S6QecOnaR/Cp2WLXtCqFih NuSIi1KT+ynXDuE9MgirIDuXQ0oEfUmSi2Hqog7DkxROXb2NjEU3IVND1Y5zo3c0+pU3 k90fVUOk5e770noRIi/8I6j4mtvy9usp6vBf5rsiYJ0nIeh4/93u/AbEaAvV/puxSoRa txabJFAQS4A081dLo42Wk3EXtDhsdgch9MFFlEN8KYOnuLlyDI53iBosZnJBAQzufgmV hnHW7YyLRp78Spf/F8eR3VqzTIJZYZCkH8eYGfCddS+I1yPFA/n8MwYxvPFvMzqbHWH6 cdCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f22si6273887plr.57.2019.03.22.00.43.09; Fri, 22 Mar 2019 00:43:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727440AbfCVHme (ORCPT + 99 others); Fri, 22 Mar 2019 03:42:34 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:55429 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726029AbfCVHme (ORCPT ); Fri, 22 Mar 2019 03:42:34 -0400 X-Originating-IP: 79.86.19.127 Received: from alex.numericable.fr (127.19.86.79.rev.sfr.net [79.86.19.127]) (Authenticated sender: alex@ghiti.fr) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id C432F1C0006; Fri, 22 Mar 2019 07:42:26 +0000 (UTC) From: Alexandre Ghiti To: Christoph Hellwig , Russell King , Catalin Marinas , Will Deacon , Ralf Baechle , Paul Burton , James Hogan , Palmer Dabbelt , Albert Ou , Alexander Viro , Luis Chamberlain , Kees Cook , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Cc: Alexandre Ghiti Subject: [PATCH 0/4] Provide generic top-down mmap layout functions Date: Fri, 22 Mar 2019 03:42:21 -0400 Message-Id: <20190322074225.22282-1-alex@ghiti.fr> X-Mailer: git-send-email 2.20.1 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 This series introduces generic functions to make top-down mmap layout easily accessible to architectures, in particular riscv which was the initial goal of this series. The generic implementation was taken from arm64 and used successively by arm, mips and finally riscv. Note that in addition the series fixes 2 issues: - stack randomization was taken into account even if not necessary. - [1] fixed an issue with mmap base which did not take into account randomization but did not report it to arm and mips, so by moving arm64 into a generic library, this problem is now fixed for both architectures. This work is an effort to factorize architecture functions to avoid code duplication and oversights as in [1]. [1]: https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1429066.html Alexandre Ghiti (4): arm64, mm: Move generic mmap layout functions to mm arm: Use generic mmap top-down layout mips: Use generic mmap top-down layout riscv: Make mmap allocation top-down by default arch/arm/include/asm/processor.h | 2 +- arch/arm/mm/mmap.c | 52 ---------------- arch/arm64/include/asm/processor.h | 2 +- arch/arm64/mm/mmap.c | 72 ---------------------- arch/mips/include/asm/processor.h | 4 +- arch/mips/mm/mmap.c | 57 ----------------- arch/riscv/Kconfig | 12 ++++ arch/riscv/include/asm/processor.h | 1 + fs/binfmt_elf.c | 20 ------ include/linux/mm.h | 2 + kernel/sysctl.c | 6 +- mm/util.c | 99 +++++++++++++++++++++++++++++- 12 files changed, 121 insertions(+), 208 deletions(-) -- 2.20.1